Browse Source

bug fix:201

chris 1 năm trước cách đây
mục cha
commit
ed23be49b7

+ 32 - 3
src/views/modules/cus/quoted-add-or-update.vue

@@ -87,7 +87,10 @@
           </el-form-item>
         </el-col>
       </el-row>
-      <div>
+      <el-row>
+        <upload-component :title="'报价附件'" :display-star="false" :accept="'*'" :file-obj-list="fileList" @uploadSuccess="uploadSuccess"/>
+      </el-row>
+      <div style="margin-top: 20px">
         <div class="title">BOM物料明细报价</div>
         <el-row>
           <el-table :data="productList" border style="width: 100%">
@@ -181,7 +184,7 @@
           </el-table>
         </el-row>
       </div>
-      <div>
+      <div style="margin-top: 20px">
         <div class="title"><span style="color: red">* </span>任务工单派发</div>
         <el-row>
           <el-table :data="dataForm.workInfoList" border style="width: 100%">
@@ -341,9 +344,10 @@ import {
 } from '@/utils/enums'
 import WorderAddOrUpdateDialog from '../worder/add-or-update-dialog'
 import AttachDetailDialog from '../common/attach-detail-dialog'
+import UploadComponent from '@/views/modules/common/upload-component'
 export default {
   name: 'quoted-add-or-update',
-  components: { WorderAddOrUpdateDialog, AttachDetailDialog },
+  components: { UploadComponent, WorderAddOrUpdateDialog, AttachDetailDialog },
   props: {},
   data () {
     return {
@@ -363,6 +367,7 @@ export default {
         quotedPriceProductParamsList: [], // 报价物料清单
         workInfoList: []
       },
+      fileList: [],
       dataRule: {
         coId: [
           { required: true, message: '请选择沟通信息', trigger: 'change' }
@@ -413,6 +418,16 @@ export default {
           if (this.dataForm.productId) {
             this.productIdChangeHandle(this.dataForm.productId)
           }
+          // 附件
+          if (data.data.attachList) {
+            data.data.attachList.forEach((item) => {
+              this.fileList.push({
+                name: item.fileName,
+                url: item.url,
+                id: item.url
+              })
+            })
+          }
         }
       })
     },
@@ -495,6 +510,9 @@ export default {
     attachDetails (attachList) {
       this.$refs.attachDetail.init(attachList)
     },
+    uploadSuccess (fileList) {
+      this.fileList = fileList
+    },
     dataFormSubmit () {
       this.$refs['dataForm'].validate((valid) => {
         if (valid) {
@@ -502,6 +520,17 @@ export default {
             this.$message.error('请添加任务工单派发')
             return
           }
+          // 附件
+          let fList = this.fileList
+          if (fList.length > 0) {
+            this.dataForm.attachList = []
+            for (let i = 0; i < fList.length; i++) {
+              this.dataForm.attachList.push({
+                fileName: fList[i].name,
+                url: fList[i].url
+              })
+            }
+          }
           this.$http({
             url: !this.id
               ? this.$http.adornUrl(`/biz-service/quoted/save`)

+ 2 - 22
src/views/modules/cus/quoted-price.vue

@@ -546,11 +546,6 @@
       <el-button @click="onChose">取消</el-button>
       <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
     </span>
-    <worder-add-or-update-dialog
-      v-if="worderVisible"
-      ref="worder"
-      @submit="addWorderItem"
-    />
     <attach-detail-dialog ref="attachDetail" @onChose="onChose" />
   </div>
 </template>
@@ -564,18 +559,16 @@ import {
   taskTypeOption,
   rankTypeOption
 } from '@/utils/enums'
-import WorderAddOrUpdateDialog from '../worder/add-or-update-dialog'
 import AttachDetailDialog from '../common/attach-detail-dialog'
 export default {
   name: 'quoted-add-or-update',
-  components: { WorderAddOrUpdateDialog, AttachDetailDialog },
+  components: { AttachDetailDialog },
   props: {},
   data () {
     return {
       id: 0,
       type: '',
       title: '',
-      worderVisible: false,
       coOption: [], // 沟通编码下拉数据
       productTypeOption: productTypeOption,
       taskTypeOption: taskTypeOption,
@@ -629,7 +622,6 @@ export default {
       }
     },
     onChose () {
-      this.worderVisible = false
       this.$emit('onChose')
     },
     setTitle (type) {
@@ -742,12 +734,6 @@ export default {
     removeWorkInfoItem (index) {
       this.dataForm.workInfoList.splice(index, 1)
     },
-    inBound () {
-      this.worderVisible = true
-      this.$nextTick(() => {
-        this.$refs.worder.init(1)
-      })
-    },
     addWorderItem (item) {
       if (!item.recordId) {
         item.recordId = Math.round(Math.random() * 1000000)
@@ -762,12 +748,6 @@ export default {
         })
       }
     },
-    updateWorderHandle (row) {
-      this.worderVisible = true
-      this.$nextTick(() => {
-        this.$refs.worder.init(1, row)
-      })
-    },
     attachDetails (attachList) {
       this.$refs.attachDetail.init(attachList)
     },
@@ -1005,4 +985,4 @@ export default {
   padding: 10px 0 0 0;
   border: 1px solid #ebeef5;
 }
-</style>
+</style>

+ 14 - 1
src/views/modules/cus/quoted.vue

@@ -96,6 +96,14 @@
           label="管理费"
         >
         </el-table-column>
+        <el-table-column
+          header-align="center"
+          align="center"
+          label="报价附件">
+          <template slot-scope="scope">
+            <el-button :disabled="!scope.row.attachList || scope.row.attachList.length === 0" type="text" size="small" @click="attachDetails(scope.row)">查看</el-button>
+          </template>
+        </el-table-column>
         <el-table-column
           prop="ratePrice"
           header-align="center"
@@ -316,6 +324,7 @@
     <quoted-accredit ref="accredit" v-if="accreditVisible" @onChose="onChose"/>
     <quoted-result ref="result" v-if="resultVisible" @onChose="onChose"/>
     <quoted-notify ref="notify" v-if="notifyVisible" @onChose="onChose"/>
+    <attach-detail-dialog ref="attachDetail" @onChose="onChose" />
   </div>
 </template>
 
@@ -329,9 +338,10 @@ import QuotedDetail from './quoted-detail'
 import QuotedAccredit from './quoted-accredit'
 import QuotedResult from './quoted-result'
 import QuotedNotify from './quoted-notify'
+import AttachDetailDialog from '@/views/modules/common/attach-detail-dialog'
 export default {
   name: 'cus-quoted',
-  components: { OrgComponent, QuotedAddOrUpdate, QuotedPrice, QuotedDetail, QuotedAccredit, QuotedResult, QuotedNotify },
+  components: { AttachDetailDialog, OrgComponent, QuotedAddOrUpdate, QuotedPrice, QuotedDetail, QuotedAccredit, QuotedResult, QuotedNotify },
   data () {
     return {
       addOrUpdateVisible: false,
@@ -457,6 +467,9 @@ export default {
       this.$nextTick(() => {
         this.$refs.result.init(priceId)
       })
+    },
+    attachDetails (attachList) {
+      this.$refs.attachDetail.init(attachList)
     }
   }
 }

+ 8 - 4
src/views/modules/worder/add-or-update-dialog.vue

@@ -49,10 +49,10 @@
         </el-row>
         <el-row class="my-row">
           <el-col :span="8">
-            <el-form-item label="工单名称" prop="taskName">
+            <el-form-item label="项目名称" prop="taskName">
               <el-input
                 v-model="dataForm.taskName"
-                placeholder="请输入"
+                placeholder="项目名称"
               ></el-input>
             </el-form-item>
           </el-col>
@@ -182,6 +182,9 @@ export default {
       } else {
         this.isModify = false
         this.dataForm = {
+          content: '尽快报价',
+          planCompletionTime: new Date(),
+          ranks: '1',
           taskType: 'routine',
           recordId: Math.round(Math.random() * 1000000)
         }
@@ -195,9 +198,10 @@ export default {
       this.$refs['dataForm'].validate((valid) => {
         if (valid) {
           this.visible = false
-          this.dataForm.receiverName = this.userList.find(
+          let user = this.userList.find(
             (t) => t.userId === this.dataForm.receiver
-          ).name
+          )
+          this.dataForm.receiverName = user ? user.name : ''
           if (this.type === 'addItem') {
             this.$emit('submit', this.dataForm)
           } else if (this.type === 'update') {