Bladeren bron

Finish Hotfix-4

chen 3 jaren geleden
bovenliggende
commit
645867a0f2

+ 16 - 15
src/store/getters.js

@@ -1,16 +1,17 @@
 const getters = {
-  sidebar: state => state.app.sidebar,
-  device: state => state.app.device,
-  visitedViews: state => state.tagsView.visitedViews,
-  cachedViews: state => state.tagsView.cachedViews,
-  token: state => state.user.token,
-  userid: state => state.user.userid,
-  phone: state => state.user.phone,
-  name: state => state.user.name,
-  menus: state => state.user.menus,
-  customerId: state => state.user.customerId,
-  customerName: state => state.user.customerName,
-  showMessages: state => state.user.showMessages,
-  code:state =>state.sales.code
-}
-export default getters
+  sidebar: (state) => state.app.sidebar,
+  device: (state) => state.app.device,
+  visitedViews: (state) => state.tagsView.visitedViews,
+  cachedViews: (state) => state.tagsView.cachedViews,
+  token: (state) => state.user.token,
+  userid: (state) => state.user.userid,
+  phone: (state) => state.user.phone,
+  name: (state) => state.user.name,
+  menus: (state) => state.user.menus,
+  customerId: (state) => state.user.customerId,
+  customerName: (state) => state.user.customerName,
+  customerNumber: (state) => state.user.customerNumber,
+  showMessages: (state) => state.user.showMessages,
+  code: (state) => state.sales.code,
+};
+export default getters;

+ 12 - 1
src/store/modules/user.js

@@ -18,6 +18,7 @@ const getDefaultState = () => {
     menus: "", // 菜单
     customerId: "", //经销商ID
     customerName: "", //经销商名称
+    customerNumber: "", //经销商编码
     showMessages: null, //
   };
 };
