Browse Source

修改bug

web100 2 years ago
parent
commit
0c2519d0d1

+ 47 - 0
src/api/accountingManagement/index.js

@@ -0,0 +1,47 @@
+import request from '@/router/axios';
+//轮胎账务管理保存数据
+export function saveSubmit(data){
+    return request({
+      url:'/api/blade-sales-part/settlement/submit',
+      method:'post',
+      data
+    })
+  }
+  //收款
+  export function collectionAndPayment(data){
+    return request({
+      url:'/api/blade-sales-part/settlement/collectionAndPayment',
+      method:'post',
+      data
+    })
+  }
+  //撤销收款
+  export function revokeCollectionAndPayment(data){
+    return request({
+      url:'/api/blade-sales-part/settlement/revokeCollectionAndPayment',
+      method:'post',
+      data
+    })
+  }
+  export function detail(data){
+    return request({
+      url:'/api/blade-sales-part/settlement/detail',
+      method:'get',
+      params:data
+    })
+  }
+  export function removeItems(data){
+    return request({
+      url:'/api/blade-sales-part/settlementItems/remove',
+      method:'post',
+      params:data
+    })
+  }
+
+    export function remove(data){
+    return request({
+      url:'/api/blade-sales-part/settlement/remove',
+      method:'post',
+      params:data
+    })
+  }

+ 10 - 0
src/api/basicData/salesContract.js

@@ -196,3 +196,13 @@ export const calculationDomesticFees = (data) => {
     data: data
   })
 }
+
+export function getCopy(id) {
+  return request({
+    url: '/api/blade-purchase-sales/exportOrder/getCopy',
+    method: 'get',
+    params: {
+      id: id
+    }
+  })
+}

+ 17 - 0
src/api/collectionSettlement/index.js

@@ -0,0 +1,17 @@
+import request from '@/router/axios';
+//查询列表
+export const getList = (params) => {
+    return request({
+        url: '/api/blade-sales-part/settlement/list',
+        method: 'get',
+        params: params
+    })
+}
+//删除
+export function remove(data){
+    return request({
+      url:'/api/blade-sales-part/settlement/remove',
+      method:'post',
+      params:data
+    })
+  }

+ 15 - 0
src/api/financialManagement/paymentRequest.js

@@ -148,3 +148,18 @@ export function getlistAll(data){
     params:data
   })
 }
+
+
+
+//轮胎收款结算选择订单
+export function getListOrder(current,size,params) {
+  return request({
+    url: '/api/blade-sales-part/order/list',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}

+ 1 - 1
src/api/oceanShipping/maritimeExport/index.js

@@ -101,4 +101,4 @@ export function found(data) {
         method: 'get',
         params:data
     })
-}
+}

+ 88 - 0
src/components/bill/config/mainLists.json

@@ -0,0 +1,88 @@
+{
+  "lazy": true,
+  "tip": true,
+  "simplePage": false,
+  "searchShow": true,
+  "reserveSelection": true,
+  "addBtn":false,
+  "editBtn":false,
+  "addRowBtn":false,
+  "cellBtn":false,
+  "cancelBtn":false,
+  "delBtn":false,
+  "refreshBtn": false,
+  "searchMenuPosition": "right",
+  "searchMenuSpan": 24,
+  "searchSpan": 8,
+  "menuWidth": "100",
+  "align": "center",
+  "dialogWidth": "60%",
+  "tree": true,
+  "border": true,
+  "index": true,
+  "selection": true,
+  "menu": true,
+  "searchIcon": true,
+  "searchIndex": 2,
+  "dialogClickModal": false,
+  "showSummary": true,
+  "summaryText": "合计",
+  "sumColumnList": [
+    {
+      "name": "amount",
+      "type": "sum"
+    },
+    {
+      "name": "settlementAmount",
+      "type": "sum"
+    },
+    {
+      "name": "invoiceAmount",
+      "type": "sum"
+    }
+  ],
+  "column": [
+    {
+      "label": "销售单号",
+      "prop": "ordNo",
+      "overHidden": true,
+      "search": true,
+      "width": 150,
+      "index": 2
+    }, {
+      "label": "结算单位",
+      "prop": "customerName",
+      "overHidden": true,
+      "search": true,
+      "width": 150,
+      "index": 2
+    },
+    {
+      "label": "数量",
+      "prop": "goodsTotalNum",
+      "overHidden": true,
+      "width": 150,
+      "index": 7
+    },
+    {
+      "label": "金额",
+      "prop": "totalMoney",
+      "overHidden": true,
+      "width": 150,
+      "index": 7
+    },
+    {
+      "label": "日期",
+      "prop": "dueDate",
+      "type": "date",
+      "searchRange": true,
+      "searchDefaultTime": ["00:00:00", "23:59:59"],
+      "format": "yyyy-MM-dd",
+      "valueFormat": "yyyy-MM-dd HH:mm:ss",
+      "overHidden": true,
+      "search": false,
+      "index": 14,
+      "width": 250
+    }
+  ]
+}

+ 174 - 0
src/components/bill/selectOrderDetailList.vue

