Ver código fonte

refactor(财务模块): 优化发票新增逻辑和交易方式显示

liujt 4 meses atrás
pai
commit
9f11b6dabb

+ 47 - 27
src/views/financialManage/collectionPlan/index.vue

@@ -42,7 +42,7 @@
                   type="primary"
                   icon="el-icon-plus"
                   class="ele-btn-icon"
-                  @click="openEdit('add')"
+                  @click="handleModal('add')"
                 >
                   合并开票
                 </el-button>
@@ -103,8 +103,8 @@
                   type="primary"
                   :underline="false"
                   icon="el-icon-plus"
-                  v-if="row.invoiceStatus != 2"
-                  @click="openEdit('add', row)"
+                  v-if="canAddInvoice(row)"
+                  @click="openEdit(row, 'single')"
                 >
                   新增发票
                 </el-link>
@@ -139,6 +139,7 @@
       v-if="collectionPlanDialogFlag"
       :collectionPlanDialogFlag.sync="collectionPlanDialogFlag"
       type="1"
+      @getPlanData="(selection) => openEdit(selection, 'merge')"
     ></collectionPlanDialog>
   </div>
 </template>
@@ -194,13 +195,13 @@ export default {
 
       groupName: '',
       columns: [
-        {
-          width: 45,
-          type: 'selection',
-          columnKey: 'selection',
-          align: 'center',
-          fixed: 'left'
-        },
+        // {
+        //   width: 45,
+        //   type: 'selection',
+        //   columnKey: 'selection',
+        //   align: 'center',
+        //   fixed: 'left'
+        // },
         {
           columnKey: 'index',
           label: '序号',
@@ -510,7 +511,7 @@ export default {
         {
           columnKey: 'action',
           label: '操作',
-          width: 180,
+          width: 100,
           align: 'center',
           resizable: false,
           slot: 'action',
@@ -521,7 +522,26 @@ export default {
       cacheKeyUrl: 'eos-5f2ac512-purchaseOrder-collectionPlan',
     };
   },
-  computed: {},
+  computed: {
+    canAddInvoice() {
+      return function(row) {
+        if (!row) return false;
+        
+        const isNotFullInvoiced = row.invoiceStatus != 2;
+        
+        const isPaymentFirstThenInvoice = row.transactionMode == 2;
+        const isNotUnpaid = row.paymentStatus != 0;
+        const paymentCondition = (isPaymentFirstThenInvoice && isNotUnpaid) || !isPaymentFirstThenInvoice;
+        
+        const isCashOnDelivery = row.settlementMode == 3;
+        const isPrepayment = row.paymentType == 1;
+        const isDelivered = row.deliveryStatus != 0;
+        const deliveryCondition = isCashOnDelivery && (isPrepayment || (!isPrepayment && isDelivered));
+        
+        return isNotFullInvoiced && !isPaymentFirstThenInvoice;
+      };
+    }
+  },
   created() {
     this.requestDict('结算方式');
     this.requestDict('客户状态');
@@ -551,24 +571,24 @@ export default {
     },
 
     //新增编辑
-    openEdit(type, row) {
+    openEdit(row, type) {
       const select = []
-      if(row) {
+      if(type == 'single') {
         select.push(row)
       } else {
-        let customerIds = this.selection.map((item) => item.customerId);
-        let initiatorIds = this.selection.map((item) => item.initiatorId);
-        let invoiceStatus = this.selection.map((item) => item.invoiceStatus);
-        console.log(customerIds, initiatorIds);
-        if(invoiceStatus.includes(2)) {
-          this.$message.warning('请选择未开票的计划!');
-          return
-        }
-        if(this.selection.length == 0 || new Set(customerIds).size != 1 || new Set(initiatorIds).size != 1) {
-          this.$message.warning('请选择相同客户和销售方的计划!');
-          return
-        }
-        select.push(...this.selection)
+        // let customerIds = this.selection.map((item) => item.customerId);
+        // let initiatorIds = this.selection.map((item) => item.initiatorId);
+        // let invoiceStatus = this.selection.map((item) => item.invoiceStatus);
+        // console.log(customerIds, initiatorIds);
+        // if(invoiceStatus.includes(2)) {
+        //   this.$message.warning('请选择未开票的计划!');
+        //   return
+        // }
+        // if(this.selection.length == 0 || new Set(customerIds).size != 1 || new Set(initiatorIds).size != 1) {
+        //   this.$message.warning('请选择相同客户和销售方的计划!');
+        //   return
+        // }
+        select.push(...row)
       }
       this.addOrEditDialogNewFlag = true;
       this.$nextTick(() => {

+ 139 - 149
src/views/financialManage/invoiceManage/components/collectionPlanDialog.vue

@@ -12,133 +12,57 @@
   >
     <el-card shadow="never">
       <div>
-        <el-form label-width="90px" :inline="true">
-            <el-form-item>
-              <el-form-item
-                label="客户名称"
+        <el-form label-width="90px" :inline="true" ref="form" :rules="rules" labelWidth="120px" :model="searchForm">
+            <el-form-item
+              label="客户名称"
+              prop="customerName"
+            >
+              <el-input
+                clearable
+                v-model="searchForm.customerName"
+                @click.native="handParent"
+                placeholder="请选择"
+                readonly
+              />
+            </el-form-item>
+            <el-form-item
+              :label="type == 2 ? '购买方名称' : '销售方名称'"
+              prop="initiatorId"
+            >
+              <el-select
+                style="width: 100%"
+                v-model="searchForm.initiatorId"
+                placeholder="请选择"
+                @change="getEnterprise()"
               >
-                <el-select
-                  clearable
-                  v-model="customerName"
-                  placeholder="请选择"
-                  :filterable="true"
+                <el-option
+                  v-for="item in enterprisePage"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
                 >
-                  <el-option
-                    label="1"
-                    value="1"
-                  ></el-option>
-                </el-select>
-              </el-form-item>
+                </el-option>
+              </el-select>
             </el-form-item>
-      
-            <el-form-item>
-              <el-dropdown
-                ref="dropdownref"
-                trigger="click"
-                :hide-on-click="false"
-                v-model="dropdownVisible"
-                @keydown.enter.native.stop="search"
+            <el-form-item
+              label="交易方式"
+              prop="transactionMode"
+            >
+              <el-select
+                style="width: 100%"
+                v-model="searchForm.transactionMode"
+                placeholder="请选择"
+                disabled
               >
-                <div v-if="seekList.length > formLength">
-                  <span class="el-dropdown-link">
-                    更多选项<i class="el-icon-arrow-down el-icon--right"></i>
-                  </span>
-                  <el-dropdown-menu slot="dropdown">
-                    <div class="padding">
-                      <el-form label-position="left">
-                        <el-form-item
-                          v-for="(item, i) in deboListRow"
-                          :key="i"
-                          :inline="true"
-                          label-position="left"
-                        >
-                          <el-form-item
-                            :label-width="
-                              item.labelWidth ? item.labelWidth : '90' + 'px'
-                            "
-                            :inline="true"
-                            :label="item.label"
-                          >
-                            <div v-if="item.type == 'input'">
-                              <el-input
-                                clearable
-                                v-model="defaultWhere[item.value]"
-                                :placeholder="item.placeholder || '请输入内容'"
-                                :style="{
-                                  width: item.width ? item.width + 'px' : '220px'
-                                }"
-                                @keydown.enter.native="() => search()"
-                                @keyup.enter.native="() => search()"
-                              />
-                            </div>
-                            <div v-if="item.type == 'select'">
-                              <el-select
-                                clearable
-                                v-model="defaultWhere[item.value]"
-                                :multiple="item.multiple ? item.multiple : false"
-                                :filterable="item.filterable ? item.filterable : true"
-                                :placeholder="item.placeholder || '请输入内容'"
-                                :style="{
-                                  width: item.width ? item.width + 'px' : '220px'
-                                }"
-                                @visible-change="change"
-                                @change="handerChange"
-                              >
-                                <el-option
-                                  v-for="(op, i) in item.planList"
-                                  :label="op.label"
-                                  :value="op.value"
-                                  :key="i"
-                                ></el-option>
-                              </el-select>
-                            </div>
-      
-                            <div v-if="item.type == 'date'">
-                              <el-date-picker
-                                v-model="defaultWhere[item.value]"
-                                @blur="change"
-                                :type="item.dateType || 'daterange'"
-                                range-separator="至"
-                                start-placeholder="开始日期"
-                                end-placeholder="结束日期"
-                                value-format="yyyy-MM-dd HH:mm:ss"
-                                :style="{
-                                  width: item.width ? item.width + 'px' : '220px'
-                                }"
-                              >
-                              </el-date-picker>
-                            </div>
-                            <div v-if="item.type == 'DictSelection'">
-                              <DictSelection
-                                v-model="defaultWhere[item.value]"
-                                :placeholder="item.placeholder || '请选择内容'"
-                                :multiple="item.multiple ? item.multiple : false"
-                                :style="{
-                                  width: item.width ? item.width + 'px' : '220px'
-                                }"
-                                :dictName="item.dictName"
-                              />
-                            </div>
-                            <div v-if="item.type == 'picker'">
-                              <el-date-picker
-                                v-model="defaultWhere[item.value]"
-                                @blur="change"
-                                value-format="yyyy-MM-dd"
-                                :style="{
-                                  width: item.width ? item.width + 'px' : '220px'
-                                }"
-                              >
-                              </el-date-picker>
-                            </div>
-                          </el-form-item>
-                        </el-form-item>
-                      </el-form>
-                    </div>
-                  </el-dropdown-menu>
-                </div>
-              </el-dropdown>
+                <el-option
+                  v-for="item in transactionMethodsOp"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                >
+                </el-option>
+              </el-select>
             </el-form-item>
-      
             <el-form-item>
               <el-button
                 type="primary"
@@ -148,9 +72,9 @@
               >
                 查询
               </el-button>
-              <el-button @click="reset" icon="el-icon-refresh-left" type="primary"
+              <!-- <el-button @click="reset" icon="el-icon-refresh-left" type="primary"
                 >重置</el-button
-              >
+              > -->
             </el-form-item>
           </el-form>
       </div>
@@ -186,6 +110,8 @@
       :account-info-dialog-flag.sync="accountInfoDialogFlag"
       @getAccountInfo="getAccountInfo"
     ></accountInfoDialog>
+
+    <parentList ref="parentRef" @changeParent="changeParent"></parentList>
   </el-dialog>
 </template>
 
@@ -195,10 +121,13 @@
   import accountInfoDialog from './accountInfoDialog.vue';
   import { shippingModeOp, transactionMethodsOp, paymentStatus, paymentType, invoiceStatusOp } from '@/enum/dict.js';
   import { receiptPaymentPlanPage } from '@/api/financialManage/payAndCollectPlan';
+  import parentList from '@/views/saleManage/contact/components/parentList.vue';
+  import { enterprisePage } from '@/api/contractManage/contractBook';
   export default {
     mixins: [dictMixins, tabMixins],
     components: {
-      accountInfoDialog
+      accountInfoDialog,
+      parentList
     },
     props: {
       form: {
@@ -529,10 +458,30 @@
           //   fixed: 'right'
           // }
         ]
-      }
+      },
+      rules() {
+        return {
+          initiatorId: [
+            { required: true, message: '请选择', trigger: 'blur' }
+          ],
+          customerId: [
+            { required: true, message: '请选择', trigger: 'blur' }
+          ],
+          transactionMode: [
+            { required: true, message: '请选择', trigger: 'blur' }
+          ]
+        }
+      },
     },
     data() {
       return {
+        enterprisePage: [],
+        searchForm: {
+          initiatorId: '',
+          customerId: '',
+          customerName: '',
+          transactionMode: 1
+        },
         currentIndex: null,
         accountInfoDialogFlag: false,
         currentRow: {},
@@ -547,8 +496,51 @@
     },
     created() {
       this.requestDict('结算方式');
+      this.getEnterprisePage();
     },
     methods: {
+      handParent() {
+        let item = {
+          id: this.searchForm.customerId
+        };
+        this.$refs.parentRef.open(item);
+      },
+      search() {
+        this.$refs.form.validate(async (valid) => {
+          if (!valid) return this.$message.warning('请选择查询条件');
+          this.reload(this.searchForm);
+        });
+      },
+      reset() {
+        this.searchForm = {
+          initiatorId: '',
+          customerId: '',
+          customerName: '',
+          transactionMode: 1
+        };
+        this.reload(this.searchForm);
+      },
+      changeParent(item) {
+        this.searchForm.customerId = item.id;
+      },
+      getEnterprisePage() {
+        enterprisePage({
+          pageNum: 1,
+          size: 100
+        }).then((res) => {
+          this.enterprisePage = [];
+          this.enterprisePage.push(...res.list);
+          this.searchForm.initiatorId = this.enterprisePage[0].id;
+          this.reload(this.searchForm);
+        });
+      },
+      getEnterprise(val) {
+        let data = this.enterprisePage.find(
+          (item) => item.id == val
+        );
+        this.searchForm.customerName = data.name;
+        // this.searchForm.initiatorId = data.id;
+      },
       init(item = {}, currentIndex = '') {
         this.currentIndex = currentIndex;
         // if (item.id) {
@@ -562,13 +554,11 @@
       },
       /* 表格数据源 */
       datasource({ page, limit, where, order }) {
-        if (this.contactData.id) {
-          where['contactId'] = this.contactData.id;
-        }
         return receiptPaymentPlanPage({
           pageNum: page,
           size: limit,
           ...where,
+          invoiceStatus: '0,1',
           // reviewStatus: 2,
           sourceType: this.type
         });
@@ -592,28 +582,28 @@
         let invoiceStatus = this.selection.map((item) => item.invoiceStatus);
         console.log(customerIds, initiatorIds);
         let flag = false
-        if(this.type == 2) {
-          this.selection.forEach(item => {
-            if(item.transactionMode == 2 && item.paymentStatus == 0) {
-              console.log('selection', item);
-              flag = true
-            }
-          })
-        }
+        // if(this.type == 2) {
+        //   this.selection.forEach(item => {
+        //     if(item.transactionMode == 2 && item.paymentStatus == 0) {
+        //       console.log('selection', item);
+        //       flag = true
+        //     }
+        //   })
+        // }
         
         console.log(customerIds, initiatorIds, flag);
-        if(flag) {
-          this.$message.warning('先款后票的计划需要付款后再开票!');
-          return
-        }
-        if(invoiceStatus.includes(2)) {
-          this.$message.warning('请选择未开票的计划!');
-          return
-        }
-        if(this.selection.length == 0 || new Set(customerIds).size != 1 || new Set(initiatorIds).size != 1) {
-          this.$message.warning('请选择相同客户和销售方的计划!');
-          return
-        }
+        // if(flag) {
+        //   this.$message.warning('先款后票的计划需要付款后再开票!');
+        //   return
+        // }
+        // if(invoiceStatus.includes(2)) {
+        //   this.$message.warning('请选择未开票的计划!');
+        //   return
+        // }
+        // if(this.selection.length == 0 || new Set(customerIds).size != 1 || new Set(initiatorIds).size != 1) {
+        //   this.$message.warning('请选择相同客户和销售方的计划!');
+        //   return
+        // }
 
         this.$emit('getPlanData', this.selection)
         this.handleClose()

+ 1 - 1
src/views/financialManage/invoiceManage/components/detailDialog.vue

@@ -23,7 +23,7 @@
         </li>
       </ul>
     </div>
-    <div v-if="activeComp === 'main'">
+    <div v-show="activeComp === 'main'">
       <el-form ref="form" :model="form" class="el-form-box" label-width="140px">
         <headerTitle title="基本信息"></headerTitle>
         <el-row :gutter="12">

+ 7 - 1
src/views/financialManage/payableManage/components/paymentListDialog.vue

@@ -27,7 +27,7 @@
           type="primary"
           :underline="false"
           icon="el-icon-plus"
-          v-if="[2].includes(row.approvalStatus) && row.invoiceStatus != 2"
+          v-if="canAddInvoice(row)"
           @click="done(row, 'view')"
         >
           新增发票
@@ -295,6 +295,12 @@
             fixed: 'right'
           }
         ];
+      },
+      canAddInvoice() {
+        return function(row) {
+          if (!row) return false;
+          return [2].includes(row.approvalStatus) && row.invoiceStatus != 2 && row.unInvoiceAmount && +row.unInvoiceAmount > 0;
+        };
       }
     },
     data() {

+ 17 - 1
src/views/financialManage/payableManage/index.vue

@@ -32,7 +32,7 @@
         <template v-slot:action="{ row }">
           <el-link
             type="primary"
-            v-if="[2].includes(row.approvalStatus) && row.invoiceStatus != 2"
+            v-if="canAddInvoice(row)"
             :underline="false"
             icon="el-icon-plus"
             @click="openEdit(row)"
@@ -175,6 +175,12 @@
       };
     },
     computed: {
+      canAddInvoice() {
+        return function(row) {
+          if (!row) return false;
+          return [2].includes(row.approvalStatus) && row.invoiceStatus != 2 && row.unInvoiceAmount && +row.unInvoiceAmount > 0;
+        };
+      },
       columns() {
         // 当columnsVersion变化时会重新计算,用作更新列配置
         const version = this.columnsVersion;
@@ -353,6 +359,16 @@
             slot: 'accountingSubjectName',
             showOverflowTooltip: true
           },
+          {
+            prop: 'transactionMode',
+            label: '交易方式',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200,
+            formatter: (row) => {
+              return this.transactionMethodsOp.find(item => item.value == row.transactionMode)?.label || '';
+            }
+          },
           {
             prop: 'invoiceStatus',
             label: '开票状态',

+ 59 - 45
src/views/financialManage/paymentPlan/index.vue

@@ -44,7 +44,7 @@
                   type="primary"
                   icon="el-icon-plus"
                   class="ele-btn-icon"
-                  @click="openEdit('add')"
+                  @click="handleModal('add')"
                 >
                   合并开票
                 </el-button>
@@ -119,13 +119,12 @@
                     </el-link>
                   </template>
                 </el-popconfirm>
-                <!-- 非全部开票,(先款后票,非未付款),(货到付款,非未收货,预交款除外) -->
                 <el-link
                   type="primary"
                   :underline="false"
                   icon="el-icon-plus"
                   v-if="canAddInvoice(row)"
-                  @click="openEdit('add', row)"
+                  @click="openEdit(row, 'single')"
                 >
                   新增发票
                 </el-link>
@@ -150,6 +149,14 @@
     />
 
     <payableOrderDetailDialog ref="payableOrderDetailDialogRef" v-if="payableOrderDetailDialogFlag" :detail-dialog-flag.sync="payableOrderDetailDialogFlag"></payableOrderDetailDialog>
+
+    <collectionPlanDialog
+      ref="collectionPlanDialogRef"
+      v-if="collectionPlanDialogFlag"
+      :collectionPlanDialogFlag.sync="collectionPlanDialogFlag"
+      type="2"
+      @getPlanData="(selection) => openEdit(selection, 'merge')"
+    ></collectionPlanDialog>
   </div>
 </template>
 
@@ -165,6 +172,7 @@ import tabMixins from '@/mixins/tableColumnsMixin';
 import addOrEditDialogNew from '@/views/financialManage/invoiceManage/components/addOrEditDialogNew.vue'
 import invoiceDetailDialog from '@/views/financialManage/invoiceManage/components/detailDialog.vue';
 import payableOrderDetailDialog from '@/views/financialManage/payableManage/components/detailDialog.vue';
+import collectionPlanDialog from '@/views/financialManage/invoiceManage/components/collectionPlanDialog.vue'   // 收款计划列表
 
 export default {
   mixins: [dictMixins, tabMixins],
@@ -176,9 +184,11 @@ export default {
     addOrEditDialogNew,
     invoiceDetailDialog,
     payableOrderDetailDialog,
+    collectionPlanDialog
   },
   data() {
     return {
+      collectionPlanDialogFlag: false,
       activeComp: 'paymentPlan',
       payableOrderDetailDialogFlag: false,
       addOrEditDialogNewFlag: false,
@@ -199,13 +209,13 @@ export default {
 
       groupName: '',
       columns: [
-        {
-          width: 45,
-          type: 'selection',
-          columnKey: 'selection',
-          align: 'center',
-          fixed: 'left'
-        },
+        // {
+        //   width: 45,
+        //   type: 'selection',
+        //   columnKey: 'selection',
+        //   align: 'center',
+        //   fixed: 'left'
+        // },
         {
           columnKey: 'index',
           label: '序号',
@@ -515,7 +525,7 @@ export default {
         {
           columnKey: 'action',
           label: '操作',
-          width: 260,
+          width: 100,
           align: 'center',
           resizable: false,
           slot: 'action',
@@ -542,7 +552,7 @@ export default {
         const isDelivered = row.deliveryStatus != 0;
         const deliveryCondition = isCashOnDelivery && (isPrepayment || (!isPrepayment && isDelivered));
         
-        return isNotFullInvoiced && ((deliveryCondition || !isCashOnDelivery) && paymentCondition);
+        return isNotFullInvoiced && !isPaymentFirstThenInvoice;
       };
     }
   },
@@ -566,47 +576,51 @@ export default {
       return receiptPaymentPlanPage(this.params);
     },
 
+    handleModal() {
+      this.collectionPlanDialogFlag = true;
+    },
+
     /* 刷新表格 */
     reload(where) {
       this.$refs.table.reload({ page: 1, where });
     },
     //新增编辑
-    openEdit(type, row) {
+    openEdit(row, type) {
       const select = []
-      if(row) {
+      if(type == 'single') {
         select.push(row)
       } else {
-        let customerIds = this.selection.map((item) => item.customerId);
-        let initiatorIds = this.selection.map((item) => item.initiatorId);
-        let invoiceStatus = this.selection.map((item) => item.invoiceStatus);
-        let flag = false
-        let errMsg = ''
-        this.selection.forEach(item => {
-          if(item.transactionMode == 2 && item.paymentStatus == 0) {
-            console.log('selection', item);
-            flag = true
-            errMsg = '先款后票的计划需要付款后再开票!'
-          }
-          if(item.settlementMode == 3 && item.paymentType != 1 && item.deliveryStatus == 0) {
-            flag = true
-            errMsg = '货到付款的计划需要收货后再开票!'
-          }
-        })
-        console.log(customerIds, initiatorIds, flag);
-        if(flag) {
-          this.$message.warning(errMsg);
-          return
-        }
-        if(invoiceStatus.includes(2)) {
-          this.$message.warning('请选择未开票的计划!');
-          return
-        }
-        console.log('selection', this.selection, new Set(customerIds).size, new Set(initiatorIds).size);
-        if(this.selection.length == 0 || new Set(customerIds).size != 1 || new Set(initiatorIds).size != 1) {
-          this.$message.warning('请选择相同客户和采购方的计划!');
-          return
-        }
-        select.push(...this.selection)
+        // let customerIds = this.selection.map((item) => item.customerId);
+        // let initiatorIds = this.selection.map((item) => item.initiatorId);
+        // let invoiceStatus = this.selection.map((item) => item.invoiceStatus);
+        // let flag = false
+        // let errMsg = ''
+        // this.selection.forEach(item => {
+        //   if(item.transactionMode == 2 && item.paymentStatus == 0) {
+        //     console.log('selection', item);
+        //     flag = true
+        //     errMsg = '先款后票的计划需要付款后再开票!'
+        //   }
+        //   if(item.settlementMode == 3 && item.paymentType != 1 && item.deliveryStatus == 0) {
+        //     flag = true
+        //     errMsg = '货到付款的计划需要收货后再开票!'
+        //   }
+        // })
+        // console.log(customerIds, initiatorIds, flag);
+        // if(flag) {
+        //   this.$message.warning(errMsg);
+        //   return
+        // }
+        // if(invoiceStatus.includes(2)) {
+        //   this.$message.warning('请选择未开票的计划!');
+        //   return
+        // }
+        // console.log('selection', this.selection, new Set(customerIds).size, new Set(initiatorIds).size);
+        // if(this.selection.length == 0 || new Set(customerIds).size != 1 || new Set(initiatorIds).size != 1) {
+        //   this.$message.warning('请选择相同客户和采购方的计划!');
+        //   return
+        // }
+        select.push(...row)
       }
       this.addOrEditDialogNewFlag = true;
         this.$nextTick(() => {

+ 7 - 1
src/views/financialManage/receivableManage/components/receivableDialog.vue

@@ -27,7 +27,7 @@
           type="primary"
           :underline="false"
           icon="el-icon-plus"
-          v-if="[2].includes(row.approvalStatus) && row.invoiceStatus != 2"
+          v-if="canAddInvoice(row)"
           @click="done(row, 'view')"
         >
           新增发票
@@ -303,6 +303,12 @@
             fixed: 'right'
           }
         ];
+      },
+      canAddInvoice() {
+        return function(row) {
+          if (!row) return false;
+          return [2].includes(row.approvalStatus) && row.invoiceStatus != 2 && row.unInvoiceAmount && +row.unInvoiceAmount > 0;
+        };
       }
     },
     data() {

+ 26 - 10
src/views/financialManage/receivableManage/index.vue

@@ -53,7 +53,7 @@
             :underline="false"
             icon="el-icon-plus"
             @click="openEdit(row)"
-            v-if="[2].includes(row.approvalStatus) && row.invoiceStatus != 2"
+            v-if="canAddInvoice(row)"
           >
             新增发票
           </el-link>
@@ -367,15 +367,25 @@
             showOverflowTooltip: true
           },
           {
-          prop: 'invoiceStatus',
-          label: '开票状态',
-          align: 'center',
-          showOverflowTooltip: true,
-          minWidth: 100,
-          formatter: (_row, _column, cellValue) => {
-            return this.invoiceStatusOp.find(item => item.value == cellValue)?.label || '';
-          }
-        },
+            prop: 'transactionMode',
+            label: '交易方式',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 200,
+            formatter: (row) => {
+              return this.transactionMethodsOp.find(item => item.value == row.transactionMode)?.label || '';
+            }
+          },
+          {
+            prop: 'invoiceStatus',
+            label: '开票状态',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100,
+            formatter: (_row, _column, cellValue) => {
+              return this.invoiceStatusOp.find(item => item.value == cellValue)?.label || '';
+            }
+          },
           {
             minWidth: 100,
             prop: 'status',
@@ -435,6 +445,12 @@
             fixed: 'right'
           }
         ];
+      },
+      canAddInvoice() {
+        return function(row) {
+          if (!row) return false;
+          return [2].includes(row.approvalStatus) && row.invoiceStatus != 2 && row.unInvoiceAmount && +row.unInvoiceAmount > 0;
+        };
       }
     },
     created() {},

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

@@ -27,7 +27,7 @@
         </ul>
       </div>
     </div>
-    <div v-if="activeComp == 'order'">
+    <div v-show="activeComp == 'order'">
       <el-form
         ref="form"
         :model="form"

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

@@ -101,6 +101,52 @@
                     </div>
                   </div>
                 </template>
+
+                <template v-slot:singlePrice="scope">
+                  <el-form-item
+                    style="margin-bottom: 20px"
+                    :prop="'datasource.' + scope.$index + '.singlePrice'"
+                    :rules="{
+                      required: true,
+                      message: '请输入正确的单价',
+                      trigger: 'change'
+                    }"
+                  >
+                    <el-input
+                      v-model="scope.row.singlePrice"
+                      placeholder="请输入"
+                      @input="changeCount(scope.row, scope.$index)"
+                      type="number"
+                    >
+                      <template slot="append">元</template>
+                    </el-input>
+                  </el-form-item>
+                </template>
+
+                <template v-slot:singleWeight="scope">
+                  <el-form-item
+                    style="margin-bottom: 20px"
+                    :rules="{
+                      required: false,
+
+                      trigger: 'change'
+                    }"
+                    :prop="'datasource.' + scope.$index + '.singleWeight'"
+                  >
+                    <el-input
+                      v-model="scope.row.singleWeight"
+                      type="number"
+                      placeholder="请输入"
+                      :disabled="needProduce == 4"
+                      @input="changeCount(scope.row, scope.$index)"
+                    >
+                      <template slot="append">
+                        {{ scope.row.weightUnit }}
+                      </template>
+                    </el-input>
+                  </el-form-item>
+                </template>
+
                 <template v-slot:action="{ row,$index }">
                   <el-popconfirm class="ele-action" title="确定要删除吗?" @confirm="remove(index,$index,'line')">
                     <template v-slot:reference>
@@ -311,7 +357,7 @@ export default {
             prop: 'singlePrice',
             label: '单价',
             align: 'center',
-            slot: 'singlePrice',
+            // slot: 'singlePrice',
           },
           {
             minWidth: 100,