chris пре 3 година
родитељ
комит
3974d3fb59

+ 1 - 1
src/views/modules/common/supplier-component.vue

@@ -102,7 +102,7 @@
         if (item === 'undefined') {
           this.value = null
         }
-        this.$emit('cusSelected', item)
+        this.$emit('supplierSelected', item)
       },
       cancelReadOnly (onOff) {
         this.$nextTick(() => {

+ 3 - 3
src/views/modules/sale/contract-add-or-update.vue

@@ -27,7 +27,7 @@
             </el-col>
             <el-col :span="8">
               <el-form-item label="供应商" prop="supplierId">
-                <supplier-component v-model="dataForm.supplierId" :supplier-id="dataForm.supplierId"></supplier-component>
+                <supplier-component v-model="dataForm.supplierId" :supplier-id.sync="dataForm.supplierId"></supplier-component>
               </el-form-item>
             </el-col>
           </el-row>
@@ -91,8 +91,8 @@ export default {
         dataRule: {
           type: [{ required: true, message: '请选择合同类别', trigger: 'change' }],
           contractNumber: [{ required: true, message: '合同号不能为空', trigger: 'blur' }],
-          totalAmount: [{ required: true, message: '合同金额不能为空', trigger: 'change' }]
-          // deliveryTime: [{ required: true, message: '合同交期不能为空', trigger: 'change' }]
+          totalAmount: [{ required: true, message: '合同金额不能为空', trigger: 'change' }],
+          supplierId: [{ required: true, message: '请选择供应商', trigger: 'change' }]
         },
         optionsType: [
           {

+ 92 - 4
src/views/modules/sale/supplier-add-or-update.vue

@@ -260,8 +260,8 @@
           if (data && data.code === '200') {
             this.dataForm = data.data
             // 附件
-            if (data.data.attachList) {
-              data.data.attachList.forEach((item) => {
+            if (data.data.attachListA) {
+              data.data.attachListA.forEach((item) => {
                 this.fileList1.push({
                   name: item.fileName,
                   url: item.url,
@@ -269,6 +269,42 @@
                 })
               })
             }
+            if (data.data.attachListB) {
+              data.data.attachListB.forEach((item) => {
+                this.fileList2.push({
+                  name: item.fileName,
+                  url: item.url,
+                  id: item.url
+                })
+              })
+            }
+            if (data.data.attachListC) {
+              data.data.attachListC.forEach((item) => {
+                this.fileList3.push({
+                  name: item.fileName,
+                  url: item.url,
+                  id: item.url
+                })
+              })
+            }
+            if (data.data.attachListD) {
+              data.data.attachListD.forEach((item) => {
+                this.fileList4.push({
+                  name: item.fileName,
+                  url: item.url,
+                  id: item.url
+                })
+              })
+            }
+            if (data.data.attachListE) {
+              data.data.attachListE.forEach((item) => {
+                this.fileList5.push({
+                  name: item.fileName,
+                  url: item.url,
+                  id: item.url
+                })
+              })
+            }
           }
         })
       },
@@ -285,9 +321,9 @@
             // 附件
             let fList1 = this.fileList1
             if (fList1.length > 0) {
-              this.dataForm.attachList = []
+              this.dataForm.attachListA = []
               for (let i = 0; i < fList1.length; i++) {
-                this.dataForm.attachList.push({
+                this.dataForm.attachListA.push({
                   fileName: fList1[i].name,
                   url: fList1[i].url
                 })
@@ -296,6 +332,58 @@
               this.$message.error('请上传文件')
               return
             }
+            let fList2 = this.fileList2
+            if (fList2.length > 0) {
+              this.dataForm.attachListB = []
+              for (let i = 0; i < fList2.length; i++) {
+                this.dataForm.attachListB.push({
+                  fileName: fList2[i].name,
+                  url: fList2[i].url
+                })
+              }
+            } else if (this.type === 0) { // 新增时判断
+              this.$message.error('请上传文件')
+              return
+            }
+            let fList3 = this.fileList3
+            if (fList3.length > 0) {
+              this.dataForm.attachListC = []
+              for (let i = 0; i < fList3.length; i++) {
+                this.dataForm.attachListC.push({
+                  fileName: fList3[i].name,
+                  url: fList3[i].url
+                })
+              }
+            } else if (this.type === 2) { // 重新评审时判断
+              this.$message.error('请上传文件')
+              return
+            }
+            let fList4 = this.fileList4
+            if (fList4.length > 0) {
+              this.dataForm.attachListD = []
+              for (let i = 0; i < fList4.length; i++) {
+                this.dataForm.attachListD.push({
+                  fileName: fList4[i].name,
+                  url: fList4[i].url
+                })
+              }
+            } else if (this.type === 2) { // 重新评审时判断
+              this.$message.error('请上传文件')
+              return
+            }
+            let fList5 = this.fileList5
+            if (fList5.length > 0) {
+              this.dataForm.attachListE = []
+              for (let i = 0; i < fList5.length; i++) {
+                this.dataForm.attachListE.push({
+                  fileName: fList5[i].name,
+                  url: fList5[i].url
+                })
+              }
+            } else if (this.type === 3) { // 取消供应商时判断
+              this.$message.error('请上传文件')
+              return
+            }
             // save or update
             let path = ''
             if (this.type === 0) path = 'save'

+ 10 - 10
src/views/modules/sale/supplier-detail.vue

@@ -54,32 +54,32 @@
         <e-desc-item label="联系人邮箱" span="3">{{dataForm.contactEmail}}</e-desc-item>
       </e-desc>
       <e-desc title="附件" column="3">
-        <e-desc-item v-show="dataForm.attachList" label="合格供方基本信息调查表" span="3">
-          <div v-for="(item, index) in dataForm.attachList" style="display: inline">
+        <e-desc-item v-show="dataForm.attachListA" label="合格供方基本信息调查表" span="3">
+          <div v-for="(item, index) in dataForm.attachListA" style="display: inline">
             <span v-if="index > 0">,</span>
             <a :key="item.fileName + index" type="primary" href="#" @click="previewFile(item.fileName, item.url)">{{ item.fileName }}</a>
           </div>
         </e-desc-item>
-        <e-desc-item v-show="dataForm.attachList" label="合格供方基本信息调查表" span="3">
-          <div v-for="(item, index) in dataForm.attachList" style="display: inline">
+        <e-desc-item v-show="dataForm.attachListB" label="合格供方基本信息调查表" span="3">
+          <div v-for="(item, index) in dataForm.attachListB" style="display: inline">
             <span v-if="index > 0">,</span>
             <a :key="item.fileName + index" type="primary" href="#" @click="previewFile(item.fileName, item.url)">{{ item.fileName }}</a>
           </div>
         </e-desc-item>
-        <e-desc-item v-show="dataForm.attachList" label="合格供方基本信息调查表" span="3">
-          <div v-for="(item, index) in dataForm.attachList" style="display: inline">
+        <e-desc-item v-show="dataForm.attachListC" label="合格供方基本信息调查表" span="3">
+          <div v-for="(item, index) in dataForm.attachListC" style="display: inline">
             <span v-if="index > 0">,</span>
             <a :key="item.fileName + index" type="primary" href="#" @click="previewFile(item.fileName, item.url)">{{ item.fileName }}</a>
           </div>
         </e-desc-item>
-        <e-desc-item v-show="dataForm.attachList" label="合格供方基本信息调查表" span="3">
-          <div v-for="(item, index) in dataForm.attachList" style="display: inline">
+        <e-desc-item v-show="dataForm.attachListD" label="合格供方基本信息调查表" span="3">
+          <div v-for="(item, index) in dataForm.attachListD" style="display: inline">
             <span v-if="index > 0">,</span>
             <a :key="item.fileName + index" type="primary" href="#" @click="previewFile(item.fileName, item.url)">{{ item.fileName }}</a>
           </div>
         </e-desc-item>
-        <e-desc-item v-show="dataForm.attachList" label="合格供方基本信息调查表" span="3">
-          <div v-for="(item, index) in dataForm.attachList" style="display: inline">
+        <e-desc-item v-show="dataForm.attachListE" label="合格供方基本信息调查表" span="3">
+          <div v-for="(item, index) in dataForm.attachListE" style="display: inline">
             <span v-if="index > 0">,</span>
             <a :key="item.fileName + index" type="primary" href="#" @click="previewFile(item.fileName, item.url)">{{ item.fileName }}</a>
           </div>