@@ -49,6 +50,9 @@ const mutations = {
   SET_CUSTOMERNAME: (state, customerName) => {
     state.customerName = customerName;
   },
+  SET_CUSTOMERNUMBER: (state, customerNumber) => {
+    state.customerNumber = customerNumber;
+  },
   showMessage: (state, value) => {
     if (value == "yes") {
       state.showMessages = true;
@@ -96,7 +100,13 @@ const actions = {
             return reject("Verification failed, please Login again.");
           }
           console.log(data);
-          const { nickName, userName, customerId, customerName } = data;
+          const {
+            nickName,
+            userName,
+            customerId,
+            customerName,
+            customerNumber,
+          } = data;
 
           // 模拟请求数据
           // const menus = [
@@ -125,6 +135,7 @@ const actions = {
           // menus.push({ path: '*', redirect: '/404', hidden: true })
           commit("SET_CUSTOMERID", customerId);
           commit("SET_CUSTOMERNAME", customerName);
+          commit("SET_CUSTOMERNUMBER", customerNumber);
           commit("SET_NAME", nickName);
           commit("SET_PHONE", userName);
           // commit("SET_MENUS", menus) // 触发vuex SET_MENUS 保存路由表到vuex

+ 13 - 4
src/views/engin_deposit/components/refund_list-detail.vue

@@ -503,7 +503,14 @@ export default {
   methods: {
     //下载
     downLoadFn(v) {
-      window.open(this.imageURL + v);
+      // window.open(this.imageURL + v + "?attname=新文件名.xlsx");
+      // const url = this.imageURL + v;
+      // const link = document.createElement("a");
+      // link.style.display = "none";
+      // link.href = url;
+      // link.setAttribute("download", "导入学生账号模板");
+      // document.body.appendChild(link);
+      // link.click();
     },
     // 检查文件类型
     checkFileType(url) {
@@ -538,7 +545,8 @@ export default {
       };
       await getDepositManageExamine(data);
       this.$message.success("审批驳回");
-      this.$parent.showSurrender = true;
+      this.goBack();
+      this.$emit("updateList");
     },
     //审批通过
     async adoptFn() {
@@ -551,8 +559,9 @@ export default {
         examineResult: 1,
       };
       await getDepositManageExamine(data);
-      this.$message.success("审批驳回");
-      this.$parent.showSurrender = false;
+      this.$message.success("审批通过");
+      this.goBack();
+      this.$emit("updateList");
     },
     async getData(data) {
       const res = await getDepositManageDetail(data);

+ 54 - 6
src/views/engin_deposit/refund_list.vue

@@ -101,6 +101,16 @@
       </div>
       <!-- 按钮 -->
       <div class="btn-group clearfix">
+        <div class="fl">
+          <el-radio-group
+            @change="changeEnginOrderTypeFn"
+            v-model="enginOrderType"
+            size=""
+          >
+            <el-radio-button label="HOME">家用工程</el-radio-button>
+            <el-radio-button label="TRADE">商用工程</el-radio-button>
+          </el-radio-group>
+        </div>
         <div class="fr">
           <el-button type="primary" size="small" @click="exportFn"
             >导出</el-button
@@ -220,7 +230,7 @@
         </div>
       </div>
     </div>
-    <RefundListDetail :detailId="detailId" v-else />
+    <RefundListDetail @updateList="updateList" :detailId="detailId" v-else />
   </div>
 </template>
 
@@ -237,6 +247,7 @@ export default {
   },
   data() {
     return {
+      enginOrderType: "HOME", //列表类型
       currentPage: 1, // 当前页码
       pageSize: 10, // 每页数量
       listTotal: 0, // 列表总数
@@ -264,7 +275,7 @@ export default {
       customerKeyword: "",
       // endDeliverTime: "",
       enginOrderNo: "",
-      enginOrderType: "",
+      enginOrderType: this.enginOrderType,
       examineStatus: "",
       refEnginRecordNo: "",
       refProjectName: "",
@@ -273,6 +284,43 @@ export default {
     });
   },
   methods: {
+    //审批后更新列表数据
+    updateList() {
+      this.getDataList({
+        pageSize: this.pageSize,
+        pageNum: this.currentPage,
+        confirmName: "",
+        createName: "",
+        customerKeyword: "",
+        // endDeliverTime: "",
+        enginOrderNo: "",
+        enginOrderType: this.enginOrderType,
+        examineStatus: "",
+        refEnginRecordNo: "",
+        refProjectName: "",
+        refUseUnit: "",
+        // startDeliverTime: "",
+      });
+    },
+    //切换列表
+    changeEnginOrderTypeFn(v) {
+      // console.log(v);
+      this.getDataList({
+        pageSize: this.pageSize,
+        pageNum: this.currentPage,
+        confirmName: "",
+        createName: "",
+        customerKeyword: "",
+        // endDeliverTime: "",
+        enginOrderNo: "",
+        enginOrderType: v,
+        examineStatus: this.examine,
+        refEnginRecordNo: "",
+        refProjectName: "",
+        refUseUnit: "",
+        // startDeliverTime: "",
+      });
+    },
     // 更改每页数量
     handleSizeChange(val) {
       this.pageSize = val;
@@ -285,7 +333,7 @@ export default {
         customerKeyword: "",
         // endDeliverTime: "",
         enginOrderNo: "",
-        enginOrderType: "",
+        enginOrderType: this.enginOrderType,
         examineStatus: this.examine,
         refEnginRecordNo: "",
         refProjectName: "",
@@ -304,7 +352,7 @@ export default {
         customerKeyword: "",
         // endDeliverTime: "",
         enginOrderNo: "",
-        enginOrderType: "",
+        enginOrderType: this.enginOrderType,
         examineStatus: this.examine,
         refEnginRecordNo: "",
         refProjectName: "",
@@ -323,7 +371,7 @@ export default {
         customerKeyword: "",
         // endDeliverTime: "",
         enginOrderNo: "",
-        enginOrderType: "",
+        enginOrderType: this.enginOrderType,
         examineStatus: this.examine,
         refEnginRecordNo: "",
         refProjectName: "",
@@ -359,7 +407,7 @@ export default {
         confirmName: "",
         createName: "",
         enginOrderNo: "",
-        enginOrderType: "",
+        enginOrderType: this.enginOrderType,
         examineStatus: this.examine,
         refUseUnit: "",
         ...this.searchForm,

+ 3 - 2
src/views/finance/balance_sum.vue

@@ -102,7 +102,7 @@
               <el-button
                 type="text"
                 class="textColor"
-                @click="seeFN(row.customerName, row.customerNumber)"
+                @click="seeFN(row.customerName, row.customerNumber,row.customerId)"
               >
                 明细
               </el-button>
@@ -165,12 +165,13 @@ export default {
       });
     },
     //明细
-    seeFN(customerName, customerNumber) {
+    seeFN(customerName, customerNumber,customerId) {
       this.$router.push({
         path: "/finance/details/standbook_list",
         query: {
           customerName,
           customerNumber,
+          customerId
         },
       });
     },

+ 88 - 12
src/views/finance/standbook_list.vue

@@ -29,6 +29,7 @@
           <el-col :xs="24" :sm="12" :lg="6">
             <el-form-item label="经销商名称" prop="customerId">
               <el-select
+                :disabled="isDisabled"
                 class="selectStyle"
                 v-model="searchForm.customerId"
                 placeholder="请选择"
@@ -443,7 +444,7 @@
 </template>
 
 <script>
-import { mapGetters } from "vuex";
+// import { mapGetters } from "vuex";
 import { getWalletCustomerList } from "@/api/finance/change_apply";
 import {
   getStandbookList,
@@ -475,13 +476,24 @@ export default {
       listLoading: false, // 列表加载loading
 
       bill: "COMMONLY",
+      isCustomer: JSON.parse(localStorage.getItem("supply_user")).isCustomer,
+      isDisabled: false,
     };
   },
-  computed: {
-    ...mapGetters(["customerId"]),
-  },
+
   created() {
+    // console.log(
+    //   this.customerId,
+    //   this.$store.state.user.customerName,
+    //   this.$store.state.user.customerNumber,
+
+    //   777777
+    // );
+
     if (this.$route.query.customerName && this.$route.query.customerNumber) {
+      this.isDisabled = true;
+      this.searchForm.customerId = this.$route.query.customerName;
+      this.changeFn(this.$route.query.customerId);
       this.getDataList({
         pageSize: this.pageSize,
         pageNum: this.currentPage,
@@ -489,14 +501,27 @@ export default {
         customerName: this.$route.query.customerName,
         customerNumber: this.$route.query.customerNumber,
       });
+    } else if (this.isCustomer) {
+      this.isDisabled = true;
+      this.searchForm.customerId = this.$store.state.user.customerName;
+      this.changeFn(this.$store.state.user.customerId);
+      this.getDataList({
+        pageSize: this.pageSize,
+        pageNum: this.currentPage,
+        type: this.bill,
+        customerName: this.$store.state.user.customerName,
+        customerNumber: this.$store.state.user.customerNumber,
+      });
     } else {
       this.getDataList({
         pageSize: this.pageSize,
         pageNum: this.currentPage,
         type: this.bill,
       });
+      this.getCustomerDataList();
     }
-    this.getCustomerDataList();
+
+    // this.getCustomerDataList();
     // this.getWalletList();
     // this.getDataDict();
   },
@@ -533,7 +558,11 @@ export default {
     //改变经销商
     async changeFn(v) {
       this.searchForm.customerWalletId = "";
-      let res = await getWalletCustomerList({ customerId: v, type: this.bill });
+      let res = await getWalletCustomerList({
+        customerId: v,
+        type: this.bill,
+        hasRecord: true,
+      });
       this.walletList = res.data;
     },
     //获取经销商列表
@@ -556,12 +585,22 @@ export default {
       // });
       if (this.$route.query.customerName && this.$route.query.customerNumber) {
         this.getDataList({
+          ...this.searchForm,
           pageSize: this.pageSize,
           pageNum: this.currentPage,
           type: this.bill,
           customerName: this.$route.query.customerName,
           customerNumber: this.$route.query.customerNumber,
         });
+      } else if (this.isCustomer) {
+        this.getDataList({
+          ...this.searchForm,
+          pageSize: this.pageSize,
+          pageNum: this.currentPage,
+          type: this.bill,
+          customerName: this.$store.state.user.customerName,
+          customerNumber: this.$store.state.user.customerNumber,
+        });
       } else {
         this.getDataList({
           ...this.searchForm,
@@ -583,12 +622,22 @@ export default {
       // });
       if (this.$route.query.customerName && this.$route.query.customerNumber) {
         this.getDataList({
+          ...this.searchForm,
           pageSize: this.pageSize,
           pageNum: this.currentPage,
           type: this.bill,
           customerName: this.$route.query.customerName,
           customerNumber: this.$route.query.customerNumber,
         });
+      } else if (this.isCustomer) {
+        this.getDataList({
+          ...this.searchForm,
+          pageSize: this.pageSize,
+          pageNum: this.currentPage,
+          type: this.bill,
+          customerName: this.$store.state.user.customerName,
+          customerNumber: this.$store.state.user.customerNumber,
+        });
       } else {
         this.getDataList({
           ...this.searchForm,
@@ -609,10 +658,17 @@ export default {
     //重置
     async resetFn() {
       // this.searchForm.customerId = "";
-      this.walletList = [];
-      this.customerName = "";
-      this.customerNumber = "";
-      await this.$refs.searchForm.resetFields();
+      // this.walletList = [];
+      // this.customerName = "";
+      // this.customerNumber = "";
+      if (this.isCustomer || this.$route.query.customerId) {
+        await this.$refs.searchForm.resetFields();
+      } else {
+        this.walletList = [];
+        this.customerName = "";
+        this.customerNumber = "";
+        await this.$refs.searchForm.resetFields();
+      }
     },
     //查询
     searchFn() {
@@ -638,6 +694,15 @@ export default {
           customerName: this.$route.query.customerName,
           customerNumber: this.$route.query.customerNumber,
         });
+      } else if (this.isCustomer) {
+        this.getDataList({
+          ...this.searchForm,
+          pageSize: this.pageSize,
+          pageNum: this.currentPage,
+          type: this.bill,
+          customerName: this.$store.state.user.customerName,
+          customerNumber: this.$store.state.user.customerNumber,
+        });
       } else {
         this.getDataList({
           ...this.searchForm,
@@ -670,15 +735,26 @@ export default {
       this.pageSize = 10;
       this.currentPage = 1;
       if (this.$route.query.customerName && this.$route.query.customerNumber) {
+        this.changeFn(this.$route.query.customerId);
         this.getDataList({
           ...this.searchForm,
 
-          pageSize: 10,
-          pageNum: 1,
+          pageSize: this.pageSize,
+          pageNum: this.currentPage,
           type: v,
           customerName: this.$route.query.customerName,
           customerNumber: this.$route.query.customerNumber,
         });
+      } else if (this.isCustomer) {
+        this.changeFn(this.$store.state.user.customerId);
+        this.getDataList({
+          ...this.searchForm,
+          pageSize: this.pageSize,
+          pageNum: this.currentPage,
+          type: this.bill,
+          customerName: this.$store.state.user.customerName,
+          customerNumber: this.$store.state.user.customerNumber,
+        });
       } else {
         this.getDataList({
           // ...this.searchForm,

+ 1 - 1
src/views/supply/retail/components/retail_detail.vue

@@ -88,7 +88,7 @@
             {{ scope.row.price | numToFixed }}
           </template>
         </el-table-column>
-        <el-table-column align="right" label="数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="right" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="right" label="订单金额" prop="totalAmount" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
             {{ scope.row.totalAmount | numToFixed }}