lilei hace 2 años
padre
commit
5c5b76e4ab

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
-  "version": 1684374319711
+  "version": 1684377779533
 }

+ 26 - 16
src/views/financialManagement/companyReceivablePayableNew/chooseBillModal.vue

@@ -39,7 +39,7 @@
                 <rangeDate ref="rangeDate" @change="dateChange" />
               </a-form-item>
             </a-col>
-            <a-col :md="5" :sm="24">
+            <a-col :md="8" :sm="24">
               <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="chooseBillModal-refresh">查询</a-button>
               <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="chooseBillModal-reset">重置</a-button>
             </a-col>
@@ -47,7 +47,8 @@
         </a-form>
       </div>
       <div class="btn-cont">
-        <a-button type="primary" ghost id="chooseBillModal-modal-save" @click="handleSave">批量更新</a-button>
+        <a-button type="primary" ghost id="chooseBillModal-modal-save" @click="handleSave">批量添加</a-button>
+        <span v-if="totalNums" style="margin-left: 15px;">已选{{ totalNums }}项</span>
       </div>
       <!-- 列表 -->
       <s-table
@@ -55,7 +56,7 @@
         ref="table"
         size="small"
         :rowKey="(record) => record.id"
-        :row-selection="{ columnWidth: 40 }"
+        :row-selection="{columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: record.checked } })}"
         @rowSelection="rowSelectionFun"
         :columns="columns"
         :data="loadData"
@@ -98,6 +99,11 @@ export default {
       default: ''
     }
   },
+  computed:{
+    totalNums(){
+      return this.rowSelectionInfo && this.rowSelectionInfo.selectedRows && this.rowSelectionInfo.selectedRows.length
+    }
+  },
   data () {
     const _this = this
     return {
@@ -116,33 +122,29 @@ export default {
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
-        { title: '单据号', dataIndex: 'bizNo', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '单据号', dataIndex: 'bizNo', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单据类型', dataIndex: 'bizTypeDictValue', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '关联单据创建时间', dataIndex: 'bizCreateDate', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '关联单据创建时间', dataIndex: 'bizCreateDate', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '审核时间', dataIndex: 'auditTime', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '金额', dataIndex: 'totalAmount', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '余额', dataIndex: 'unsettleAmount', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
+        { title: '余额', dataIndex: 'unsettleAmount', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '状态', dataIndex: 'checked', width: '6%', align: 'center', customRender: function (text) { return text ? '已选' : '--' } }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
+        const _this = this
         return settleInfoAllList(Object.assign(this.queryParam, { settleClientType: this.settleClientType, settleClientSn: this.settleClientSn, notEqZero: 1 })).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
-            const selectedRowKeys = []
-            const selectedRows = []
             for (var i = 0; i < data.length; i++) {
               data[i].no = i + 1
               data[i].settleAmount = data[i].unsettleAmount
-              const ind = this.nowChoose.findIndex(item => item.id == data[i].id)
-              if (ind != -1) {
-                selectedRowKeys.push(data[i].id)
-                selectedRows.push(data[i])
-              }
+              const has = _this.nowChoose.find(item => item.id == data[i].id)
+              data[i].checked = !!has
             }
-            this.$refs.table.setTableSelected(selectedRowKeys, selectedRows) // 设置表格选中项
             this.disabled = false
           }
           this.spinning = false
@@ -155,6 +157,7 @@ export default {
   methods: {
     // 表格选中项
     rowSelectionFun (obj) {
+      console.log(obj)
       this.rowSelectionInfo = obj || null
     },
     // 关联单据创建时间
@@ -169,8 +172,12 @@ export default {
     },
     // 确定
     handleSave () {
-      this.$emit('ok', this.rowSelectionInfo && this.rowSelectionInfo.selectedRows)
-      this.isShow = false
+      if(this.totalNums){
+        this.$emit('ok', this.rowSelectionInfo && this.rowSelectionInfo.selectedRows)
+        this.resetSearchForm()
+      }else{
+        this.$message.info("请选择单据")
+      }
     },
     // 重置
     resetSearchForm () {
@@ -183,6 +190,7 @@ export default {
       this.queryParam.bizNo = ''
       this.queryParam.bizType = undefined
       this.$refs.table.refresh(true)
+      this.$refs.table.clearSelected()
     }
   },
   watch: {
@@ -196,6 +204,8 @@ export default {
       if (!newValue) {
         _this.$emit('close')
         _this.$refs.table.clearSelected() // 清空表格选中项
+        _this.selectedRowKeys = []
+        _this.selectedRows = []
         _this.resetSearchForm()
       } else {
         setTimeout(() => {

+ 2 - 5
src/views/financialManagement/companyReceivablePayableNew/collectionPayment.vue

@@ -410,12 +410,11 @@ export default {
       })
     },
     handleOk (selectedRows) {
-      this.chooseLoadData = selectedRows.sort((a, b) => {
+      this.chooseLoadData = this.chooseLoadData.concat(selectedRows).sort((a, b) => {
         const at = new Date(a.auditTime).getTime()
         const bt = new Date(b.auditTime).getTime()
         return at - bt
       })
-      // this.chooseLoadData = selectedRows.reverse()
       this.amountSettledChange()
     },
     // 返回列表
@@ -496,8 +495,6 @@ export default {
         color: #ed1c24;
       }
     }
-    .affix-cont{
-      text-align:right !important;
-    }
+    
   }
 </style>