Browse Source

成本分配列表详情-增加附件上传列表

jingbb 1 year ago
parent
commit
22ea449302

+ 38 - 15
src/views/cost-allocation-total/costDetailDrawer.vue

@@ -246,6 +246,14 @@
               </h4>
               </a-form-model-item>
             </a-col>
+            <a-col :md="6" :sm="8" class="noprint">
+              <a-upload  productName="file" :showUploadList="true" :file-list="fileList" :headers="tokenHeader" :multiple="false"   :action="importExcelUrl"   :data="{code:this.detailsPlanNum.planNum,name:this.fileName}"  >
+                <a-button type="primary" disabled>附件上传</a-button>
+              </a-upload>
+            </a-col>
+            <a-col :md="6" :sm="8" class="noprint">
+              <a-button type="primary" @click="openEnclosure">附件</a-button>
+            </a-col>
         </a-form-model>
       </div>
       </a-row>
@@ -328,7 +336,8 @@
        <Csubmit-information ref="CsubmitInformation" @close="closeInformation"></Csubmit-information>
        <!-- 选择指派人员 -->
        <select-user-modal ref="SelectUserModal" @selectFinished="selectFinished"></select-user-modal>
-    </div>
+       <attachment-display ref="attachmentDisplay"></attachment-display>
+      </div>
   </div>
   </a-modal>
 </template>
@@ -352,11 +361,11 @@ import accidentListModal from '@views/cost-allocation-total/modal/accidentListMo
 import SelectUserModal from '@views/cost-allocation-total/modal/SelectUserModal.vue'
 import { USER_AUTH } from "@/store/mutation-types"
 import { seachPlanNum, addHalfInfo,deleteFileDetail,assignedData,cancelSubmit } from '@api/document/cost-allocation-total.js'
-
+import AttachmentDisplay from '@views/reportForms/fabric-loss-table/attachment-display.vue'
 export default {
   name: 'CostAllocationTable', // 成本分配 (新增)
   mixins: [JeecgListMixin],
-  components: { JEllipsis,SelectUserModal,CsubmitInformation, moment, tabs, mainTableExpenseCNYModal, mainTableExpenseUSDModal, accidentListModal },
+  components: { JEllipsis,AttachmentDisplay,SelectUserModal,CsubmitInformation, moment, tabs, mainTableExpenseCNYModal, mainTableExpenseUSDModal, accidentListModal },
 
   data() {
     return {
@@ -504,18 +513,18 @@ export default {
               this.detailsPlanNum.shortseveral = 0
               this.detailsPlanNum.shortvalue = 0
             }
-            // var fileList =  (this.detailsPlanNum.attachs!==''&&this.detailsPlanNum.attachs)?this.detailsPlanNum.attachs.split(","):[]
-            //   this.fileList = []
-            //   if(fileList.length!==0){
-            //     fileList.map(item=>{
-            //       this.fileList.push({
-            //         uid: '-1',
-            //         name: item,
-            //         status: 'done',
-            //         url:'http://www.myfitt.cn:18001/jeecg-boot/sys/common/static' +'/'+item
-            //       })
-            //   })
-            //   }
+            var fileList =  (this.detailsPlanNum.attachs!==''&&this.detailsPlanNum.attachs)?this.detailsPlanNum.attachs.split(","):[]
+              this.fileList = []
+              if(fileList.length!==0){
+                fileList.map(item=>{
+                  this.fileList.push({
+                    uid: '-1',
+                    name: item,
+                    status: 'done',
+                    url:'http://www.myfitt.cn:18001/jeecg-boot/sys/common/static' +'/'+item
+                  })
+              })
+              }
             //调整表头格式
             this.adjustingHeader()
             // this.accidentListData = res.result.syCostAllocationAccidentList //事故单
@@ -649,6 +658,20 @@ export default {
       this.color2 = this.color2>0?this.color2:-this.color2
     },
 
+    openEnclosure(){
+      this.$refs.attachmentDisplay.AttachmentModVis = true
+      var attachList = [];
+      if (this.detailsPlanNum != null && this.detailsPlanNum.accessorItemList != null){
+        this.detailsPlanNum.accessorItemList.forEach(e=>{
+          var attach = {};
+          attach.name = e.filename;
+          attach.src=e.fileurl;
+          attachList.push(attach);
+        });
+      }
+      this.$refs.attachmentDisplay.attachmentData =  attachList;
+    },
+
 
     //判断有无指派人
     determineAssignedPerson(){

+ 17 - 2
src/views/cost-allocation-total/list.vue

@@ -136,11 +136,12 @@
         </span> -->
         <span slot="action" slot-scope="text, record">
           <!-- <a @click="handleApply(record)" v-if="apply == 1 && (record.status=='保存' || record.status=='' || !record.status)">发起申请</a> -->
-          <a @click="detail(record)">详情</a>
+          <a @click="openAppendixList(record)">附件</a>
           <a-divider type="vertical"  />
           <a-dropdown>
           <a class="ant-dropdown-link">更多<a-icon type="down"/></a>
             <a-menu slot="overlay" >
+              <a-menu-item><a @click="detail(record)">详情</a></a-menu-item>
               <a-menu-item><a @click="cancelSumit(record)">取消提交</a></a-menu-item>
               <a-menu-item><a @click="approvalHistory(record)">审批历史</a></a-menu-item>
             </a-menu>
@@ -150,6 +151,7 @@
     </a-card>
   </a-spin>
     <ChistoryModal ref="ChistoryModal"></ChistoryModal>
+    <attachment   ref="attachment"></attachment>
     <!-- 详情 大抽屉 -->
     <costDetail-drawer ref="costDetailDrawer"   @close="getCostList"></costDetail-drawer>
   </div>
@@ -161,6 +163,7 @@ import JEllipsis from '@/components/jeecg/JEllipsis'
 import moment from 'moment'
 import { downFile } from '@/api/manage'
 import costDetailDrawer from '@views/cost-allocation-total/costDetailDrawer.vue'
+import attachment from '@views/cost-allocation-total/modal/attachment.vue'
 import ChistoryModal from '@views/cost-allocation-total/modal/ChistoryModal'
 
 import { costList, itemCheck, cancelItemCheck,cancelSubmit } from '@api/document/cost-allocation-total.js'
@@ -168,7 +171,7 @@ import { costList, itemCheck, cancelItemCheck,cancelSubmit } from '@api/document
 export default {
   name: 'CostAllocationTotal', // 成本分配汇总 单证
   mixins: [JeecgListMixin],
-  components: { JEllipsis, moment, costDetailDrawer,ChistoryModal },
+  components: { JEllipsis, moment,attachment, costDetailDrawer,ChistoryModal },
 
   data() {
     let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
@@ -306,6 +309,18 @@ export default {
       // console.log('参数record', this.$refs.costDetailDrawer.record.planNum)
       this.$refs.costDetailDrawer.onSearch(record.planNum)
     },
+    openAppendixList(record){
+      this.$refs.attachment.AttachmentModVis = true
+      var attachmentArr = record.attachs.split(',')
+      var attachList = [];
+      attachmentArr.forEach(item=>{
+        var attach = {};
+          attach.name = item;
+          attach.src=item;
+          attachList.push(attach);
+      })
+      this.$refs.attachment.attachmentData =  attachList;
+    },
     //  审核
     check(record) {
       this.$nextTick(() => {