@@ -0,0 +1,174 @@
+<template>
+  <div>
+    <avue-crud :option="option" :table-loading="loading" :data="data" :search.sync="search" ref="crud"
+      @refresh-change="refreshChange" @selection-change="selectionChange" @search-change="searchChange"
+      @saveColumn="saveColumn" :page.sync="page" @on-load="onLoad">
+      <template slot="costTypeSearch">
+        <breakdown-select v-model="search.costType" :configuration="breakConfiguration"></breakdown-select>
+      </template>
+      <template slot="menuLeft">
+        <el-tabs v-model="activeName" @tab-click="tabHandle">
+          <el-tab-pane label="查询结果" name="searchList"></el-tab-pane>
+          <el-tab-pane label="已选定数据" name="importStaging"></el-tab-pane>
+        </el-tabs>
+      </template>
+      <template slot-scope="scope" slot="menu">
+        <el-button type="text" icon="el-icon-edit" size="small" @click.stop="importStagList(scope.row, scope.index)"
+          v-if="activeName == 'searchList'"
+          :disabled="goodsListSave.findIndex(item => item.id == scope.row.id) !== -1">选择
+        </el-button>
+        <el-button type="text" icon="el-icon-delete" size="small" @click.stop="removeStagList(scope.row, scope.index)"
+          v-else>移除
+        </el-button>
+      </template>
+    </avue-crud>
+    <div class="dialogButton">
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="$emit('closeFun')">取 消</el-button>
+        <el-button type="primary" @click="importProMent" :disabled="goodsListSave.length == 0">导入</el-button>
+      </span>
+    </div>
+  </div>
+</template>
+
+<script>
+import option from './config/mainLists.json'
+import { getListOrder } from "@/api/financialManagement/paymentRequest";
+
+export default {
+  name: "index",
+  props: {
+    billType: {
+      type: String
+    },
+    flag: {
+      type: Number
+    },
+    params: {
+      type: Object
+    },
+    itemId: {
+      type: String
+    },
+    closeFun: {
+      type: Function
+    }
+  },
+  data() {
+    return {
+      activeName: "searchList",
+      option: option,
+      loading: false,
+      search: {},
+      data: [],
+      selectList: [],
+      page: {
+        pageSize: 20,
+        pagerCount: 1,
+        total: 0,
+        pageSizes: [20, 200, 300, 500, 700, 1000]
+      },
+      breakConfiguration: {
+        multipleChoices: false,
+        multiple: false,
+        disabled: false,
+        searchShow: true,
+        collapseTags: false,
+        clearable: true,
+        placeholder: '请点击右边按钮选择',
+        dicData: []
+      },
+      goodsListShow: [],
+      goodsListSave: []
+    }
+  },
+  watch: {
+    'params.corpId'(newVal, oldVal) {
+      if (newVal != oldVal) {
+        this.onLoad(this.page, this.search)
+      }
+    }
+  },
+  async created() {
+    // this.option = await this.getColumnData(this.getColumnName(45), option);
+  },
+  methods: {
+    importStagList(row, index) {
+      // this.goodsListSave.push(row);
+      this.$refs.crud.toggleSelection([row]);
+    },
+    removeStagList(row, index) {
+      this.goodsListSave.splice(row.$index, 1);
+    },
+    // 标签页切换
+    tabHandle(data) {
+      if (data.name == "searchList") {
+        this.goodsListSave = this.data;
+        this.data = this.goodsListShow;
+        this.page.total = this.page.totalTwo
+      } else if (data.name == "importStaging") {
+        this.goodsListShow = this.data;
+        this.data = this.goodsListSave;
+        this.page.totalTwo = this.page.total;
+        this.page.total = 0;
+      }
+    },
+    refreshChange() {
+      this.onLoad(this.page);
+    },
+    searchChange(params, done) {
+      if (params.createStart) {
+        params.createStartDate = params.createStart[0]
+        params.createEndDate = params.createStart[1]
+      }
+      this.onLoad(this.page, params);
+      done()
+    },
+    selectionChange(row) {
+      // this.selectList = row
+      this.goodsListSave = row
+    },
+    onLoad(page, params) {
+
+      if(params && params.rentStartDate ){
+        params.createStartDate = params.rentStartDate[0] + " " + "00:00:00"?params.rentStartDate[0] + " " + "00:00:00":'';
+        params.createEndDate = params.rentStartDate[1] + " " + "23:59:59"?params.rentStartDate[1] + " " + "23:59:59":'';
+        this.$delete(params, 'rentStartDate')
+      }
+       
+      this.loading = true;
+      params = {
+        ...params,
+        ...this.params
+      }
+      params.billType = this.billType
+      if (this.$store.getters.userInfo.tenant_id === "673511") {
+        params.type = "CMY"
+      }
+      params.flag = this.flag
+      getListOrder(page.currentPage, page.pageSize, params).then(res => {
+        this.data = res.data.data.records
+        this.page.total = res.data.data.total
+      }).finally(() => {
+        this.loading = false;
+      })
+    },
+    importProMent() {
+      this.$emit('importProMent', this.goodsListSave);
+    },
+    //列保存触发
+    async saveColumn() {
+      const inSave = await this.saveColumnData(
+        this.getColumnName(45),
+        this.option
+      );
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+      }
+    },
+  }
+}
+</script>
+<style scoped></style>

+ 7 - 1
src/enums/column-name.js

