|
@@ -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;
|
|
|
},
|
|
|
},
|