Forráskód Böngészése

轮胎bug 2024-3-25

caojunjie 1 éve
szülő
commit
465b12402d

+ 9 - 0
src/api/tirePartsMall/basicData/listingManagement/index.js

@@ -73,6 +73,15 @@ export const groundingList = (params) => {
     params: params
   })
 }
+// 新的新增列表
+export const groundingListZero = (params) => {
+  return request({
+    url: '/api/blade-sales-part/stockDesc/groundingListZero',
+    method: 'get',
+    params: params
+  })
+}
+
 //导入
 export function productLaunch(data) {
   return request({

+ 8 - 0
src/api/tirePartsMall/inventory.js

@@ -7,3 +7,11 @@ export const getList = (params) => {
     params: params
   })
 }
+// 合计
+export const stockDescStockSum = (params) => {
+  return request({
+    url: '/api/blade-sales-part/stockDesc/stockSum',
+    method: 'get',
+    params: params
+  })
+}

+ 4 - 0
src/enums/column-name.js

@@ -1595,6 +1595,10 @@ const columnName = [{
     code: 340,
     name: '轮胎商城-基础资料-额度历史记录'
   },
+  {
+    code: 341,
+    name: '轮胎商城-系统管理-机构'
+  },
 ]
 export const getColumnName = (key) => {
   for (let index = 0; index < columnName.length; index++) {

+ 65 - 4
src/views/system/dept.vue

@@ -19,7 +19,9 @@
                      @size-change="sizeChange"
                      @refresh-change="refreshChange"
                      @on-load="onLoad"
-                     @tree-load="treeLoad">
+                     @tree-load="treeLoad"
+                     @resetColumn="resetColumnTwo('crud','option','optionList',341)"
+                     @saveColumn="saveColumnTwo('crud','option','optionList',341)" >
               <template slot="menuLeft">
                   <el-button type="danger"
                              size="small"
@@ -58,6 +60,11 @@
                                 @corpFocus="polBportsListfun($event,'polCnName')" >
                   </search-query>
               </template>
+              <template slot="regionForm">
+                  <avue-cascader :emit-path="true" showAllLevelss
+                                 v-model="form.region" placeholder="请选择产品分类" :dic="regionList"
+                                 :props="regionProps" @change="regionChange" ></avue-cascader>
+              </template>
           </avue-crud>
       </basic-container>
   </div>
@@ -94,7 +101,13 @@
           currentPage: 1,
           total: 0,
         },
-        option: {
+          regionProps:{
+              label: 'name',
+              value:'name'
+          },
+          regionList:[],
+        option:{},
+        optionList: {
           lazy: true,
           tip: false,
           simplePage: true,
@@ -222,6 +235,22 @@
                   overHidden:true,
               },
               {
+                  label: "所属区域",
+                  prop: "region",
+                  formslot:true,
+                  overHidden:true,
+                  // dicData: [],
+                  // dataType: "string",
+                  // type: "cascader",
+                  // // type: "async-cascader", // 修改为 "async-cascader"
+                  // props: {
+                  //     label: 'name',
+                  //     value: 'name'
+                  // },
+                  // lazy: true,
+                  // filterable: true,
+              },
+              {
                   label: "fax",
                   prop: "fax",
                   overHidden:true,
@@ -314,7 +343,10 @@
         data: []
       };
     },
-      created() {
+      async created() {
+          this.option = await this.getColumnData(this.getColumnName(341), this.optionList);
+          // this.findObject(this.option.column, "region").dicData = JSON.parse(localStorage.getItem('areaTypeTree'))
+          this.regionList = JSON.parse(localStorage.getItem('areaTypeTree'))
           // 判断是否是admin 权限
           let arr = localStorage.getItem('roleName').split(',')
           // 根据 租户好判断是否要显示 积分余额
@@ -368,6 +400,9 @@
       }
     },
     methods: {
+        regionChange(value){
+            console.log(value,404)
+        },
         // 装货港数据
         polBportsListfun(enName){
             bportsList(1,10,{enName}).then(res=>{
@@ -502,6 +537,8 @@
         if (["edit", "view"].includes(type)) {
           getDept(this.form.id).then(res => {
             this.form = res.data.data;
+            const region = JSON.parse(JSON.stringify(this.form.region.split(',')))
+            this.form.region = region[region.length - 1]
           });
         }
         done();
@@ -536,7 +573,31 @@
           console.log(res.data.data)
           resolve(res.data.data);
         });
-      }
+      },
+        //自定义列保存
+        async saveColumnTwo(ref, option, optionBack, code) {
+            /**
+             * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
+             * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
+             * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
+             */
+            const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
+            if (inSave) {
+                this.$message.success("保存成功");
+                //关闭窗口
+                this.$refs[ref].$refs.dialogColumn.columnBox = false;
+            }
+        },
+        //自定义列重置
+        async resetColumnTwo(ref, option, optionBack, code) {
+            this[option] = this[optionBack];
+            const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
+            if (inSave) {
+                this.$message.success("重置成功");
+                this.$refs[ref].$refs.dialogColumn.columnBox = false;
+            }
+        },
+
     }
   };
 </script>

