Jelajahi Sumber

任务单:添加附件

chrislee 1 tahun lalu
induk
melakukan
e7a722a9e7

+ 13 - 1
src/views/modules/order/order-add-or-update.vue

@@ -63,6 +63,18 @@
             <el-input type="textarea" v-model="dataForm.notes" :disabled="display || addType === 2"  placeholder="备注说明" ></el-input>
           </el-form-item>
         </el-row>
+        <el-row class="my-row">
+          <el-form-item label="附件">
+            <upload-component
+              :display="display"
+              :displayStar="false"
+              :display-title="false"
+              :accept="'*'"
+              v-model="fileList"
+              @uploadSuccess="uploadSuccess"
+            />
+          </el-form-item>
+        </el-row>
         <el-row class="my-row">
           <div class="title"><span style="color: red">*</span> 物料清单明细</div>
           <el-table
@@ -461,7 +473,7 @@ export default {
       dataFormSubmit () {
         this.$refs['dataForm'].validate((valid) => {
           if (valid) {
-            // 合同扫描
+            // 
             let fList = this.fileList
             if (fList.length > 0) {
               this.dataForm.attachList = []

+ 7 - 0
src/views/modules/order/order-detail.vue

@@ -33,6 +33,13 @@
         <e-desc-item label="合同交期">{{dataForm.deliveryDate?dataForm.deliveryDate.substring(0,10):''}}</e-desc-item>
 
         <e-desc-item label="备注说明" span="3">{{dataForm.notes}}</e-desc-item>
+
+        <e-desc-item 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>
       <e-desc title="物料清单明细">
         <el-table

+ 22 - 2
src/views/modules/order/order.vue

@@ -159,6 +159,14 @@
           :show-overflow-tooltip="true"
           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
           fixed="right"
           header-align="center"
@@ -189,6 +197,8 @@
     <dispatch-arrived v-if="arrivedVisible" ref="arrived" @refreshDataList="getDataList" @onChose="onChose"></dispatch-arrived>
     <notice-change-setting v-if="noticeChangeAttachVisible" ref="noticeChangeSetting" @onChose="onChose"/>
     <amount-mask-setting v-if="amountMaskSettingVisible" ref="amountMaskSetting" @onChose="onChose"/>
+    <!-- 文件预览 -->
+    <attach-detail v-if="attachVisible" ref="attachDetail" @onChose="onChose"/>
   </div>
 </template>
 
@@ -200,9 +210,11 @@
   import DispatchArrived from './dispatch-arrived'
   import NoticeChangeSetting from './order-notice-change-setting'
   import AmountMaskSetting from './order-amount-mask-setting'
-  export default {
+  import AttachDetail from '@/views/modules/common/attach-detail.vue'
+export default {
     name: 'order',
     components: {
+      AttachDetail,
       DispatchArrived,
       CusComponent,
       AddOrUpdate,
@@ -252,7 +264,8 @@
             code: '6', value: '技术待确定'
           }
         ],
-        optionsCustomer: []
+        optionsCustomer: [],
+        attachVisible: false
       }
     },
     methods: {
@@ -406,6 +419,13 @@
         this.$nextTick(() => {
           this.$refs.amountMaskSetting.init()
         })
+      },
+      // 附件
+      attachDetails (row) {
+        this.attachVisible = true
+        this.$nextTick(() => {
+          this.$refs.attachDetail.init(row.attachList)
+        })
       }
     }
   }