landydb 1 тиждень тому
батько
коміт
e9ece53e37

+ 93 - 0
src/views/modules/production/scheduling-notice-change-setting.vue

@@ -0,0 +1,93 @@
+<template>
+    <div>
+        <div class="my-title">发货通知人设置</div>
+        <!-- 表单 -->
+        <el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="auto">
+          <el-row class="my-row">
+            <el-form-item label="通知接收人" prop="userIds">
+              <user-components v-model="dataForm.userIds" :userIds="dataForm.userIds" @change="userSelectedChanged"/>
+            </el-form-item>
+          </el-row>
+        </el-form>
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="onChose">取消</el-button>
+          <el-button type="primary" @click="dataFormSubmit()" v-reClick>确定</el-button>
+        </span>
+    </div>
+</template>
+
+<script>
+  import UserComponents from '../common/user-components'
+
+export default {
+    name: 'dispatch-notice-change-setting',
+    components: {
+      UserComponents
+    },
+    data () {
+      return {
+        visible: false,
+        dataForm: {
+          userIds: []
+        },
+        dataRule: {
+          userIds: [{ required: true, message: '请选择通知接收人', trigger: 'change' }]
+        }
+      }
+    },
+    methods: {
+      onChose () {
+        this.$emit('onChose')
+      },
+      async init () {
+        this.dataForm = {}
+        this.$http({
+          url: this.$http.adornUrl(`/biz-service/ProdProduction/noteChangeConfig`),
+          method: 'get'
+        }).then(({data}) => {
+          if (data && data.code === '200') {
+            this.dataForm = {
+              userIds: data.data
+            }
+          }
+        })
+        this.visible = true
+      },
+      validateField (type) {
+        this.$refs.dataForm.validateField(type)
+      },
+      // 表单提交
+      dataFormSubmit () {
+        this.$refs['dataForm'].validate((valid) => {
+          if (valid) {
+            this.$http({
+              url: this.$http.adornUrl(`/biz-service/ProdProduction/noteChangeConfig`),
+              method: 'post',
+              data: this.dataForm.userIds
+            }).then(({data}) => {
+              if (data && data.code === '200') {
+                this.$message({
+                  message: '操作成功',
+                  type: 'success',
+                  duration: 1500,
+                  onClose: () => {
+                    this.onChose()
+                  }
+                })
+              } else {
+                this.$message.error(data.msg)
+              }
+            })
+          }
+        })
+      },
+      userSelectedChanged (val) {
+        this.dataForm.userIds = val
+      }
+    }
+  }
+</script>
+
+<style scoped>
+
+</style>

+ 16 - 3
src/views/modules/production/scheduling.vue

@@ -1,12 +1,14 @@
 <!-- 任务处理中心 -->
 <template>
   <div class="production">
-    <template v-if="!detailsVisible && !outsourceVisible && !checkVisible && !preCheckVisible && !purchaseVisible && !printLabelVisible && !addOrUpdateVisible && !addOrUpdateOutsourceVisible">
-      <el-header style="font-size: large;text-align: center">任务处理中心</el-header>
+    <template v-if="!detailsVisible && !outsourceVisible && !checkVisible && !preCheckVisible && !purchaseVisible && !printLabelVisible && !addOrUpdateVisible && !addOrUpdateOutsourceVisible && !noticeChangeSettingVisible">
+      <!-- <el-header style="font-size: large;text-align: center">任务处理中心</el-header> -->
       <el-form>
         <el-form-item>
           <el-button v-if="isAuth('prod:production:purchase')" type="primary" @click="batchBuyHandle()" :disabled="batchIncomeBtnDisabled">批量转采购</el-button>
           <el-button v-if="isAuth('pur:commDetail:save')" type="primary" @click="batchOutsourceHandle()" :disabled="batchBtnDisabled">批量转委外</el-button>
+          <el-button type="primary" @click="noticeChangeSettingHandle()">工作通知设置</el-button>
+          <el-button  @click="queryPage()">刷新</el-button>
         </el-form-item>
       </el-form>
       <el-table
@@ -214,6 +216,7 @@
     <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" :options-type="optionsType" @refreshDataList="getDataList" @onChose="onChose"></add-or-update>
     <!-- 委外 -->
     <outsource-add-or-update v-if="addOrUpdateOutsourceVisible" ref="addOrUpdateOutsource" @refreshDataList="getDataList" @onChose="onChose"></outsource-add-or-update>
+    <scheduling-notice-change-setting v-if="noticeChangeSettingVisible" ref="noticeChangeSetting" @refreshDataList="getDataList" @onChose="onChose"/>
   </div>
 </template>
 
@@ -230,6 +233,7 @@
   import PrintLabel from '@/views/modules/production/components/print-label.vue'
   import AddOrUpdate from '@/views/modules/sale/purchase-add-or-update'
   import { getDictList } from '@/api/dict'
+  import SchedulingNoticeChangeSetting from '@/views/modules/production/scheduling-notice-change-setting'
 export default {
     name: 'scheduling',
     components: {
@@ -241,7 +245,8 @@ export default {
       SchedulingCheck,
       Detail,
       AddOrUpdate,
-      OutsourceAddOrUpdate
+      OutsourceAddOrUpdate,
+      SchedulingNoticeChangeSetting
     },
     data () {
       return {
@@ -254,6 +259,7 @@ export default {
         printLabelVisible: false,
         addOrUpdateVisible: false,
         addOrUpdateOutsourceVisible: false,
+        noticeChangeSettingVisible: false,
         dataForm: {},
         dataList: [],
         pageIndex: 1,
@@ -332,6 +338,7 @@ export default {
         this.batchBtnDisabled = false
         this.addOrUpdateVisible = false
         this.addOrUpdateOutsourceVisible = false
+        this.noticeChangeSettingVisible = false
       },
        // 获取采购类别字典
       getTypeList () {
@@ -574,6 +581,12 @@ export default {
         this.$nextTick(() => {
           this.$refs.addOrUpdateOutsource.init(null, null, null, list)
         })
+      },
+      noticeChangeSettingHandle () {
+        this.noticeChangeSettingVisible = true
+        this.$nextTick(() => {
+          this.$refs.noticeChangeSetting.init()
+        })
       }
     }
   }