+ 1 - 1
src/views/tirePartsMall/basicData/customerInformation/components/limitrecord.vue

@@ -200,7 +200,7 @@
       // 修改额度input 监听
       amountInput(value){
           this.$set(this.formEidt,'amountUpdate',regularBurdenfloating(value))
-          this.$set(this.formEidt,'amountNew',Number(this.formEidt.amountOld) - Number(this.formEidt.amountUpdate))
+          this.$set(this.formEidt,'amountNew',Number(this.formEidt.amountOld) + Number(this.formEidt.amountUpdate))
       },
       rowSave(row, done, loading) {
         limitrecordSubmit(row).then(() => {

+ 20 - 16
src/views/tirePartsMall/basicData/customerInformation/detailsPage.vue

@@ -35,9 +35,9 @@
                 @click="dialogVisibleCK = true"></i>
             </div>
           </template>
-          <template slot="creditLimit">
+          <template slot="limitAmount">
               <div style="display:flex;">
-                  <el-input v-model="form.creditLimit" disabled size="small" placeholder="请输入额度"></el-input>
+                  <el-input v-model="form.limitAmount" disabled size="small" placeholder="请输入额度"></el-input>
                   <i class="el-icon-circle-plus-outline" style="font-size:18px;line-height: 32px;margin-left:4px"
                      @click="limitPopupfun"></i>
               </div>
@@ -129,7 +129,7 @@
     </el-dialog>
 
     <el-dialog title="额度修改记录" :visible.sync="dialogVisibleED" append-to-body width="60%">
-        <limitrecord ref="limitrecord" :amountOld="form.creditLimit" :pid="form.id" ></limitrecord>
+        <limitrecord ref="limitrecord" :amountOld="form.limitAmount" :pid="form.id" ></limitrecord>
         <span slot="footer" class="dialog-footer">
             <el-button @click="cancellationEDfun">取 消</el-button>
             <el-button type="primary" @click="limitrecordSubmitfun">确 定</el-button>
@@ -385,7 +385,7 @@ export default {
       addressTitle: null,
       addressVisible: false,
       form: {
-          ifLimitAmount:0
+          ifLimitAmount:'0'
       },
       form2: {},
       form3: {},
@@ -483,29 +483,30 @@ export default {
               type: "switch",
               dicData:[{
                   label:'否',
-                  value:0
+                  value:'0'
               },{
                   label:'是',
-                  value:1
+                  value:'1'
               }],
           },
           {
             label: "信用额度",
-            prop: "creditLimit",
+            prop: "limitAmount",
             span: 8,
             type: "number",
             controls: false,
             precision: 2,
           },
-          {
-            label: "使用信用额度",
-            prop: "useCreditLimit",
-            span: 8,
-            type: "number",
-            disabled: true,
-            controls: false,
-            precision: 2
-          }, {
+          // {
+          //   label: "使用信用额度",
+          //   prop: "useCreditLimit",
+          //   span: 8,
+          //   type: "number",
+          //   disabled: true,
+          //   controls: false,
+          //   precision: 2
+          // },
+            {
             label: "备注",
             prop: "remarks",
             type: "textarea",
@@ -644,18 +645,21 @@ export default {
                         this.$message.success('修改成功')
                         this.$set(this.$refs.limitrecord,'formEidt',{})
                         this.dialogVisibleED = false
+                        this.getDetail(this.form.id)
                     })
                 }
             })
         }else {
             this.$set(this.$refs.limitrecord,'formEidt',{})
             this.dialogVisibleED = false
+            this.getDetail(this.form.id)
         }
     },
     // 额度弹窗取消
     cancellationEDfun(){
         this.$set(this.$refs.limitrecord,'formEidt',{})
         this.dialogVisibleED = false
+        this.getDetail(this.form.id)
     },
     // 额度弹窗开启
     limitPopupfun(){

+ 16 - 0
src/views/tirePartsMall/basicData/listingManagement/commodity.json

@@ -135,6 +135,22 @@
         "type":"select",
         "cell":"true",
         "overHidden": true
+      },
+      {
+        "label": "是否零库存上架",
+        "prop": "whether",
+        "search":true,
+        "type":"select",
+        "overHidden": true,
+        "dicData": [{
+          "label": "是",
+          "value": 1
+        }, {
+          "label": "否",
+          "value": 0
+        }],
+        "searchValue": 0,
+        "searchLabelWidth": 120
       }
     ]
   }

