Browse Source

货代修改bug 2023-12-13

caojunjie 1 year ago
parent
commit
5026c4dc0f

+ 8 - 0
src/api/iosBasicData/ReceivingOrders/precontainers.js

@@ -39,5 +39,13 @@ export const precontainersSubmit = (row) => {
     data: row
   })
 }
+// 批量保存
+export const precontainersSubmitList = (row) => {
+  return request({
+    url: '/api/blade-los/precontainers/submitList',
+    method: 'post',
+    data: row
+  })
+}
 
 

+ 4 - 0
src/enums/column-name.js

@@ -1452,6 +1452,10 @@ const columnName = [{
     code: 321,
     name: '货运代理-账单管理-财务凭证'
   },
+  {
+    code: 321.1,
+    name: '货运代理-账单管理-财务凭证明细'
+  },
 ]
 export const getColumnName = (key) => {
   for (let index = 0; index < columnName.length; index++) {

+ 6 - 1
src/views/iosBasicData/SeafreightExportF/bills/assembly/DistributionBox/PackingBusiness.vue

@@ -150,7 +150,6 @@
                 :row-style="{height:'20px',padding:'0px',fontSize:'12px'}"
                 :cell-style="{padding:'0px',fontSize:'12px',textAlign:'center'}"
                 :data="containersBillsList"
-
                 :header-cell-style="tableHeaderCellStyle"
                 border
                 stripe
@@ -769,6 +768,12 @@
                     cancelButtonText: "取消",
                     type: "warning"
                 }).then(()=>{
+                    for(let item of this.selectionDetailList) {
+                        item.billNo = this.assemblyForm.billNo
+                        item.ppId = this.assemblyForm.id
+                        item.pid = this.selectionList[0].id
+                        item.lineNo = this.selectionList[0].containersCommodityList.length
+                    }
                     containerscommoditySubmitList(this.selectionDetailList).then(res=>{
                         this.$message.success("操作成功!");
                         this.containersCommodityList = []

+ 1 - 1
src/views/iosBasicData/SeafreightExportF/bills/assembly/EntrustmentLnformation.vue

@@ -1009,7 +1009,7 @@ import emailhash from '@/views/iosBasicData/SeafreightExportF/bills/assembly/Jso
                 let cnPorArr = ['pol','pod','pot']
                 if (arr.indexOf(name) != -1) {
                     for(let item of this[name + 'Data']) {
-                        if (item.id == value) {
+                        if (item.cnName == value) {
                             this.$set(this.assemblyForm,name + 'Id',item.id)
                             this.$set(this.assemblyForm,name + 'CnName',item.cnName)
                             this.$set(this.assemblyForm,name + 'EnName',item.enName)

+ 71 - 14
src/views/iosBasicData/SeafreightExportF/bills/assembly/EntrustmentLnformation/precontainers.vue

@@ -30,6 +30,7 @@
                    :disabled="seeDisabled"
                    @click.stop="handleDelete">删 除
         </el-button>
+        <el-button type="primary" size="small" :disabled="seeDisabled" @click="batchSavefun" >批量保存</el-button>
         <el-button type="success" size="small" plain :disabled="seeDisabled"
                    @click.stop="equalDistribution">均分箱量
         </el-button>
@@ -69,7 +70,13 @@
 </template>
 
 <script>
-  import {precontainersList, precontainersDetail, precontainersSubmit, precontainersRemove} from "@/api/iosBasicData/ReceivingOrders/precontainers";
+import {
+    precontainersList,
+    precontainersDetail,
+    precontainersSubmit,
+    precontainersRemove,
+    precontainersSubmitList
+} from "@/api/iosBasicData/ReceivingOrders/precontainers";
   import {getWorkDicts} from "@/api/system/dictbiz";
   import {mapGetters} from "vuex";
   import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
@@ -121,33 +128,53 @@
             {
               label: "尺码箱型",
               prop: "cntrTypeCode",
-                formslot: true,
+              formslot: true,
               width:'120',
-                cell:true,
+              cell:true,
+              rules: [{
+                 required: true,
+                 message: " ",
+                 trigger: "blur"
+              }]
             },
             {
               label: "箱量",
               prop: "quantity",
               width:'120',
-                cell:true,
+              cell:true,
+              rules: [{
+                required: true,
+                message: " ",
+                trigger: "blur"
+              }]
             },
             {
               label: "毛重(KGM)",
               prop: "grossWeight",
               width:'120',
-                cell:true,
+              cell:true,
+              rules: [{
+                  required: true,
+                  message: " ",
+                  trigger: "blur"
+              }]
             },
             {
               label: "净重(KGM)",
               prop: "netWeight",
               width:'120',
-                cell:true,
+              cell:true,
             },
             {
               label: "体积(CBM)",
               prop: "measurement",
               width:'120',
-                cell:true,
+              cell:true,
+              rules: [{
+                 required: true,
+                 message: " ",
+                 trigger: "blur"
+              }]
             },
             {
               label: "温度",
@@ -240,6 +267,36 @@
           this.option = await this.getColumnData(this.getColumnName(309.1), this.optionBack);
       },
       methods: {
+        // 批量保存
+        batchSavefun(){
+            if (!this.assemblyForm.id) {
+                this.$message({
+                    message: '请先保存数据之后才能添加',
+                    type: 'warning'
+                });
+                return
+            }
+            for(let item of this.assemblyForm.preContainersList) {
+                if (!item.cntrTypeCode) {
+                    this.$message.warning('请选择尺码箱型')
+                    return;
+                }
+                item.pid = this.assemblyForm.id
+            }
+            this.$confirm("确认批量保存吗?已经存在配箱信息,如果修改预配箱数据 要清除全部配箱信息?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            }).then(()=>{
+                precontainersSubmitList(this.assemblyForm.preContainersList).then(res=>{
+                    this.$message({
+                        type: "success",
+                        message: "操作成功!"
+                    });
+                    this.$emit('billsDetailfun')
+                })
+            })
+        },
         // 平均箱量
         equalDistribution(){
             if(this.assemblyForm.waitingBoxList.length <= 0) {
@@ -428,6 +485,13 @@
                   return;
               }
           }
+          if (!this.pid) {
+              this.$message({
+                  message: '请先保存数据之后才能添加',
+                  type: 'warning'
+              });
+              return
+          }
           if (row.id) {
               this.$confirm("已经存在配箱信息,如果修改预配箱数据 要清除全部配箱信息?", {
                   confirmButtonText: "确定",
@@ -483,13 +547,6 @@
       },
       // 新增
       addfun(){
-          if (!this.pid) {
-              this.$message({
-                  message: '请先保存数据之后才能添加',
-                  type: 'warning'
-              });
-              return
-          }
           this.$refs.crud.rowCellAdd({})
          // this.$refs.crud.rowAdd()
       },

+ 80 - 15
src/views/iosBasicData/SeafreightExportF/bills/assembly/feecenter.vue

@@ -935,13 +935,6 @@
             },
             // 应收新增
             addDfun(){
-                if (!this.pid) {
-                    this.$message({
-                        message: '请先保存数据之后才能添加',
-                        type: 'warning'
-                    });
-                    return
-                }
                 // 判断数据需要的数据是否有
                 if (!requiredMessage(this.assemblyForm,this.messageData)) {
                     return;
@@ -962,13 +955,6 @@
             },
             // 应付新增
             addCfun(){
-                if (!this.pid) {
-                    this.$message({
-                        message: '请先保存数据之后才能添加',
-                        type: 'warning'
-                    });
-                    return
-                }
                 // 判断数据需要的数据是否有
                 if (!requiredMessage(this.assemblyForm,this.messageData)) {
                     return;
@@ -999,10 +985,17 @@
             },
             // 应付应付保存
             savefun(row,index,dc){
+                if (!this.pid) {
+                    this.$message({
+                        message: '请先保存数据之后才能添加',
+                        type: 'warning'
+                    });
+                    return
+                }
                 // 收付 D=收 C=付
                 row.dc = dc
                 row.pid = this.pid
-                row.sort = index
+                row.sort = Number(index) + 1
                 row.businessType = this.assemblyForm.businessType // 业务类型
                 row.billType = this.assemblyForm.billType // 单据类型
                 row.billNo = this.assemblyForm.billNo // 单据编号
@@ -1336,11 +1329,83 @@
             },
             // 费用信息明细保存按钮
             feecenterSubmitListfun(){
+                if (!this.pid) {
+                    this.$message({
+                        message: '请先保存数据之后才能添加',
+                        type: 'warning'
+                    });
+                    return
+                }
                 this.$confirm("确定保存全部的费用信息?", {
                     confirmButtonText: "确定",
                     cancelButtonText: "取消",
                     type: "warning"
                 }).then(()=>{
+                    this.assemblyForm.feeCenterListD.map((row,index)=>{
+                        row.dc = 'D'
+                        row.pid = this.pid
+                        row.sort = Number(index) + 1
+                        row.businessType = this.assemblyForm.businessType // 业务类型
+                        row.billType = this.assemblyForm.billType // 单据类型
+                        row.billNo = this.assemblyForm.billNo // 单据编号
+                        row.billDate = this.assemblyForm.billDate // 单据日期
+                        row.billCorpId = this.assemblyForm.corpId // 主表客户 id
+                        row.billCorpCnName = this.assemblyForm.corpCnName // 主表客户中文名称
+                        row.billCorpEnName = this.assemblyForm.corpEnName // 主表客户英文名称
+                        row.lineId = this.assemblyForm.lineId // 航线 id
+                        row.lineCnName = this.assemblyForm.lineCnName // 航线中文名称
+                        row.lineEnName = this.assemblyForm.lineEnName // 航线英文名称
+                        row.vesselId = this.assemblyForm.vesselId // 船名 id
+                        row.vesselCnName = this.assemblyForm.vesselCnName // 中文船名
+                        row.vesselEnName = this.assemblyForm.vesselEnName // 英文船名
+                        row.voyageNo = this.assemblyForm.voyageNo // 航次
+                        row.mblno = this.assemblyForm.mblno // MB/L NO
+                        row.hblno = this.assemblyForm.hblno // HB/L NO
+                        row.etd = this.assemblyForm.etd // 开船日期
+                        row.eta = this.assemblyForm.eta // 到港日期
+                        row.polId = this.assemblyForm.polId // 装货港 id
+                        row.polCode = this.assemblyForm.polCode // 装货港代码
+                        row.polCnName = this.assemblyForm.polCnName // 装货港中文名称
+                        row.polEnName = this.assemblyForm.polEnName // 装货港英文名称
+                        row.podId = this.assemblyForm.podId // 卸货港 id
+                        row.podCode = this.assemblyForm.podCode // 卸货港代码
+                        row.podCnName = this.assemblyForm.podCnName // 卸货港中文名称
+                        row.podEnName = this.assemblyForm.podEnName // 卸货港英文名称
+                        row.corpArgreementNo = this.assemblyForm.corpArgreementNo // 客户约号
+                    })
+                    this.assemblyForm.feeCenterListC.map((row,index)=>{
+                        row.dc = 'C'
+                        row.pid = this.pid
+                        row.sort = Number(index) + 1
+                        row.businessType = this.assemblyForm.businessType // 业务类型
+                        row.billType = this.assemblyForm.billType // 单据类型
+                        row.billNo = this.assemblyForm.billNo // 单据编号
+                        row.billDate = this.assemblyForm.billDate // 单据日期
+                        row.billCorpId = this.assemblyForm.corpId // 主表客户 id
+                        row.billCorpCnName = this.assemblyForm.corpCnName // 主表客户中文名称
+                        row.billCorpEnName = this.assemblyForm.corpEnName // 主表客户英文名称
+                        row.lineId = this.assemblyForm.lineId // 航线 id
+                        row.lineCnName = this.assemblyForm.lineCnName // 航线中文名称
+                        row.lineEnName = this.assemblyForm.lineEnName // 航线英文名称
+                        row.vesselId = this.assemblyForm.vesselId // 船名 id
+                        row.vesselCnName = this.assemblyForm.vesselCnName // 中文船名
+                        row.vesselEnName = this.assemblyForm.vesselEnName // 英文船名
+                        row.voyageNo = this.assemblyForm.voyageNo // 航次
+                        row.mblno = this.assemblyForm.mblno // MB/L NO
+                        row.hblno = this.assemblyForm.hblno // HB/L NO
+                        row.etd = this.assemblyForm.etd // 开船日期
+                        row.eta = this.assemblyForm.eta // 到港日期
+                        row.polId = this.assemblyForm.polId // 装货港 id
+                        row.polCode = this.assemblyForm.polCode // 装货港代码
+                        row.polCnName = this.assemblyForm.polCnName // 装货港中文名称
+                        row.polEnName = this.assemblyForm.polEnName // 装货港英文名称
+                        row.podId = this.assemblyForm.podId // 卸货港 id
+                        row.podCode = this.assemblyForm.podCode // 卸货港代码
+                        row.podCnName = this.assemblyForm.podCnName // 卸货港中文名称
+                        row.podEnName = this.assemblyForm.podEnName // 卸货港英文名称
+                        row.corpArgreementNo = this.assemblyForm.corpArgreementNo // 客户约号
+                    })
+
                     feecenterSubmitList([
                         ...this.assemblyForm.feeCenterListD,
                         ...this.assemblyForm.feeCenterListC

+ 14 - 7
src/views/iosBasicData/SeafreightExportF/bills/assembly/reportformsFrame/DispatchNotice.vue

@@ -17,12 +17,19 @@
                 </el-input>
             </el-form-item>
             <el-form-item label="提单号码:" prop="corpCnName" >
-                <el-input type="age" style="width: 100%;" v-model="documentForm.mblno"
-                          size="small" autocomplete="off" clearable placeholder="提单号码" >
-                </el-input>
-                <el-input type="age" style="width: 100%;" v-model="documentForm.FM"
-                          size="small" autocomplete="off" clearable placeholder="提单号码" >
-                </el-input>
+                <el-row>
+                    <el-col :span="12">
+                        <el-input type="age" style="width: 100%;" v-model="documentForm.mblno"
+                                  size="small" autocomplete="off" clearable placeholder="提单号码" >
+                        </el-input>
+                    </el-col>
+                    <el-col :span="11">
+                        <span style="margin-left: 15px"></span>
+                        <el-input type="age" style="width: 100%;" v-model="documentForm.mblno"
+                                  size="small" autocomplete="off" clearable placeholder="提单号码" >
+                        </el-input>
+                    </el-col>
+                </el-row>
             </el-form-item>
             <el-form-item label="船名/航次:" prop="corpCnName" >
                 <el-row>
@@ -34,7 +41,7 @@
                     <el-col :span="11">
                         <span style="margin-left: 15px"></span>
                         <el-input type="age" style="width: 100%;" v-model="documentForm.FM"
-                                  size="small" autocomplete="off" clearable placeholder="提单号码" >
+                                  size="small" autocomplete="off" clearable placeholder="业务编号" >
                         </el-input>
                     </el-col>
                 </el-row>

+ 69 - 132
src/views/iosBasicData/SeafreightExportF/bills/billsDetails.vue

@@ -338,6 +338,9 @@ import DocumentCenter from "@/views/iosBasicData/SeafreightExportF/bills/assembl
                     seaType:'E', // 进出口 默认出口 E=出口 I=进口"
                     cargoType:'dry', // 货物类型默认普货
                     filesList:[], // 文件中心
+                    feeCenterListD:[], // 收
+                    feeCenterListC:[], // 付
+                    preContainersList:[], // 箱
                 },
                 // 循环的配置
                 basicData:{
@@ -566,138 +569,7 @@ import DocumentCenter from "@/views/iosBasicData/SeafreightExportF/bills/assembl
                                     trigger: "blur"
                                 }]
                             },
-                            // {
-                            //     label: "业务类型", // SE=海运出口 SI=海运进口"
-                            //     prop: "businessType",
-                            //     type:'select',
-                            //     disabled:false,
-                            //     dicData:[
-                            //         {
-                            //             label:'海运出口',
-                            //             value:'SE'
-                            //         },
-                            //         {
-                            //             label:'海运进口',
-                            //             value:'SI'
-                            //         },
-                            //     ],
-                            //     rules: [{
-                            //         required: true,
-                            //         message: "请输入业务类型",
-                            //         trigger: "blur"
-                            //     }]
-                            // },
                         ],
-                        // [
-                        //     {
-                        //         label: "单据类型", // DD=直单(默认) MM=主单 MH=分单 HH=从分单
-                        //         prop: "billType",
-                        //         type:'select',
-                        //         disabled:false,
-                        //         dicData:[
-                        //             {
-                        //                 label:'直单',
-                        //                 value:'DD'
-                        //             },
-                        //             {
-                        //                 label:'主单',
-                        //                 value:'MM'
-                        //             },
-                        //             {
-                        //                 label:'分单',
-                        //                 value:'MH'
-                        //             }
-                        //         ],
-                        //         rules: [{
-                        //             required: true,
-                        //             message: "请输入单据类型",
-                        //             trigger: "blur"
-                        //         }]
-                        //     },
-                        //     {
-                        //         label: "核算部门", // 核算部门Id accDept 核算部门 accDeptName 调机构管理接口
-                        //         prop: "accDeptName",
-                        //         type:'tree',
-                        //         dicData:[],
-                        //         disabled:false,
-                        //         forParameter:{
-                        //             label: "title",
-                        //             children:'children'
-                        //         },
-                        //         rules: [{
-                        //             required: true,
-                        //             message: "请选择核算部门",
-                        //             trigger: "blur"
-                        //         }]
-                        //     },
-                        // ],
-                        // [
-                        //     {
-                        //         label: "签单方式",
-                        //         prop: "issueType",
-                        //         type:'select',
-                        //         dicData:[],
-                        //         disabled:false,
-                        //         forParameter:{
-                        //             key:'dictKey',
-                        //             label:'dictValue',
-                        //             value:'dictValue',
-                        //         },
-                        //         rules: [{
-                        //             required: true,
-                        //             message: "请输入签单方式",
-                        //             trigger: "blur"
-                        //         }]
-                        //     },
-                        //     {
-                        //         label: "装箱方式", // FCL=整箱, LCL=拼箱",
-                        //         prop: "loadType",
-                        //         type:'select',
-                        //         disabled:false,
-                        //         dicData:[
-                        //             {
-                        //                 label:'整箱',
-                        //                 value:'FCL'
-                        //             },
-                        //             {
-                        //                 label:'拼箱',
-                        //                 value:'LCL'
-                        //             }
-                        //         ],
-                        //         rules: [{
-                        //             required: true,
-                        //             message: "请输入装箱方式",
-                        //             trigger: "blur"
-                        //         }]
-                        //     },
-                        // ],
-                        // {
-                        //     label: "付费地点", // MB/L 付款地点 地点管理表
-                        //     prop: "mPayplace",
-                        //     type:'select',
-                        //     dicData:[],
-                        //     disabled:false,
-                        //     buttonIf:false,
-                        //     forParameter:{
-                        //         key:'id',
-                        //         label:'cnName',
-                        //         value:'cnName',
-                        //     },
-                        // },
-                        // {
-                        //     label: "COLOADER", // Co-Loader 中文名称  往来单位 类别
-                        //     prop: "coloaderCnName",
-                        //     type:'select',
-                        //     dicData:[],
-                        //     slot:'bcorpstypedefine',
-                        //     buttonIf:true,
-                        //     disabled:false,
-                        //     forParameter:{
-                        //         key:'id',
-                        //         label:'cnName',
-                        //         value:'cnName',
-                        //     },
-                        // },
 
                     ]
                 },
@@ -782,7 +654,7 @@ import DocumentCenter from "@/views/iosBasicData/SeafreightExportF/bills/assembl
                     this.$set(this.form,'issueAt',this.form.polCnName)
                     // 主单单付费地点 默认  如果主单付费方式 为PP 取装货港 如果主单付费地点为CC 取卸货港
                     if (this.form.mpaymode == 'PP') {
-                        this.$set(this.form,'mPayplace',this.form.polCnName)
+                        this.$set(this.form,'mpayplace',this.form.polCnName)
                     }
                     // 分单单付费地点 默认  如果分单付费方式 为PP 取装货港 如果分单付费地点为CC 取卸货港
                     if (this.form.hpaymode == 'PP') {
@@ -1175,8 +1047,73 @@ import DocumentCenter from "@/views/iosBasicData/SeafreightExportF/bills/assembl
                 this.form.billNoFormat = 'HYCK'
                 this.form.businessTypeCode = 'HYCK'
                 // 把拼接的数据拆开 开始 🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒🐒
+                console.log(this.form,1050)
                 this.searchSplit()
                 // 把拼接的数据拆开 结束 💩💩💩💩💩💩💩💩💩💩💩💩💩💩
+                // 费用 收 赋值数据
+                this.form.feeCenterListD.map((row,index)=>{
+                    row.dc = 'D'
+                    row.sort = Number(index) + 1
+                    row.businessType = this.form.businessType // 业务类型
+                    row.billType = this.form.billType // 单据类型
+                    row.billNo = this.form.billNo // 单据编号
+                    row.billDate = this.form.billDate // 单据日期
+                    row.billCorpId = this.form.corpId // 主表客户 id
+                    row.billCorpCnName = this.form.corpCnName // 主表客户中文名称
+                    row.billCorpEnName = this.form.corpEnName // 主表客户英文名称
+                    row.lineId = this.form.lineId // 航线 id
+                    row.lineCnName = this.form.lineCnName // 航线中文名称
+                    row.lineEnName = this.form.lineEnName // 航线英文名称
+                    row.vesselId = this.form.vesselId // 船名 id
+                    row.vesselCnName = this.form.vesselCnName // 中文船名
+                    row.vesselEnName = this.form.vesselEnName // 英文船名
+                    row.voyageNo = this.form.voyageNo // 航次
+                    row.mblno = this.form.mblno // MB/L NO
+                    row.hblno = this.form.hblno // HB/L NO
+                    row.etd = this.form.etd // 开船日期
+                    row.eta = this.form.eta // 到港日期
+                    row.polId = this.form.polId // 装货港 id
+                    row.polCode = this.form.polCode // 装货港代码
+                    row.polCnName = this.form.polCnName // 装货港中文名称
+                    row.polEnName = this.form.polEnName // 装货港英文名称
+                    row.podId = this.form.podId // 卸货港 id
+                    row.podCode = this.form.podCode // 卸货港代码
+                    row.podCnName = this.form.podCnName // 卸货港中文名称
+                    row.podEnName = this.form.podEnName // 卸货港英文名称
+                    row.corpArgreementNo = this.form.corpArgreementNo // 客户约号
+                })
+                // 费用 付 赋值数据
+                this.form.feeCenterListC.map((row,index)=>{
+                    row.dc = 'C'
+                    row.sort = Number(index) + 1
+                    row.businessType = this.form.businessType // 业务类型
+                    row.billType = this.form.billType // 单据类型
+                    row.billNo = this.form.billNo // 单据编号
+                    row.billDate = this.form.billDate // 单据日期
+                    row.billCorpId = this.form.corpId // 主表客户 id
+                    row.billCorpCnName = this.form.corpCnName // 主表客户中文名称
+                    row.billCorpEnName = this.form.corpEnName // 主表客户英文名称
+                    row.lineId = this.form.lineId // 航线 id
+                    row.lineCnName = this.form.lineCnName // 航线中文名称
+                    row.lineEnName = this.form.lineEnName // 航线英文名称
+                    row.vesselId = this.form.vesselId // 船名 id
+                    row.vesselCnName = this.form.vesselCnName // 中文船名
+                    row.vesselEnName = this.form.vesselEnName // 英文船名
+                    row.voyageNo = this.form.voyageNo // 航次
+                    row.mblno = this.form.mblno // MB/L NO
+                    row.hblno = this.form.hblno // HB/L NO
+                    row.etd = this.form.etd // 开船日期
+                    row.eta = this.form.eta // 到港日期
+                    row.polId = this.form.polId // 装货港 id
+                    row.polCode = this.form.polCode // 装货港代码
+                    row.polCnName = this.form.polCnName // 装货港中文名称
+                    row.polEnName = this.form.polEnName // 装货港英文名称
+                    row.podId = this.form.podId // 卸货港 id
+                    row.podCode = this.form.podCode // 卸货港代码
+                    row.podCnName = this.form.podCnName // 卸货港中文名称
+                    row.podEnName = this.form.podEnName // 卸货港英文名称
+                    row.corpArgreementNo = this.form.corpArgreementNo // 客户约号
+                })
                 this.pageLoading = true
                 billsSubmit(this.form).then(res=>{
                     this.pageLoading = false

+ 192 - 0
src/views/iosBasicData/finvouchers/assembly/fromtableDetails.vue

@@ -0,0 +1,192 @@
+<template>
+    <div>
+        <el-table
+            ref="tableRef"
+            :cell-style="{padding:'0px',fontSize:'12px'}"
+            :header-cell-style="tableHeaderCellStyle"
+            :data="tableData"
+            border
+            style="width: 100%"
+            @selection-change="handleSelectionChange"
+            @row-click="rowClick"
+            :row-style="rowStyle"
+            :row-class-name="rowClassName" >
+            <el-table-column
+                fixed="left"
+                type="selection"
+                width="55">
+            </el-table-column>
+            <el-table-column
+                type="index"
+                width="55">
+            </el-table-column>
+            <el-table-column
+                prop="businessType"
+                label="摘要">
+            </el-table-column>
+            <el-table-column label="科目属性">
+                <el-table-column
+                    prop="accountCode"
+                    label="代码">
+                </el-table-column>
+                <el-table-column
+                    prop="accountFullName"
+                    label="名称">
+                </el-table-column>
+                <el-table-column
+                    prop="dc"
+                    label="方向">
+                </el-table-column>
+            </el-table-column>
+            <el-table-column label="金额">
+                <el-table-column
+                    prop="amountDr"
+                    label="借方">
+                </el-table-column>
+                <el-table-column
+                    prop="amountCr"
+                    label="货方">
+                </el-table-column>
+            </el-table-column>
+        </el-table>
+    </div>
+</template>
+
+<script>
+    export default {
+        data(){
+            return {
+                selectionList:[], // 多选的数据
+            }
+        },
+        props:{
+            tableData:{
+                type:Array
+            }
+        },
+        async created() {
+            this.option = await this.getColumnData(this.getColumnName(321.1), this.optionBack);
+        },
+        methods:{
+            // 表头样式
+            tableHeaderCellStyle({row,column,rowIndex, columnIndex}){
+                return "padding:4px 0px;fontSize:12px;color:#000;background:#ecf5ff"
+            },
+            // 列表多选
+            // 多选选择的数据
+            handleSelectionChange(arr){
+                this.$emit('handleSelectionChange',arr)
+            },
+            // 监听点击表格事件
+            rowClick(row, column, event) {
+                let refsElTable = this.$refs.tableRef; // 获取表格对象
+                if (this.CtrlDown) {
+                    refsElTable.toggleRowSelection(row); // ctrl多选 如果点击两次同样会取消选中
+                    return;
+                }
+                if ( this.shiftOrAltDown && this.handleSelectionData.length > 0) {
+                    // 通过rowIndex判断已选择的行中最上面和最下面的是哪行,再对比按住shift/alt点击的当前行得到新的最上面和最下面的行,把这两行中间的行进行循环选中。
+                    let topAndBottom = this.getTopAndBottom(  row, this.bottomSelectionRow, this.topSelectionRow );
+                    refsElTable.clearSelection(); //先清空 不然会导致在这两行中间之外的行状态不变
+                    for (let index = topAndBottom.top; index <= topAndBottom.bottom; index++) { //选中两行之间的所有行
+                        refsElTable.toggleRowSelection(this.tableData[index], true);
+                    }
+                } else {
+                    let findRow = this.handleSelectionData.find(c => c.rowIndex == row.rowIndex); //找出当前选中行
+                    //如果只有一行且点击的也是这一行则取消选择 否则清空再选中当前点击行
+                    if (findRow&& this.handleSelectionData.length === 1 ) {
+                        refsElTable.toggleRowSelection(row, false);
+                        return;
+                    }
+                    // refsElTable.clearSelection(); // 清空之前选择的数据(如果放开,选择之前会变成单选)
+                    refsElTable.toggleRowSelection(row); // 调用选中行方法
+                }
+            },
+            // 行的 style 的回调方法
+            rowStyle({row,rowIndex}) {
+                // 直接在一个对象上定义一个新属性,或者修改一个对象的现有属性,并返回此对象
+                // object: 要添加或者修改属性的目标对象;prop: 要定义或修改属性的名称;descript: 是一个对象,里面是我们上述的对象属性的特性;
+                Object.defineProperty(row, 'rowIndex', { //给每一行添加不可枚举属性rowIndex来标识当前行
+                    value: rowIndex, // 设置age的值,不设置的话默认为undefined
+                    writable: true, // 表示属性的值true可以修改,false不可以被修改
+                    enumerable: false, // 设置为false表示不能通过 for-in 循环返回
+                    // configurable: false, // configurable 设置为 false,意味着这个属性不能从对象上删除
+                })
+            },
+            keyDown(event) {
+                let key = event.keyCode;
+                if (key == 17) this.CtrlDown = true;
+                if (key == 16 || key == 18) this.shiftOrAltDown = true;
+            },
+            keyUp(event) {
+                let key = event.keyCode;
+                if (key == 17) this.CtrlDown = false;
+                if (key == 16 || key == 18) this.shiftOrAltDown = false;
+            },
+            // 文章说明 https://www.jianshu.com/p/48f2c522d2a2
+            getTopAndBottom(row, bottom, top){
+                let n = row.rowIndex,
+                    mx = bottom.rowIndex,
+                    mi = top.rowIndex;
+                if (n > mx) {
+                    return {
+                        top: mi,
+                        bottom: n
+                    };
+                } else if (n < mx && n > mi) {
+                    return {
+                        top: mi,
+                        bottom: n
+                    };
+                } else if (n < mi) {
+                    return {
+                        top: n,
+                        bottom: mx
+                    };
+                } else if (n == mi || n == mx) {
+                    return {
+                        top: mi,
+                        bottom: mx
+                    };
+                }
+            },
+            // 给选中行加上current-row这个class类,所以要使用row-class-name这个属性(其实给每一行添加rowIndex也可以用这个属性),
+            // 判断方式也是通过判断rowIndex对比
+            rowClassName({ row,  rowIndex }) {
+                let rowName = "",
+                    findRow = this.handleSelectionData.find(c => c.rowIndex === row.rowIndex);
+                if (findRow) {
+                    rowName = "current-row "; // elementUI 默认高亮行的class类 不用再样式了^-^,也可通过css覆盖改变背景颜色
+                }
+                return rowName; //也可以再加上其他类名 如果有需求的话
+            },
+        },
+        mounted() {
+            // 按住ctrl实现多选 设置监听keydown事件,以及keyup事件,
+            addEventListener("keydown", this.keyDown, false);
+            addEventListener("keyup", this.keyUp, false);
+        },
+        beforeDestroy() { //解绑
+            removeEventListener("keydown", this.keyDown);
+            removeEventListener("keyup", this.keyUp);
+        },
+        computed: { //实时得到最上行和最下行
+            bottomSelectionRow() {
+                if (this.handleSelectionData.length == 0) return null;
+                return this.handleSelectionData.reduce((start, end) => {
+                    return start.rowIndex > end.rowIndex ? start : end;
+                });
+            },
+            topSelectionRow() {
+                if (this.handleSelectionData.length == 0) return null;
+                return this.handleSelectionData.reduce((start, end) => {
+                    return start.rowIndex < end.rowIndex ? start : end;
+                });
+            }
+        },
+    }
+</script>
+
+<style scoped>
+
+</style>

+ 259 - 108
src/views/iosBasicData/finvouchers/finvouchersitems.vue

@@ -8,6 +8,9 @@
             </div>
             <div class="add-customer-btn">
                 <el-button  size="small" type="success" style="margin-right: 8px"
+                            :loading="saveLoading" >凭证标错
+                </el-button>
+                <el-button  size="small" type="primary" style="margin-right: 8px"
                             :loading="saveLoading" >保 存
                 </el-button>
             </div>
@@ -17,175 +20,299 @@
                 <el-form :model="form" ref="form" label-width="90px" class="demo-ruleForm">
                     <el-row>
                         <el-col :span="6">
-                            <el-form-item label="凭证来源" prop="voucherSource">
-                                <el-input style="width: 100%;" v-model="form.voucherSource"
-                                          size="small" autocomplete="off"
-                                          clearable placeholder="请输入凭证来源" >
-                                </el-input>
-                            </el-form-item>
-                        </el-col>
-                        <el-col :span="6">
                             <el-form-item label="凭证类型" prop="voucherType">
-                                <el-input style="width: 100%;" v-model="form.voucherType"
-                                          size="small" autocomplete="off"
-                                          clearable placeholder="请输入凭证类型" >
-                                </el-input>
+                                <search-query :datalist="voucherTypeData"
+                                              :selectValue="form.voucherType"
+                                              :clearable="true"
+                                              :buttonIf="false"
+                                              :forParameter="{key:'dictKey',label:'dictValue',value:'dictValue',}"
+                                              placeholder="请输入凭证类型"
+                                              @corpChange="corpChange($event,'voucherType')">
+                                </search-query>
                             </el-form-item>
                         </el-col>
                         <el-col :span="6">
                             <el-form-item label="凭证号" prop="voucherNo">
                                 <el-input style="width: 100%;" v-model="form.voucherNo"
                                           size="small" autocomplete="off"
+                                          :disabled="true"
                                           clearable placeholder="请输入凭证号" >
                                 </el-input>
                             </el-form-item>
                         </el-col>
                         <el-col :span="6">
                             <el-form-item label="凭证日期" prop="voucherDate">
-                                <el-input style="width: 100%;" v-model="form.voucherDate"
-                                          size="small" autocomplete="off"
-                                          clearable placeholder="请输入凭证日期" >
-                                </el-input>
-                            </el-form-item>
-                        </el-col>
-                        <el-col :span="6">
-                            <el-form-item label="分录摘要" prop="voucherDate">
-                                <el-input style="width: 100%;" v-model="form.descr"
-                                          size="small" autocomplete="off"
-                                          clearable placeholder="请输入分录摘要" >
-                                </el-input>
-                            </el-form-item>
-                        </el-col>
-                        <el-col :span="6">
-                            <el-form-item label="借方金额" prop="voucherDate">
-                                <el-input style="width: 100%;" v-model="form.amountDr"
-                                          size="small" autocomplete="off"
-                                          clearable placeholder="请输入借方金额(CNY)" >
-                                </el-input>
-                            </el-form-item>
-                        </el-col>
-                        <el-col :span="6">
-                            <el-form-item label="贷方金额" prop="voucherDate">
-                                <el-input style="width: 100%;" v-model="form.amountCr"
-                                          size="small" autocomplete="off"
-                                          clearable placeholder="请输入贷方金额(CNY)" >
-                                </el-input>
-                            </el-form-item>
-                        </el-col>
-                        <el-col :span="6">
-                            <el-form-item label="综合 USD" prop="amountDrUsd">
-                                <el-input style="width: 100%;" v-model="form.amountDrUsd"
-                                          size="small" autocomplete="off"
-                                          clearable placeholder="请输入综合 USD" >
-                                </el-input>
+                                <el-date-picker v-model="form.voucherDate" clearable
+                                                style="width: 100%;"
+                                                type="date" size="small"
+                                                value-format="yyyy-MM-dd HH:mm"
+                                                placeholder="选择凭证日期">
+                                </el-date-picker>
                             </el-form-item>
                         </el-col>
                         <el-col :span="6">
-                            <el-form-item label="综合 USD" prop="amountCrUsd">
-                                <el-input style="width: 100%;" v-model="form.amountCrUsd"
-                                          size="small" autocomplete="off"
-                                          clearable placeholder="请输入综合 USD" >
-                                </el-input>
-                            </el-form-item>
-                        </el-col>
-                        <el-col :span="6">
-                            <el-form-item label="合计借方金额" prop="amountDrLoc">
-                                <el-input style="width: 100%;" v-model="form.amountDrLoc"
-                                          size="small" autocomplete="off"
-                                          clearable placeholder="请输入合计本位币借方金额" >
-                                </el-input>
-                            </el-form-item>
-                        </el-col>
-                        <el-col :span="6">
-                            <el-form-item label="合计贷方金额" prop="amountCrLoc">
-                                <el-input style="width: 100%;" v-model="form.amountCrLoc"
+                            <el-form-item label="凭证来源" prop="voucherSource">
+                                <el-input style="width: 100%;" v-model="form.voucherSource"
                                           size="small" autocomplete="off"
-                                          clearable placeholder="请输入合计本位币贷方金额" >
+                                          :disabled="true"
+                                          clearable placeholder="请输入凭证来源" >
                                 </el-input>
                             </el-form-item>
                         </el-col>
                         <el-col :span="6">
-                            <el-form-item label="是否外币凭证" prop="isForeign">
-                                <el-input style="width: 100%;" v-model="form.isForeign"
+                            <el-form-item label="REF NO" prop="billNo">
+                                <el-input style="width: 100%;" v-model="form.billNo"
                                           size="small" autocomplete="off"
-                                          clearable placeholder="请输入合计本位币贷方金额" >
+                                          :disabled="true"
+                                          clearable placeholder="请输入编号" >
                                 </el-input>
                             </el-form-item>
                         </el-col>
                         <el-col :span="6">
-                            <el-form-item label="是否数量凭证" prop="isQuantity">
-                                <el-input style="width: 100%;" v-model="form.isQuantity"
+                            <el-form-item label="附件" prop="billNo">
+                                <el-input type="" style="width: 100%;" v-model="form.billNo"
                                           size="small" autocomplete="off"
-                                          clearable placeholder="请输入是否数量凭证" >
+                                          clearable placeholder="请输入附件" >
                                 </el-input>
                             </el-form-item>
                         </el-col>
-                        <el-col :span="6">
-                            <el-form-item label="复核人" prop="checkUserName">
-                                <el-input style="width: 100%;" v-model="form.checkUserName"
+                    </el-row>
+                </el-form>
+            </el-card>
+
+            <el-card style="margin-top: 10px">
+                <div style="margin-bottom: 10px">
+                    <el-button  size="small" type="success" style="margin-right: 8px"
+                                :loading="saveLoading" >项目属性
+                    </el-button>
+                    <el-button  size="small" type="success" style="margin-right: 8px"
+                                :loading="saveLoading" >凭证断号观察器
+                    </el-button>
+                    <el-button  size="small" type="success" style="margin-right: 8px"
+                                :loading="saveLoading" >断号优化
+                    </el-button>
+                    <el-button  size="small" type="success" style="margin-right: 8px"
+                                :loading="saveLoading" >科目余额查询
+                    </el-button>
+                </div>
+                <fromtable-details ></fromtable-details>
+            </el-card>
+
+            <el-row style="margin-top: 10px">
+                <el-col :span="8">
+                    <el-card class="cardRight">
+                        <el-checkbox class="borderCheckbox" style="width: 100%" v-model="checked">数量项目</el-checkbox>
+                        <el-form :model="form" ref="form" label-width="70px" class="demo-ruleForm">
+                            <el-col :span="12">
+                                <el-form-item label="单位:" prop="voucherType">
+                                    <el-input style="width: 100%;" v-model="form.voucherNo"
+                                              size="small" autocomplete="off"
+                                              :disabled="true"
+                                              clearable placeholder="请输入单位" >
+                                    </el-input>
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="12">
+                                <el-form-item label="规格:" prop="voucherType">
+                                    <el-input style="width: 100%;" v-model="form.voucherNo"
+                                              size="small" autocomplete="off"
+                                              :disabled="true"
+                                              clearable placeholder="请输入规格" >
+                                    </el-input>
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="12">
+                                <el-form-item label="借方数量:" prop="voucherType">
+                                    <el-input style="width: 100%;" v-model="form.voucherNo"
+                                              size="small" autocomplete="off"
+                                              :disabled="true"
+                                              clearable placeholder="请输入借方数量" >
+                                    </el-input>
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="12">
+                                <el-form-item label="借方单价:" prop="voucherType">
+                                    <el-input style="width: 100%;" v-model="form.voucherNo"
+                                              size="small" autocomplete="off"
+                                              :disabled="true"
+                                              clearable placeholder="请输入借方单价" >
+                                    </el-input>
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="12">
+                                <el-form-item label="贷方数量:" prop="voucherType">
+                                    <el-input style="width: 100%;" v-model="form.voucherNo"
+                                              size="small" autocomplete="off"
+                                              :disabled="true"
+                                              clearable placeholder="请输入贷方数量" >
+                                    </el-input>
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="12">
+                                <el-form-item label="贷方单价:" prop="voucherType">
+                                    <el-input style="width: 100%;" v-model="form.voucherNo"
+                                              size="small" autocomplete="off"
+                                              :disabled="true"
+                                              clearable placeholder="请输入贷方单价" >
+                                    </el-input>
+                                </el-form-item>
+                            </el-col>
+                        </el-form>
+                    </el-card>
+                </el-col>
+                <el-col :span="8">
+                    <el-card class="cardRight">
+                        <el-checkbox class="borderCheckbox" style="width: 100%" v-model="checked">外币项目</el-checkbox>
+                        <el-form :model="form" ref="form" label-width="70px" class="demo-ruleForm">
+                            <el-form-item label="外币名称:" prop="voucherType">
+                                <el-input style="width: 100%;" v-model="form.voucherNo"
                                           size="small" autocomplete="off"
-                                          clearable placeholder="请输入复核人" >
+                                          :disabled="true"
+                                          clearable placeholder="请输入外币名称" >
                                 </el-input>
                             </el-form-item>
-                        </el-col>
-                        <el-col :span="6">
-                            <el-form-item label="复核时间" prop="checkTime">
-                                <el-input style="width: 100%;" v-model="form.checkTime"
+                            <el-form-item label="汇率:" prop="voucherType">
+                                <el-input style="width: 100%;" v-model="form.voucherNo"
                                           size="small" autocomplete="off"
-                                          clearable placeholder="请输入复核时间" >
+                                          :disabled="true"
+                                          clearable placeholder="请输入汇率" >
                                 </el-input>
                             </el-form-item>
-                        </el-col>
-                        <el-col :span="6">
-                            <el-form-item label="记账人" prop="postUserName">
-                                <el-input style="width: 100%;" v-model="form.postUserName"
+                            <el-form-item label="原币借方:" prop="voucherType">
+                                <el-input style="width: 100%;" v-model="form.voucherNo"
                                           size="small" autocomplete="off"
-                                          clearable placeholder="请输入记账人" >
+                                          :disabled="true"
+                                          clearable placeholder="请输入原币借方" >
                                 </el-input>
                             </el-form-item>
-                        </el-col>
-                        <el-col :span="6">
-                            <el-form-item label="记账时间" prop="postTime">
-                                <el-input style="width: 100%;" v-model="form.postTime"
+                            <el-form-item label="原币货方:" prop="voucherType">
+                                <el-input style="width: 100%;" v-model="form.voucherNo"
                                           size="small" autocomplete="off"
-                                          clearable placeholder="请输入记账时间" >
+                                          :disabled="true"
+                                          clearable placeholder="请输入原币货方" >
                                 </el-input>
                             </el-form-item>
-                        </el-col>
-                        <el-col :span="6">
-                            <el-form-item label="凭证状态" prop="voucherStatus">
-                                <el-input style="width: 100%;" v-model="form.voucherStatus"
+                        </el-form>
+                    </el-card>
+
+                </el-col>
+                <el-col :span="8" class="cardRight" style="margin-right: 0">
+                    <el-card>
+                        <el-checkbox class="borderCheckbox" style="width: 100%" v-model="checked">核算项目</el-checkbox>
+                        <el-form :model="form" ref="form" label-width="70px" class="demo-ruleForm">
+                            <el-col :span="7">
+                                <el-form-item label="" prop="voucherType" label-width="0px">
+                                    <el-checkbox v-model="checked">选择类型</el-checkbox>
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="17">
+                                <el-form-item>
+                                    <span slot="label">
+                                        <el-checkbox v-model="checked">客户:</el-checkbox>
+                                    </span>
+                                    <el-input style="width: 100%;" v-model="form.voucherNo"
+                                              size="small" autocomplete="off"
+                                              :disabled="true"
+                                              clearable placeholder="请输入客户" >
+                                    </el-input>
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="24">
+                                <el-input style="width: 100%;" v-model="form.voucherNo"
                                           size="small" autocomplete="off"
-                                          clearable placeholder="请输入凭证状态" >
+                                          :disabled="true"
+                                          clearable placeholder="请输入客户" >
                                 </el-input>
-                            </el-form-item>
-                        </el-col>
-                        <el-col :span="6">
-                            <el-form-item label="备注" prop="remarks">
-                                <el-input style="width: 100%;" v-model="form.remarks"
+                            </el-col>
+                            <el-col :span="12">
+                                <el-form-item>
+                                        <span slot="label">
+                                            <el-checkbox v-model="checked">部门:</el-checkbox>
+                                        </span>
+                                    <el-input style="width: 100%;" v-model="form.voucherNo"
+                                              size="small" autocomplete="off"
+                                              :disabled="true"
+                                              clearable placeholder="请输入客户" >
+                                    </el-input>
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="12">
+                                <el-form-item>
+                                        <span slot="label">
+                                            <el-checkbox v-model="checked">职员:</el-checkbox>
+                                        </span>
+                                    <el-input style="width: 100%;" v-model="form.voucherNo"
+                                              size="small" autocomplete="off"
+                                              :disabled="true"
+                                              clearable placeholder="请输入客户" >
+                                    </el-input>
+                                </el-form-item>
+                            </el-col>
+                            <el-form-item>
+                                        <span slot="label">
+                                            <el-checkbox v-model="checked">项目:</el-checkbox>
+                                        </span>
+                                <el-input style="width: 100%;" v-model="form.voucherNo"
                                           size="small" autocomplete="off"
-                                          clearable placeholder="请输入备注" >
+                                          :disabled="true"
+                                          clearable placeholder="请输入客户" >
                                 </el-input>
                             </el-form-item>
-                        </el-col>
-                    </el-row>
-                </el-form>
-            </el-card>
 
+                        </el-form>
+                    </el-card>
+
+                </el-col>
+            </el-row>
         </div>
     </div>
 </template>
 
 <script>
+    import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
+    import {getWorkDicts} from "@/api/system/dictbiz";
+    import {finvouchersSubmit} from "@/api/iosBasicData/finvouchers";
+    import {getCurrentDate, getYearDate} from "@/util/date";
+    import fromtableDetails from "@/views/iosBasicData/finvouchers/assembly/fromtableDetails.vue";
+
     export default {
+        components: {SearchQuery,fromtableDetails},
         data(){
             return {
                 pageLoading:false, // 整个的动画
                 saveLoading:false, // 按钮动画
-                form:{}, // 获取的数据
+                // 获取的数据
+                form:{
+                    voucherDate:getCurrentDate(),
+                },
+                voucherTypeData:[], // 凭证字数据
             }
         },
+        created() {
+            this.getWorkDictsfun()
+        },
         methods:{
+            // 保存
+            finvouchersSubmitfun(){
+                this.form.billNoFormat = 'PZDH'
+                this.form.businessTypeCode = 'PZDH'
+                finvouchersSubmit().then(res=>{
+
+                })
+            },
+            // 下拉回调
+            corpChange(value,name){
+                if (name == 'voucherType') {
+
+                }
+            },
+            // 获取字典数据
+            getWorkDictsfun(){
+                // 凭证字数据
+                getWorkDicts('voucher_word_los').then(res=>{
+                    this.voucherTypeData = res.data.data
+                })
+            },
             //返回列表
             backToList() {
                 this.$emit('goBack')
@@ -198,4 +325,28 @@
 ::v-deep.el-form-item {
     margin-bottom: 0;
 }
+.borderBox {
+    border: 1px solid #b6b6b6;
+    padding: 5px;
+    box-sizing: border-box;
+    border-radius: 2px;
+    position: relative;
+    margin-right: 10px;
+}
+.positionCheckbox {
+    position: absolute;
+    top: -10px;
+    left: 10px;
+    background: #fff;
+}
+.cardRight {
+    margin-right: 10px;
+    height: 220px;
+}
+.borderCheckbox {
+    border-bottom: 1px solid #4a9de6;
+    padding-bottom: 5px;
+    color:#4a9de6;
+    margin-bottom: 5px;
+}
 </style>