jiangn 1 год назад
Родитель
Сommit
2404d3db67

+ 2 - 0
src/api/pages/common/common.js

@@ -121,6 +121,8 @@ export default {
     getGoodsForIntoByPage: 'get_goods_for_into_by_page',
     // 获取首页实时数据
     getRealTimeData: 'get_real_time_data',
+    // 获取商品品牌补分页
+    getGoodsBrandNoPage:'get_goods_brand_no_page',
   },
   fileService:{
     prefix: 'mdm-server/file/',

+ 23 - 0
src/api/pages/fin/cost-refill.js

@@ -0,0 +1,23 @@
+/**
+ * @desc   : 成本补录
+ * @author : 姜宁
+ * @date   : 2024/7/22 16:08
+ */
+export default {
+  costRefillService:{
+    prefix: '/mdm-server/ivt/inboundItem/',
+    selectCostCheckList:'select_cost_check_list',
+  }
+}
+
+/**
+ * @desc   : 采购入库路由
+ * @author : 付斌
+ * @date   : 2024-02-01 16:03
+ */
+export const routeUrl = {
+  costRefill: {
+    costRefill:{key: 'costRefill', method: 'costRefill'},
+    save:{key: 'save', method: 'save'}
+  }
+}

+ 2 - 0
src/components/table/edit-table/edit-table.vue

@@ -909,6 +909,8 @@ export default {
       // 编辑
       if (n && n.length > 0) {
         this.tableData = n
+        // 把改变中的数据清空
+        this.tableDataChange = []
         this.handleSelectData();
       } else {
         this.tableData = []

+ 9 - 1
src/mixins/index.js

@@ -331,6 +331,10 @@ export const indexMixin = {
             }
             this.pageInfo.currentPage = 1;
           }
+          // 处理查询后的数据
+          if(this.handleSearchData){
+            this.handleSearchData();
+          }
           this.loading = false
         }
       })