+ 22 - 5
src/views/tirePartsMall/basicData/listingManagement/index.vue

@@ -45,8 +45,11 @@
             <template slot-scope="{type,size,row,$index}" slot="menuLeft">
               <el-button type="primary" icon="el-icon-plus" size="small" @click="commoditySelection">选择产品
               </el-button>
-              <el-button class="el-icon-bottom" type="warning" size="small" @click="excelBox = true">
-                导入
+              <el-button class="el-icon-bottom" type="warning" size="small" @click="excelBoxfun('名称')">
+                按名称导入
+              </el-button>
+              <el-button class="el-icon-bottom" type="warning" size="small" @click="excelBoxfun('code')">
+                 按编码导入
               </el-button>
               <el-button class="el-icon-document-copy" :disabled="selectionList.length === 0" type="primary" size="small"
                 @click="change(row, 'up')">批量上架
@@ -215,7 +218,7 @@ import {
     getDetail,
     remove,
     productLaunch,
-    deptList, listAllP
+    deptList, listAllP, groundingListZero
 } from "@/api/tirePartsMall/basicData/listingManagement/index.js";
 import { getToken } from "@/util/auth";
 import commodity from "./commodity.json"
@@ -279,6 +282,7 @@ export default {
           }
         ]
       },
+        templateUrl:'/api/blade-sales-part/productLaunch/export-productLaunch',
       treeOption: {
         addBtn: false,
         menu: false,
@@ -529,6 +533,16 @@ export default {
     }
   },
   methods: {
+      excelBoxfun(name){
+          if (name == '名称') {
+              this.findObject(this.excelOption.column, "excelFile").action = '/api/blade-sales-part/productLaunch/import-productLaunch'
+              this.templateUrl = '/api/blade-sales-part/productLaunch/export-productLaunch'
+          }else if (name == 'code') {
+              this.findObject(this.excelOption.column, "excelFile").action = '/api/blade-sales-part/productLaunch/import-productLaunch-code'
+              this.templateUrl = '/api/blade-sales-part/productLaunch/export-productLaunch-code'
+          }
+          this.excelBox = true
+      },
       // 商城图片上传
       onSuccess(response, file, fileList){
           let version = '2'
@@ -607,7 +621,7 @@ export default {
 
     derivation() {
       window.open(
-        `/api/blade-sales-part/productLaunch/export-productLaunch?${this.website.tokenHeader
+        `${this.templateUrl}?${this.website.tokenHeader
         }=${getToken()}`
       );
     },
@@ -917,7 +931,10 @@ export default {
     })
     this.loading = true
 
-    groundingList(params).then(res => {
+    groundingListZero({
+        whether:params.whether?params.whether:0,
+        ...params,
+    }).then(res => {
       this.goodsListShow = res.data.data.records
       this.data = res.data.data.records;
       this.pages.total = res.data.data.total

+ 44 - 7
src/views/tirePartsMall/inventory/index.vue

@@ -17,6 +17,18 @@
               <el-button type="warning" icon="el-icon-download" size="small" @click="outExport">导出</el-button>
                 <!--<el-button type="primary" icon="el-icon-printer" size="small"-->
                 <!--           @click="handlePrint">打印</el-button>-->
+                <div style="display: flex;align-items: center;">
+                    <div style="font-size: 14px;color: #2d8cf0;margin-right: 30px;">
+                        <span>库存数量总计:</span>
+                        <span>{{stockSum.balanceQuantity}}</span>
+                    </div>
+                    <div style="font-size: 14px;color: #2d8cf0;">
+                        <span>库存金额总计:</span>
+                        <span>{{stockSum.inventoryAmount}}</span>
+                    </div>
+                </div>
+
+
             </template>
             <template slot-scope="{ row }" slot="balanceQuantity">
               <span style="color: #409EFF;cursor: pointer" @click.stop="storeInventoryOpen(row)">{{ row.balanceQuantity }}
@@ -32,7 +44,7 @@
 </template>
 
 <script>
-import { getList } from "@/api/tirePartsMall/inventory";
+import {getList, stockDescStockSum} from "@/api/tirePartsMall/inventory";
 import { getToken } from "@/util/auth";
 import { getCorpType } from "@/api/tirePartsMall/basicData/commodityInformation";
 import reportDialog from "@/components/report-dialog/main.vue";
@@ -50,6 +62,7 @@ export default {
       search: {whether:'0'},
       form: {},
       dataList: [],
+      stockSum:{}, // 合计数据
       detailData: {},
       params: {
         corpId: null,
@@ -59,7 +72,7 @@ export default {
         pageSize: 20,
         currentPage: 1,
         total: 0,
-        pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
+        pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 1000]
       },
       key: 0,
       treeOption: {
@@ -94,7 +107,7 @@ export default {
         highlightCurrentRow: true,
         dialogWidth: "70%",
         summaryText: "合计",
-        showSummary: true,
+        showSummary: false,
         sumColumnList: [
           {
             name: 'balanceQuantity',
@@ -164,10 +177,11 @@ export default {
             width: 100
           }, {
             label: '仓库',
-            prop: "storageName",
+            prop: "storageId",
             // searchProp: "storageId",
             search: true,
             overHidden: true,
+            hide:true,
             type: 'select',
             props: {
               label: 'cname',
@@ -175,7 +189,14 @@ export default {
             },
             dicUrl: '/api/blade-sales-part/storageDesc/listAll',
             width: 100
-          }, {
+          },
+          {
+              label: '仓库',
+              prop: "storageName",
+              overHidden: true,
+              width: 100
+          },
+          {
             label: '库存数量',
             prop: "balanceQuantity",
             overHidden: true,
@@ -226,7 +247,20 @@ export default {
               label: '否',
                 value: '0'
             }],
-          }]
+          }, {
+            label: '是否上架',
+            prop: "ifGrounding",
+            overHidden: true,
+            search: true,
+            type: 'select',
+            dicData: [{
+                label: '未上架',
+                value: '1'
+            }, {
+                label: '已上架',
+                value: '0'
+            }],
+          },]
       }
     }
   },
@@ -313,7 +347,7 @@ export default {
     onLoad(page, params = {}) {
       console.log(params);
       params = {
-        storageId:params.storageName,
+        storageId:params.storageId,
         current: page.currentPage,
         size: page.pageSize,
         ...Object.assign(params, this.search)
@@ -322,6 +356,9 @@ export default {
       getList(params).then(res => {
         this.dataList = res.data.data.records
         this.page.total = res.data.data.total
+        stockDescStockSum(params).then(re=>{
+            this.stockSum = re.data.data
+        })
         this.$nextTick(() => {
           this.$refs.crud.doLayout()
         })

+ 2 - 2
src/views/tirePartsMall/salesManagement/purchaseOrder/detailsPage.vue

@@ -86,10 +86,10 @@
                                 <el-button type="primary" icon="el-icon-plus" size="small" :disabled="isAddBtn"
                                     @click="rowAdd(row)">添加商品</el-button>
                                 <el-button type="success" size="small" :disabled="isAddBtn" icon="el-icon-bottom"
-                                           @click="excelDialogfun('名称')">名称导入
+                                           @click="excelDialogfun('名称')">名称导入
                                 </el-button>
                                 <el-button type="success" size="small" :disabled="isAddBtn" icon="el-icon-bottom"
-                                           @click="excelDialogfun('code')">Code导入
+                                           @click="excelDialogfun('code')">Code导入
                                 </el-button>
                                 <el-button type="primary" icon="el-icon-printer" size="small"
                                            @click="handlePrint">打印</el-button>