liqianyi 3 سال پیش
والد
کامیت
4a82093a16

+ 1 - 1
src/views/modules/cus/contract-record-notice-change-setting.vue

@@ -5,7 +5,7 @@
         <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"/>
+              <user-components v-model="dataForm.userIds" :userIds.sync="dataForm.userIds" @change="userSelectedChanged"/>
             </el-form-item>
           </el-row>
         </el-form>

+ 4 - 1
src/views/modules/sale/contract-notice-change-setting.vue

@@ -5,7 +5,7 @@
         <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.sync="dataForm.userIds"/>
+              <user-components v-model="dataForm.userIds" :userIds.sync="dataForm.userIds" @change="userSelectedChanged"/>
             </el-form-item>
           </el-row>
         </el-form>
@@ -80,6 +80,9 @@ export default {
             })
           }
         })
+      },
+      userSelectedChanged (val) {
+        this.dataForm.userIds = val
       }
     }
   }

+ 93 - 0
src/views/modules/sale/outsource-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.sync="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()">确定</el-button>
+        </span>
+    </div>
+</template>
+
+<script>
+  import UserComponents from '../common/user-components'
+
+export default {
+    name: 'outsource-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/purCommDetail/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/purCommDetail/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>

+ 9 - 2
src/views/modules/sale/outsource.vue

@@ -1,7 +1,7 @@
 <!-- 委外列表 -->
 <template>
   <div class="sale">
-    <template v-if="!detailVisible && !addOrUpdateVisible && !changeFormVisible &&!changeAttachVisible && !attachVisible && !noticeChangeAttachVisible && !inboundVisible && !outsourceVisible">
+    <template v-if="!detailVisible && !addOrUpdateVisible && !changeFormVisible &&!changeAttachVisible && !attachVisible && !noticeChangeAttachVisible && !inboundVisible && !outsourceVisible && !noticeChangeAttachVisible">
       <el-form :inline="true" :model="dataForm" @keyup.enter.native="search()">
         <el-form-item label="类别">
           <el-select
@@ -260,7 +260,7 @@ import AddOrUpdate from './outsource-add-or-update'
 import Detail from './outsource-detail'
 import { getOutsourceList } from '@/api/sale'
 import AttachDetail from '../common/attach-detail'
-import NoticeChangeSetting from '../cus/contract-record-notice-change-setting'
+import NoticeChangeSetting from './outsource-notice-change-setting'
 import ChangeForm from '../cus/contract-record-change'
 import { getDictList } from '@/api/dict'
 import StockOrderInbound from '../warehouse/stock-order-inbound'
@@ -506,6 +506,13 @@ export default {
       this.$nextTick(() => {
         this.$refs.refOutsource.init(row.purComDetailId, row.cnt)
       })
+    },
+    // 变更通知人设置
+    setNoticeChangeHandel () {
+      this.noticeChangeAttachVisible = true
+      this.$nextTick(() => {
+        this.$refs.noticeChangeSetting.init()
+      })
     }
   }
 }

+ 93 - 0
src/views/modules/sale/purchase-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.sync="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()">确定</el-button>
+        </span>
+    </div>
+</template>
+
+<script>
+  import UserComponents from '../common/user-components'
+
+export default {
+    name: 'purchase-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/purchaseDetail/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/purchaseDetail/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>

+ 15 - 3
src/views/modules/sale/purchase.vue

@@ -1,7 +1,7 @@
 <!-- 采购管理 -->
 <template>
   <div class="purchase">
-    <template v-if="!addOrUpdateVisible && !detailVisible && !operateVisible && !inboundVisible">
+    <template v-if="!addOrUpdateVisible && !detailVisible && !operateVisible && !inboundVisible && !noticeChangeAttachVisible">
       <el-form :inline="true" :model="dataForm" @keyup.enter.native="search()">
         <el-form-item label="类别">
           <el-select
@@ -45,7 +45,7 @@
         <el-form-item>
           <el-button @click="search()">查询</el-button>
           <el-button v-if="isAuth('purchase:detail:save')" type="primary" @click="addOrUpdateHandle(0, false)">新建采购申请</el-button>
-          <el-button v-if="isAuth('purchase:detail:noteChangeConfig')" type="primary" @click="setNoticeChangeHandel()">工作提示通知设置</el-button>
+          <el-button v-if="isAuth('purchase:detail:noteChangeConfig')" type="primary" @click="setNoticeChangeHandel()">业务变更通知设置</el-button>
         </el-form-item>
       </el-form>
       <el-table
@@ -228,6 +228,8 @@
     <operate v-if="operateVisible" ref="operate" @onChose="onChose"/>
     <!-- 入库 -->
     <inbound v-if="inboundVisible" ref="inbound" @onChose="onChose"/>
+    <notice-change-setting v-if="noticeChangeAttachVisible" ref="noticeChangeSetting" @onChose="onChose"/>
+<!--    <change-form v-if="changeFormVisible" ref="changeForm" @refreshDataList="getDataList" @onChose="onChose"/>-->
   </div>
 </template>
 
@@ -238,10 +240,11 @@
   import Inbound from '../warehouse/stock-order-inbound'
   import { getDictList } from '@/api/dict'
   import { getPurchaseList, revokePurchase } from '@/api/sale'
+  import NoticeChangeSetting from './purchase-notice-change-setting'
   export default {
     name: 'purchase',
     components: {
-      AddOrUpdate, Detail, Operate, Inbound
+      AddOrUpdate, Detail, Operate, Inbound, NoticeChangeSetting
     },
     data () {
       return {
@@ -249,6 +252,7 @@
         detailVisible: false,
         operateVisible: false,
         inboundVisible: false,
+        noticeChangeAttachVisible: false,
         dataForm: {},
         dataList: [],
         pageIndex: 1,
@@ -281,6 +285,7 @@
         this.detailVisible = false
         this.operateVisible = false
         this.inboundVisible = false
+        this.noticeChangeAttachVisible = false
       },
       // 获取采购类别字典
       getTypeList () {
@@ -406,6 +411,13 @@
         this.$nextTick(() => {
           this.$refs.inbound.init(0, false, dataForm)
         })
+      },
+      // 变更通知人设置
+      setNoticeChangeHandel () {
+        this.noticeChangeAttachVisible = true
+        this.$nextTick(() => {
+          this.$refs.noticeChangeSetting.init()
+        })
       }
     }
   }