ソースを参照

Merge branch 'master' of http://git.dongkesoft.com:9001/iBOSS-2.0-Mini/iboss-mini-web

zhoux 2 年 前
コミット
280a2b41ec

+ 20 - 0
src/api/pages/fin/account.js

@@ -0,0 +1,20 @@
+/**
+ * @desc   : 账务对象
+ * @author : 付斌
+ * @date   : 2024-01-31 14:37
+ */
+export default {
+  accountService: {
+    prefix: '/mdm-server/mac/account/',
+  }
+}
+
+/**
+ * @desc   : 客户收款路由
+ * @author : 付斌
+ * @date   : 2024-02-01 16:03
+ */
+export const routeUrl = {
+  account: {
+  }
+}

+ 0 - 20
src/api/pages/fin/accounting-verification.js

@@ -1,20 +0,0 @@
-/**
- * @desc   : 账务核销服务
- * @author : 常皓宁
- * @date   : 2024/2/19 9:19
- */
-export default {
-  accountingVerificationService:{
-  }
-}
-
-/**
- * @desc   : 账务核销路由
- * @author : 常皓宁
- * @date   : 2024/2/22 15:10
- */
-export const routeUrl = {
-  accountingVerification: {
-    add: {key: 'add', method: 'add'},
-  }
-}

+ 0 - 4
src/api/pages/pur/pur-order.js

@@ -19,10 +19,6 @@ export const routeUrl = {
     add: {key: 'add', routeName: 'pur-order-add'},
     edit: {key: 'edit', routeName: 'pur-order-edit'},
     revert: {key: 'revert', method: 'revert'},
-    close: {key: 'close', method: 'close'},
-    returnAndExchangeGoods: {key: 'returnAndExchangeGoods', method: 'returnAndExchangeGoods'},
     purchaseReturn: {key: 'purchaseReturn', method: 'purchaseReturn'},
-    print: {key: 'print', method: 'print'},
-    //add:{key:'add', url:'/core/customer/add'}
   }
 }

+ 2 - 1
src/api/pages/pur/pur-return.js

@@ -6,6 +6,7 @@
 export default {
   purReturnService: {
     prefix: '/mdm-server/ivt/intoReturn/',
+    cancel:'cancel',
   }
 }
 
