Bläddra i källkod

提货人管理新增操作功能

chen 3 år sedan
förälder
incheckning
5978a09a09

+ 8 - 0
src/api/basic_data/taker.js

@@ -24,6 +24,14 @@ export function addDataList(data) {
     data
   })
 }
+//删除提货人档案
+export function deleDataList(params) {
+  return request({
+    url: '/taker-record/del',
+    method: 'POST',
+    params
+  })
+}
 //提货人档案列表导出
 export function exportDataList(params) {
   return request({

+ 22 - 23
src/views/basic_data/dealer/dealer_deposit.vue

@@ -139,8 +139,8 @@
               >
                 <el-button type="text" class="textColor" slot="reference"
                   >删除</el-button
-                ></el-popconfirm
-              >
+                >
+              </el-popconfirm>
             </template>
           </el-table-column>
         </el-table>
@@ -192,12 +192,19 @@
         </el-form-item>
 
         <el-form-item label="押金比例" prop="rate">
-          <el-input v-model.number="dialogForm.rate" class="inputStyle">
+          <el-input
+            placeholder="请输入押金比例"
+            @focus="rateFn"
+            v-model.number="dialogForm.rate"
+            class="inputStyle"
+          >
             <i class="el-input__icon" slot="suffix">% </i>
           </el-input>
         </el-form-item>
         <el-form-item label="押金定额金额" prop="amount">
           <el-input
+            placeholder="请输入押金定额"
+            @focus="amountFn"
             v-model.number="dialogForm.amount"
             class="inputStyle"
           ></el-input>
@@ -254,26 +261,6 @@ import { number } from "echarts";
 
 export default {
   data() {
-    // var amount = (rule, value, callback) => {
-    //   console.log(rule, value);
-    //   console.log(this.dialogForm);
-    //   if (this.dialogForm.rate !== 0) {
-    //     this.$message.warning("已选押金比例,如需选择定额押金,请把押金比例归零");
-    //     // callback(new Error("已选押金比例,如需选择定额押金,请把押金比例归零"));
-    //   } else {
-    //     callback();
-    //   }
-    // };
-    // var rate = (rule, value, callback) => {
-    //   console.log(rule, value);
-    //   console.log(this.dialogForm);
-    //   if (this.dialogForm.amount !== 0) {
-    //     this.$message.warning("已选定额押金,如需选择押金比例,请把定额押金归零");
-    //     // callback(new Error("已选定额押金,如需选择押金比例,请把定额押金归零"));
-    //   } else {
-    //     callback();
-    //   }
-    // };
     return {
       title: "",
       currentPage: 1, // 当前页码
@@ -351,7 +338,19 @@ export default {
     await this.getList({ pageNum: 1, pageSize: 10 });
     await this.getDealerDataList({ pageNum: 1, pageSize: 10 });
   },
+
   methods: {
+    //押金
+    amountFn(e) {
+      if (this.dialogForm.rate != 0 || this.dialogForm.rate != "") {
+        this.$message.warning("已选押金比例,如需选择定额押金,请把押金比例归零");
+      }
+    },
+    rateFn(e) {
+      if (this.dialogForm.amount != 0 || this.dialogForm.amount != "") {
+        this.$message.warning("已选定额押金,如需选择押金比例,请把定额押金归零");
+      }
+    },
     //取消
     async cancelFn() {
       await this.$refs.dialogForm.resetFields();

+ 15 - 1
src/views/basic_data/taker/taker_car.vue

@@ -249,7 +249,7 @@ export default {
       },
       rules: {
         customerId: [
-          { required: true, message: "请选择活动区域", trigger: "change" },
+          { required: true, message: "请选择活动区域", trigger: "blur" },
         ],
         mobile: [
           {
@@ -304,6 +304,13 @@ export default {
     },
     //取消
     async cancelFn() {
+      this.addForm = {
+        customerId: "",
+        mobile: "",
+        carType: "",
+        volume: "",
+        carBrand: "",
+      };
       await this.$refs.addForm.resetFields();
       this.dialogForm = false;
     },
@@ -342,6 +349,13 @@ export default {
     },
     //新增
     addDataList() {
+      this.addForm = {
+        customerId: "",
+        mobile: "",
+        carType: "",
+        volume: "",
+        carBrand: "",
+      };
       this.dialogForm = true;
       this.getDealerDataList({ pageNum: 1, pageSize: 10 });
     },

+ 83 - 5
src/views/basic_data/taker/taker_list.vue

@@ -155,13 +155,34 @@
             show-overflow-tooltip
           >
             <template slot-scope="scope"
-              ><el-button type="text" class="textColor">查看</el-button>
+              ><el-button
+                type="text"
+                class="textColor"
+                @click="seeFn(scope.row)"
+                >查看</el-button
+              >
+              <el-popconfirm
+                @onConfirm="deleFn(scope.row.id)"
+                title="这是一段内容确定删除吗?"
+              >
+                <el-button type="text" class="textColor" slot="reference"
+                  >删除</el-button
+                >
+              </el-popconfirm>
               <el-button
                 type="text"
                 class="textColor"
                 @click="stopFn(scope.row.id)"
+                v-if="scope.row.flag === 1"
                 >停用</el-button
               >
+              <el-button
+                type="text"
+                class="textColor"
+                @click="rebuild(scope.row)"
+                v-else-if="scope.row.flag === 2"
+                >重建</el-button
+              >
             </template>
           </el-table-column>
         </el-table>
@@ -273,6 +294,7 @@ import {
   addDataList,
   getCodeApi,
   stopTaker,
+  deleDataList,
 } from "@/api/basic_data/taker";
 import { getDealerList } from "@/api/basic_data/dealer";
 import { downloadFiles } from "@/utils/util";
@@ -295,7 +317,7 @@ export default {
       },
       rules: {
         customerId: [
-          { required: true, message: "请选择经销商", trigger: "change" },
+          { required: true, message: "请选择经销商", trigger: "blur" },
         ],
         takerName: [
           { required: true, message: "请输入提货人姓名", trigger: "blur" },
@@ -351,6 +373,7 @@ export default {
         telephone: "",
       },
       dealerList: [],
+      id: "", //重建之前的Id
     };
   },
   async created() {
@@ -358,11 +381,46 @@ export default {
     await this.getDealerDataList({ pageNum: 1, pageSize: 10 });
   },
   methods: {
-    changFn(v) {
-      console.log(v);
+    //重建
+    rebuild(data) {
+      this.id = data.id;
+      this.addForm = {
+        customerId: data.customerId,
+        takerName: data.takerName,
+        identity: data.identity,
+        phone: data.phone,
+
+        sparePhone: data.sparePhone,
+        expireTime: "",
+        code: "",
+      };
+      this.dialogForm = true;
+    },
+    //删除
+    async deleFn(ids) {
+      await deleDataList({ ids });
+      this.$message.success("删除成功");
+      this.getDataList({ pageNum: 1, pageSize: 10 });
     },
+    //查看
+    seeFn(data) {
+      console.log(data);
+      this.addForm = data;
+      this.dialogForm = true;
+    },
+
     //取消
     cancelFn() {
+      this.addForm = {
+        customerId: "",
+        takerName: "",
+        identity: "",
+        phone: "",
+
+        sparePhone: "",
+        expireTime: "",
+        code: "",
+      };
       this.$refs.addForm.resetFields();
       this.dialogForm = false;
     },
@@ -432,12 +490,32 @@ export default {
       )[0];
       console.log(res);
       await addDataList({ ...this.addForm, orgNumber: res.useOrgNumber });
+      await deleDataList({ ids: this.id });
       this.$message.success("新增成功");
-      this.$refs.addForm.resetFields();
+      // this.addForm = {
+      //   customerId: "",
+      //   takerName: "",
+      //   identity: "",
+      //   phone: "",
+
+      //   sparePhone: "",
+      //   expireTime: "",
+      //   code: "",
+      // };
       this.getDataList({ pageNum: 1, pageSize: 10 });
       this.dialogForm = false;
     },
     addFn() {
+      this.addForm = {
+        customerId: "",
+        takerName: "",
+        identity: "",
+        phone: "",
+
+        sparePhone: "",
+        expireTime: "",
+        code: "",
+      };
       this.dialogForm = true;
     },
   },