Selaa lähdekoodia

Merge branch 'master' of http://112.74.164.79:3000/chenying/X-web

damon227 1 vuosi sitten
vanhempi
commit
4614f59f81

+ 33 - 4
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
+              })
+            })
+          }
         }
       })
     },
@@ -469,7 +484,7 @@ export default {
     inBound () {
       this.worderVisible = true
       this.$nextTick(() => {
-        this.$refs.worder.init(1)
+        this.$refs.worder.init(1, null, null, this.dataForm.projectName)
       })
     },
     addWorderItem (item) {
@@ -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`)

+ 20 - 2
src/views/modules/cus/quoted-detail.vue

@@ -44,9 +44,16 @@
         <e-desc-item label="项目类别">{{ dataForm.typeName }}</e-desc-item>
         <e-desc-item label="备注" span="3">{{ dataForm.remark }}</e-desc-item>
 
-        <e-desc-item label="关联BOM物料清单">{{
+        <e-desc-item label="关联BOM物料清单" span="3">{{
           dataForm.productName
         }}</e-desc-item>
+
+        <e-desc-item v-if="dataForm.attachList" label="附件" span="3">
+          <div v-for="(item, index) in dataForm.attachList" 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>
       <div class="desc">
         <h1 class="desc-title">BOM物料明细报价</h1>
@@ -311,6 +318,8 @@
     </span>
 
     <attach-detail-dialog ref="attachDetail" @onChose="onChose" />
+    <!-- 文件预览 -->
+    <preview-component v-if="previewVisible" ref="preview"/>
   </div>
 </template>
 
@@ -329,13 +338,15 @@ import {
   taskTypeOption,
   rankTypeOption
 } from '@/utils/enums'
+import PreviewComponent from '@/views/modules/common/preview-component'
 export default {
   name: 'cus-quoted-detail',
-  components: { EDesc, EDescItem, UploadComponent, AttachDetailDialog, ApproveComponent },
+  components: { PreviewComponent, EDesc, EDescItem, UploadComponent, AttachDetailDialog, ApproveComponent },
   props: {},
   data () {
     return {
       isFlow: false,
+      previewVisible: false,
       id: 0,
       productTypeOption: productTypeOption,
       taskTypeOption: taskTypeOption,
@@ -501,6 +512,13 @@ export default {
     approveFinished () {
       this.onChose()
       this.$emit('approveFinished')
+    },
+    // 预览
+    previewFile (fileName, url) {
+      this.previewVisible = true
+      this.$nextTick(() => {
+        this.$refs.preview.init(fileName, url)
+      })
     }
   }
 }

+ 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)
     }
   }
 }

+ 10 - 5
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>
@@ -168,7 +168,7 @@ export default {
       this.visible = false
     },
     // 初始化。type:{addItem:仅回调方法返回数据,update:调用接口更新}
-    async init (id, item, type) {
+    async init (id, item, type, projectName) {
       this.id = id || 0
       this.type = type || 'addItem'
       if (item) {
@@ -182,6 +182,10 @@ export default {
       } else {
         this.isModify = false
         this.dataForm = {
+          taskName: projectName,
+          content: '尽快报价',
+          planCompletionTime: new Date(),
+          ranks: '1',
           taskType: 'routine',
           recordId: Math.round(Math.random() * 1000000)
         }
@@ -195,9 +199,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') {