@@ -16,6 +17,6 @@ export default {
  */
 export const routeUrl = {
   purReturn: {
-    add: {key: 'add', routeName: 'pur-return-add'},
+    invalid: {key: 'invalid', routeName: 'invalid'},
   }
 }

+ 4 - 2
src/api/pages/sale/cus-receipt.js

@@ -7,6 +7,8 @@ export default {
   cusReceiptService: {
     prefix: '/mdm-server/mac/recPay/',
     selectRpInfoById: 'select_rp_info_by_id',
+    insertReceipt: 'insert_receipt',
+    insertRefund: 'insert_refund',
   }
 }
 
@@ -17,7 +19,7 @@ export default {
  */
 export const routeUrl = {
   cusReceipt: {
-    receipt: {key: 'receipt', routeName: 'cus-receipt-add'},
-    refund: {key: 'refund', routeName: 'cus-receipt-edit'},
+    receipt: {key: 'receipt', routeName: 'cus-receipt-receipt'},
+    refund: {key: 'refund', routeName: 'cus-receipt-refund'},
   }
 }

+ 5 - 3
src/config/index.js

@@ -599,8 +599,6 @@ export default {
     detail: 'detail',
     // 审批
     approval: 'approval',
-    // 退款
-    refund: 'refund',
     // 选择
     choose: 'choose',
     //结转
@@ -612,7 +610,11 @@ export default {
     //办理
     handle: 'handle',
     // 解冻
-    unFreeze:'unFreeze'
+    unFreeze:'unFreeze',
+    // 收款
+    receipt:'receipt',
+    // 退款
+    refund: 'refund',
   },
 
   /**

+ 3 - 0
src/locale/lang/zh-CN.js

@@ -430,6 +430,7 @@ export const columns = {
   biznisNo:'来源单号',
   amtRec:'收款金额',
   ownerFlag:'主业务标识',
+  receiptResidue:'客户可用余额',
 }
 
 /**
@@ -506,6 +507,8 @@ export const messages = {
   W_098: '当前单据不存在入库数据,无法进行此操作',
   W_099: '当前业务部门中不存在主业务部门,请重新操作',
   W_100: '当前业务员中不存在主业务员,请重新操作',
+  W_101: '待入库单据不允许进行采购退货',
+  W_102: '已出库单据不允许进行作废处理',
   E_001: '系统出现异常,请联系管理员。',
   Q_001: '当前页面的数据有过更改,请确认需要保存吗?',
   Q_002: '确定要进行{param}操作吗?',

+ 21 - 28
src/view/pur/pur-order/index.vue

@@ -8,10 +8,6 @@
         <BaseIndexButton ref="edit" name="edit"></BaseIndexButton>
         <!--冲正-->
         <BaseIndexButton ref="revert" name="revert"></BaseIndexButton>
-        <!--关闭-->
-        <BaseIndexButton ref="close" name="close"></BaseIndexButton>
-        <!--退货/换货-->
-        <BaseIndexButton ref="returnAndExchangeGoods" name="returnAndExchangeGoods"></BaseIndexButton>
         <!--采购退货-->
         <BaseIndexButton ref="purchaseReturn" name="purchaseReturn"></BaseIndexButton>
         <!--打印-->
@@ -37,7 +33,6 @@
                  :id="'table-'+$options.name"
                  ref="table-select"
                  :data="tableData"
-                 multiple
                  :height="this.tableHeight * split - 60"
                  primaryKey="purId"
                  :pageFlag="true"
@@ -73,10 +68,9 @@
           <!--采购折扣-->
           <DkTableColumn field="purDiscount"></DkTableColumn>
           <!--订单状态-->
-          <DkTableColumn field="purStatus"></DkTableColumn>
+          <DkTableColumn field="purStatusName"></DkTableColumn>
           <!--入库状态-->
-          <DkTableColumn field="intoStatus" :color-cards="['未入库','入库中','入库完成']"
-          ></DkTableColumn>
+          <DkTableColumn field="intoStatusName"></DkTableColumn>
           <!--入库中数量-->
           <DkTableColumn field="intoingQty"></DkTableColumn>
           <!--入库中金额-->
@@ -199,24 +193,6 @@ export default {
           digits: 0,
           sum: true
         },
-        // //标价
-        // {
-        //   field: 'pricePurchase',
-        //   title: self.$t('priceStd'),
-        //   digits: 2,
-        //   type: 'number',
-        //   UserSensitiveFlag: true
-        // },
-        // //标价金额
-        // {
-        //   field: 'amtStd',
-        //   title: self.$t('amtStd'),
-        //   type: 'number',
-        //   digits: 2,
-        //   sum: true,
-        //   UserSensitiveFlag: true
-        // },
-
         //采购价
         {
           field: 'pricePur',
@@ -239,8 +215,7 @@ export default {
         {field: 'nonStdCode', title: self.$t('nonStandardCode')},
         //入库状态
         {
-          field: 'intoStatus',
-          title: self.$t('intoStatusName'),
+          field: 'intoStatusName',
           type: 'text',
         },
         //入库中数量
@@ -372,12 +347,30 @@ export default {
       // 查询数据
       let excute = this.excute(this.$service.purOrderService, this.$service.purOrderService.selectByCond, params)
       excute.then(res=>{
+        console.log('res',res)
         if(res.code === this.$config.SUCCESS_CODE){
           this.tableDataDetail_goodsDetail = []
         }
       })
       return excute;
     },
+
+    /**
+    * @desc   : 采购退货
+    * @author : 常皓宁
+    * @date   : 2024/3/21 9:39
+    */
+    purchaseReturn(){
+      if(this.$refs['table-select'].batchKeys.length == 1){
+        // 判断状态是否可以进行采购退货
+        let row = this.$refs['table-select'].batchRows[0];
+        if(row.intoStatus == this.$config.intoStatus.daiRuKu){
+          this.$Message.warning(this.$t('W_007', {'param': this.$t('W_101')}));
+          return
+        }
+        this.$router.push('/pur/pur-return/add?fromId=' + this.$refs['table-select'].batchKeys[0])
+      }
+    },
     /**
      * @desc   : 打开附件
      * @author : 付斌

+ 28 - 32
src/view/pur/pur-return/form.vue

@@ -1,4 +1,4 @@
-<!-- @desc:采购入库新建  @auth:常皓宁 @time:2024/03/14 14:15 -->
+<!-- @desc:采购退货新建  @auth:常皓宁 @time:2024/03/14 14:15 -->
 <template>
   <div class="main-div" style="position: relative;">
     <loading :loading="loading" v-if="!modalVisible"></loading>
@@ -7,10 +7,7 @@
         <!--    选择来源单    -->
         <BaseIndexButton ref="choosePurchase" name="choosePurchase"
                          :disabled="editFlag"
-                         @click="open($config.routeUrl.purEnter.choosePurchase)"/>
-        <!--    清空条件    -->
-        <BaseIndexButton ref="clearDetail" name="clearDetail" :disabled="editFlag"
-                         @click="open($config.routeUrl.purEnter.clearDetail)"></BaseIndexButton>
+                         @click="choosePurchase(true)"/>
       </template>
     </BaseIndexButtonGroup>
     <DkCollapse @on-change="changeCollapse" ref="collapse">
@@ -25,20 +22,13 @@
                              :multiple="false"
                              :otherCondition="{supplierType:'供应商类别-采购'}"/>
           </DkFormItem>
-          <!-- 采购人 -->
-          <DkFormItem prop="makingUser" :label="'采购人'">
-            <SelectMagnifier v-model="formData.makingUser"
-                             :display-text="formData.makingUserName"
-                             :multiple="false"
-                             :type="this.$config.MagnifierType.staff">
-            </SelectMagnifier>
+          <!--收货人-->
+          <DkFormItem prop="contactName" :label="$t('contactName')">
+            <InputPop ref="contactName" :readonly="true" v-model="formData.contactName"/>
           </DkFormItem>
-          <!--部门-->
-          <DkFormItem prop="orgId" :label="$t('department')">
-            <SelectMagnifier v-model="formData.orgId"
-                             :display-text="formData.orgName"
-                             :multiple="false"
-                             :type="this.$config.MagnifierType.organization"></SelectMagnifier>
+          <!--收货电话-->
+          <DkFormItem prop="contactPhone" :label="$t('contactPhone')">
+            <InputPop :telephone="true" ref="contactPhone" :readonly="true" v-model="formData.contactPhone"/>
           </DkFormItem>
           <!--来源单号-->
           <DkFormItem prop="fromNo">
@@ -203,6 +193,7 @@ export default {
   data() {
     let self = this
     return {
+      fromId:null,//采购入库单来源Id
       //是否显示自动办理入库标识
       showAutoFlag: true,
       tableHeight: 450,
@@ -238,11 +229,12 @@ export default {
         intoId: null,//入库单Id
         fromId: null,//来源单Id
         fromNo: null,//来源单号
-        makeStaff: null,//采购人
         purId: null,//采购入库单Id
         purNo: null,//采购入库单号
         supId: null,//供应商Id
         supplierName: null,//供应商
+        contactName: null,//联系人
+        contactPhone: null,//联系电话
         automaticFlg: false,//自动出库标识
         remarks: null,
       },
@@ -327,21 +319,15 @@ export default {
     },
 
     /**
-     * @desc   : desc
-     * @author : 常皓宁
-     * @date   : 2024/3/15 15:41
-     */
-    clearDetail() {
-      this.purchaseItemList = null
-    },
-
-    /**
      * @desc   : 选择采购入库单
      * @author : 常皓宁
      * @date   : 2024/3/15 13:02
      */
-    choosePurchase() {
-      this.chooseModal = this.type === this.$config.formMode.add ? true : false
+    choosePurchase(modalOpenFlag) {
+      if(modalOpenFlag){
+        this.chooseModal = true
+        this.getDataTable()
+      }
     },
 
     /**
@@ -511,7 +497,7 @@ export default {
       // 新建
       if (this.type === this.$config.formMode.add) {
         let tableFilter = this.$refs['detailTable'].getTableDataFilter();
-        // 采购入库明细
+        // 采购退货明细
         this.params.intoReturnItemVOList = tableFilter
         // 入库中数量
         this.params.sumQuantity = tableFilter.sum('itemQty')
@@ -537,7 +523,7 @@ export default {
       if (this.type === this.$config.formMode.add) {
         return this.excute(this.$service.purReturnService, this.$service.purReturnService.insert, this.params)
       }
-      //入库办理
+      //退货办理
       else if (this.type === this.$config.formMode.handle) {
         return this.excute(this.$service.purEnterService, this.$service.purEnterService.purchaseHandleInbound, this.params)
       }
@@ -555,6 +541,7 @@ export default {
      */
     getDataTable() {
       let param = {}
+      param.fromId = this.fromId
       param.cpId = this.$store.state.user.cpId
       param.intoStatus = this.$config.intoStatus.yiRuKu
       param = Object.assign(param, this.searchCond._value)
@@ -591,6 +578,8 @@ export default {
       this.formData.supId = data.data.supId
       this.formData.supplierName = data.data.supplierName
       this.formData.remarks = data.data.remarks
+      this.formData.contactName = data.contactName
+      this.formData.contactPhone = data.contactPhone
       let dataItem = data.dataItem
       dataItem.map(row => {
         let item = row
@@ -627,6 +616,13 @@ export default {
       this.showAutoFlag = false;
     }
   },
+
+  activated() {
+    if (this.$route.query && this.$route.query.fromId) {
+      this.fromId = this.$route.query.fromId
+      this.choosePurchase(true)
+    }
+  },
 }
 </script>
 

+ 29 - 11
src/view/pur/pur-return/index.vue

@@ -12,9 +12,8 @@
         <BaseIndexButton ref="entryHandle" name="entryHandle"></BaseIndexButton>
         <!--    出库撤回    -->
         <BaseIndexButton ref="entryBack" name="entryBack"></BaseIndexButton>
-      </template>
-      <template #right>
-        <BaseIndexButton ref="add" name="add"></BaseIndexButton>
+        <!--    作废    -->
+        <BaseIndexButton ref="invalid" name="invalid"></BaseIndexButton>
       </template>
     </BaseIndexButtonGroup>
 
@@ -22,8 +21,7 @@
     <div id="search-cond-div" ref="search-cond-div" style="margin-top: 1px;padding: 0">
       <SearchCond ref="searchCond" v-model="searchCond"
                   @collapse-change="collapseChange" :setFlag="false"
-                  :search-content="searchContent"
-                  @on-switch-change="changeShowItem"></SearchCond>
+                  :search-content="searchContent"></SearchCond>
     </div>
 
     <!--  表格部分  -->
@@ -310,13 +308,33 @@ export default {
       })
 
     },
-    /**
-     * @desc   : 查看冲正单据
-     * @author : 付斌
-     * @date   : 2024-02-19 11:34
-     */
-    changeShowItem({code, e}) {
 
+    /**
+    * @desc   : 作废
+    * @author : 常皓宁
+    * @date   : 2024/3/21 12:59
+    */
+    invalid(rows) {
+      if (rows && rows.length > 0) {
+        if(rows.outStatus == this.$config.outStatus.yiChuKu){
+          this.$Message.warning(this.$t('W_007', {'param': this.$t('W_102')}));
+          return
+        }
+        this.$IBMessage({content: this.$t('Q_002', {'param': this.$v('invalid')}), title: this.$t('systemQuestion')},
+          {
+            ok: () => {
+              this.loading = true
+              this.excuteNoParam(this.$service.purReturnService, this.$service.purReturnService.cancel, [rows[0].returnId], false).then(res => {
+                if (res.code === this.$config.SUCCESS_CODE) {
+                  this.$Message.success(this.$t('I_001', {'param': this.$t('invalid')}))
+                } else {
+                  this.$Message.warning(res.message)
+                }
+                this.loading = false
+              })
+            },
+          })
+      }
     },
 
     /**

+ 45 - 8
src/view/sale/cus-receipt/form.vue

@@ -41,6 +41,10 @@
             <DatePickerPop v-model="formData.accDate"
                            :short-cut-flag="true"/>
           </DkFormItem>
+          <!--客户可用余额-->
+          <DkFormItem prop="receiptResidue">
+            <InputPop ref="receiptResidue" v-model="formData.receiptResidue" :disabled="true"/>
+          </DkFormItem>
           <!--合计收款金额-->
           <DkFormItem prop="sumAmtRec">
             <InputPop ref="sumAmtRec" v-model="formData.sumAmtRec" :disabled="true"/>
@@ -54,7 +58,7 @@
                      major-field="receiptId"
                      :height="this.tableHeight"
                      :new-row-flag="true"
-                     :columns="this.type === this.$config.formMode.add ? addReceiptColumns: null"
+                     :columns="this.type === this.$config.formMode.receipt ? receiptColumns : refundColumns"
                      controlId="macId" @on-choose="getTotals" @changeValue="getTotals"/>
         </div>
       </DkPanel>
@@ -93,11 +97,33 @@ export default {
         orgName: null,
         orgCode: null,
         sumAmtRec: null,
+        receiptResidue: null,
         makeStaff: self.$store.state.user.id,
         cpId: self.$store.state.user.cpId,
         itemList: [],
       },
-      addReceiptColumns: [
+      receiptColumns: [
+        {
+          field: 'macName',
+          controlId: 'macId',
+          type: 'tableSelect',
+          width: 200,
+          dataType: self.$config.tableSelectType.moneyAccount,
+          fieldUpdate: self.$updateColumns.receiptChooseMac,
+          searchDetailFlag: true
+        },
+        //收款金额
+        {
+          field: 'amtRec',
+          type: 'number',
+          digits: 2,
+          sum: true,
+        },
+        {
+          field: 'remarks', type: 'text', equal: true,
+        },
+      ],
+      refundColumns: [
         {
           field: 'macName',
           controlId: 'macId',
@@ -118,6 +144,7 @@ export default {
         {
           field: 'amtRec',
           type: 'number',
+          negative: true,
           digits: 2,
           sum: true,
         },
@@ -135,6 +162,7 @@ export default {
      * @date   : 2024-02-20 15:53
      */
     initData() {
+
     },
     /**
      *   @desc   : 获取客户资料并且监听每一次的客户修改
@@ -151,6 +179,15 @@ export default {
         this.formData.staffId = val[0].staffId
         this.formData.staffName = val[0].staffName
         this.formData.addressFull = val[0].addressFull
+
+        let params = {
+          'objectId': this.formData.objectId
+        }
+        this.excute(this.$service.accountService, this.$service.accountService.selectByCond, params).then(res => {
+          if (res.code === this.$config.SUCCESS_CODE && res.data.list.length > 0) {
+            this.formData.receiptResidue = res.data.list[0].receiptResidue
+          }
+        })
       }
     },
     /**
@@ -213,9 +250,9 @@ export default {
      * @date   : 2023/6/25 14:31
      */
     setParams(arg) {
-      if (this.type === this.$config.formMode.add) {
+      if (this.type === this.$config.formMode.receipt) {
         this.formData.rpType = this.$config.rpType.shouKuan
-      } else if (this.type === this.$config.formMode.edit) {
+      } else if (this.type === this.$config.formMode.refund) {
         this.formData.rpType = this.$config.rpType.tuiShouKuan
       }
       this.formData.accDate = new Date(this.formData.accDate).toDateStr();
@@ -235,10 +272,10 @@ export default {
      * @date   : 2023/6/25 14:31
      */
     saveData() {
-      if (this.type === this.$config.formMode.add) {
-        return this.excute(this.$service.cusReceiptService, this.$service.cusReceiptService.insert, this.params);
-      } else {
-        return this.excute(this.$service.cusReceiptService, this.$service.cusReceiptService.update, this.params)
+      if (this.type === this.$config.formMode.receipt) {
+        return this.excute(this.$service.cusReceiptService, this.$service.cusReceiptService.insertReceipt, this.params);
+      } else if (this.type === this.$config.formMode.refund) {
+        return this.excute(this.$service.cusReceiptService, this.$service.cusReceiptService.insertRefund, this.params)
       }
     },
     /**

+ 3 - 2
src/view/sale/cus-receipt/index.vue

@@ -8,7 +8,8 @@
         <BaseIndexButton ref="search" name="search"></BaseIndexButton>
         <BaseIndexButton ref="clear" name="clear"></BaseIndexButton>
         <BaseIndexButton ref="receipt" name="receipt" :isMustChooseFlag="false"></BaseIndexButton>
-        <BaseIndexButton ref="refund" name="refund"></BaseIndexButton>
+        <BaseIndexButton ref="refund" name="refund" :isMustChooseFlag="false"></BaseIndexButton>
+        <BaseIndexButton ref="edit" name="edit"></BaseIndexButton>
       </template>
     </BaseIndexButtonGroup>
 
@@ -28,7 +29,7 @@
                  ref="table-select"
                  :data="tableData"
                  showFooter
-                 :height="this.tableHeight"
+                 :height="this.tableHeight * split - 35"
                  primaryKey="rpId"
                  @pageChange="pageSizeChange"
                  :page-total="pageInfo.total"

+ 14 - 0
src/view/sale/cus-receipt/receipt.vue

@@ -0,0 +1,14 @@
+<template>
+  <CommonForm type="receipt" ></CommonForm>
+</template>
+
+<script>
+import CommonForm from './form'
+
+export default {
+  name: 'cus-receipt-receipt',
+  components:{
+    CommonForm
+  },
+}
+</script>

+ 2 - 2
src/view/sale/cus-receipt/add.vue → src/view/sale/cus-receipt/refund.vue

@@ -1,12 +1,12 @@
 <template>
-  <CommonForm type="add" ></CommonForm>
+  <CommonForm type="refund" ></CommonForm>
 </template>
 
 <script>
 import CommonForm from './form'
 
 export default {
-  name: 'cus-receipt-add',
+  name: 'cus-receipt-refund',
   components:{
     CommonForm
   },