@@ -1192,7 +1192,13 @@ const columnName = [{
 },{
   code: 274.3,
   name: '轮胎商城-采购管理-入库工单-历史记录'
-}]
+},{
+  code: 274.4,
+  name: '轮胎商城-采购管理-采购订单列表'
+},{
+  code: 276,
+  name: '轮胎商城-采购管理-入库任务-列表'
+},]
 export const getColumnName = (key) => {
   for (let index = 0; index < columnName.length; index++) {
     const element = columnName[index];

+ 19 - 3
src/views/exportTrade/salesContract/detailsPage.vue

@@ -497,6 +497,7 @@ import feeInfo from "@/components/fee-info/main";
 import uploadFile from "@/components/upload-file/main";
 import {
   detail,
+  getCopy,
   submit,
   delItem,
   getDeptLazyTree,
@@ -2109,8 +2110,8 @@ export default {
     getDetail(id) {
       this.showBut = false;
       this.pageLoading = true;
-      detail(id).then(res => {
-          if (this.detailData.status == "copy") {
+      if (this.detailData.status == "copy") {
+        getCopy(id).then(res => {
             delete res.data.data.id;
             delete res.data.data.sysNo;
             delete res.data.data.orderNo;
@@ -2161,7 +2162,6 @@ export default {
               delete e.status;
               delete e.isDeleted;
             });
-          }
           this.form = res.data.data;
           this.data = res.data.data.orderItemsList;
           this.orderFeesList = res.data.data.orderFeesList;
@@ -2175,6 +2175,22 @@ export default {
           this.showBut = true;
           this.pageLoading = false;
         });
+      }else{
+        detail(id).then(res => {
+          this.form = res.data.data;
+          this.data = res.data.data.orderItemsList;
+          this.orderFeesList = res.data.data.orderFeesList;
+          this.orderFilesList = res.data.data.orderFilesList;
+          this.oldform = res.data.data;
+          this.olddata = this.deepClone(res.data.data.orderItemsList);
+          this.oldorderFeesList = this.deepClone(res.data.data.orderFeesList);
+          this.oldorderFilesList = this.deepClone(res.data.data.orderFilesList);
+          this.oldExchange = this.deepClone(this.form.exchangeRate);
+        }).finally(() => {
+          this.showBut = true;
+          this.pageLoading = false;
+        });
+      }
     },
     getproductRemark(row) {
       const ename = row.ename ? row.ename : "";

+ 1 - 1
src/views/tirePartsMall/basicData/commodityInformation/index.vue

@@ -56,7 +56,7 @@
           <el-button type="text" size="small" @click.stop="rowDel(row, index)">
             删除
           </el-button> -->
-          <el-button type="text" size="small" @click.stop="rowDel(row, index)" v-if="row.status != 0">
+          <el-button type="text" size="small" @click.stop="rowDel(row, index)" v-if="row.status != 0" :disabled="row.enableOrNot">
             删除
           </el-button>
             </template>

+ 2 - 2
src/views/tirePartsMall/basicData/commodityInformation/js/optionList.js

@@ -88,8 +88,8 @@ export const option = {
       label: "是否启用",
       prop: "enableOrNot",
       overHidden: true,
-      hide: true,
-      showColumn: false,
+      // hide: true,
+      // showColumn: false,
       type: 'select',
       dicData: [{
         label: '否',

+ 4 - 4
src/views/tirePartsMall/basicData/customerInformation/detailsPage.vue

@@ -11,8 +11,8 @@
           <el-button type="primary" size="small" @click="editCustomer">
             保存数据
           </el-button>
-          <el-button class="el-button--small-yh" type="primary" size="small" v-if="form.id" @click="editEnable">
-            {{ form.enableOrNot ? '禁用' : '启用' }}
+          <el-button class="el-button--small-yh"  size="small" v-if="form.id" @click="editEnable">
+            {{ form.enableOrNot ? '启用' : '禁用' }}
           </el-button>
         </div>
       </div>
@@ -587,10 +587,10 @@ export default {
     // 启用或禁用
     editEnable() {
       let data = this.form
-      editenable({ id: data.id, enableOrNot: data.enableOrNot ? 0 : 1 }).then(res => {
+      editenable({ id: data.id, enableOrNot: data.enableOrNot ? 1 : 0 }).then(res => {
         this.$message({
           type: "success",
-          message: data.enableOrNot ? "禁用成功!" : "启用成功!"
+          message: data.enableOrNot ? "启用成功!" : "禁用成功!"
         });
         this.$set(this.form, 'enableOrNot', data.enableOrNot == 1 ? 0 : 1)
       })

+ 24 - 1
src/views/tirePartsMall/basicData/customerInformation/index.vue

@@ -273,7 +273,12 @@ export default {
   },
   activated() {
     console.log(1);
-    // this.$refs.crud.refreshTable()
+    setTimeout(() => {
+        this.$nextTick(() => {
+          this.$refs.crud.doLayout()
+          this.$refs.crud.refreshTable();
+        })
+      }, 100)
   },
   async created() {
     this.option = await this.getColumnData(this.getColumnName(207), option);
@@ -289,6 +294,20 @@ export default {
         this.$refs.crud.$refs.dialogColumn.columnBox = false;
       }
   },
+  mounted() {
+      // 页面尺寸改变,重新渲染avue表格,避免表格错位
+      window.addEventListener(
+        'resize',
+        () => {
+          if(Math.abs(this.screenWidth - document.body.clientWidth) > 20) {
+            this.$nextTick(() => {
+               this.$refs.crud.refreshTable();
+            })
+          }
+          this.screenWidth = document.body.clientWidth;
+        }
+      )
+    },
   methods: {
     derivation() {
       window.open(
@@ -488,6 +507,10 @@ export default {
       this.show = true;
       this.showInfo = true;
       this.onLoad(this.page, this.search);
+      this.$nextTick(() => {
+          this.$refs.crud.doLayout()
+          this.$refs.crud.refreshTable();
+        })
     },
   }
 }

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

@@ -3,25 +3,20 @@
     <div class="customer-head">
       <div class="customer-back">
         <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
-                   @click="backToList(0)">返回列表
+          @click="backToList(0)">返回列表
         </el-button>
       </div>
       <div class="add-customer-btn">
         <!--        <el-button class="el-button&#45;&#45;small-yh" style="margin-right: 10px" type="primary" size="small" v-if="!editButton"-->
         <!--                   @click="confirmEditing">编辑-->
         <!--        </el-button>-->
-        <el-button
-            class="el-button--small-yh"
-            type="primary"
-            size="small"
-            @click="editCustomer">保存数据
+        <el-button class="el-button--small-yh" type="primary" size="small" :disabled="form.financeStatus == '已付款' " @click="editCustomer">保存数据
         </el-button>
-        <el-button
-            class="el-button--small-yh"
-            type="primary"
-            size="small"
-            v-if="form.id">启用
+        <el-button class="el-button--small-yh" type="warning" 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> -->
       </div>
     </div>
     <div style="margin-top: 50px">
@@ -29,44 +24,67 @@
         <avue-form :option="optionForm" v-model="form" ref="form"></avue-form>
       </trade-card>
       <trade-card title="明细信息">
-        <avue-crud :option="optionContacts" v-model="formContacts" ref="formContacts" :data="form.contactsList"
-                   @row-save="rowSave"
-                   @row-update="rowUpdate"
-                   @resetColumn="resetColumnTwo('formContacts','optionContacts','optionContactsBack',267.1)"
-                   @saveColumn="saveColumnTwo('formContacts','optionContacts','optionContactsBack',267.1)">
+        <avue-crud :option="optionContacts" v-model="formContacts" ref="formContacts" :data="form.settlementItemsList"
+          @row-save="rowSave" @row-update="rowUpdate"
+          @resetColumn="resetColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 267.1)"
+          @saveColumn="saveColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 267.1)">
+          <template slot-scope="scope" slot="menuLeft">
+            <el-button type="primary" icon="el-icon-plus" :disabled="form.financeStatus == '已付款' " size="small" @click="rowAdd()">选择订单</el-button>
+          </template>
           <template slot-scope="{type,size,row,index,disabled}" slot="menu">
-            <el-button
-                :size="size" :disabled="disabled" :type="type"
-                :icon="row.$cellEdit?'el-icon-plus':'el-icon-edit'"
-                @click="$refs.formContacts.rowCell(row,index)"
-            >{{ row.$cellEdit ? '确认' : '修改' }}
+            <el-button :size="size" :disabled="form.financeStatus == '已付款' " :type="type" 
+              :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"   @click="$refs.formContacts.rowCell(row, index)">{{
+                row.$cellEdit ? '确认' : '修改' }}
             </el-button>
-            <el-button icon="el-icon-delete" :size="size" :disabled="disabled" :type="type"
-                       @click="rowDelBox(row,index)">删除
+            <el-button icon="el-icon-delete" :size="size" :disabled="form.financeStatus == '已付款' " :type="type"
+              @click="rowDelBox(row, index)">删除
             </el-button>
           </template>
         </avue-crud>
       </trade-card>
     </div>
+    <el-dialog title="导入销售" 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>
+    </el-dialog>
   </div>
 </template>
 
 <script>
+import billDetail from "@/components/bill/selectOrderDetailList";
+import { saveSubmit, collectionAndPayment, revokeCollectionAndPayment, detail,removeItems,remove } from '@/api/accountingManagement/index.js';
+import { getList } from "@/api/collectionSettlement/index.js";
+
 
 export default {
   name: "detailsPage",
+  components: {
+    billDetail
+  },
   data() {
     return {
       disabled: false,
+      billDetailDialog: false,
+      params: {},
       form: {
-        contactsList: []
+        settlementItemsList: []
       },
       optionForm: {
+        disabled:false,
         menuBtn: false,
         span: 8,
         column: [{
           label: '客户',
           prop: "corpId",
+          type: 'select',
+          remote: true,
+          props: {
+            label: 'cname',
+            value: 'id'
+          },
+          dicUrl: '/api/blade-sales-part/corpsDesc/listAll?cname={{key}}&corpType=KH&enableOrNot=0',
           rules: [{
             required: true,
             message: " ",
@@ -74,7 +92,23 @@ export default {
           }]
         }, {
           label: '收款账户',
-          prop: "accountId",
+          prop: "accountName",
+          remote: true,
+          type: 'select',
+          props: {
+            label: 'cname',
+            value: 'cname'
+          },
+          dicUrl: '/api/blade-sales-part/accountManagement/list?enableOrNot=1&cname={{key}}&billType=HYCK',
+          dicFormatter: (res => {
+            return res.data.records
+          }),
+          change: (data => {
+            console.log(data);
+            console.log(this.$refs.form.DIC.accountName);
+            const targetObject = this.$refs.form.DIC.accountName.find(obj => obj.cname == data.value);
+            this.form.accountId = targetObject.id
+          }),
           rules: [{
             required: true,
             message: " ",
@@ -83,6 +117,7 @@ export default {
         }, {
           label: '金额',
           prop: "amount",
+          disabled: true,
           rules: [{
             required: true,
             message: " ",
@@ -90,11 +125,11 @@ export default {
           }]
         }, {
           label: "经办人",
-          prop: "handledById",
+          prop: "handledByName",
           type: "select",
           props: {
             label: "name",
-            value: "id"
+            value: "name"
           },
           dicUrl: "/api/blade-user/client/gainUser",
           filterable: true,
@@ -106,6 +141,17 @@ export default {
         }, {
           label: '收款日期',
           prop: "settlementDate",
+          type: "date",
+          overHidden: true,
+          width: 100,
+          searchRange: true,
+          searchDefaultTime: ["00:00:00", "23:59:59"],
+          format: "yyyy-MM-dd",
+          valueFormat: "yyyy-MM-dd HH:mm:ss"
+        }, {
+          label: '单据编号',
+          prop: "sysNo",
+          disabled: true
         }, {
           label: '备注',
           prop: "remarks",
@@ -117,50 +163,93 @@ export default {
       formContacts: {},
       optionContacts: {},
       optionContactsBack: {
+        disabled:false,
         align: 'center',
         index: true,
-        addBtnText: "录入明细",
+        // addBtnText: "录入明细",
         refreshBtn: false,
         dialogDrag: true,
         addBtn: false,
         span: 8,
         height: 600,
-        addRowBtn: true,
+        // addRowBtn: true,
         editBtn: false,
         delBtn: false,
         menuWidth: 140,
         dialogTop: 25,
         dialogWidth: "80%",
-        column: [{
-          label: '单据编号',
-          prop: 'attn',
-          cell: true
-        }, {
-          label: '合同号',
-          prop: 'contractNumber',
-          cell: true
-        }, {
-          label: '应收金额',
-          prop: 'accountsAmount',
-          cell: true
-        }, {
-          label: '结算金额',
-          prop: 'settlmentAmount',
-          cell: true
-        }, {
-          label: '本次金额',
-          prop: 'thisAmount',
-          cell: true
-        }, {
-          label: '备注',
-          prop: 'remarks',
-          cell: true
-        }]
+        column: [
+          //   {
+          //   label: '单据编号',
+          //   prop: 'attn',
+          //   cell: true
+          // }, 
+          {
+            label: '合同号',
+            prop: 'contractNumber',
+            cell: false
+          }, {
+            label: '应收金额',
+            prop: 'accountsAmount',
+            cell: false
+          }, {
+            label: '结算金额',
+            prop: 'settlmentAmount',
+            cell: false
+          }, {
+            label: '本次金额',
+            prop: 'thisAmount',
+            cell: true
+          }, {
+            label: '来源主表id',
+            hide: true,
+            showColumn: false,
+            prop: 'srcParentId',
+            cell: true
+          }, {
+            label: '来源单据编号',
+            prop: 'srcBillNo',
+            hide: true,
+            showColumn: false,
+            cell: false
+          }, {
+            label: '所属公司id',
+            prop: 'salesCompanyId',
+            hide: true,
+            showColumn: false,
+            cell: false
+          }, {
+            label: '所属公司名称',
+            prop: 'salesCompanyName',
+            hide: true,
+            showColumn: false,
+            cell: false
+          }, {
+            label: '备注',
+            prop: 'remarks',
+            cell: true
+          }]
       }
     }
   },
+  props: {
+    onLoad: Object,
+    detailData: Object
+  },
   async created() {
+    let thisAmountSum = 0
     this.optionContacts = await this.getColumnData(this.getColumnName(267.1), this.optionContactsBack);
+    this.findObject(this.optionContacts.column, "thisAmount").change = ({ value, column }) => {
+      thisAmountSum = 0
+      for (let item of this.form.settlementItemsList) {
+        thisAmountSum += item.thisAmount;
+      }
+      this.form.amount = thisAmountSum
+    }
+    console.log(this.onLoad.id);
+    if (this.onLoad.id) {
+      this.refresh(this.onLoad.id)
+    }
   },
   methods: {
     rowDelBox(row, index) {
@@ -169,18 +258,19 @@ export default {
         cancelButtonText: "取消",
         type: "warning"
       }).then(() => {
-          if (row.id) {
-            // tradingBox(row.id).then(res => {
-            //   this.form.contactsList.splice(index, 1);
-            //   this.$message.success("操作成功!");
-            // });
-          } else {
-            this.form.contactsList.splice(index, 1);
+        if (row.id) {
+          console.log(this.form);
+          removeItems({ids:row.id}).then(res => {
+            this.form.settlementItemsList.splice(index, 1);
             this.$message.success("操作成功!");
-          }
+          });
+        } else {
+          this.form.settlementItemsList.splice(index, 1);
+          this.$message.success("操作成功!");
         }
+      }
       )
-      ;
+        ;
     },
     rowSave(form, done, loading) {
       done(form)
@@ -188,6 +278,161 @@ export default {
     rowUpdate(form, index, done, loading) {
       done(form)
     },
+    refresh(id, type) {
+      const loading = this.$loading({
+        lock: true,
+        text: '加载中',
+        spinner: 'el-icon-loading',
+        background: 'rgba(255,255,255,0.7)'
+      })
+      detail({ id: id }).then(res => {
+        this.form = res.data.data
+        if(res.data.data.financeStatus == '已付款'){
+          console.log('已付款');
+          this.$set(this.optionForm,'disabled',true)
+          this.$set(this.optionContactsBack,'disabled',true)
+        }else{
+          this.$set(this.optionForm,'disabled',false)
+
+        }
+        loading.close();
+      }).catch(() => {
+        loading.close();
+      })
+    },
+    //新增
+    rowAdd() {
+      if (!this.form.corpId) {
+        this.$message.warning("请先选择客户!")
+        return
+      }
+      this.params = {
+        customerId: this.form.corpId,
+        generateTask: '已生成',
+        bsType: 'XS',
+        actualPaymentStatus: '2'
+      }
+      this.billDetailDialog = true;
+
+      // this.$refs.formContacts.rowAdd()
+    },
+    //导入
+    importProMent(list) {
+      console.log(list);
+      // return
+      // for (let item of this.dataList){
+      //   for (let li of list){
+      //     if (item.srcSysno == li.srcSysno && item.srcRefno == li.srcRefno && new Date(item.rentEndDate) == new Date(li.rentEndDate)){
+      //       return this.$message.error(`合同号${item.accSysNo}已存在`)
+      //     }
+      //   }
+      // }
+      list.forEach((item, index) => {
+        item.contractNumber = item.ordNo;
+        item.accountsAmount = item.totalMoney
+        item.settlmentAmount = item.paymentAmountTl
+        item.thisAmount = (Number(item.totalMoney) - Number(item.paymentAmountTl))
+        item.srcParentId = item.id
+        item.srcBillNo = item.ordNo
+        item.salesCompanyId = item.salesCompanyId
+        item.salesCompanyName = item.salesCompanyName
+        item.id = null
+        delete item.ordNo;
+        this.$refs.formContacts.rowCellAdd(item);
+      })
+      //明细列表所有合同号 去重 加, 为主表合同号
+      // this.$set(this.form,'srcOrderno',Array.from(new Set(this.dataList.map(item =>{ return item.srcOrderno}))).join(','))
+
+      this.billDetailDialog = false;
+    },
+    //保存数据
+    editCustomer() {
+      this.$refs["form"].validate((valid, done) => {
+        done()
+        if (valid) {
+          let data = {
+            ...this.form,
+            dc: 'd',
+            billType: 'SK'
+          }
+          const loading = this.$loading({
+            lock: true,
+            text: '加载中',
+            spinner: 'el-icon-loading',
+            background: 'rgba(255,255,255,0.7)'
+          });
+          saveSubmit(data).then(res => {
+            console.log(res);
+            this.$message.success('保存成功')
+            loading.close();
+          }).catch(() => {
+            loading.close()
+          })
+        }
+      })
+
+    },
+    //收款
+    collection() {
+      this.$refs["form"].validate((valid, done) => {
+        done()
+        if (valid) {
+          if (this.form.financeStatus !== '已付款') {
+            console.log('this.form.financeStatus',this.form.financeStatus );
+            this.$confirm("确认收款?", {
+              confirmButtonText: "确定",
+              cancelButtonText: "取消",
+              type: "warning"
+            }).then(() => {
+              const loading = this.$loading({
+                lock: true,
+                text: '加载中',
+                spinner: 'el-icon-loading',
+                background: 'rgba(255,255,255,0.7)'
+              });
+              let data = {
+                ...this.form,
+                dc: 'd',
+                billType: 'SK'
+              }
+              collectionAndPayment(data).then((res => {
+                this.refresh(res.data.data.id)
+                this.$message.success('收款成功')
+                loading.close()
+              }))
+            })
+          }else{
+            this.$confirm("确认撤销退款?", {
+              confirmButtonText: "确定",
+              cancelButtonText: "取消",
+              type: "warning"
+            }).then(() => {
+              const loading = this.$loading({
+                lock: true,
+                text: '加载中',
+                spinner: 'el-icon-loading',
+                background: 'rgba(255,255,255,0.7)'
+              });
+              let data = {
+                ...this.form,
+                dc: 'd',
+                billType: 'SK'
+              }
+              revokeCollectionAndPayment(data).then((res => {
+                this.refresh(res.data.data.id)
+                this.$message.success('撤销收款成功')
+                loading.close()
+              }))
+            })
+          }
+        }
+      })
+
+    },
+    //关闭
+    closeBillDetail() {
+      this.billDetailDialog = false;
+    },
     //自定义列保存
     async saveColumnTwo(ref, option, optionBack, code) {
       /**

+ 54 - 63
src/views/tirePartsMall/financialManagement/collectionSettlement/index.vue

@@ -18,7 +18,7 @@
           :page.sync="page">
         <template slot-scope="{type,size,row,index}" slot="menu">
           <el-button  :size="size" :type="type" @click="check(row)">查看</el-button>
-          <el-button  :size="size" :type="type" @click="$refs.crud.rowDel(row,index)">删除</el-button>
+          <el-button  :size="size" :type="type" :disabled="row.financeStatus == '已付款' || item>=1" @click="$refs.crud.rowDel(row,index)">删除</el-button>
         </template>
         <template slot="corpNameSearch">
           <crop-select v-model="search.corpId" corpType="KH" :refresh="false"></crop-select>
@@ -34,7 +34,8 @@
 </template>
 
 <script>
-import {getList, remove} from "@/api/oceanShipping/maritimeExport/index.js";
+// import {getList, remove} from "@/api/oceanShipping/maritimeExport/index.js";
+import {getList, remove} from "@/api/collectionSettlement/index.js";
 import detailsPage from "./detailsPage"
 
 export default {
@@ -77,66 +78,61 @@ export default {
         highlightCurrentRow: true,
         dialogWidth: "70%",
         column: [{
-          label: '单据编号',
+          label: '系统编号',
           prop: "sysNo",
           search: true,
           overHidden: true,
         }, {
-          label: '合同号',
+          label: '订单号',
           prop: "contractNumber",
           search: true,
           overHidden: true,
         }, {
-          label: "客户",
+          label: "客户名称",
           prop: "corpId",
           search: true,
+          props: {
+            label: 'cname',
+            value: 'id'
+          },
+          dicUrl: '/api/blade-sales-part/corpsDesc/listAll?cname={{key}}&corpType=KH&enableOrNot=0',
         }, {
-          label: "所属公司",
+          label: "所属公司名称",
           prop: "salesCompanyId",
           search: true,
         }, {
-          label: '账户',
-          prop: "accountId",
+          label: '收付款状态',
+          prop: "financeStatus",
           search: true,
           overHidden: true,
         }, {
-          label: '金额',
-          prop: "amount",
-          search: true,
-          overHidden: true,
-        }, {
-          label: '收款日期',
-          prop: "settlementDate",
+          label: '收款账户',
+          prop: "accountName",
           search: true,
           overHidden: true,
+          props: {
+            label: 'cname',
+            value: 'id'
+          },
+          dicUrl: '/api/blade-sales-part/accountManagement/list?enableOrNot=1&cname={{key}}&billType=HYCK',
         }, {
-          label: '应结日期',
-          prop: "dueDate",
+          label: '人民币金额',
+          prop: "amount",
           search: true,
           overHidden: true,
         }, {
-          label: '状态',
-          prop: "status",
+          label: '经办人名称',
+          prop: "handledByName",
           search: true,
           overHidden: true,
-        }, {
-          label: "制单人",
-          prop: "createUserName",
-          searchProp: "createUser",
-          overHidden: true,
-          width: 100,
-          filterable: true,
-          remote: true,
-          type: "select",
-          dicUrl: "/api/blade-user/page?size=20&current=1&account={{key}}",
           props: {
-            label: "account",
-            value: "id",
-            res: 'data.records'
-          }
+            label: "name",
+            value: "id"
+          },
+          dicUrl: "/api/blade-user/client/gainUser",
         }, {
-          label: "制单日期",
-          prop: "createTime",
+          label: "结算日期",
+          prop: "settlementDate",
           searchProp: "createTimeList",
           type: "date",
           overHidden: true,
@@ -145,33 +141,20 @@ export default {
           searchDefaultTime: ["00:00:00", "23:59:59"],
           format: "yyyy-MM-dd",
           valueFormat: "yyyy-MM-dd HH:mm:ss"
-        }, {
-          label: "更新人",
-          prop: "updateUserName",
-          searchProp: "updateUser",
-          overHidden: true,
-          width: 100,
-          filterable: true,
-          remote: true,
-          type: "select",
-          dicUrl: "/api/blade-user/page?size=20&current=1&account={{key}}",
-          props: {
-            label: "account",
-            value: "id",
-            res: 'data.records'
-          }
-        }, {
-          label: "更新日期",
-          prop: "updateTime",
-          searchProp: "updateTimeList",
-          type: "date",
-          overHidden: true,
-          width: 100,
-          searchRange: true,
-          searchDefaultTime: ["00:00:00", "23:59:59"],
-          format: "yyyy-MM-dd",
-          valueFormat: "yyyy-MM-dd HH:mm:ss"
-        }]
+        }, 
+        // {
+        //   label: "应结日期",
+        //   prop: "dueDate",
+        //   searchProp: "updateTimeList",
+        //   type: "date",
+        //   overHidden: true,
+        //   width: 100,
+        //   searchRange: true,
+        //   searchDefaultTime: ["00:00:00", "23:59:59"],
+        //   format: "yyyy-MM-dd",
+        //   valueFormat: "yyyy-MM-dd HH:mm:ss"
+        // }
+      ]
       }
     }
   },
@@ -188,6 +171,12 @@ export default {
       this.option.searchMenuPosition = "right";
     }
   },
+        // 解决AVue表格错位问题
+        activated () {
+      this.$nextTick(() => {
+        this.$refs.crud.doLayout()
+      })
+    },
   methods: {
     check(row) {
       this.form = row
@@ -211,7 +200,7 @@ export default {
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
-        remove(form.id).then(res => {
+        remove({ids:form.id}).then(res => {
           this.$message({
             type: 'success',
             message: '删除成功!'
@@ -226,12 +215,14 @@ export default {
       done();
       this.onLoad(this.page, params)
     },
+
     onLoad(page, params = {}) {
       params = {
         ...params,
         current: page.currentPage,
         size: page.pageSize,
         billType: "HYCK",
+        dc:'d',
         ...Object.assign(params, this.search)
       }
       this.loading = true

+ 29 - 1
src/views/tirePartsMall/financialManagement/paymentSettlement/detailsPage.vue

@@ -34,6 +34,9 @@
                    @row-update="rowUpdate"
                    @resetColumn="resetColumnTwo('formContacts','optionContacts','optionContactsBack',266.1)"
                    @saveColumn="saveColumnTwo('formContacts','optionContacts','optionContactsBack',266.1)">
+          <template slot-scope="scope" slot="menuLeft">
+            <el-button type="primary" icon="el-icon-plus" :disabled="form.financeStatus == '已付款' " size="small" @click="rowAdd()">选择订单</el-button>
+          </template>
           <template slot-scope="{type,size,row,index,disabled}" slot="menu">
             <el-button
                 :size="size" :disabled="disabled" :type="type"
@@ -48,15 +51,26 @@
         </avue-crud>
       </trade-card>
     </div>
+    <el-dialog title="导入销售" 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>
+    </el-dialog>
   </div>
 </template>
 
 <script>
+import billDetail from "@/components/bill/selectOrderDetailList";
 
 export default {
   name: "detailsPage",
+  components: {
+    billDetail
+  },
   data() {
     return {
+      billDetailDialog:false,
       disabled: false,
       form: {
         contactsList: []
@@ -125,7 +139,7 @@ export default {
         addBtn: false,
         span: 8,
         height: 600,
-        addRowBtn: true,
+        addRowBtn: false,
         editBtn: false,
         delBtn: false,
         menuWidth: 140,
@@ -182,6 +196,20 @@ export default {
       )
       ;
     },
+    rowAdd(){
+      if (!this.form.corpId) {
+        this.$message.warning("请先选择客户!")
+        return
+      }
+      this.params = {
+        customerId: this.form.corpId,
+        generateTask: '已生成',
+        bsType: 'XS',
+        actualPaymentStatus: '2'
+      }
+      this.billDetailDialog = true;
+
+    },
     rowSave(form, done, loading) {
       done(form)
     },

+ 4 - 4
src/views/tirePartsMall/salesManagement/inboundTask/index.vue

@@ -4,8 +4,8 @@
       <avue-crud :option="option" :search.sync="search" v-model="form" :table-loading="loading" :data="dataList"
         ref="crud" :key="key" @selection-change="selectionChange" @on-load="onLoad" @search-change="searchChange"
         @row-del="rowDel" @refresh-change="refreshChange"
-        @resetColumn="resetColumnTwo('crud', 'option', 'optionList', 271)"
-        @saveColumn="saveColumnTwo('crud', 'option', 'optionList', 271)" :page.sync="page"
+        @resetColumn="resetColumnTwo('crud', 'option', 'optionList', 276)"
+        @saveColumn="saveColumnTwo('crud', 'option', 'optionList', 276)" :page.sync="page"
         @row-update="rowUpdate">
         <template slot-scope="{type,size,row,index}" slot="menu" >
           <!--<el-button icon="el-icon-view" :size="size" :type="type" @click="check(row)">查看</el-button>-->
@@ -219,7 +219,7 @@ export default {
     }
   },
   async created() {
-    this.option = await this.getColumnData(this.getColumnName(271), this.optionList);
+    this.option = await this.getColumnData(this.getColumnName(276), this.optionList);
     this.key++
     let i = 0;
     this.option.column.forEach(item => {
@@ -230,7 +230,7 @@ export default {
       this.option.searchMenuSpan = num * 8;
       this.option.searchMenuPosition = "right";
     }
-    this.option = await this.getColumnData(this.getColumnName(271), this.optionList);
+    this.option = await this.getColumnData(this.getColumnName(276), this.optionList);
 
     this.option.selectable = (row, index) => {
       return Number(row.sendTotalNum) !== Number(row.goodsTotalNum);

+ 21 - 23
src/views/tirePartsMall/salesManagement/purchaseOrder/detailsPage.vue

@@ -459,7 +459,7 @@ export default {
                         value: 'id'
                     },
                     // dicUrl: '/api/blade-sales-part/goodsDesc/goodsListAll?cname={{key}}'
-                    dicUrl: "/api/blade-sales-part/goodsDesc/goodsListAll?cname={{key}}"
+                    dicUrl: "/api/blade-sales-part/goodsDesc/goodsListAll?cname={{key}}&enableOrNot=0"
                     // dicUrl: "/api/blade-sales-part/goodsDesc/goodsListXs?cname={{key}}"
                 }, {
                     label: '数量',
@@ -476,9 +476,7 @@ export default {
                             console.log(this.formContacts.inventory);
                             if (value < 0) {
                                 callback(new Error("数量不能小于0"));
-                            } else if (Number(value) > Number(this.formContacts.inventory)) {
-                                callback(new Error("数量不能大于库存"));
-                            } else {
+                            }else {
                                 callback();
                             }
                         },
@@ -580,7 +578,7 @@ export default {
                 },
 
                 {
-                    label: '货数量',
+                    label: '货数量',
                     prop: 'sendNum',
                     disabled: false,
                     overHidden: true,
@@ -610,25 +608,25 @@ export default {
                 //     overHidden: true,
                 //     width: 100
                 // }, 
-                {
-                    label: '成本',
-                    prop: 'costprie',
-                    overHidden: true,
-                    width: 100,
-                    disabled: true,
-                    editDisplay: false,
-                    addDisplay: false
+                // {
+                //     label: '成本',
+                //     prop: 'costprie',
+                //     overHidden: true,
+                //     width: 100,
+                //     disabled: true,
+                //     editDisplay: false,
+                //     addDisplay: false
 
-                },
-                {
-                    label: '毛利',
-                    prop: 'grossProfit',
-                    overHidden: true,
-                    width: 100,
-                    disabled: true,
-                    editDisplay: false,
-                    addDisplay: false
-                },
+                // },
+                // {
+                //     label: '毛利',
+                //     prop: 'grossProfit',
+                //     overHidden: true,
+                //     width: 100,
+                //     disabled: true,
+                //     editDisplay: false,
+                //     addDisplay: false
+                // },
                 {
                     label: '备注',
                     prop: "remarks",

+ 4 - 4
src/views/tirePartsMall/salesManagement/purchaseOrder/index.vue

@@ -3,8 +3,8 @@
     <basic-container v-show="!detailsOpen">
       <avue-crud :option="option" :search.sync="search" v-model="form" :table-loading="loading" :data="dataList"
         ref="crud" :key="key" @on-load="onLoad" @search-change="searchChange" @row-del="rowDel"
-        @refresh-change="refreshChange" @resetColumn="resetColumnTwo('crud', 'option', 'optionList', 269)"
-        @saveColumn="saveColumnTwo('crud', 'option', 'optionList', 269)" :page.sync="page">
+        @refresh-change="refreshChange" @resetColumn="resetColumnTwo('crud', 'option', 'optionList', 274.4)"
+        @saveColumn="saveColumnTwo('crud', 'option', 'optionList', 274.4)" :page.sync="page">
         <template slot-scope="{type,size,row,index}" slot="menu">
           <!-- <el-button :size="size" :type="type" @click="check(row)">查看</el-button> -->
           <el-button :size="size" :type="type" :disabled="row.status != '录入' && row.status != '待确认' && row.item>=1 || row.businessSource == '外部销售' || row.numberRows>=1" @click="$refs.crud.rowDel(row, index)">删除</el-button>
@@ -227,7 +227,7 @@ export default {
     }, 100);
   },
   async created() {
-    this.option = await this.getColumnData(this.getColumnName(269), this.optionList);
+    this.option = await this.getColumnData(this.getColumnName(274.4), this.optionList);
     this.key++
     let i = 0;
     this.option.column.forEach(item => {
@@ -263,7 +263,7 @@ export default {
     },
     //刷新
     refreshChange() {
-      this.onLoad(this.page, this.search)
+    this.onLoad(this.page, this.search)
     },
     rowDel(form, index) {
       this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {