QuKatie 3 年 前
コミット
5eda2bd6e6

+ 8 - 0
src/api/basicData/rateManagement.js

@@ -32,3 +32,11 @@ export function deleteDetails(data) {
     }
   })
 }
+//列表删除
+export function delItem(data) {
+  return request({
+    url: '/api/blade-client/paritiesitem/updateByPid',
+    method: 'post',
+    params:data
+  })
+}

+ 10 - 1
src/components/price-Library/main.vue

@@ -182,7 +182,16 @@ export default {
       this.$refs.crud.toggleSelection();
     }
   },
-  watch: {}
+  watch: {
+    tableOption: function() {
+      if (localStorage.getItem("roleName") == "贸易") {
+        this.findObject(this.tableOption.column, "taxRate").hide = true;
+        this.findObject(this.tableOption.column, "taxRate").showColumn = false;
+        this.findObject(this.tableOption.column, "price").hide = true;
+        this.findObject(this.tableOption.column, "price").showColumn = false;
+      }
+    }
+  }
 };
 </script>
 

+ 67 - 74
src/views/basicData/rateManagement/detailsPage.vue

@@ -64,7 +64,8 @@
               type="primary"
               @click="createExRate"
               :disabled="detailData.status == 1"
-            >产生汇率项目</el-button>
+              >产生汇率项目</el-button
+            >
           </template>
         </avue-form>
       </basic-container>
@@ -87,7 +88,7 @@
 <script>
 import { getToken } from "@/util/auth";
 import { dateFormat } from "@/util/date";
-import { typeSave, dataDetail } from "@/api/basicData/rateManagement";
+import { typeSave, dataDetail, delItem } from "@/api/basicData/rateManagement";
 import { optionList } from "./js/optionList";
 import reportDialog from "@/components/report-dialog/main";
 export default {
@@ -108,7 +109,7 @@ export default {
         labelWidth: 100,
         column: [
           {
-            label: "货币代码",
+            label: "货币币别",
             prop: "code",
             span: 6,
             rules: [
@@ -117,7 +118,7 @@ export default {
                 message: " ",
                 trigger: "blur"
               }
-            ],
+            ]
           },
           {
             label: "货币名称",
@@ -129,7 +130,7 @@ export default {
                 message: " ",
                 trigger: "blur"
               }
-            ],
+            ]
           },
           {
             label: "默认汇率",
@@ -141,7 +142,7 @@ export default {
                 message: " ",
                 trigger: "blur"
               }
-            ],
+            ]
           },
           {
             label: "本位币",
@@ -153,7 +154,7 @@ export default {
                 message: " ",
                 trigger: "blur"
               }
-            ],
+            ]
           },
           {
             label: "符号",
@@ -165,14 +166,14 @@ export default {
                 message: " ",
                 trigger: "blur"
               }
-            ],
+            ]
           },
           {
             label: "汇率类型",
             prop: "paritiesType",
             type: "select",
             filterable: true,
-            clearable:false,
+            clearable: false,
             props: {
               label: "dictValue",
               value: "dictValue"
@@ -198,7 +199,7 @@ export default {
                 message: " ",
                 trigger: "change"
               }
-            ],
+            ]
           },
           {
             label: "汇率年度",
@@ -212,7 +213,7 @@ export default {
                 message: " ",
                 trigger: "blur"
               }
-            ],
+            ]
           },
           {
             label: "月份",
@@ -232,12 +233,12 @@ export default {
                 message: " ",
                 trigger: "change"
               }
-            ],
+            ]
           },
           {
             prop: "button",
             span: 6
-          },
+          }
         ]
       },
       optionList: optionList
@@ -252,7 +253,7 @@ export default {
     reportDialog
   },
   created() {
-    this.$set(this.form,'standardMoney', 0);
+    this.$set(this.form, "standardMoney", 0);
     if (this.detailData.id) {
       this.getDetail(this.detailData.id);
     }
@@ -269,52 +270,37 @@ export default {
       dataDetail(id)
         .then(res => {
           this.form = res.data.data;
-          this.dataList = res.data.data.paritiesItemList? res.data.data.paritiesItemList: [];
+          this.dataList = res.data.data.paritiesItemList
+            ? res.data.data.paritiesItemList
+            : [];
         })
         .finally(() => {
           this.allloading = false;
         });
     },
-    rowDel(row) {
-      this.$confirm("确定删除数据?", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      }).then(() => {
-        if (row.id) {
-          delItem(row.id).then(res => {
-            this.$message({
-              type: "success",
-              message: "删除成功!"
-            });
-          });
-        } else {
-          this.$message({
-            type: "success",
-            message: "删除成功!"
-          });
-          this.dataList.splice(row.$index, 1);
-        }
-      });
-    },
     //修改提交触发
     editCustomer() {
       this.$refs["form"].validate((valid, done) => {
         done();
         if (valid) {
           this.loadingBtn = true;
-          typeSave({
-            ...this.form,
-            paritiesItemList: this.dataList
-          })
-            .then(res => {
-              this.$message.success("保存成功");
-              // this.form = res.data.data;
-              this.getDetail(res.data.data.id)
-            })
-            .finally(() => {
-              this.loadingBtn = false;
+          if (this.form.id) {
+            delItem({ id: this.form.id }).then(res => {
+              if (res.data.code == 200) {
+                typeSave({
+                  ...this.form,
+                  paritiesItemList: this.dataList
+                })
+                  .then(res => {
+                    this.$message.success("保存成功");
+                    this.getDetail(res.data.data.id);
+                  })
+                  .finally(() => {
+                    this.loadingBtn = false;
+                  });
+              }
             });
+          }
         } else {
           return false;
         }
@@ -357,46 +343,47 @@ export default {
       this.$refs["form"].validate((valid, done) => {
         done();
         if (valid) {
+          this.toggleForm();
           this.dataList = [];
-          if (this.form.paritiesType == '年汇率') {
+          if (this.form.paritiesType == "年汇率") {
+            delete this.form.moon;
             const data = {
               annual: this.form.annual,
               receivableParities: this.form.parities,
               handleParities: this.form.parities,
               receiptsParities: this.form.parities,
-              actuallyParities: this.form.parities,
-            }
-            this.dataList.push(data)
-          } else if (this.form.paritiesType == '月汇率') {
-            for (let i = 1;i <= 12;i++) {
+              actuallyParities: this.form.parities
+            };
+            this.dataList.push(data);
+          } else if (this.form.paritiesType == "月汇率") {
+            for (let i = 1; i <= 12; i++) {
               const data = {
                 annual: this.form.annual,
-                moon: i + '月',
+                moon: i + "月",
                 receivableParities: this.form.parities,
                 handleParities: this.form.parities,
                 receiptsParities: this.form.parities,
-                actuallyParities: this.form.parities,
-              }
-              this.dataList.push(data)
+                actuallyParities: this.form.parities
+              };
+              this.dataList.push(data);
             }
-          } else if (this.form.paritiesType == '日汇率') {
-            const days = this.getCountDays(this.form.annual, this.form.moon)
-            for (let i = 1;i <= days;i++) {
+          } else if (this.form.paritiesType == "日汇率") {
+            const days = this.getCountDays(this.form.annual, this.form.moon);
+            for (let i = 1; i <= days; i++) {
               const data = {
                 annual: this.form.annual,
-                moon: this.form.moon + '月',
-                national: i + '号',
+                moon: this.form.moon + "月",
+                national: i + "号",
                 receivableParities: this.form.parities,
                 handleParities: this.form.parities,
                 receiptsParities: this.form.parities,
-                actuallyParities: this.form.parities,
-              }
-              this.dataList.push(data)
-              console.log(this.dataList)
+                actuallyParities: this.form.parities
+              };
+              this.dataList.push(data);
             }
           }
         }
-      })
+      });
     },
     // 获取一个月的天数
     getCountDays(curDate, month) {
@@ -405,21 +392,27 @@ export default {
       date.setDate(0);
       return date.getDate();
     },
+    toggleForm() {
+      if (this.form.paritiesType == "日汇率") {
+        this.findObject(this.optionList.column, "national").hide = false;
+        this.findObject(this.optionList.column, "moon").hide = false;
+      } else if (this.form.paritiesType == "月汇率") {
+        this.findObject(this.optionList.column, "national").hide = true;
+        this.findObject(this.optionList.column, "moon").hide = false;
+      } else {
+        this.findObject(this.optionList.column, "national").hide = true;
+        this.findObject(this.optionList.column, "moon").hide = true;
+      }
+    }
   },
   watch: {
     "form.paritiesType": function(row) {
       if (row == "日汇率") {
         this.findObject(this.option.column, "moon").display = true;
-        this.findObject(this.optionList.column, "national").hide = false;
-        this.findObject(this.optionList.column, "moon").hide = false;
       } else if (row == "月汇率") {
         this.findObject(this.option.column, "moon").display = false;
-        this.findObject(this.optionList.column, "national").hide = true;
-        this.findObject(this.optionList.column, "moon").hide = false;
       } else {
         this.findObject(this.option.column, "moon").display = false;
-        this.findObject(this.optionList.column, "national").hide = true;
-        this.findObject(this.optionList.column, "moon").hide = true;
       }
     }
   }

+ 1 - 1
src/views/basicData/rateManagement/index.vue

@@ -92,7 +92,7 @@ export default {
         stripe: true,
         column: [
           {
-            label: "货币代码",
+            label: "货币币别",
             prop: "code",
             overHidden: true,
             search:true

+ 13 - 1
src/views/maintenance/priceLibrary/index.vue

@@ -188,7 +188,7 @@ import { micrometerFormat } from "@/util/validate";
 import { orderStateFormat } from "@/enums/order-stauts";
 import { taxRateFormat } from "@/enums/tax-rate";
 import { purchaseCal } from "@/util/calculate";
-  import {mapGetters} from "vuex";
+import { mapGetters } from "vuex";
 import _ from "lodash";
 export default {
   name: "customerInformation",
@@ -456,6 +456,18 @@ export default {
   },
   computed: {
     ...mapGetters(["permission"])
+  },
+  watch: {
+    option: function() {
+      if (localStorage.getItem("roleName") == "贸易") {
+        this.findObject(this.option.column, "coefficient").hide = true;
+        this.findObject(this.option.column, "coefficient").showColumn = false;
+        this.findObject(this.option.column, "taxRate").hide = true;
+        this.findObject(this.option.column, "taxRate").showColumn = false;
+        this.findObject(this.option.column, "price").hide = true;
+        this.findObject(this.option.column, "price").showColumn = false;
+      }
+    }
   }
 };
 </script>

+ 8 - 8
src/views/statisticAnalysis/salaryInquiry/index.vue

@@ -86,10 +86,10 @@ export default {
     //点击搜索按钮触发
     searchChange(params, done) {
       if (params.createTime) {
-        params.startYear = params.createTime[0].substr(0,4);
-        params.startMonth = params.createTime[0].substr(5,7);
-        params.endYear = params.createTime[1].substr(0,4);
-        params.endMonth = params.createTime[1].substr(5,7);
+        params.startYear = params.createTime[0].substr(0, 4);
+        params.startMonth = params.createTime[0].substr(5, 7);
+        params.endYear = params.createTime[1].substr(0, 4);
+        params.endMonth = params.createTime[1].substr(5, 7);
       }
       delete params.createTime;
       this.page.currentPage = 1;
@@ -126,13 +126,13 @@ export default {
         }=${getToken()}&cname=${this.search.cname}&inSection=${
           this.search.inSection
         }&idNumber=${this.search.idNumber}&startYear=${
-          this.search.createTime ? this.search.createTime[0].substr(0,4) : ''
+          this.search.createTime ? this.search.createTime[0].substr(0, 4) : ""
         }&startMonth=${
-          this.search.createTime ? this.search.createTime[0].substr(5,7) : ''
+          this.search.createTime ? this.search.createTime[0].substr(5, 7) : ""
         }&endYear=${
-          this.search.createTime ? this.search.createTime[1].substr(0,4) : ''
+          this.search.createTime ? this.search.createTime[1].substr(0, 4) : ""
         }&endMonth=${
-          this.search.createTime ? this.search.createTime[1].substr(5,7) : ''
+          this.search.createTime ? this.search.createTime[1].substr(5, 7) : ""
         }`
       );
     }

+ 12 - 0
src/views/system/lock/index.vue

@@ -112,6 +112,18 @@ export default {
         {
           label: "小学部",
           value: "xxb"
+        },
+        {
+          label: "初中部",
+          value: "czb"
+        },
+        {
+          label: "高中部",
+          value: "gzb"
+        },
+        {
+          label: "后勤部",
+          value: "hqb"
         }
       ]
     };