瀏覽代碼

合同台账

chris 3 年之前
父節點
當前提交
d19e17e52a

+ 130 - 0
src/views/modules/cus/contract-record-change.vue

@@ -0,0 +1,130 @@
+<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="changeContentDesc">
+            <el-input type="textarea" v-model="dataForm.changeContentDesc" placeholder="请输入更改内容描述"></el-input>
+          </el-form-item>
+        </el-row>
+        <el-row class="my-row">
+          <upload-component :title="'合同更改通知单'" :accept="'*'" :file-obj-list="fileList" @uploadSuccess="uploadSuccess"/>
+        </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'
+  import UploadComponent from '../common/upload-component'
+  import { geContractBookDetail } from '@/api/cus'
+
+export default {
+    name: 'contract-record-change',
+    components: {
+      UploadComponent,
+      UserComponents
+    },
+    computed: {
+      orgId: {
+        get () { return this.$store.state.user.orgId }
+      }
+    },
+    data () {
+      return {
+        visible: false,
+        dataForm: {
+          changeContentDesc: ''
+        },
+        id: 0,
+        fileList: [],
+        dataRule: {
+          changeContentDesc: [{ required: true, message: '更改内容简述不能为空', trigger: 'blur' }]
+        }
+      }
+    },
+    methods: {
+      onChose () {
+        this.$emit('onChose')
+      },
+      async init (id) {
+        this.fileList = []
+        this.visible = true
+        this.id = id || 0
+        if (!id) return
+        this.dataForm.contractId = id
+        await geContractBookDetail(id).then(({data}) => {
+          if (data && data.code === '200' && data.data) {
+            this.dataForm.changeContentDesc = data.data.changeContentDesc
+            if (data.data.noticeAttachList) {
+              data.data.noticeAttachList.forEach((item) => {
+                this.fileList.push({
+                  name: item.fileName,
+                  url: item.url,
+                  id: item.url
+                })
+              })
+            }
+          } else {
+            this.$message.error(data.msg)
+          }
+        })
+      },
+      validateField (type) {
+        this.$refs.dataForm.validateField(type)
+      },
+      // 表单提交
+      dataFormSubmit () {
+        // 附件
+        let fList = this.fileList
+        if (fList.length > 0) {
+          this.dataForm.noticeAttachList = []
+          for (let i = 0; i < fList.length; i++) {
+            this.dataForm.noticeAttachList.push({
+              fileName: fList[i].name,
+              url: fList[i].url
+            })
+          }
+        } else {
+          this.$message.error('请上传文件')
+          return
+        }
+        this.$refs['dataForm'].validate((valid) => {
+          if (valid) {
+            this.$http({
+              url: this.$http.adornUrl(`/biz-service/cusContractBook/changeContract`),
+              method: 'post',
+              data: this.$http.adornData({...this.dataForm, orgId: this.orgId})
+            }).then(({data}) => {
+              if (data && data.code === '200') {
+                this.$message({
+                  message: '操作成功',
+                  type: 'success',
+                  duration: 1500,
+                  onClose: () => {
+                    this.onChose()
+                    this.$emit('refreshDataList')
+                  }
+                })
+              } else {
+                this.$message.error(data.msg)
+              }
+            })
+          }
+        })
+      },
+      uploadSuccess (fileList) {
+        this.fileList = fileList
+      }
+    }
+  }
+</script>
+
+<style scoped>
+
+</style>

+ 7 - 0
src/views/modules/cus/contract-record-detail.vue

@@ -122,6 +122,13 @@
             this.dataForm = data.data
           }
         })
+      },
+      // 预览
+      previewFile (fileName, url) {
+        this.previewVisible = true
+        this.$nextTick(() => {
+          this.$refs.preview.init(fileName, url)
+        })
       }
     }
   }

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

+ 8 - 8
src/views/modules/cus/contract-record.vue

@@ -155,9 +155,9 @@
 <!--    <crafts-detail v-if="craftsVisible" ref="craftsDetail" @onChose="onChose"/>-->
 <!--    <product-draw-detail v-if="drawVisible" ref="drawDetail" @onChose="onChose"/>-->
 <!--    <attach-detail v-if="changeVisible" ref="changeDetail" @onChose="onChose"/>-->
-<!--    <attach-detail v-if="attachVisible" ref="attachDetail" @onChose="onChose"/>-->
-<!--    <notice-change-setting v-if="noticeChangeVisible" ref="noticeChangeSetting" @onChose="onChose"/>-->
-<!--    <change-form v-if="changeFormVisible" ref="changeForm" @refreshDataList="getDataList" @onChose="onChose"/>-->
+    <attach-detail v-if="attachVisible" ref="attachDetail" @onChose="onChose"/>
+    <notice-change-setting v-if="noticeChangeVisible" ref="noticeChangeSetting" @onChose="onChose"/>
+    <change-form v-if="changeFormVisible" ref="changeForm" @refreshDataList="getDataList" @onChose="onChose"/>
   </div>
 </template>
 
@@ -168,8 +168,8 @@ import { getCusContractBookList } from '@/api/cus'
 // import CraftsDetail from './crafts-detail'
 // import ProductDrawDetail from './product-draw-detail'
 import AttachDetail from '../common/attach-detail'
-// import NoticeChangeSetting from './product-notice-change-setting'
-// import ChangeForm from './product-change'
+import NoticeChangeSetting from './contract-record-notice-change-setting'
+import ChangeForm from './contract-record-change'
 export default {
   name: 'contract-record',
   components: {
@@ -177,10 +177,10 @@ export default {
     // ProductDrawDetail,
     // CraftsDetail,
     AddOrUpdate,
-    Detail
+    Detail,
     // Detail,
-    // NoticeChangeSetting,
-    // ChangeForm
+    NoticeChangeSetting,
+    ChangeForm
   },
   data () {
     return {

+ 4 - 2
src/views/modules/tech/product-notice-change-setting.vue

@@ -20,7 +20,7 @@
   import UserComponents from '../common/user-components'
 
 export default {
-    name: 'product-add-or-update',
+    name: 'product-notice-change-setting',
     components: {
       UserComponents
     },
@@ -46,7 +46,9 @@ export default {
           method: 'get'
         }).then(({data}) => {
           if (data && data.code === '200') {
-            this.dataForm.userIds = data.data
+            this.dataForm = {
+              userIds: data.data
+            }
           }
         })
         this.visible = true