Просмотр исходного кода

销售/采购/合同流程新增折后单价和折后合计

Z 2 лет назад
Родитель
Сommit
90b84e985b
24 измененных файлов с 1056 добавлено и 651 удалено
  1. 2 1
      src/views/contractManage/contractBook/components/addDialog.vue
  2. 86 9
      src/views/contractManage/contractBook/components/inventoryTable.vue
  3. 16 1
      src/views/contractManage/contractBook/components/inventoryTabledetail.vue
  4. 356 0
      src/views/financialManage/components/feeRelatedInfoTable.vue
  5. 5 219
      src/views/financialManage/feeManage/feeApplication/addOrEditDialog.vue
  6. 15 1
      src/views/purchasingManage/purchaseOrder/accountstatement/components/inventoryTable.vue
  7. 8 8
      src/views/purchasingManage/purchaseOrder/accountstatement/components/purchaseForm.vue
  8. 0 1
      src/views/purchasingManage/purchaseOrder/components/addDialog.vue
  9. 16 1
      src/views/purchasingManage/purchaseOrder/components/detailDialog.vue
  10. 13 0
      src/views/purchasingManage/purchaseOrder/components/inventoryTable.vue
  11. 1 1
      src/views/purchasingManage/purchaseOrder/index.vue
  12. 12 0
      src/views/purchasingManage/purchaseOrder/invoice/components/detailDialog.vue
  13. 17 0
      src/views/purchasingManage/purchaseOrder/invoice/components/inventoryTable.vue
  14. 2 5
      src/views/purchasingManage/purchaseOrder/returnGoods/components/addReturnGoodsDialog.vue
  15. 12 0
      src/views/purchasingManage/purchaseOrder/returnGoods/components/detailDialog.vue
  16. 408 380
      src/views/purchasingManage/purchaseOrder/returnGoods/components/inventoryTable.vue
  17. 15 1
      src/views/saleManage/saleOrder/accountstatement/components/inventoryTable.vue
  18. 8 8
      src/views/saleManage/saleOrder/accountstatement/components/saleForm.vue
  19. 1 1
      src/views/saleManage/saleOrder/accountstatement/index.vue
  20. 16 10
      src/views/saleManage/saleOrder/components/addDialog.vue
  21. 12 0
      src/views/saleManage/saleOrder/invoice/components/inventoryTable.vue
  22. 1 1
      src/views/saleManage/saleOrder/returnGoods/components/addReturnGoodsDialog.vue
  23. 12 0
      src/views/saleManage/saleOrder/returnGoods/components/detailDialog.vue
  24. 22 3
      src/views/saleManage/saleOrder/returnGoods/components/inventoryTable.vue

+ 2 - 1
src/views/contractManage/contractBook/components/addDialog.vue

