Ver Fonte

新加模块

Qukatie há 2 semanas atrás
pai
commit
d24b90c29b

+ 450 - 0
src/views/iosBasicData/SeafreightExportF/bills/assembly/importModule.vue

@@ -0,0 +1,450 @@
+<template>
+    <div>
+        <el-dialog title="导入 Magic Hand 文件" append-to-body :visible.sync="excelBox" width="60%" top="5vh"
+            :close-on-click-modal="false" v-dialog-drag :fullscreen="true">
+            <span>
+                <el-row>
+                    <el-col :span="24" style="display: flex;">
+                        <el-upload action="/api/blade-los/magicHandImport/importZip" :headers="headers"
+                            :on-progress="onProgress" :show-file-list=false accept=".zip" multiple
+                            :on-success="onSuccess" :on-error="onError" :on-change="onChange" style="float: right">
+                            <el-button type="success" size="mini" icon="el-icon-upload">解析文件</el-button>
+                        </el-upload>
+                    </el-col>
+                </el-row>
+                <el-row>
+                    <el-col :span="8">
+                        <el-row>
+                            <el-card class="box-card" shadow="never" :body-style="bodyStyle"
+                                style="margin: 0 4px 4px 0;">
+                                <el-divider content-position="left">ConsolDetail</el-divider>
+                                <avue-crud v-if="excelBox" :data="data" :option="option" :table-loading="loading"
+                                    @row-click="handleRowClick">
+                                </avue-crud>
+                            </el-card>
+                        </el-row>
+                        <el-row>
+                            <el-card class="box-card" shadow="never" :body-style="bodyStyle" style="margin: 0 4px 0 0;">
+                                <avue-form v-if="excelBox" v-model="form" :option="optionForm">
+                                    <tempalte slot="etd" slot-scope="{ row }" style="display: flex;">
+                                        <el-date-picker v-model="form.etd" type="date" format="yyyy-MM-dd"
+                                            value-format="yyyy-MM-dd" placeholder="请选择 ETD">
+                                        </el-date-picker>
+                                        <el-tooltip class="item" effect="dark" content="刷新ETD" placement="top">
+                                            <el-button size="mini" icon="el-icon-refresh" @click="etdClick"></el-button>
+                                        </el-tooltip>
+                                    </tempalte>
+                                </avue-form>
+                            </el-card>
+                        </el-row>
+                    </el-col>
+                    <el-col :span="16">
+                        <el-row>
+                            <el-card class="box-card" shadow="never" :body-style="bodyStyle" style="margin: 0 0 4px 0;">
+                                <el-divider content-position="left">Containers</el-divider>
+                                <avue-crud v-if="excelBox" :data="form.containersList" :option="option1"
+                                    :table-loading="loading" @row-click="handleRowClick2">
+                                </avue-crud>
+                            </el-card>
+                        </el-row>
+                        <el-row>
+                            <el-card class="box-card" shadow="never" :body-style="bodyStyle" style="margin: 0 0 4px 0;">
+                                <avue-crud v-if="excelBox" :data="data2" :option="option2" :table-loading="loading">
+                                </avue-crud>
+                            </el-card>
+                        </el-row>
+                        <el-row>
+                            <el-card class="box-card" shadow="never" :body-style="bodyStyle">
+                                <el-divider content-position="left">Shipments</el-divider>
+                                <avue-form v-if="excelBox" v-model="form.detail" :option="optionForm2"></avue-form>
+                            </el-card>
+                        </el-row>
+                    </el-col>
+                </el-row>
+            </span>
+            <span slot="footer" class="dialog-footer">
+                <el-button @click="excelBox = false" size="mini">取 消</el-button>
+                <el-button type="primary" @click="importData" size="mini">导 入</el-button>
+            </span>
+        </el-dialog>
+    </div>
+</template>
+
+<script>
+import { getDicinit } from "@/api/dicSelect/index";
+import { getToken } from "@/util/auth";
+export default {
+    data() {
+        return {
+            bodyStyle: {
+                padding: '5px'
+            },
+            loading: false,
+            headers: { "Blade-Auth": 'Bearer ' + getToken() },
+            action: null,
+            excelBox: false,
+            form: {
+                detail: {}
+            },
+            data: [],
+            data2: [],
+            data3: [],
+            selectionList: [],
+            optionForm: {
+                menuBtn: false,
+                span: 24,
+                disabled: false,
+                column: [
+                    {
+                        label: 'BOOK NO',
+                        prop: "bookingNo",
+                        disabled: false,
+                    },
+                    {
+                        label: 'VESSEL',
+                        prop: "vesselEnName",
+                        span: 12,
+                        disabled: false,
+                    },
+                    {
+                        label: 'VOY NO',
+                        prop: "voyageNo",
+                        span: 12,
+                        disabled: false,
+                    },
+                    {
+                        label: 'POL',
+                        prop: "polEnName",
+                        span: 12,
+                        disabled: false,
+                    },
+                    {
+                        label: 'POD',
+                        prop: "podEnName",
+                        span: 12,
+                        disabled: false,
+                    },
+                    {
+                        label: 'ETD',
+                        prop: "etd",
+                        span: 12,
+                        disabled: false,
+                        type: "date",
+                        format: "yyyy-MM-dd",
+                        valueFormat: "yyyy-MM-dd HH:mm:ss"
+                    },
+                    {
+                        label: 'ETA',
+                        prop: "eta",
+                        span: 12,
+                        disabled: false,
+                        type: "date",
+                        format: "yyyy-MM-dd",
+                        valueFormat: "yyyy-MM-dd HH:mm:ss"
+                    },
+                    {
+                        label: 'PayMode',
+                        prop: "hpaymode",
+                        span: 12,
+                        disabled: false,
+                    },
+                    {
+                        label: 'PayAtLocation',
+                        prop: "hpayplace",
+                        span: 12,
+                        disabled: false,
+                    },
+                    {
+                        label: 'TermsCode',
+                        prop: "serviceTerms",
+                        span: 12,
+                        disabled: false,
+                    },
+                    {
+                        label: 'ServiceContract',
+                        prop: "corpArgreementNo",
+                        span: 12,
+                        labelWidth: 100,
+                        disabled: false,
+                    },
+                    {
+                        label: 'ServiceCode',
+                        prop: "serviceCode",
+                        span: 12,
+                        disabled: false,
+                    },
+                    {
+                        label: 'IsAMS',
+                        prop: "isAMS",
+                        span: 12,
+                        disabled: false,
+                    },
+                    {
+                        label: 'FinalDest',
+                        prop: "finalDestinationName",
+                        disabled: false,
+                    },
+                    {
+                        label: 'TransportModeCode',
+                        prop: "fnltransMode",
+                        labelWidth: 124,
+                        disabled: false,
+                    },
+                    {
+                        label: 'Comment',
+                        prop: "bookingRemarks",
+                        type: 'textarea',
+                        minRows: 3,
+                        maxRows: 3,
+                        disabled: false,
+                    }
+                ]
+            },
+            optionForm2: {
+                menuBtn: false,
+                span: 8,
+                disabled: false,
+                column: [
+                    {
+                        label: '发货人',
+                        prop: "hshipperCnName",
+                        disabled: false,
+                    },
+                    {
+                        label: '收货人',
+                        prop: "hconsigneeCnName",
+                        disabled: false,
+                    },
+                    {
+                        label: '通知人',
+                        prop: "hnotifyCnName",
+                        disabled: false,
+                    },
+                    {
+                        label: '提单描述',
+                        prop: "hshipperDetails",
+                        type: 'textarea',
+                        minRows: 3,
+                        maxRows: 3,
+                        disabled: false,
+                    },
+                    {
+                        label: '提单描述',
+                        prop: "hconsigneeDetails",
+                        type: 'textarea',
+                        minRows: 3,
+                        maxRows: 3,
+                        disabled: false,
+                    },
+                    {
+                        label: '提单描述',
+                        prop: "hnotifyDetails",
+                        type: 'textarea',
+                        minRows: 3,
+                        maxRows: 3,
+                        disabled: false,
+                    },
+                ]
+            },
+            option: {
+                height: 220,
+                border: true,
+                align: 'center',
+                menu: false,
+                header: false,
+                stripe: true,
+                column: [
+                    {
+                        label: 'Booking No',
+                        prop: 'bookingNo',
+                        overHidden: true,
+                    }
+                ]
+            },
+            option1: {
+                height: 230,
+                border: true,
+                align: 'center',
+                menu: false,
+                header: false,
+                stripe: true,
+                column: [
+                    {
+                        label: 'ContainerNumber',
+                        prop: 'cntrNo',
+                        overHidden: true,
+                    },
+                    {
+                        label: 'SealNumber',
+                        prop: 'sealNo',
+                        overHidden: true,
+                    },
+                    {
+                        label: 'ContainerTypeCode',
+                        prop: 'cntrTypeCode',
+                        overHidden: true,
+                    }
+                ]
+            },
+            option2: {
+                height: 230,
+                border: true,
+                align: 'center',
+                menu: false,
+                header: false,
+                stripe: true,
+                column: [
+                    {
+                        label: 'Commodity',
+                        prop: 'commodityCnName',
+                        width: 90,
+                        overHidden: true,
+                    },
+                    {
+                        label: 'HarmonizedCode',
+                        prop: 'hscode',
+                        width: 120,
+                        overHidden: true,
+                    },
+                    {
+                        label: 'ShortDescriptior',
+                        prop: 'commodityShName',
+                        width: 120,
+                        overHidden: true,
+                    },
+                    {
+                        label: 'ShipperDescriptior',
+                        prop: 'commodityDescr',
+                        width: 130,
+                        overHidden: true,
+                    },
+                    {
+                        label: 'MarksNumbers',
+                        prop: 'marks',
+                        width: 110,
+                        overHidden: true,
+                    },
+                    {
+                        label: 'PackageTypeCode',
+                        prop: 'packingUnitCode',
+                        width: 124,
+                        overHidden: true,
+                    },
+                    {
+                        label: 'Quantity',
+                        prop: 'quantity',
+                        width: 80,
+                        overHidden: true,
+                    },
+                    {
+                        label: 'PackageTypeCode',
+                        prop: 'packingUnit',
+                        width: 124,
+                        overHidden: true,
+                    },
+                    {
+                        label: 'Weight',
+                        prop: 'grossWeight',
+                        width: 70,
+                        overHidden: true,
+                    },
+                    {
+                        label: 'Measurementer',
+                        prop: 'measurement',
+                        width: 110,
+                        overHidden: true,
+                    }
+                ]
+            },
+            url: null,
+            type: null
+        };
+    },
+    created() { },
+    methods: {
+        etdClick() {
+            this.data.forEach(item => {
+                item.etd = this.form.etd
+            })
+        },
+        handleRowClick(row, event, column) {
+            this.form = row
+        },
+        handleRowClick2(row, event, column) {
+            console.log(row)
+            this.data2 = row.containersCommodityList
+        },
+        //文件上传时的钩子
+        onProgress(event, file, fileList) {
+            this.loading = true
+        },
+        //文件上传成功时的钩子
+        onSuccess(res, file) {
+            this.data = res.data
+            this.$message.success('上传成功');
+            this.loading = false
+        },
+        //文件上传失败时的钩子
+        onError(err, file, fileList) {
+            let errorMsg = err.toString();
+            errorMsg = errorMsg.replace('Error:', '')
+            errorMsg = JSON.parse(errorMsg)
+            this.$message.error(errorMsg.msg);
+            this.loading = false
+        },
+        //上传成功和上传失败时都会被调用
+        onChange(file, fileList) {
+            // if (file.status == "fail") {
+            //     this.$message.error("上传失败");
+            // }
+        },
+        // //上传文件之前的钩子
+        // beforeUpload(file) {
+
+        // },
+        openDialog(type) {
+            this.data = []
+            this.selectionList = []
+            this.excelBox = true
+        },
+        download() {
+            if (this.type == 1) {
+                window.open(`/api/blade-los/boxPool/emptyContainerEntry/template?${this.website.tokenHeader}=${getToken()}`);
+            }
+        },
+        selectionChange(list) {
+            this.selectionList = list
+        },
+        importData() {
+            if (this.data.length == 0) {
+                return this.$message.error("请上传数据");
+            }
+            if (this.selectionList.length == 0) {
+                return this.$message.error("请选择数据");
+            }
+            this.loading = true
+            getDicinit('POST', this.url, this.selectionList).then(res => {
+                this.excelBox = false
+                this.$emit('refreshData')
+            }).finally(() => {
+                this.loading = false;
+            })
+        },
+    }
+}
+
+</script>
+
+<style lang="scss" scoped>
+::v-deep .el-dialog__body {
+    padding: 0px 5px !important;
+}
+
+::v-deep .el-table td {
+    padding: 0px !important;
+}
+
+::v-deep .el-table th {
+    padding: 0px !important;
+}
+</style>

+ 16 - 14
src/views/iosBasicData/SeafreightExportF/bills/index.vue

@@ -38,6 +38,8 @@
                     </el-button>
                     <el-button type="warning" size="small" @click="outExport">导 出
                     </el-button>
+                    <el-button type="primary" size="small" plain @click="importMagicHand">导入 MH
+                    </el-button>
                     <el-dropdown style="line-height: 0">
                         <el-button size="small" type="success" :disabled="selectionList.length == 0">
                             发送 SO EDI<i class="el-icon-arrow-down el-icon--right"></i>
@@ -58,9 +60,6 @@
                             </el-dropdown-item>
                         </el-dropdown-menu>
                     </el-dropdown>
-                    <el-button type="primary" size="small" plain
-                               @click="importMagicHand">导入 MH
-                    </el-button>
                     <el-dropdown style="line-height: 0" @command="batchClick">
                         <el-button size="small" type="danger" :disabled="selectionList.length == 0">
                             批量操作<i class="el-icon-arrow-down el-icon--right"></i>
@@ -145,7 +144,7 @@
                 <template slot="eta" slot-scope="scope">
                     <span>{{
                         scope.row.eta ? scope.row.eta.slice(0, 10) : ""
-                    }}</span>
+                        }}</span>
                 </template>
                 <template slot="updateTime" slot-scope="scope">
                     <span>{{
@@ -277,12 +276,13 @@
         <update-batch-field ref="updateFieldRef"></update-batch-field>
 
         <!--导入模板-->
-        <el-dialog title="导入 Magic Hand 文件" append-to-body :visible.sync="magicHandBox" width="555px" :close-on-click-modal="false"
-                   v-dialog-drag>
+        <!-- <el-dialog title="导入 Magic Hand 文件" append-to-body :visible.sync="magicHandBox" width="555px"
+            :close-on-click-modal="false" v-dialog-drag>
             <avue-form :option="magicHandOption" v-model="magicHandForm" :table-loading="magicHandLoading"
-                       :upload-before="beforeUploadMagicHandZipFile" :upload-after="onSuccessUploadMagicHandZipFile">
+                :upload-before="beforeUploadMagicHandZipFile" :upload-after="onSuccessUploadMagicHandZipFile">
             </avue-form>
-        </el-dialog>
+        </el-dialog> -->
+        <import-module ref="importModule" @refreshData="refreshData" />
     </div>
 </template>
 
@@ -321,7 +321,7 @@ import TreeSelect from "@/components/iosbasic-data/TreeSelect.vue";
 import { getDeptTree } from "@/api/system/dept";
 import { getToken } from "@/util/auth";
 import UpdateBatchField from "@/views/iosBasicData/SeafreightExportF/bills/updateBatchField.vue";
-
+import importModule from "./assembly/importModule.vue";
 export default {
     components: {
         UpdateBatchField,
@@ -329,7 +329,8 @@ export default {
         SearchQuery,
         feesTemplateItems,
         billsDetails,
-        SplitList
+        SplitList,
+        importModule
     },
     data() {
         return {
@@ -2348,8 +2349,9 @@ export default {
             done();
         },
 
-        importMagicHand (){
-            this.magicHandBox = true
+        importMagicHand() {
+            // this.magicHandBox = true
+            this.$refs.importModule.openDialog()
         },
         beforeUploadMagicHandZipFile(file, done, loading) {
             done();
@@ -2358,7 +2360,7 @@ export default {
         // 上传成功
         onSuccessUploadMagicHandZipFile(res, done, loading, column) {
             console.log('onSuccessUploadMagicHandZipFile.res', res)
-            try{
+            try {
                 if (Object.keys(res).length) {
                     console.log('onSuccessUploadMagicHandZipFile.res', res)
 
@@ -2366,7 +2368,7 @@ export default {
                         this.$message.success("测试提交 MH 成功");
                     });
                 }
-            }finally {
+            } finally {
                 loading = false;
                 done();
                 this.magicHandBox = false;

+ 63 - 60
src/views/tirePartsMall/financialManagement/collectionSettlement/detailsPage.vue

@@ -13,9 +13,10 @@
         <el-button class="el-button--small-yh" type="primary" size="small"
           :disabled="form.financeStatus == '已收款' || isSaveBtn" @click="editCustomer">保存数据
         </el-button>
-        <el-button class="el-button--small-yh" type="warning" :disabled="isFinanceBtn" size="small" @click="collection">{{
-          form.financeStatus ==
-          '已收款' ? '撤销收款' : '收款' }}
+        <el-button class="el-button--small-yh" type="warning" :disabled="isFinanceBtn" size="small"
+          @click="collection">{{
+            form.financeStatus ==
+              '已收款' ? '撤销收款' : '收款' }}
         </el-button>
         <!-- <el-button class="el-button--small-yh" type="primary" size="small" v-if="form.id">启用
         </el-button> -->
@@ -24,24 +25,12 @@
     <div style="margin-top: 50px">
       <trade-card title="基础信息">
         <avue-form :option="optionForm" v-model="form" ref="form">
-          <!--<template slot-scope="scope" slot="corpId">-->
-          <!--    <el-select v-model="form.corpId" placeholder="请选择">-->
-          <!--        <el-option-->
-          <!--            v-for="item in corpIdData"-->
-          <!--            :key="item.id"-->
-          <!--            :label="item.cname"-->
-          <!--            :value="item.id">-->
-          <!--        </el-option>-->
-          <!--    </el-select>-->
-          <!--</template>-->
-          <!--<template slot-scope="scope" slot="settlementDate">-->
-          <!--    <el-date-picker-->
-          <!--        v-model="value1"-->
-          <!--        type="date"-->
-          <!--        format="yyyy-MM-dd",-->
-          <!--        placeholder="选择日期">-->
-          <!--    </el-date-picker>-->
-          <!--</template>-->
+          <tempalte slot="corpName" slot-scope="{ row }">
+            <dic-select v-model="form.corpName" placeholder="客户" key="id" label="cname" res="records"
+              url="/blade-sales-part/corpsDesc/list?current=1&size=10&corpType=KH" :filterable="true" :remote="true"
+              dataName="cname" @selectChange="dicChange('corpName', $event)"
+              :disabled="optionForm.disabled"></dic-select>
+          </tempalte>
         </avue-form>
       </trade-card>
       <trade-card title="明细信息">
@@ -59,12 +48,14 @@
           </template>
           <template slot-scope="{ row, index }" slot="thisAmount">
             <el-input-number size="small" v-model="row.thisAmount" :precision="2" :controls="false"
-              v-if="row.$cellEdit && row.businesType == 'XS'" @change="thisAmountChange(row)" :max="row.accountsAmount-row.settlmentAmount"></el-input-number>
+              v-if="row.$cellEdit && row.businesType == 'XS'" @change="thisAmountChange(row)"
+              :max="row.accountsAmount - row.settlmentAmount"></el-input-number>
             <span v-else>{{ row.thisAmount }}</span>
           </template>
           <template slot-scope="{ row, index }" slot="thisRefundAmount">
             <el-input-number size="small" width="100" v-model="row.thisRefundAmount" :precision="2" :controls="false"
-              v-if="row.$cellEdit && row.businesType == 'TKXS'" @change="thisReAmountChange(row)" :max="row.accountsAmount-row.settlmentAmount"></el-input-number>
+              v-if="row.$cellEdit && row.businesType == 'TKXS'" @change="thisReAmountChange(row)"
+              :max="row.accountsAmount - row.settlmentAmount"></el-input-number>
             <span v-else>{{ row.thisRefundAmount }}</span>
           </template>
           <template slot-scope="{type,size,row,index,disabled}" slot="menu">
@@ -84,9 +75,9 @@
         deleteUrl="/api/trade-purchase/woodHarvestingCloud/removeByFileId" :data="filesList" display
         :enumerationValue="35.1"></c-upload>
     </div>
-    <el-dialog title="导入订单" v-if="billDetailDialog" append-to-body class="el-dialogDeep" :visible.sync="billDetailDialog"
-      width="80%" :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" top="10vh"
-      v-dialog-drag>
+    <el-dialog title="导入订单" v-if="billDetailDialog" append-to-body class="el-dialogDeep"
+      :visible.sync="billDetailDialog" width="80%" :close-on-click-modal="false" :destroy-on-close="true"
+      :close-on-press-escape="false" top="10vh" v-dialog-drag>
       <bill-detail :params="params" :billType="billType" :flag="1" @closeFun="closeBillDetail"
         @importProMent="importProMent">
       </bill-detail>
@@ -99,12 +90,13 @@ import billDetail from "@/components/bill/selectOrderDetailList";
 import { saveSubmit, collectionAndPayment, revokeCollectionAndPayment, detail, removeItems, getFinanceList, remove } from '@/api/accountingManagement/index.js';
 import { getList } from "@/api/collectionSettlement/index.js";
 import { skgetKh } from "@/api/tirePartsMall/salesManagement/saleOrder";
-
+import dicSelect from "@/components/dicSelect/main";
 
 export default {
   name: "detailsPage",
   components: {
-    billDetail
+    billDetail,
+    dicSelect
   },
   data() {
     return {
@@ -132,17 +124,18 @@ export default {
         span: 8,
         column: [{
           label: '客户',
-          prop: "corpId",
-          type: 'select',
-          remote: true,
-          props: {
-            label: 'cname',
-            value: 'id'
-          },
-          click: () => {
-            this.$refs.form.dicInit()
-          },
-          dicUrl: '/api/blade-sales-part/corpsDesc/listAll?cname={{key}}&corpType=KH',
+          prop: "corpName",
+          // type: 'select',
+          // remote: true,
+          // props: {
+          //   label: 'cname',
+          //   value: 'id',
+          //   res: 'data.records'
+          // },
+          // click: () => {
+          //   this.$refs.form.dicInit()
+          // },
+          // dicUrl: '/api/blade-sales-part/corpsDesc/list?current=1&size=20&cname={{key}}&corpType=KH',
           rules: [{
             required: true,
             message: " ",
@@ -379,22 +372,32 @@ export default {
     // this.corpIdData
   },
   methods: {
-    thisAmountChange(row){
-      let sum1=0
-      let sum2=0
-      this.form.settlementItemsList.forEach(e=>{
+    dicChange(name, row) {
+      if (name == 'corpName') {
+        if (row) {
+          this.form.corpId = row.id
+        } else {
+          this.form.corpId = null
+          this.form.corpName = null
+        }
+      }
+    },
+    thisAmountChange(row) {
+      let sum1 = 0
+      let sum2 = 0
+      this.form.settlementItemsList.forEach(e => {
         sum1 += e.thisAmount ? Number(e.thisAmount) : 0;
         sum2 += e.thisRefundAmount ? Number(e.thisRefundAmount) : 0;
-        this.$set(this.form,'amount',sum1-sum2)
+        this.$set(this.form, 'amount', sum1 - sum2)
       })
     },
-    thisReAmountChange(row){
-      let sum1=0
-      let sum2=0
-      this.form.settlementItemsList.forEach(e=>{
+    thisReAmountChange(row) {
+      let sum1 = 0
+      let sum2 = 0
+      this.form.settlementItemsList.forEach(e => {
         sum1 += e.thisAmount ? Number(e.thisAmount) : 0;
         sum2 += e.thisRefundAmount ? Number(e.thisRefundAmount) : 0;
-        this.$set(this.form,'amount',sum1-sum2)
+        this.$set(this.form, 'amount', sum1 - sum2)
       })
     },
     rowDelBox(row, index) {
@@ -473,15 +476,15 @@ export default {
       //     }
       //   }
       // }
-      let sum1=0
-      let sum2=0
+      let sum1 = 0
+      let sum2 = 0
       list.forEach((item, index) => {
         item.contractNumber = item.ordNo;
-        item.accountsAmount = item.bsType == "XS"||item.bsType == "GX"?item.totalMoney:item.returnsAmount
+        item.accountsAmount = item.bsType == "XS" || item.bsType == "GX" ? item.totalMoney : item.returnsAmount
         item.settlmentAmount = item.paymentAmountTl
-        item.businesType=item.bsType
-        this.$set(item,'thisAmount',item.bsType=="XS"||item.bsType == "GX"?(Number(item.totalMoney) - Number(item.paymentAmountTl)):0)
-        this.$set(item,'thisRefundAmount',item.bsType=="TKXS"?(Number(item.returnsAmount) - Number(item.paymentAmountTl)):0)
+        item.businesType = item.bsType
+        this.$set(item, 'thisAmount', item.bsType == "XS" || item.bsType == "GX" ? (Number(item.totalMoney) - Number(item.paymentAmountTl)) : 0)
+        this.$set(item, 'thisRefundAmount', item.bsType == "TKXS" ? (Number(item.returnsAmount) - Number(item.paymentAmountTl)) : 0)
         // item.thisAmount =item.bsType=="XS"?(Number(item.totalMoney) - Number(item.paymentAmountTl)):0
         // item.thisRefundAmount =item.bsType=="TKXS"? (Number(item.totalMoney) - Number(item.paymentAmountTl)):0
         item.srcParentId = item.id
@@ -492,9 +495,9 @@ export default {
         delete item.ordNo;
         this.$refs.formContacts.rowCellAdd(item);
         //计算主表金额
-        sum1+=item.bsType=="XS"||item.bsType == "GX"?(Number(item.totalMoney) - Number(item.paymentAmountTl)):0
-        sum2+=item.bsType=="TKXS"? (Number(item.totalMoney) - Number(item.paymentAmountTl)):0
-        this.form.amount=sum1-sum2
+        sum1 += item.bsType == "XS" || item.bsType == "GX" ? (Number(item.totalMoney) - Number(item.paymentAmountTl)) : 0
+        sum2 += item.bsType == "TKXS" ? (Number(item.totalMoney) - Number(item.paymentAmountTl)) : 0
+        this.form.amount = sum1 - sum2
       })
       //明细列表所有合同号 去重 加, 为主表合同号
       // this.$set(this.form,'srcOrderno',Array.from(new Set(this.dataList.map(item =>{ return item.srcOrderno}))).join(','))
@@ -510,7 +513,7 @@ export default {
             ...this.form,
             dc: 'd',
             billType: 'SK',
-            corpName: this.form.$corpId,
+            // corpName: this.form.$corpId,
             accountName: this.form.$accountId,
             filesList: this.filesList
           }
@@ -561,7 +564,7 @@ export default {
                 ...this.form,
                 dc: 'd',
                 billType: 'SK',
-                corpName: this.form.$corpId
+                // corpName: this.form.$corpId
               }
               saveSubmit(data).then(res => {
                 loading.close()

+ 46 - 23
src/views/tirePartsMall/financialManagement/paymentSettlement/detailsPage.vue

@@ -13,9 +13,10 @@
         <el-button class="el-button--small-yh" type="primary" :disabled="isSaveBtn" size="small"
           @click="editCustomer">保存数据
         </el-button>
-        <el-button class="el-button--small-yh" type="warning" size="small" :disabled="isFinanceBtn" @click="collection">{{
-          form.financeStatus ==
-          '已付款' ? '撤销付款' : '付款' }}
+        <el-button class="el-button--small-yh" type="warning" size="small" :disabled="isFinanceBtn"
+          @click="collection">{{
+            form.financeStatus ==
+              '已付款' ? '撤销付款' : '付款' }}
         </el-button>
         <!-- <el-button class="el-button--small-yh" type="primary" size="small" v-if="form.id">启用
         </el-button> -->
@@ -23,7 +24,14 @@
     </div>
     <div style="margin-top: 50px">
       <trade-card title="基础信息">
-        <avue-form :option="optionForm" v-model="form" ref="form"></avue-form>
+        <avue-form :option="optionForm" v-model="form" ref="form">
+          <tempalte slot="corpName" slot-scope="{ row }">
+            <dic-select v-model="form.corpName" placeholder="供应商" key="id" label="cname" res="records"
+              url="/blade-sales-part/corpsDesc/list?current=1&size=10&corpType=GYS" :filterable="true" :remote="true"
+              dataName="cname" @selectChange="dicChange('corpName', $event)"
+              :disabled="optionForm.disabled"></dic-select>
+          </tempalte>
+        </avue-form>
       </trade-card>
       <trade-card title="明细信息">
         <avue-crud :option="optionContacts" v-model="formContacts" ref="formContacts" :data="form.settlementItemsList"
@@ -40,12 +48,14 @@
           </template>
           <template slot-scope="{ row, index }" slot="thisAmount">
             <el-input-number size="small" v-model="row.thisAmount" :precision="2" :controls="false"
-              v-if="row.$cellEdit && row.businesType == 'CG'" @change="thisAmountChange(row)" :max="row.accountsAmount-row.settlmentAmount"></el-input-number>
+              v-if="row.$cellEdit && row.businesType == 'CG'" @change="thisAmountChange(row)"
+              :max="row.accountsAmount - row.settlmentAmount"></el-input-number>
             <span v-else>{{ row.thisAmount }}</span>
           </template>
           <template slot-scope="{ row, index }" slot="thisRefundAmount">
             <el-input-number size="small" width="100" v-model="row.thisRefundAmount" :precision="2" :controls="false"
-              v-if="row.$cellEdit && row.businesType == 'TKCG'" @change="thisReAmountChange(row)" :max="row.accountsAmount-row.settlmentAmount"></el-input-number>
+              v-if="row.$cellEdit && row.businesType == 'TKCG'" @change="thisReAmountChange(row)"
+              :max="row.accountsAmount - row.settlmentAmount"></el-input-number>
             <span v-else>{{ row.thisRefundAmount }}</span>
           </template>
           <template slot-scope="{type,size,row,index,disabled}" slot="menu">
@@ -61,8 +71,9 @@
       </trade-card>
 
       <containerTitle title="上传附件"></containerTitle>
-      <c-upload v-loading="loadingBtn" typeUpload="LT" deleteUrl="/api/trade-purchase/woodHarvestingCloud/removeByFileId"
-        :data="filesList" display :enumerationValue="35.1"></c-upload>
+      <c-upload v-loading="loadingBtn" typeUpload="LT"
+        deleteUrl="/api/trade-purchase/woodHarvestingCloud/removeByFileId" :data="filesList" display
+        :enumerationValue="35.1"></c-upload>
 
     </div>
     <el-dialog title="导入订单" append-to-body class="el-dialogDeep" :visible.sync="billDetailDialog" width="80%"
@@ -78,11 +89,12 @@
 import billDetail from "@/components/bill/selectOrderDetailListCG";
 import { saveSubmit, collectionAndPayment, revokeCollectionAndPayment, detail, removeItems, getFinanceList, remove } from '@/api/accountingManagement/index.js';
 import { number } from "echarts";
-
+import dicSelect from "@/components/dicSelect/main";
 export default {
   name: "detailsPage",
   components: {
-    billDetail
+    billDetail,
+    dicSelect
   },
   data() {
     return {
@@ -107,17 +119,18 @@ export default {
         span: 8,
         column: [{
           label: '供应商',
-          prop: "corpId",
-          type: "select",
-          remote: true,
-          props: {
-            label: 'cname',
-            value: 'id'
-          },
-          click: () => {
-            this.$refs.form.dicInit()
-          },
-          dicUrl: '/api/blade-sales-part/corpsDesc/listAll?cname={{key}}&corpType=GYS',
+          prop: "corpName",
+          // type: "select",
+          // remote: true,
+          // props: {
+          //   label: 'cname',
+          //   value: 'id',
+          //   res: 'data.records'
+          // },
+          // click: () => {
+          //   this.$refs.form.dicInit()
+          // },
+          // dicUrl: '/api/blade-sales-part/corpsDesc/list?current=1&size=20&cname={{key}}&corpType=GYS',
           rules: [{
             required: true,
             message: " ",
@@ -322,6 +335,16 @@ export default {
 
   },
   methods: {
+    dicChange(name, row) {
+      if (name == 'corpName') {
+        if (row) {
+          this.form.corpId = row.id
+        } else {
+          this.form.corpId = null
+          this.form.corpName = null
+        }
+      }
+    },
     thisAmountChange(row) {
       let sum1 = 0
       let sum2 = 0
@@ -427,7 +450,7 @@ export default {
             ...this.form,
             dc: 'c',
             billType: 'FK',
-            corpName: this.form.$corpId,
+            // corpName: this.form.$corpId,
             filesList: this.filesList
           }
           const loading = this.$loading({
@@ -547,7 +570,7 @@ export default {
                 ...this.form,
                 dc: 'c',
                 billType: 'FK',
-                corpName: this.form.$corpId
+                // corpName: this.form.$corpId
               }
               revokeCollectionAndPayment(data).then((res => {
                 this.refresh(res.data.data.id)