@@ -395,7 +399,7 @@ export const indexMixin = {
         // 2、给参数赋值
         this._setParams(arg);
         // this.params.ftyId = this.$store.state.user.ftyId;// 给工厂赋默认值
-        this.params.cpId = this.$store.state.user.cpId;
+        // this.params.cpId = this.$store.state.user.cpId;
 
         // 如果主键id有值需要在新建时清空主键Id
         if (this.primaryKey && button === 'add' && this.params[this.primaryKey]) {
@@ -416,6 +420,10 @@ export const indexMixin = {
               this.$refs[modalRef].showModal = false;
               this.searchData(); // 重新触发查询
             }
+            // 保存后提供给也没做处理
+            if(this.handleData){
+              this.handleData();
+            }
           }
           // else {
           //   // 如果不成功就提示错误信息

+ 269 - 0
src/view/fin/cost-refill/index.vue

@@ -0,0 +1,269 @@
+<!-- @desc:陈本补录  @auth:姜宁  @time:2024-7-22 09:56 -->
+<template>
+  <div class="main-div" ref="mainDiv">
+    <loading :loading="loading" v-if="!modalVisible"></loading>
+    <BaseIndexButtonGroup ref="BaseIndexButtonGroup" id="BaseIndexButtonGroup">
+      <template #left>
+        <!--    查询    -->
+        <BaseIndexButton ref="search" name="search"></BaseIndexButton>
+        <!--    清空条件    -->
+        <BaseIndexButton ref="clear" name="clear"></BaseIndexButton>
+        <!--    保存    -->
+        <BaseIndexButton  ref="save" name="save"></BaseIndexButton>
+      </template>
+    </BaseIndexButtonGroup>
+
+    <!--  卡片区  -->
+    <div class="index-card">
+      <!--  查询条件区域  -->
+      <div id="search-cond-div" ref="search-cond-div" class="search-cond-class">
+        <SearchCond ref="searchCond" v-model="searchCond"
+                    @collapse-change="collapseChange" :setFlag="false"
+                    :searchContent="searchContent"
+        ></SearchCond>
+      </div>
+      <!--  表格部分  -->
+      <div :style="'height: ' + tableHeight + 'px'" class="split-div-class">
+        <DkSplit v-model="split">
+          <!-- 左边部分   -->
+          <DkTable slot="left" ref="leftTable" :data="leftData" :height="tableHeight" :page-flag="false"
+                   :page-total-flag="false"  :choose-flag="false" :show-setting-flag="false"
+                   @current-change="currentChangeEvent($event)" primaryKey="brandId">
+            <DkTableColumn field="brandName" :title="this.$t('brandIds')" />
+          </DkTable>
+
+          <!-- 右边部分   -->
+          <EditTable slot="right" ref="goodsTable" :data="tableData" showFooter major-field="skuId"
+                     :height="this.tableHeight -35"
+                     :operateFlag = "false"
+                     :new-row-flag="false"
+                     :columns="costRefillColumns"
+                     @on-choose="getTotals"
+                     @changeValue="getTotals"/>
+        </DkSplit>
+      </div>
+    </div>
+
+  </div>
+</template>
+
+<script>
+import {indexMixin} from "@/mixins";
+import {forEach} from "@/libs/tools/tools";
+
+export default {
+  name: 'cost-refill',
+  mixins: [indexMixin],
+  data(){
+    let self = this
+    return{
+      leftData: [],
+      tableData: [],
+      brandList: [],
+      saveParams: [],// 保存时赋值的参数
+      brandId:null,
+      split: 0.15,
+      minSplit: 0.15,
+      searchContent:
+        [
+          {
+            itemCode: 'skuName',
+          },
+          {
+            itemCode: 'skuModel',
+          },
+        ],
+      costRefillColumns: [
+        {
+          field: 'skuModel',
+          type: 'disabled',
+        },
+        {
+          field: 'skuName',
+          type: 'disabled',
+        },
+        {
+          field: 'skuCode',
+          type: 'disabled',
+        },
+        {
+          field: 'skuSpec',
+          type: 'disabled',
+        },
+        {
+          field: 'brandName',
+          type: 'disabled',
+        },
+        {
+          field: 'costPrice',
+          title: self.$t('costPriceSaleOrder'),
+          type: 'number',
+          digits: 2,
+          number: true,
+          sum: true,
+        },
+      ],
+    }
+  },
+  methods:{
+
+    /**
+     * @desc   : 加载数据
+     * @author : 姜宁
+     * @date   : 2024/7/22 16:16
+     */
+    initData(){
+      // 查询品牌信息
+      this.getGoodsBrand();
+    },
+
+   /**
+    * @desc   : 品牌数据源
+    * @author : 姜宁
+    * @date   : 2024/7/22 16:16
+    */
+    getGoodsBrand(){
+      this.excute(this.$service.commonService, this.$service.commonService.getGoodsBrandNoPage, {}).then(res => {
+        if (res.code === this.$config.SUCCESS_CODE) {
+          let brands  = [{
+            brandId : null,
+            brandName : '全部',
+          }]
+          this.leftData = brands.concat(res.data)
+        }
+      })
+    },
+    /**
+     * @desc   : 商品表格中成本改变计算金额
+     * @author : 姜宁
+     * @date   : 2024/7/23 13:57
+     */
+    getTotals(field, row, rowIndex) {
+      let table = this.$refs['goodsTable'].tableData.filter(it=>it.skuId)
+      if (table && table.length > 0) {
+        table.forEach(row => {
+          if(!row['costPrice']){
+            this.$set(row, 'costPrice', 0);
+          }
+          row.itemList.forEach(it=>{
+            it["costPrice"] = row['costPrice']
+            it['costAmt'] = row['costPrice']*it['intoQty']
+          })
+        })
+      }
+    },
+    /**
+     * @desc   : 查询数据
+     * @author : 姜宁
+     * @date   : 2024/7/22 16:17
+     */
+    getData(params){
+      return this.excute(this.$service.costRefillService,this.$service.costRefillService.selectCostCheckList,params)
+    },
+    /**
+     * @desc   : 处理查询结果
+     * @author : 姜宁
+     * @date   : 2024/7/23 13:45
+     */
+    handleSearchData(){
+      if(this.tableData && this.tableData.length > 0){
+        this.tableData.forEach(it=>{
+          if(it.itemList && it.itemList.value){
+            it.itemList = JSON.parse(it.itemList.value)
+          }
+        })
+      }
+    },
+    /**
+     * @desc   : 查询参数重新赋值
+     * @author : 姜宁
+     * @date   : 2024/7/22 16:17
+     */
+    setSearchParams(params){
+      params.brandId = this.brandId;
+      return params;
+    },
+    /**
+     * @desc   : 右侧列表行变化事件
+     * @author : 姜宁
+     * @date   : 2024/7/22 16:17
+     */
+    currentChangeEvent({row}){
+      if (row != null){
+        this.brandId =  row.brandId;
+      }
+      let changeTable= this.$refs['goodsTable'].getTableChangeData()?.filter(it=>it.costPrice !== 0);
+      if (changeTable && changeTable.length > 0){
+        //提示是否保存
+        this.$IBMessage({
+            content: this.$t('Q_005'),
+            title: this.$t('systemQuestion')
+          },
+          {
+            ok: () => {
+              this.save()
+            },
+            cancel: () => {
+              //调用查询事件
+              this.searchData();
+            }
+          })
+      }
+      else{
+        //调用查询事件
+        this.searchData();
+      }
+    },
+    /**
+     * @desc   : 保存校验
+     * @author : 姜宁
+     * @date   : 2024/7/23 14:43
+     */
+    validData(){
+     let changeGoodsTable = this.$refs['goodsTable'].getTableChangeData()?.filter(it=>it.costPrice !== 0);
+     if(!changeGoodsTable || changeGoodsTable.length == 0){
+       this.$message.error(this.$t('W_015'))
+       return false;
+     }
+      return true;
+    },
+    /**
+     * @desc   : 参数赋值
+     * @author : 姜宁
+     * @date   : 2024/7/23 14:43
+     */
+    setParams(){
+      let changeGoodsTable = this.$refs['goodsTable'].getTableChangeData();
+      let itemList = []
+      changeGoodsTable.forEach(it=>{
+        itemList = itemList.concat(it.itemList)
+      })
+      this.saveParams = itemList;
+    },
+    /**
+     * @desc   : 保存方法
+     * @author : 姜宁
+     * @date   : 2024/7/23 14:43
+     */
+    saveData(){
+      return this.excute(this.$service.costCheckService, this.$service.costCheckService.costCheckOk, this.saveParams, false)
+    },
+    /**
+     * @desc   : 查询后做处理
+     * @author : 姜宁
+     * @date   : 2024/7/23 14:43
+     */
+    handleData(){
+      let row = [this.$refs['leftTable'].getCurrentRow()]
+      this.brandId = row[0].brandId;
+      //调用查询事件
+      this.searchData();
+    },
+  },
+  created() {
+    // this.primaryKey = 'skuId'  // 设置主键Id
+    this.routeObjName = 'costRefill'  // 设置路由名称
+  },
+}
+</script>
+

+ 1 - 3
src/view/fin/fund-report/index.vue

@@ -198,15 +198,13 @@ export default {
           }
           this.isMacFlag = false
           this.isMacDetailFlag = true
-          // this.tableDataDetail_rpItem = res.data.recPayItem;
-          // this.tableDataDetail_recPayHandleItem = res.data.recPayHandleItem;
         }
         this.loading = false
       })
     },
   },
   created() {
-    this.primaryKey = 'itemId'  // 设置主键Id
+    this.primaryKey = 'rpId'  // 设置主键Id
     this.routeObjName = 'detailReport'  // 设置路由名称
   }
 }