@@ -510,7 +510,7 @@ export default {
       contractFile: [],
       contractName: '',
       contractNumber: '',
-      contractStartDate: '',
+      contractStartDate:'',
       opportunityId: '',
       categoryName: '',
       categoryId: '',
@@ -916,6 +916,7 @@ export default {
         this.isUpdate = false;
         userInfo.id = userInfo.userId;
         this.changePersonel();
+        this.form.contractStartDate = new Date()
         if (row?.contractVO?.type) {
           this.dictChange(row.contractVO.type, 'init');
         }

+ 86 - 9
src/views/contractManage/contractBook/components/inventoryTable.vue

@@ -37,10 +37,15 @@
               }"
             >
               <el-input
+                type="number"
+                :min="0"
+                :max="allPrice"
+                :disabled="!allPrice"
                 v-model="form.discountTotalPrice"
-                style="width: 150px"
+                style="width: 180px"
                 placeholder="请输入"
                 @input="discountInput"
+                @blur="discountInputByOrder(form.discountTotalPrice)"
               >
                 <template slot="append">元</template>
               </el-input
@@ -318,7 +323,8 @@
               :underline="false"
               @click="downloadFile(link)"
             >
-              {{ link.name }}</el-link
+              {{ link.name }}
+            </el-link
             >
           </div>
         </el-form-item>
@@ -343,7 +349,8 @@
               :underline="false"
               @click="downloadFile(link)"
             >
-              {{ link.name }}</el-link
+              {{ link.name }}
+            </el-link
             >
           </div>
         </el-form-item>
@@ -373,7 +380,8 @@
               :underline="false"
               @click="downloadFile(link)"
             >
-              {{ link.name }}</el-link
+              {{ link.name }}
+            </el-link
             >
           </div>
         </el-form-item>
@@ -398,7 +406,8 @@
               :underline="false"
               @click="downloadFile(link)"
             >
-              {{ link.name }}</el-link
+              {{ link.name }}
+            </el-link
             >
           </div>
         </el-form-item>
@@ -644,6 +653,11 @@ export default {
           slot: 'singlePrice',
           headerSlot: 'headerSinglePrice'
         },
+        {
+          width: 160,
+          prop: 'discountSinglePrice',
+          label: '折让单价',
+        },
         {
           width: 120,
           prop: 'totalCount',
@@ -663,6 +677,11 @@ export default {
           label: '合计',
           slot: 'totalPrice'
         },
+        {
+          width: 160,
+          prop: 'discountTotalPrice',
+          label: '折让合计',
+        },
         {
           width: 120,
           prop: 'singleWeight',
@@ -812,7 +831,7 @@ export default {
 
   methods: {
     downloadFile(file) {
-      getFile({ objectName: file.storePath }, file.name);
+      getFile({objectName: file.storePath}, file.name);
     },
     openVersion(index) {
       this.$refs.versionRefs.open(index);
@@ -915,13 +934,14 @@ export default {
     //计算总金额
     getTotalPrice(row) {
       this.singleWeightChange(row);
-
       if (this.form.datasource.length) {
         let datasource = this.form.datasource,
           sum = 0;
         datasource.forEach((r) => {
+          r.discountSinglePrice = r.singlePrice
           if (r.singlePrice && r.totalCount) {
             sum += r.singlePrice * r.totalCount;
+            r.discountTotalPrice = r.discountSinglePrice * r.totalCount
           }
         });
         let allsum = sum.toFixed(2);
@@ -929,10 +949,12 @@ export default {
         this.form.discountTotalPrice = allsum;
         this.$store.commit('concact/setDiscountAmount', allsum);
         this.$store.commit('order/setAllcountAmount', allsum);
+        this.$emit('orderDiscountAmount', this.allPrice)
         return allsum;
       } else {
         this.allPrice = 0.0;
         this.form.discountTotalPrice = 0.0;
+        this.$emit('orderDiscountAmount', 0)
         return 0.0;
       }
     },
@@ -940,6 +962,32 @@ export default {
     discountInput(val) {
       this.$store.commit('concact/setDiscountAmount', val);
     },
+
+    //设置优惠总金额修改产品单价
+    discountInputByOrder(val) {
+      //获取优惠金额和总计的差价
+      let diffPrice = this.allPrice - val
+      this.form.datasource.forEach((item) => {
+        if(val===0){
+          item.discountTotalPrice = 0
+          item.discountSinglePrice = 0
+          return
+        }
+        if(!val){
+          item.discountTotalPrice = item.totalPrice
+          item.discountSinglePrice = item.singlePrice
+          return
+        }
+        //获取详情每条的小计
+        let totalPrice = item.totalCount * item.singlePrice
+        // 使用小计除以总价得出该条数据小计占比 在乘以差价或的该条数据应承担的差价 在小计-应承担差价获得折让后的小计
+        item.discountTotalPrice = (totalPrice - totalPrice / this.allPrice * diffPrice).toFixed(2)
+        //使用折让后的小计除以数量得到单价
+        item.discountSinglePrice = (item.discountTotalPrice / item.totalCount).toFixed(2)
+      })
+      this.$refs.table.reload()
+      this.$store.commit('concact/setDiscountAmount', val);
+    },
     //修改回显
     putTableValue(data) {
       let productList =
@@ -964,9 +1012,38 @@ export default {
         });
         this.form.datasource = productList;
         this.allPrice = data?.contractVO?.totalPrice;
-        this.getTotalPrice();
+       // this.getTotalPrice();
         this.form.discountTotalPrice = data?.contractVO?.discountTotalPrice;
-        this.discountInput(data?.contractVO?.discountTotalPrice);
+
+       // this.discountInput(data?.contractVO?.discountTotalPrice);
+      }
+    },
+    //修改订单未选择合同时回显
+    putTableValueByOrder(row) {
+      let data = {...row}
+      let productList =
+        (data && data.productList) || [];
+      if (productList) {
+        productList.forEach((item) => {
+          item.guaranteePeriodUnitCode = item.guaranteePeriodUnitCode ? item.guaranteePeriodUnitCode + '' : '';
+          // if (item.deliveryDays) {
+          //   item['deliveryDeadline'] =
+          //     item['deliveryDeadline'] || this.setDay(item.deliveryDays);
+          // }
+          let guaranteePeriodUnitName = this.guaranteePeriodUnit(
+            item.guaranteePeriodUnitCode
+          );
+          if (item.guaranteePeriod && item.guaranteePeriodUnitCode) {
+            item['guaranteePeriodDeadline'] =
+              item['guaranteePeriodDeadline'] ||
+              guaranteePeriodUnitName != 'second'
+                ? this.setDay(item.guaranteePeriod, guaranteePeriodUnitName)
+                : '';
+          }
+        });
+        this.form.datasource = productList;
+        this.allPrice = data.totalAmount;
+        this.form.discountTotalPrice = data.payAmount;
       }
     },
     //计算单重

+ 16 - 1
src/views/contractManage/contractBook/components/inventoryTabledetail.vue

@@ -165,7 +165,12 @@
             slot: 'singlePrice',
             show:this.isSinglePrice
           },
-
+          {
+            width: 160,
+            prop: 'discountSinglePrice',
+            label: '折让单价',
+            show:this.isSinglePrice
+          },
           {
             width: 120,
             prop: 'totalCount',
@@ -187,6 +192,16 @@
               return _row.totalPrice?_row.totalPrice + '元':'';
             }
           },
+          {
+            width: 120,
+            prop: 'discountTotalPrice',
+            label: '折让合计',
+            slot: 'discountTotalPrice',
+            formatter: (_row, _column, cellValue) => {
+              return _row.discountTotalPrice?_row.discountTotalPrice + '元':'';
+            }
+          },
+
           {
             width: 120,
             prop: 'singleWeight',

+ 356 - 0
src/views/financialManage/components/feeRelatedInfoTable.vue

@@ -0,0 +1,356 @@
+<template>
+  <div>
+    <el-form ref="form" :model="form">
+
+      <!-- 数据表格 -->
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="form.datasource"
+        :needPage="false"
+        :toolkit="[]"
+        :minHeight="100"
+        tool-class="ele-toolbar-form"
+        cache-key="eomContactPageTable"
+      >
+        <!-- 表头工具栏 -->
+        <template v-slot:toolbar>
+          <el-button
+            size="small"
+            type="primary"
+            icon="el-icon-plus"
+            class="ele-btn-icon"
+            @click="handleAddInfo"
+          >
+            新增关联信息
+          </el-button>
+        </template>
+
+        <template v-slot:action="{row,$index}">
+          <el-popconfirm
+            class="ele-action"
+            title="确定要删除此信息吗?"
+            @confirm="handleDelInfo($index)"
+          >
+            <template v-slot:reference>
+              <el-link
+                type="danger"
+                :underline="false"
+                icon="el-icon-delete"
+              >
+                删除
+              </el-link>
+            </template>
+          </el-popconfirm>
+        </template>
+        <template v-slot:linkType="{row,$index}">
+          <el-form-item>
+            <DictSelection clearable dictName="关联类型" v-model="row.linkType"
+                           @itemChange="(val)=>handleChangeFinLink(val,row)"></DictSelection>
+          </el-form-item>
+        </template>
+        <template v-slot:linkName="{row,$index}">
+          <!--         客户   -->
+          <el-form-item v-if="row.linkType==100" :prop="'datasource.'+$index+'.linkName'"
+                        :rules="{required:true,message:'请选择客户',trigger:['blur','change']}">
+            <el-input v-model="row.linkName" @click.native="(val)=>handleSelectData(val,row,$index)"
+                      clearable></el-input>
+          </el-form-item>
+          <!--        商机   -->
+          <el-form-item v-else-if="row.linkType==120" :prop="'datasource.'+$index+'.linkName'"
+                        :rules="{required:true,message:'请选择商机',trigger:['blur','change']}">
+            <el-input v-model="row.linkName" @click.native="(val)=>handleSelectData(val,row,$index)"
+                      clearable></el-input>
+          </el-form-item>
+          <!--        销售合同   -->
+          <el-form-item v-else-if="row.linkType==130" :prop="'datasource.'+$index+'.linkName'"
+                        :rules="{required:true,message:'请选择销售合同',trigger:['blur','change']}">
+            <el-input v-model="row.linkName" @click.native="(val)=>handleSelectData(val,row,$index)"
+                      clearable></el-input>
+          </el-form-item>
+          <!--        销售订单   -->
+          <el-form-item v-else-if="row.linkType==140" :prop="'datasource.'+$index+'.linkName'"
+                        :rules="{required:true,message:'请选择销售订单',trigger:['blur','change']}">
+            <el-input v-model="row.linkName" @click.native="(val)=>handleSelectData(val,row,$index)"
+                      clearable></el-input>
+          </el-form-item>
+          <!--        销售对账单   -->
+          <el-form-item v-else-if="row.linkType==190" :prop="'datasource.'+$index+'.linkName'"
+                        :rules="{required:true,trigger:['blur','change']}">
+
+          </el-form-item>
+          <!--        供应商   -->
+          <el-form-item v-else-if="row.linkType==210" :prop="'datasource.'+$index+'.linkName'"
+                        :rules="{required:true,message:'请选择供应商',trigger:['blur','change']}">
+            <el-input v-model="row.linkName" @click.native="(val)=>handleSelectData(val,row,$index)"
+                      clearable></el-input>
+          </el-form-item>
+          <!--        采购计划   -->
+          <el-form-item v-else-if="row.linkType==230" :prop="'datasource.'+$index+'.linkName'"
+                        :rules="{required:true,trigger:['blur','change']}">
+          </el-form-item>
+          <!--        采购合同   -->
+          <el-form-item v-else-if="row.linkType==250" :prop="'datasource.'+$index+'.linkName'"
+                        :rules="{required:true,trigger:['blur','change']}">
+            <el-input v-model="row.linkName" @click.native="(val)=>handleSelectData(val,row,$index)"
+                      clearable></el-input>
+          </el-form-item>
+          <!--        采购订单   -->
+          <el-form-item v-else-if="row.linkType==260" :prop="'datasource.'+$index+'.linkName'"
+                        :rules="{required:true,message:'请选择采购订单',trigger:['blur','change']}">
+            <el-input v-model="row.linkName" @click.native="(val)=>handleSelectData(val,row,$index)"
+                      clearable></el-input>
+          </el-form-item>
+
+          <!--        采购对账单   -->
+          <el-form-item v-else-if="row.linkType==290" :prop="'datasource.'+$index+'.linkName'"
+                        :rules="{required:true,trigger:['blur','change']}">
+
+          </el-form-item>
+          <!--        项目   -->
+          <el-form-item v-else-if="row.linkType==900" :prop="'datasource.'+$index+'.linkName'"
+                        :rules="{required:true,trigger:['blur','change']}">
+
+          </el-form-item>
+
+
+        </template>
+
+        <template v-slot:headerGLLXMC="{column}">
+          <span class="is-required">{{ column.label }}</span>
+        </template>
+      </ele-pro-table>
+    </el-form>
+    <!--选择客户/供应商-->
+    <customer-list-dialog v-if="customerListDialogFlag" :customerListDialogFlag.sync="customerListDialogFlag"
+                          ref="customerListDialogRef" @changeParent="getCustomerData"></customer-list-dialog>
+    <!--选择合同-->
+    <contract-list-dialog v-if="contractListDialogFlag" :contractListDialogFlag.sync="contractListDialogFlag"
+                          ref="contractListDialogRef" @changeParent="getContractData"
+                          :type="contractType"></contract-list-dialog>
+    <!--选择销售订单-->
+    <sale-order-list-dialog ref="saleOrderListDialogRef" @changeParent="getOrderData"></sale-order-list-dialog>
+    <!--选择采购订单-->
+    <purchase-order-list-dialog ref="purchaseOrderListDialogRef"
+                                @changeParent="getOrderData"></purchase-order-list-dialog>
+  </div>
+</template>
+
+
+<script>
+
+import contractListDialog from "@/views/financialManage/feeManage/feeApplication/contractListDialog.vue";
+import customerListDialog from "@/views/financialManage/feeManage/feeApplication/customerListDialog.vue";
+import saleOrderListDialog from "@/views/saleManage/saleOrder/invoice/components/orderListDialog.vue";
+import purchaseOrderListDialog from "@/views/purchasingManage/purchaseOrder/invoice/components/orderListDialog.vue";
+import {getTableList} from "@/api/saleManage/businessOpportunity";
+import {listOrganizations} from "@/api/system/organization";
+
+export default {
+  name: "relatedInfoTable",
+  components: {purchaseOrderListDialog, saleOrderListDialog, customerListDialog, contractListDialog},
+  data() {
+    return {
+      editIndex: undefined,//当前修改数据的下标
+      contractType: undefined,//选择关联类型为合同时区分销售合同和采购合同
+      contractListDialogFlag: false,
+      customerListDialogFlag: false,
+      form: {
+        datasource: []
+      },
+      columns: [
+        {
+          columnKey: 'index',
+          label: '序号',
+          type: 'index',
+          width: 55,
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'left'
+        },
+        {
+          columnKey: 'action',
+          slot: 'action',
+          label: '操作',
+          resizable: false,
+          width: 80,
+          align: 'center',
+          showOverflowTooltip: true,
+          fixed: 'right'
+        },
+        {
+          prop: 'linkType',
+          label: '关联类型',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 120,
+          slot: 'linkType',
+        },
+        {
+          prop: 'linkName',
+          label: '关联类型名称',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 130,
+          slot: 'linkName',
+          headerSlot: 'headerGLLXMC'
+        },
+      ]
+    }
+  },
+  methods: {
+    //新增关联信息数据
+    handleAddInfo() {
+      this.form.datasource.push(
+        {
+          linkType: '',
+          linkTypeName: '',
+          linkId: '',
+          linkName: '',
+          linkCode: '',
+        }
+      )
+    },
+    //
+    handleSelectData(val, row, index) {
+      this.editIndex = index
+      if (val.target.nodeName == 'I') {
+        row.linkId = ''
+        row.linkName = ''
+        row.linkCode = ''
+        return
+      }
+      switch (row.linkType) {
+        case '100': //客户
+          this.handleSelectContact(row);
+          break;
+        case '120': //商机
+          this.handleSelectContact(row);
+          break
+        case '130': //销售合同
+          this.contractType = 1
+          this.handleSelectContract(row);
+          break
+        case '140': //销售订单
+          this.handleSelectSaleOrder(row);
+          break;
+        case '210': //供应商
+          this.handleSelectContact(row);
+          break
+        case '250': //采购合同
+          this.contractType = 2
+          this.handleSelectContract(row);
+          break;
+        case '260': //采购订单
+          this.handleSelectPurchaseOrder(row);
+          break;
+
+
+      }
+
+
+      // // 客户/供应商
+      // if (['100', '210'].includes(row.linkType)) {
+      //   this.handleSelectContact(row)
+      // }else if(['130', '250'].includes(row.linkType)){
+      //   handleSelectContract
+      // }
+
+    },
+    setSelectData(val) {
+      this.$set(this.form.datasource[this.editIndex], 'linkId', val.id)
+      this.$set(this.form.datasource[this.editIndex], 'linkName', val.name)
+      this.$set(this.form.datasource[this.editIndex], 'linkCode', val.code)
+    },
+    //新增关联信息数据
+    handleDelInfo(index) {
+      this.form.datasource.splice(index, 1)
+    },
+    //修改关联类型
+    handleChangeFinLink(val, row) {
+      if (!val.dictValue) return
+      row.linkTypeName = val.dictValue || ''
+
+      if (val.dictCode == 3) {
+        this.getOpportunityList()
+      }
+
+    },
+
+    //选择客户或者供应商
+    handleSelectContact(row) {
+      this.customerListDialogFlag = true
+      let params = {
+        id: row.contactId,
+        assetTreeId: row.linkType == 210 ? '19' : '17',
+        classType: row.linkType == 210 ? 2 : 1,
+        titleName: row.linkType == 210 ? '选择供应商' : '选择客户',
+      }
+      this.$nextTick(() => {
+        this.$refs.customerListDialogRef.init(params)
+      })
+    },
+    //获取选择 供应商/客户 数据
+    getCustomerData(params) {
+      this.setSelectData(params)
+    },
+    //获取客户的商机列表
+    async getOpportunityList() {
+      const data = await getTableList({
+        pageNum: 1,
+        size: 999,
+        approvalStatus: 2
+      });
+      //  contactName: name,
+      this.opportunityList = data.list;
+    },
+    //获取选择的商机数据
+    handleSelectOpportunity(val) {
+      if (!val) return this.form.opportunityName = ''
+      this.form.opportunityName = this.opportunityList.find(item => item.id == val)?.name
+    },
+    //选择人员数据
+    changeUserInfo(val, info) {
+      this.form.applyUserName = info.name;
+    },
+    //选择合同
+    handleSelectContract(val) {
+      this.contractListDialogFlag = true
+      this.$nextTick(() => {
+        this.$refs.contractListDialogRef.init()
+      })
+    },
+    //获取合同数据
+    getContractData(params) {
+      let row = {
+        id: params.id,
+        name: params.contractName,
+        code: params.contractNo
+      }
+      this.setSelectData(row)
+    },
+    //选择销售订单
+    handleSelectSaleOrder(val) {
+      this.$refs.saleOrderListDialogRef.open();
+    },
+    //选择采购订单
+    handleSelectPurchaseOrder(val) {
+      this.$refs.purchaseOrderListDialogRef.open();
+    },
+    //获取采购/销售订单数据
+    getOrderData(params) {
+      let row = {
+        id: params.id,
+        name: params.orderNo,
+        code: params.orderNo
+      }
+      this.setSelectData(row)
+    },
+  }
+}
+</script>
+
+
+<style scoped lang="scss">
+
+</style>

+ 5 - 219
src/views/financialManage/feeManage/feeApplication/addOrEditDialog.vue

@@ -75,84 +75,6 @@
           </el-form-item>
         </el-col>
       </el-row>
-      <el-row :gutter="12">
-        <el-col :span="12">
-          <el-form-item
-            label="关联类型"
-            style="margin-bottom: 22px">
-            <DictSelection clearable dictName="关联类型" v-model="form.finLinkType"
-                           @itemChange="handleChangeFinLink"></DictSelection>
-          </el-form-item>
-        </el-col>
-      </el-row>
-      <el-row v-if="form.finLinkType==1">
-        <el-col :span="12">
-          <el-form-item
-            label="客户名称"
-            prop="contactName"
-            style="margin-bottom: 22px">
-            <el-input v-model="form.contactName" @click.native="handleSelectContact" clearable></el-input>
-          </el-form-item>
-        </el-col>
-      </el-row>
-      <el-row v-if="form.finLinkType==2">
-        <el-col :span="12">
-          <el-form-item
-            label="供应商名称"
-            prop="contactName"
-            style="margin-bottom: 22px">
-            <el-input v-model="form.contactName" @click.native="handleSelectContact" clearable></el-input>
-          </el-form-item>
-        </el-col>
-      </el-row>
-      <el-row v-if="form.finLinkType==3">
-        <el-col :span="12">
-          <el-form-item
-            label="商机名称"
-            style="margin-bottom: 22px">
-            <el-select
-              v-model="form.opportunityId"
-              style="width: 100%"
-              @change="handleSelectOpportunity">
-              <el-option
-                v-for="item in opportunityList"
-                :key="item.id"
-                :label="item.name"
-                :value="item.id"
-              >
-              </el-option>
-            </el-select>
-          </el-form-item>
-        </el-col>
-      </el-row>
-      <el-row v-if="form.finLinkType==4">
-        <el-col :span="12">
-          <el-form-item
-            label="选择合同"
-            style="margin-bottom: 22px">
-            <el-input v-model="form.contractName" @click.native="handleSelectContract" clearable></el-input>
-          </el-form-item>
-        </el-col>
-      </el-row>
-      <el-row v-if="form.finLinkType==5">
-      </el-row>
-      <el-row v-if="form.finLinkType==6">
-        <el-col :span="12">
-          <el-form-item
-            label="销售订单"
-            style="margin-bottom: 22px">
-            <el-input v-model="form.saleOrderCode" @click.native="handleSelectSaleOrder" clearable></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="12">
-          <el-form-item
-            label="采购订单"
-            style="margin-bottom: 22px">
-            <el-input v-model="form.purchaseOrderCode" @click.native="handleSelectPurchaseOrder" clearable></el-input>
-          </el-form-item>
-        </el-col>
-      </el-row>
-
       <!--        <el-col :span="12">-->
       <!--          <el-form-item-->
       <!--            label="会计科目"-->
@@ -195,35 +117,21 @@
           </el-form-item>
         </el-col>
       </el-row>
-
-
     </el-form>
+    <headerTitle title="关联信息"></headerTitle>
+    <fee-related-info-table></fee-related-info-table>
     <div slot="footer">
       <el-button type="primary" @click="handleSave(0)">保存</el-button>
       <el-button type="primary" @click="handleSave(1)">提交</el-button>
       <el-button @click="cancel">返回</el-button>
     </div>
-    <!--选择客户/供应商-->
-    <customer-list-dialog v-if="customerListDialogFlag" :customerListDialogFlag.sync="customerListDialogFlag"
-                          ref="customerListDialogRef" @changeParent="getCustomerData"></customer-list-dialog>
-    <!--选择合同-->
-    <contract-list-dialog v-if="contractListDialogFlag" :contractListDialogFlag.sync="contractListDialogFlag"
-                          ref="contractListDialogRef" @changeParent="getContractData"></contract-list-dialog>
-    <!--选择销售订单-->
-    <sale-order-list-dialog ref="saleOrderListDialogRef" @changeParent="getSaleOrderData"></sale-order-list-dialog>
-    <!--选择采购订单-->
-    <purchase-order-list-dialog ref="purchaseOrderListDialogRef"
-                                @changeParent="getPurchaseOrderData"></purchase-order-list-dialog>
+
   </ele-modal>
 </template>
 <script>
 import personSelect from "@/components/CommomSelect/person-select.vue";
 import {listOrganizations} from "@/api/system/organization";
 import {mapGetters} from "vuex";
-import customerListDialog from "./customerListDialog.vue";
-import contractListDialog from './contractListDialog.vue'
-import saleOrderListDialog from "@/views/saleManage/saleOrder/invoice/components/orderListDialog.vue";
-import purchaseOrderListDialog from "@/views/purchasingManage/purchaseOrder/invoice/components/orderListDialog.vue";
 import fileUpload from "@/components/upload/fileUpload.vue";
 import {
   feeApplySaveAPI,
@@ -233,16 +141,13 @@ import {
 } from "@/api/financialManage/fee-manage/fee-application";
 import {getTreeByPid} from "@/api/classifyManage";
 import {getTableList} from '@/api/saleManage/businessOpportunity';
-
+import feeRelatedInfoTable from "@/views/financialManage/components/feeRelatedInfoTable.vue";
 export default {
   name: "add-or-edit-dialog",
   components: {
     fileUpload,
-    purchaseOrderListDialog,
-    saleOrderListDialog,
     personSelect,
-    customerListDialog,
-    contractListDialog
+    feeRelatedInfoTable
   },
   props: {
     addOrEditDialogFlag: {
@@ -255,8 +160,6 @@ export default {
   },
   data() {
     return {
-      contractListDialogFlag: false,
-      customerListDialogFlag: false,
       dialogType: '',
       title: '',
       form: {
@@ -330,32 +233,7 @@ export default {
       this.form = await getFeeApplyInfoAPI(id)
     },
 
-    //修改关联类型
-    handleChangeFinLink(val) {
-      this.form = Object.assign(this.form, {
-        accountingSubjectId: '',
-        accountingSubjectName: "",
-        contactId: '',
-        contactName: "",
-        contractCode: "",
-        contractId: '',
-        contractName: "",
-        opportunityId: '',
-        opportunityName: "",
-        projectId: '',
-        projectName: "",
-        purchaseOrderCode: "",
-        purchaseOrderId: '',
-        saleOrderCode: "",
-        saleOrderId: ''
-      })
-      if (!val.dictValue) return
-      this.form.finLinkTypeName = val.dictValue || ''
-      if (val.dictCode == 3) {
-        this.getOpportunityList()
-      }
 
-    },
     //获取分类管理中的数据
     async getClassifyList(id, listName) {
       let res = await getTreeByPid(id)
@@ -377,48 +255,6 @@ export default {
       let data = this.$refs.treeSelect?.$refs?.tree?.getCurrentNode() || {}
       this.form.accountingSubjectName = data.name
     },
-
-    //选择客户或者供应商
-    handleSelectContact(val) {
-      if (val.target.nodeName == 'I') {
-        this.form.contactId = ''
-        this.form.contactName = ''
-        this.form.opportunityId = ''
-        this.form.opportunityName = ''
-        this.opportunityList = []
-        return
-      }
-      this.customerListDialogFlag = true
-      let params = {
-        id: this.form.contactId,
-        assetTreeId: this.form.finLinkType == 2 ? '19' : '17',
-        classType: this.form.finLinkType || 1,
-        titleName: this.form.finLinkType == 2 ? '选择供应商' : '选择客户',
-      }
-      this.$nextTick(() => {
-        this.$refs.customerListDialogRef.init(params)
-      })
-    },
-    //获取选择 供应商/客户 数据
-    getCustomerData(params) {
-      this.form.contactId = params.id
-      this.form.contactName = params.name
-    },
-    //获取客户的商机列表
-    async getOpportunityList() {
-      const data = await getTableList({
-        pageNum: 1,
-        size: 999,
-        approvalStatus: 2
-      });
-      //  contactName: name,
-      this.opportunityList = data.list;
-    },
-    //获取选择的商机数据
-    handleSelectOpportunity(val) {
-      if (!val) return this.form.opportunityName = ''
-      this.form.opportunityName = this.opportunityList.find(item => item.id == val)?.name
-    },
     // 获取部门数据
     getDeptList() {
       listOrganizations().then((list) => {
@@ -448,56 +284,6 @@ export default {
     changeUserInfo(val, info) {
       this.form.applyUserName = info.name;
     },
-    //选择合同
-    handleSelectContract(val) {
-      if (val.target.nodeName == 'I') {
-        this.form.contractId = ''
-        this.form.contractName = ''
-        return
-      }
-      this.contractListDialogFlag = true
-      this.$nextTick(() => {
-        this.$refs.contractListDialogRef.init()
-      })
-    },
-    //获取合同数据
-    getContractData(params) {
-      this.form.contractId = params.type == 1 ? params.partaId : params.partbName
-      this.form.contractName = params.type == 1 ? params.partaName : params.partbName
-    },
-    //选择销售订单
-    handleSelectSaleOrder(val) {
-      if (val.target.nodeName == 'I') {
-        this.form.saleOrderId = ''
-        this.form.saleOrderCode = ''
-        return
-      }
-      this.$refs.saleOrderListDialogRef.open();
-    },
-    //获取销售订单数据
-    getSaleOrderData(obj) {
-      this.form = Object.assign({}, this.form, {
-        saleOrderId: obj.id,
-        saleOrderCode: obj.orderNo
-      });
-    },
-    //选择采购订单
-    handleSelectPurchaseOrder(val) {
-      if (val.target.nodeName == 'I') {
-        this.form.purchaseOrderId = ''
-        this.form.purchaseOrderCode = ''
-        return
-      }
-      this.$refs.purchaseOrderListDialogRef.open();
-    },
-    //获取采购订单数据
-    getPurchaseOrderData(obj) {
-      this.form = Object.assign({}, this.form, {
-        purchaseOrderId: obj.id,
-        purchaseOrderCode: obj.orderNo
-      });
-    },
-
     //
     handleSave(flag) {
       this.$refs.form.validate(async valid => {

+ 15 - 1
src/views/purchasingManage/purchaseOrder/accountstatement/components/inventoryTable.vue

@@ -111,6 +111,13 @@ export default {
           align: 'center',
           slot: 'singlePrice'
         },
+        {
+          minWidth: 100,
+          prop: 'discountSinglePrice',
+          label: '折后单价',
+          align: 'center',
+          slot: 'discountSinglePrice'
+        },
         {
           minWidth: 130,
           prop: 'contractTotalPrice',
@@ -140,6 +147,13 @@ export default {
           align: 'center',
           slot: 'totalPrice'
         },
+        {
+          minWidth: 130,
+          prop: 'discountTotalPrice',
+          label: '折后已收货金额',
+          align: 'center',
+          slot: 'discountTotalPrice'
+        },
       ]
       let permissionType = {
         // 'add': [
@@ -310,7 +324,7 @@ export default {
     getSummaries(param) {
       const {columns, data} = param;
       const sums = [];
-      let fields = ['totalPrice', 'paidPrice', 'notPaidPrice', 'invoicedPrice', 'notInvoicedPrice']
+      let fields = ['totalPrice', 'paidPrice', 'notPaidPrice', 'invoicedPrice', 'notInvoicedPrice','discountTotalPrice']
       columns.forEach((column, index) => {
         if (index === 0) {
           sums[index] = '合计';

+ 8 - 8
src/views/purchasingManage/purchaseOrder/accountstatement/components/purchaseForm.vue

@@ -13,13 +13,13 @@ export default {
     return {
       monthByDays: {},
       quarterList: {
-        '一季度': ['-01-01 00:00:00', '-03-31 12:59:59'],
-        '二季度': ['-04-01 00:00:00', '-06-30 12:59:59'],
-        '三季度': ['-07-01 00:00:00', '-09-30 12:59:59'],
-        '四季度': ['-10-01 00:00:00', '-12-31 12:59:59'],
+        '一季度': ['-01-01 00:00:00', '-03-31 23:59:59'],
+        '二季度': ['-04-01 00:00:00', '-06-30 23:59:59'],
+        '三季度': ['-07-01 00:00:00', '-09-30 23:59:59'],
+        '四季度': ['-10-01 00:00:00', '-12-31 23:59:59'],
       },
       startTime: '-01-01 00:00:00',
-      endTime: '12:59:59',
+      endTime: '23:59:59',
       rules: {
         fromType: {required: true, message: '请选择', trigger: 'change'},
         contactId: {required: true, message: '请选择', trigger: 'change'},
@@ -42,7 +42,7 @@ export default {
         case 1:
           this.dataForm.dateValue = this.dataForm.year
           this.dataForm.startDate = this.dataForm.year + this.startTime
-          this.dataForm.endDate = this.dataForm.year + '-12-31 12:59:59'
+          this.dataForm.endDate = this.dataForm.year + '-12-31 23:59:59'
           break;
         case 2:
           this.dataForm.dateValue = this.dataForm.year + '年-' + this.dataForm.quarter
@@ -54,12 +54,12 @@ export default {
           this.dataForm.startDate = this.dataForm.month + '-01 00:00:00'
           let data = this.dataForm.month.split('-')
           let days = new Date(data[0], data[1], 0).getDate()
-          this.dataForm.endDate = this.dataForm.month + '-' + days + ' 12:59:59'
+          this.dataForm.endDate = this.dataForm.month + '-' + days + ' 23:59:59'
           break
         default:
           this.dataForm.dateValue = ''
           this.dataForm.startDate = this.dataForm.dateTimeRange[0] + ' 00:00:00'
-          this.dataForm.endDate = this.dataForm.dateTimeRange[1] +  ' 12:59:59'
+          this.dataForm.endDate = this.dataForm.dateTimeRange[1] +  ' 23:59:59'
       }
       this.$refs.form.validate(validate => {
         if (!validate) return

+ 0 - 1
src/views/purchasingManage/purchaseOrder/components/addDialog.vue

@@ -961,7 +961,6 @@ export default {
     },
     sub(res) {
       submit({
-        sourceType:this.form.sourceType,
         businessId: this.businessId || res
       }).then((res) => {
         this.cancel();

+ 16 - 1
src/views/purchasingManage/purchaseOrder/components/detailDialog.vue

@@ -463,15 +463,30 @@
             label: '单价',
             slot: 'singlePrice'
           },
+          {
+            width: 160,
+            prop: 'discountSinglePrice',
+            label: '折后单价',
+            slot: 'discountSinglePrice'
+          },
           {
             width: 120,
             prop: 'totalPrice',
-            label: '销售总金额',
+            label: '合计',
             slot: 'totalPrice',
             formatter: (_row, _column, cellValue) => {
               return _row.totalPrice + '元';
             }
           },
+          {
+            width: 120,
+            prop: 'discountTotalPrice',
+            label: '折后合计',
+            slot: 'discountTotalPrice',
+            formatter: (_row, _column, cellValue) => {
+              return _row.discountTotalPrice + '元';
+            }
+          },
 
           {
             width: 120,

+ 13 - 0
src/views/purchasingManage/purchaseOrder/components/inventoryTable.vue

@@ -467,6 +467,13 @@ export default {
           slot: 'singlePrice',
           headerSlot: 'headerSinglePrice'
 
+        },
+        {
+          width: 160,
+          prop: 'discountSinglePrice',
+          label: '折后单价',
+          slot: 'discountSinglePrice',
+
         },
         {
           width: 120,
@@ -474,6 +481,12 @@ export default {
           label: '合计',
           slot: 'totalPrice'
         },
+        {
+          width: 120,
+          prop: 'discountTotalPrice',
+          label: '折后合计',
+          slot: 'discountTotalPrice'
+        },
         // {
         //   width: 80,
         //   prop: 'deliveryDays',

+ 1 - 1
src/views/purchasingManage/purchaseOrder/index.vue

@@ -404,8 +404,8 @@ export default {
       this.$refs.contactDetailDialogRef.open(row);
     },
     saleOrderSubmit(res) {
+      /*sourceType: res.sourceType,*/
       submit({
-        sourceType: res.sourceType,
         businessId: res.id
       }).then((res) => {
         this.$message.success('提交成功');

+ 12 - 0
src/views/purchasingManage/purchaseOrder/invoice/components/detailDialog.vue

@@ -271,12 +271,24 @@
             label: '单价',
             slot: 'singlePrice'
           },
+          {
+            width: 160,
+            prop: 'discountSinglePrice',
+            label: '折后单价',
+            slot: 'discountSinglePrice'
+          },
           {
             width: 120,
             prop: 'totalPrice',
             label: '合计',
             slot: 'totalPrice'
           },
+          {
+            width: 160,
+            prop: 'discountTotalPrice',
+            label: '折后合计',
+            slot: 'discountTotalPrice'
+          },
           {
             width: 80,
             prop: 'deliveryDays',

+ 17 - 0
src/views/purchasingManage/purchaseOrder/invoice/components/inventoryTable.vue

@@ -247,12 +247,24 @@
             label: '单价',
             slot: 'singlePrice'
           },
+          {
+            width: 160,
+            prop: 'discountSinglePrice',
+            label: '折后单价',
+            slot: 'discountSinglePrice'
+          },
           {
             width: 120,
             prop: 'totalPrice',
             label: '合计',
             slot: 'totalPrice'
           },
+          {
+            width: 120,
+            prop: 'discountTotalPrice',
+            label: '折后合计',
+            slot: 'discountTotalPrice'
+          },
           {
             width: 80,
             prop: 'deliveryDays',
@@ -352,6 +364,11 @@
           'totalPrice',
           (Number(this.form.datasource[index].singlePrice) * val).toFixed(2)
         );
+        this.$set(
+          this.form.datasource[index],
+          'discountTotalPrice',
+          (Number(this.form.datasource[index].discountSinglePrice) * val).toFixed(2)
+        );
       },
       //选择产品回调
       changeParent(obj, idx) {

+ 2 - 5
src/views/purchasingManage/purchaseOrder/returnGoods/components/addReturnGoodsDialog.vue

@@ -75,6 +75,7 @@
       </el-row>
       <headerTitle title="产品清单" style="margin-top: 30px"></headerTitle>
       <inventoryTable
+        :payAmount.sync="form.payAmount"
         ref="inventoryTableref"
         :receiveId="form.receiveId"
       ></inventoryTable>
@@ -196,10 +197,6 @@ import {contactDetail} from '@/api/saleManage/contact';
     computed: {
       totalAmount() {
         let allcountAmount = this.$store.state.returnGoods.allcountAmount;
-        if (!this.$store.state.isDefaultPayableAmount) {
-          this.form.payAmount = allcountAmount;
-        }
-
         return allcountAmount;
       }
     },
@@ -228,7 +225,7 @@ import {contactDetail} from '@/api/saleManage/contact';
         this.loading = false;
         if (data) {
           this.$nextTick(async () => {
-    
+
             const contactInfo = await contactDetail(data.supplierId);
             this.form = Object.assign({}, data, {
               receiveId: data.id,

+ 12 - 0
src/views/purchasingManage/purchaseOrder/returnGoods/components/detailDialog.vue

@@ -310,12 +310,24 @@
             label: '单价',
             slot: 'singlePrice'
           },
+          {
+            width: 160,
+            prop: 'discountSinglePrice',
+            label: '折后单价',
+            slot: 'discountSinglePrice'
+          },
           {
             width: 120,
             prop: 'totalPrice',
             label: '合计',
             slot: 'totalPrice'
           },
+          {
+            width: 120,
+            prop: 'discountTotalPrice',
+            label: '折后合计',
+            slot: 'discountTotalPrice'
+          },
           {
             width: 200,
             prop: 'returnReason',

+ 408 - 380
src/views/purchasingManage/purchaseOrder/returnGoods/components/inventoryTable.vue

@@ -143,411 +143,439 @@
   </el-form>
 </template>
 <script>
-  import { numberReg } from 'ele-admin';
-  import dictMixins from '@/mixins/dictMixins';
-  import productList from '@/views/saleManage/saleOrder/invoice/components/product-list.vue';
-  import {
-    // getWarehouseList,
-    getWarehouseOutStock
-  } from '@/api/saleManage/saleorder';
-  export default {
-    mixins: [dictMixins],
-    props: {
-      receiveId: String
-    },
-    components: {
-      productList
-    },
-    data() {
-      const defaultForm = {
-        key: null,
-        endTime: '',
-        isFirst: 0,
-        name: '',
-        startTime: '',
-        workHour: '',
-        technicalDrawings: []
-      };
-      return {
-        discountTotalPrice: 0.0,
-        allPrice: 0.0,
-        numberReg,
-        defaultForm,
-        // warehouseList: [],
-        form: {
-          datasource: []
-        },
-        rules: {},
+import {numberReg} from 'ele-admin';
+import dictMixins from '@/mixins/dictMixins';
+import productList from '@/views/saleManage/saleOrder/invoice/components/product-list.vue';
+import {
+  // getWarehouseList,
+  getWarehouseOutStock
+} from '@/api/saleManage/saleorder';
 
-        columns: [
-          {
-            width: 45,
-            type: 'index',
-            columnKey: 'index',
-            align: 'center',
-            fixed: 'left'
-          },
-          {
-            width: 200,
-            prop: 'productName',
-            label: '名称',
-            slot: 'productName'
-          },
-          {
-            width: 120,
-            prop: 'productCode',
-            label: '编码',
-            slot: 'productCode'
-          },
-          {
-            width: 200,
-            prop: 'productCategoryName',
-            label: '类型',
-            slot: 'productCategoryName'
-          },
-          {
-            width: 160,
-            prop: 'productBrand',
-            label: '牌号',
-            slot: 'productBrand'
-          },
-          {
-            width: 120,
-            prop: 'modelType',
-            label: '型号',
-            slot: 'modelType'
-          },
-          {
-            width: 120,
-            prop: 'specification',
-            label: '规格',
-            slot: 'specification'
-          },
-          {
-            width: 200,
-            prop: 'warehouseName',
-            label: '仓库名称',
-            slot: 'warehouseName',
-          },
-          {
-            width: 100,
-            prop: 'warehouseNum',
-            label: '库存',
-            slot: 'warehouseNum'
-          },
-          {
-            width: 120,
-            prop: 'receiveTotalCount',
-            label: '收货数量',
-            slot: 'receiveTotalCount'
-          },
-          {
-            width: 120,
-            prop: 'totalCount',
-            label: '退货数量',
-            slot: 'totalCount',
-            headerSlot:'headerTotalCount'
-          },
-          {
-            width: 80,
-            prop: 'measuringUnit',
-            label: '计量单位',
-            slot: 'measuringUnit'
-          },
-          {
-            width: 160,
-            prop: 'singlePrice',
-            label: '单价',
-            slot: 'singlePrice'
-          },
-          {
-            width: 120,
-            prop: 'totalPrice',
-            label: '合计',
-            slot: 'totalPrice'
-          },
-          {
-            width: 200,
-            prop: 'returnReason',
-            label: '退货原因',
-            slot: 'returnReason'
-          },
-          // {
-          //   width: 140,
-          //   prop: 'returnType',
-          //   label: '退货类型',
-          //   slot: 'returnType'
-          // },
+export default {
+  mixins: [dictMixins],
+  props: {
+    receiveId: String,
+    payAmount: [Number,String]
+  },
+  components: {
+    productList
+  },
+  data() {
+    const defaultForm = {
+      key: null,
+      endTime: '',
+      isFirst: 0,
+      name: '',
+      startTime: '',
+      workHour: '',
+      technicalDrawings: []
+    };
+    return {
+      discountTotalPrice: 0.0,
+      allPrice: 0.0,
+      numberReg,
+      defaultForm,
+      // warehouseList: [],
+      form: {
+        datasource: []
+      },
+      rules: {},
 
-          // {
-          //   width: 80,
-          //   prop: 'deliveryDays',
-          //   label: '交期(天)',
-          //   slot: 'deliveryDays'
-          // },
-          // {
-          //   width: 200,
-          //   prop: 'guaranteePeriod',
-          //   label: '质保期',
-          //   slot: 'guaranteePeriod'
-          // },
+      columns: [
+        {
+          width: 45,
+          type: 'index',
+          columnKey: 'index',
+          align: 'center',
+          fixed: 'left'
+        },
+        {
+          width: 200,
+          prop: 'productName',
+          label: '名称',
+          slot: 'productName'
+        },
+        {
+          width: 120,
+          prop: 'productCode',
+          label: '编码',
+          slot: 'productCode'
+        },
+        {
+          width: 200,
+          prop: 'productCategoryName',
+          label: '类型',
+          slot: 'productCategoryName'
+        },
+        {
+          width: 160,
+          prop: 'productBrand',
+          label: '牌号',
+          slot: 'productBrand'
+        },
+        {
+          width: 120,
+          prop: 'modelType',
+          label: '型号',
+          slot: 'modelType'
+        },
+        {
+          width: 120,
+          prop: 'specification',
+          label: '规格',
+          slot: 'specification'
+        },
+        {
+          width: 200,
+          prop: 'warehouseName',
+          label: '仓库名称',
+          slot: 'warehouseName',
+        },
+        {
+          width: 100,
+          prop: 'warehouseNum',
+          label: '库存',
+          slot: 'warehouseNum'
+        },
+        {
+          width: 120,
+          prop: 'receiveTotalCount',
+          label: '收货数量',
+          slot: 'receiveTotalCount'
+        },
+        {
+          width: 120,
+          prop: 'totalCount',
+          label: '退货数量',
+          slot: 'totalCount',
+          headerSlot: 'headerTotalCount'
+        },
+        {
+          width: 80,
+          prop: 'measuringUnit',
+          label: '计量单位',
+          slot: 'measuringUnit'
+        },
+        {
+          width: 160,
+          prop: 'singlePrice',
+          label: '单价',
+          slot: 'singlePrice'
+        },
+        {
+          width: 160,
+          prop: 'discountSinglePrice',
+          label: '折后单价',
+          slot: 'discountSinglePrice'
+        },
+        {
+          width: 120,
+          prop: 'totalPrice',
+          label: '合计',
+          slot: 'totalPrice'
+        },
+        {
+          width: 120,
+          prop: 'discountTotalPrice',
+          label: '折后合计',
+          slot: 'discountTotalPrice'
+        },
+        {
+          width: 200,
+          prop: 'returnReason',
+          label: '退货原因',
+          slot: 'returnReason'
+        },
+        // {
+        //   width: 140,
+        //   prop: 'returnType',
+        //   label: '退货类型',
+        //   slot: 'returnType'
+        // },
 
-          // {
-          //   width: 130,
-          //   prop: 'technicalAnswerName',
-          //   label: '技术答疑人',
-          //   slot: 'technicalAnswerName'
-          // },
-          // {
-          //   width: 220,
-          //   prop: 'technicalParams',
-          //   label: '技术参数',
-          //   slot: 'technicalParams'
-          // },
-          // {
-          //   width: 240,
-          //   prop: 'technicalDrawings',
-          //   label: '技术图纸',
-          //   slot: 'technicalDrawings'
-          // },
-          {
-            width: 220,
-            prop: 'remark',
-            label: '备注',
-            slot: 'remark'
-          },
-          {
-            columnKey: 'action',
-            label: '操作',
-            width: 120,
-            align: 'center',
-            resizable: false,
-            slot: 'action',
-            fixed: 'right',
-            showOverflowTooltip: true
-          }
-        ]
-      };
+        // {
+        //   width: 80,
+        //   prop: 'deliveryDays',
+        //   label: '交期(天)',
+        //   slot: 'deliveryDays'
+        // },
+        // {
+        //   width: 200,
+        //   prop: 'guaranteePeriod',
+        //   label: '质保期',
+        //   slot: 'guaranteePeriod'
+        // },
+
+        // {
+        //   width: 130,
+        //   prop: 'technicalAnswerName',
+        //   label: '技术答疑人',
+        //   slot: 'technicalAnswerName'
+        // },
+        // {
+        //   width: 220,
+        //   prop: 'technicalParams',
+        //   label: '技术参数',
+        //   slot: 'technicalParams'
+        // },
+        // {
+        //   width: 240,
+        //   prop: 'technicalDrawings',
+        //   label: '技术图纸',
+        //   slot: 'technicalDrawings'
+        // },
+        {
+          width: 220,
+          prop: 'remark',
+          label: '备注',
+          slot: 'remark'
+        },
+        {
+          columnKey: 'action',
+          label: '操作',
+          width: 120,
+          align: 'center',
+          resizable: false,
+          slot: 'action',
+          fixed: 'right',
+          showOverflowTooltip: true
+        }
+      ]
+    };
+  },
+  computed: {
+    contractId() {
+      return this.$store.state.order.contractId;
+    }
+  },
+  created() {
+    // getWarehouseList().then((res) => {
+    //   this.warehouseList = res;
+    // });
+  },
+  methods: {
+    //修改数量更新合计
+    changeNum(val, index) {
+      this.$set(
+        this.form.datasource[index],
+        'totalPrice',
+        (Number(this.form.datasource[index].singlePrice) * val).toFixed(2)
+      );
+      this.$set(
+        this.form.datasource[index],
+        'discountTotalPrice',
+        (Number(this.form.datasource[index].discountSinglePrice) * val).toFixed(2)
+      );
+      this.$store.commit('returnGoods/setIsDefaultPayableAmount', false);
+      this.gettotalAmount();
     },
-    computed: {
-      contractId() {
-        return this.$store.state.order.contractId;
+    //获取订单总金额
+    gettotalAmount() {
+      let productData = this.form.datasource;
+      if (productData.length) {
+        let sum = productData
+          .reduce((sum, item) => {
+            return sum + Number(item.totalPrice);
+          }, 0)
+          .toFixed(2);
+        this.$emit('update:payAmount', productData.reduce((sum, item) => {
+            return sum + Number(item.discountTotalPrice);
+          }, 0).toFixed(2)
+        )
+        this.$store.commit('returnGoods/setAllcountAmount', sum);
+      } else {
+        this.$store.commit('returnGoods/setAllcountAmount', 0);
       }
     },
-    created() {
-      // getWarehouseList().then((res) => {
-      //   this.warehouseList = res;
-      // });
+    //选择产品回调
+    async changeParent(obj, idx) {
+      obj.receiveTotalCount = obj.totalCount;
+      obj.receiveProductId = obj.id;
+      obj.id = ''
+
+      if (obj.warehouseId) {
+        obj['warehouseNum'] = await getWarehouseOutStock({
+          warehouseId: obj.warehouseId,
+          code: obj.productCode
+        });
+      }
+      this.$set(this.form.datasource, this.form.datasource.length, obj);
     },
-    methods: {
-      //修改数量更新合计
-      changeNum(val, index) {
-        this.$set(
-          this.form.datasource[index],
-          'totalPrice',
-          (Number(this.form.datasource[index].singlePrice) * val).toFixed(2)
-        );
-        this.$store.commit('returnGoods/setIsDefaultPayableAmount', false);
-        this.gettotalAmount();
-      },
-      //获取订单总金额
-      gettotalAmount() {
-        let productData = this.form.datasource;
-        if (productData.length) {
-          let sum = productData
-            .reduce((sum, item) => {
-              return sum + Number(item.totalPrice);
-            }, 0)
-            .toFixed(2);
-          this.$store.commit('returnGoods/setAllcountAmount', sum);
-        } else {
-          this.$store.commit('returnGoods/setAllcountAmount', 0);
-        }
-      },
-      //选择产品回调
-      async changeParent(obj, idx) {
-        obj.receiveTotalCount = obj.totalCount;
-        obj.receiveProductId = obj.id;
-        obj.id = ''
 
-        if (obj.warehouseId) {
-          obj['warehouseNum'] = await getWarehouseOutStock({
-            warehouseId: obj.warehouseId,
-            code: obj.productCode
-          });
-        }
-        this.$set(this.form.datasource, this.form.datasource.length, obj);
-      },
+    // async warehouseChange(index, row) {
+    //   let warehouseIds =
+    //     this.form.datasource
+    //       .filter(
+    //         (item, i) => row.productCode == item.productCode && index != i
+    //       )
+    //       .map((item) => item.warehouseId) || [];
+    //   const data = this.warehouseList.find(
+    //     (item) => item.id == row.warehouseId
+    //   );
+    //   if (warehouseIds.length > 0 && warehouseIds.includes(row.warehouseId)) {
+    //     row.warehouseId = '';
+    //     return this.$message.error('同一个产品不能选择相同的仓库');
+    //   }
 
-      // async warehouseChange(index, row) {
-      //   let warehouseIds =
-      //     this.form.datasource
-      //       .filter(
-      //         (item, i) => row.productCode == item.productCode && index != i
-      //       )
-      //       .map((item) => item.warehouseId) || [];
-      //   const data = this.warehouseList.find(
-      //     (item) => item.id == row.warehouseId
-      //   );
-      //   if (warehouseIds.length > 0 && warehouseIds.includes(row.warehouseId)) {
-      //     row.warehouseId = '';
-      //     return this.$message.error('同一个产品不能选择相同的仓库');
-      //   }
+    //   this.$set(this.form.datasource[index], 'warehouseName', data.name);
+    //   this.$set(this.form.datasource[index], 'warehouseCode', data.code);
+    //   const warehouseOutStock = await getWarehouseOutStock({
+    //     warehouseId: data.id,
+    //     code: row.productCode
+    //   });
+    //   this.$set(
+    //     this.form.datasource[index],
+    //     'warehouseNum',
+    //     warehouseOutStock
+    //   );
+    // },
 
-      //   this.$set(this.form.datasource[index], 'warehouseName', data.name);
-      //   this.$set(this.form.datasource[index], 'warehouseCode', data.code);
-      //   const warehouseOutStock = await getWarehouseOutStock({
-      //     warehouseId: data.id,
-      //     code: row.productCode
-      //   });
-      //   this.$set(
-      //     this.form.datasource[index],
-      //     'warehouseNum',
-      //     warehouseOutStock
-      //   );
-      // },
+    validateTotalCount(row) {
+      return (rule, value, callback) => {
+        if (isNaN(value) || Number(value) <= 0) {
+          this.$message.error('请输入大于0的数');
+          callback(new Error('请输入大于0的数字'));
+        } else if (Number(value) > row.receiveTotalCount) {
+          this.$message.error('退货数量不能大于收货数量');
+          callback(new Error('退货数量不能大于收货数量'));
+        } else {
+          callback();
+        }
+      };
+    },
+    // else if (this.getTotalCount(row)> row.warehouseNum) {
+    //       this.$message.error('退货数量不能大于库存');
+    //       callback(new Error('退货数量不能大于库存'));
+    //     }
+    getTotalCount(row) {
+      let num = 0;
+      this.form.datasource.filter(item => item.warehouseId == row.warehouseId).forEach(item => {
+        num += Number(item.totalCount)
+      })
 
-      validateTotalCount(row) {
-        return (rule, value, callback) => {
-          if (isNaN(value) || Number(value) <= 0) {
-            this.$message.error('请输入大于0的数');
-            callback(new Error('请输入大于0的数字'));
-          } else if (Number(value) > row.receiveTotalCount) {
-            this.$message.error('退货数量不能大于收货数量');
-            callback(new Error('退货数量不能大于收货数量'));
-          }  else {
-            callback();
-          }
-        };
-      },
-      // else if (this.getTotalCount(row)> row.warehouseNum) {
-      //       this.$message.error('退货数量不能大于库存');
-      //       callback(new Error('退货数量不能大于库存'));
-      //     }
-      getTotalCount(row){
-        let num=0;
-        this.form.datasource.filter(item=>item.warehouseId==row.warehouseId).forEach(item=>{
-          num+=Number(item.totalCount)
-        })
+      return num;
+    },
+    // 返回列表数据
+    getTableValue() {
+      let comitDatasource = this.form.datasource;
+      if (comitDatasource.length === 0) return [];
+      comitDatasource.forEach((v) => {
+        v.totalCount = Number(v.totalCount);
+        v.technicalDrawings = Array.isArray(v.technicalDrawings)
+          ? v.technicalDrawings
+          : [];
+      });
+      return comitDatasource;
+    },
+    getPrice() {
+      return [this.allPrice];
+    },
 
-        return num;
-      },
-      // 返回列表数据
-      getTableValue() {
-        let comitDatasource = this.form.datasource;
-        if (comitDatasource.length === 0) return [];
-        comitDatasource.forEach((v) => {
-          v.totalCount = Number(v.totalCount);
-          v.technicalDrawings = Array.isArray(v.technicalDrawings)
-            ? v.technicalDrawings
-            : [];
+    //修改回显
+    putTableValue(data) {
+      if (data && data?.length) {
+        data.forEach((v, index) => {
+          v.receiveTotalCount = v.receiveTotalCount || v.totalCount;
+          v.receiveProductId = v.receiveProductId || v.id;
         });
-        return comitDatasource;
-      },
-      getPrice() {
-        return [this.allPrice];
-      },
-
-      //修改回显
-      putTableValue(data) {
-        if (data && data?.length) {
-          data.forEach((v, index) => {
-            v.receiveTotalCount = v.receiveTotalCount || v.totalCount;
-            v.receiveProductId = v.receiveProductId ||v.id;
-          });
-
-          this.form.datasource = data;
-          this.form.datasource.forEach(async (v, index) => {
-            if (v.warehouseId) {
-              this.$set(
-                this.form.datasource[index],
-                'warehouseNum',
-                await getWarehouseOutStock({
-                  warehouseId: v.warehouseId,
-                  code: v.productCode
-                })
-              );
-            }
-          });
-          this.gettotalAmount();
-        }
-      },
 
-      remove(row) {
-        let index = this.form.datasource.findIndex((n) => n.key == row.key);
-        if (index !== -1) {
-          this.form.datasource.splice(index, 1);
-          this.setSort();
-          this.gettotalAmount();
-        }
-      },
-      // 清空表格
-      restTable() {
-        this.form.datasource = [];
-      },
-      // 重新排序
-      setSort() {
-        this.form.datasource.forEach((n, index) => {
-          n.key = index + 1;
+        this.form.datasource = data;
+        this.form.datasource.forEach(async (v, index) => {
+          if (v.warehouseId) {
+            this.$set(
+              this.form.datasource[index],
+              'warehouseNum',
+              await getWarehouseOutStock({
+                warehouseId: v.warehouseId,
+                code: v.productCode
+              })
+            );
+          }
         });
-      },
-      // 添加
-      handlAdd() {
-        if (!this.receiveId) return this.$message.error('请先选择收货单');
-        this.$refs.productListRef.open(this.form.datasource);
-      },
+        this.gettotalAmount();
+      }
+    },
 
-      validateForm(callback) {
-        //开始表单校验
-        this.$refs.form.validate((valid) => {
-          callback(valid);
-        });
+    remove(row) {
+      let index = this.form.datasource.findIndex((n) => n.key == row.key);
+      if (index !== -1) {
+        this.form.datasource.splice(index, 1);
+        this.setSort();
+        this.gettotalAmount();
       }
+    },
+    // 清空表格
+    restTable() {
+      this.form.datasource = [];
+    },
+    // 重新排序
+    setSort() {
+      this.form.datasource.forEach((n, index) => {
+        n.key = index + 1;
+      });
+    },
+    // 添加
+    handlAdd() {
+      if (!this.receiveId) return this.$message.error('请先选择收货单');
+      this.$refs.productListRef.open(this.form.datasource);
+    },
+
+    validateForm(callback) {
+      //开始表单校验
+      this.$refs.form.validate((valid) => {
+        callback(valid);
+      });
     }
-  };
+  }
+};
 </script>
 <style lang="scss" scoped>
-  .headbox {
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
-    .amount {
-      font-size: 14px;
-      font-weight: bold;
-      padding-right: 30px;
-    }
-  }
-  .time-form .el-form-item {
-    margin-bottom: 0 !important;
+.headbox {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+
+  .amount {
+    font-size: 14px;
+    font-weight: bold;
+    padding-right: 30px;
   }
+}
 
-  ::v-deep .period {
-    display: flex;
-    .borderleftnone {
-      .el-input--medium .el-input__inner {
-        border-top-right-radius: 0;
-        border-bottom-right-radius: 0;
-      }
-    }
-    .borderrightnone {
-      .el-input--medium .el-input__inner {
-        border-top-left-radius: 0;
-        border-bottom-left-radius: 0;
-      }
+.time-form .el-form-item {
+  margin-bottom: 0 !important;
+}
+
+::v-deep .period {
+  display: flex;
+
+  .borderleftnone {
+    .el-input--medium .el-input__inner {
+      border-top-right-radius: 0;
+      border-bottom-right-radius: 0;
     }
   }
 
-  ::v-deep .time-form tbody > tr:hover > td {
-    background-color: transparent !important;
-  }
-  ::v-deep .time-form .el-table tr {
-    background-color: #ffffff;
+  .borderrightnone {
+    .el-input--medium .el-input__inner {
+      border-top-left-radius: 0;
+      border-bottom-left-radius: 0;
+    }
   }
+}
 
-  .pricebox {
-    display: flex;
-    justify-content: flex-start;
-    align-items: center;
-    font-weight: bold;
-  }
+::v-deep .time-form tbody > tr:hover > td {
+  background-color: transparent !important;
+}
+
+::v-deep .time-form .el-table tr {
+  background-color: #ffffff;
+}
+
+.pricebox {
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+  font-weight: bold;
+}
 </style>

+ 15 - 1
src/views/saleManage/saleOrder/accountstatement/components/inventoryTable.vue

@@ -126,6 +126,13 @@ export default {
           align: 'center',
           slot: 'singlePrice'
         },
+        {
+          minWidth: 100,
+          prop: 'discountSinglePrice',
+          label: '折让单价',
+          align: 'center',
+          slot: 'discountSinglePrice'
+        },
         {
           minWidth: 120,
           prop: 'totalPrice',
@@ -133,6 +140,13 @@ export default {
           slot: 'totalPrice',
           align: 'center',
         },
+        {
+          minWidth: 100,
+          prop: 'discountTotalPrice',
+          label: '折让合计金额',
+          align: 'center',
+          slot: 'discountTotalPrice'
+        },
       ]
       let permissionType = {
         // 'add': [
@@ -301,7 +315,7 @@ export default {
     getSummaries(param) {
       const {columns, data} = param;
       const sums = [];
-      let fields = ['totalPrice', 'notInvoicedPrice', 'invoicedPrice', 'receivablePrice', 'receivedPrice']
+      let fields = ['totalPrice', 'notInvoicedPrice', 'invoicedPrice', 'receivablePrice', 'receivedPrice','discountTotalPrice']
       columns.forEach((column, index) => {
         if (index === 0) {
           sums[index] = '合计';

+ 8 - 8
src/views/saleManage/saleOrder/accountstatement/components/saleForm.vue

@@ -11,13 +11,13 @@ export default {
     return {
       monthByDays: {},
       quarterList: {
-        '一季度': ['-01-01 00:00:00', '-03-31 12:59:59'],
-        '二季度': ['-04-01 00:00:00', '-06-30 12:59:59'],
-        '三季度': ['-07-01 00:00:00', '-09-30 12:59:59'],
-        '四季度': ['-10-01 00:00:00', '-12-31 12:59:59'],
+        '一季度': ['-01-01 00:00:00', '-03-31 23:59:59'],
+        '二季度': ['-04-01 00:00:00', '-06-30 23:59:59'],
+        '三季度': ['-07-01 00:00:00', '-09-30 23:59:59'],
+        '四季度': ['-10-01 00:00:00', '-12-31 23:59:59'],
       },
       startTime: '-01-01 00:00:00',
-      endTime: '12:59:59',
+      endTime: '23:59:59',
       rules: {
         fromType: {required: true, message: '请选择', trigger: 'change'},
         contactId: {required: true, message: '请选择', trigger: 'change'},
@@ -40,7 +40,7 @@ export default {
         case 1:
           this.dataForm.dateValue = this.dataForm.year
           this.dataForm.startDate = this.dataForm.year + this.startTime
-          this.dataForm.endDate = this.dataForm.year + '-12-31 12:59:59'
+          this.dataForm.endDate = this.dataForm.year + '-12-31 23:59:59'
           break;
         case 2:
           this.dataForm.dateValue = this.dataForm.year + '年-' + this.dataForm.quarter
@@ -52,12 +52,12 @@ export default {
           this.dataForm.startDate = this.dataForm.month + '-01 00:00:00'
           let data = this.dataForm.month.split('-')
           let days = new Date(data[0], data[1], 0).getDate()
-          this.dataForm.endDate = this.dataForm.month + '-' + days + ' 12:59:59'
+          this.dataForm.endDate = this.dataForm.month + '-' + days + ' 23:59:59'
           break
         default:
           this.dataForm.dateValue = ''
           this.dataForm.startDate = this.dataForm.dateTimeRange[0] + ' 00:00:00'
-          this.dataForm.endDate = this.dataForm.dateTimeRange[1] +  ' 12:59:59'
+          this.dataForm.endDate = this.dataForm.dateTimeRange[1] +  ' 23:59:59'
       }
       this.$refs.form.validate(validate => {
         if (!validate) return

+ 1 - 1
src/views/saleManage/saleOrder/accountstatement/index.vue

@@ -67,7 +67,7 @@
               type="primary"
               :underline="false"
               icon="el-icon-edit"
-              @click="handleAddOrEditAccount('edit',row)"
+              @click="handleAddOrEditAccount('update',row)"
               v-if="[0, 3].includes(row.reviewStatus)"
             >
               修改

+ 16 - 10
src/views/saleManage/saleOrder/components/addDialog.vue

@@ -300,6 +300,7 @@
 
       <headerTitle title="产品清单" style="margin-top: 30px"></headerTitle>
       <inventoryTable
+        @orderDiscountAmount="orderDiscountAmount"
         ref="inventoryTable"
         :isCustomerMark="true"
         :isContractId=!!form.contractId
@@ -312,11 +313,14 @@
             style="margin-bottom: 22px"
           >
             <el-input
+              type="number"
+              :min="0"
+              :max="allcountAmount"
               clearable
-              :disabled="!!form.contractId"
-              v-model="form.payAmount"
-              placeholder="请输入"
-            >
+              :disabled="!!form.contractId||!allcountAmount"
+              v-model.number="form.payAmount"
+              @blur="discountInput"
+              placeholder="请输入">
               <template slot="append">元</template>
             </el-input>
           </el-form-item>
@@ -517,9 +521,6 @@ export default {
   },
   computed: {
     allcountAmount() {
-      if (!this.form.contractId) {
-        this.form.payAmount = this.$store.state.order.allcountAmount
-      }
       return this.$store.state.order.allcountAmount;
     }
   },
@@ -528,6 +529,9 @@ export default {
     this.getEnterprisePage();
   },
   methods: {
+    discountInput() {
+      this.$refs.inventoryTable.discountInputByOrder(this.form.payAmount)
+    },
     // 选择负责人部门
     change_principalDep(id) {
       const info = this.groupData.find((e) => e.id == id);
@@ -636,16 +640,18 @@ export default {
         this.$nextTick(() => {
           data.saleType = +data.saleType
           this.form = data;
-          console.log(this.form)
           this.$refs.inventoryTable &&
-          this.$refs.inventoryTable.putTableValue(data);
+          this.$refs.inventoryTable.putTableValueByOrder(data);
           this.getLinkInfo(data.partaId);
           this.$store.commit('order/setAllcountAmount', data.totalAmount);
           this.$store.commit('order/setContractId', data.contractId);
         });
       }
     },
-
+    //产品清单修改单价或者数量重置优惠金额
+    orderDiscountAmount(val=0){
+      this.form.payAmount = val
+    },
     //更新联系人数据
     async getLinkInfo(contactId) {
       const data = await getcontactlink({contactId});

+ 12 - 0
src/views/saleManage/saleOrder/invoice/components/inventoryTable.vue

@@ -319,12 +319,24 @@ export default {
           label: '单价',
           slot: 'singlePrice'
         },
+        {
+          width: 160,
+          prop: 'discountSinglePrice',
+          label: '折让单价',
+          slot: 'discountSinglePrice'
+        },
         {
           width: 120,
           prop: 'totalPrice',
           label: '合计',
           slot: 'totalPrice'
         },
+        {
+          width: 120,
+          prop: 'discountTotalPrice',
+          label: '折让合计',
+          slot: 'discountTotalPrice'
+        },
         {
           width: 120,
           prop: 'singleWeight',

+ 1 - 1
src/views/saleManage/saleOrder/returnGoods/components/addReturnGoodsDialog.vue

@@ -533,7 +533,7 @@
           this.form.repliedFiles = this.form.repliedFiles || [];
           this.form.replied = this.form.repliedFiles.length > 0 ? 1 : 0;
           let commitData = Object.assign({}, this.form, {
-            totalAmount: Number(this.totalAmount),
+            totalAmount: Number(this.$refs.inventoryTableref.payAmount),
             productList: data.productList,
             redressProductList: []
           });

+ 12 - 0
src/views/saleManage/saleOrder/returnGoods/components/detailDialog.vue

@@ -322,12 +322,24 @@ export default {
           label: '单价',
           slot: 'singlePrice'
         },
+        {
+          width: 160,
+          prop: 'discountSinglePrice',
+          label: '折让单价',
+          slot: 'discountSinglePrice'
+        },
         {
           width: 120,
           prop: 'totalPrice',
           label: '合计',
           slot: 'totalPrice'
         },
+        {
+          width: 120,
+          prop: 'discountTotalPrice',
+          label: '折让合计',
+          slot: 'discountTotalPrice'
+        },
 
         {
           width: 200,

+ 22 - 3
src/views/saleManage/saleOrder/returnGoods/components/inventoryTable.vue

@@ -264,12 +264,24 @@
             label: '单价',
             slot: 'singlePrice'
           },
+          {
+            width: 160,
+            prop: 'discountSinglePrice',
+            label: '折让单价',
+            slot: 'discountSinglePrice'
+          },
           {
             width: 120,
             prop: 'totalPrice',
             label: '合计',
             slot: 'totalPrice'
           },
+          {
+            width: 120,
+            prop: 'discountTotalPrice',
+            label: '折让合计',
+            slot: 'discountTotalPrice'
+          },
           {
             width: 200,
             prop: 'returnReason',
@@ -337,9 +349,6 @@
     computed: {
       totalAmount() {
         let allcountAmount = this.$store.state.returnGoods.allcountAmount;
-        if (!this.$store.state.isDefaultPayableAmount) {
-          this.payAmount = allcountAmount;
-        }
         return allcountAmount;
       }
     },
@@ -354,6 +363,11 @@
           'totalPrice',
           (Number(this.form.datasource[index].singlePrice) * val).toFixed(2)
         );
+        this.$set(
+          this.form.datasource[index],
+          'discountTotalPrice',
+          (Number(this.form.datasource[index].discountSinglePrice) * val).toFixed(2)
+        );
         this.$store.commit('returnGoods/setIsDefaultPayableAmount', false);
         this.gettotalAmount();
       },
@@ -366,6 +380,11 @@
               return sum + Number(item.totalPrice);
             }, 0)
             .toFixed(2);
+          this.payAmount = productData
+            .reduce((sum, item) => {
+              return sum + Number(item.discountTotalPrice);
+            }, 0)
+            .toFixed(2);
           this.$store.commit('returnGoods/setAllcountAmount', sum);
         } else {
           this.$store.commit('returnGoods/setAllcountAmount', 0);