|
@@ -12,15 +12,14 @@
|
|
|
<el-row>
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="是否同意" prop="whether_back">
|
|
|
+ <el-form-item label="是否同意" prop="is_th">
|
|
|
<el-select
|
|
|
style="width: 100%"
|
|
|
- v-model="ruleForm.whether_back"
|
|
|
- placeholder="请选择是否同意退回"
|
|
|
- @change="handleView"
|
|
|
+ v-model="ruleForm.is_th"
|
|
|
+ placeholder="是否同意退回"
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="item in whether_back_options"
|
|
|
+ v-for="item in is_th_options"
|
|
|
:key="item.value"
|
|
|
:label="item.label"
|
|
|
:value="item.value"
|
|
@@ -29,65 +28,55 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="反馈备注" prop="feedback_remark">
|
|
|
+ <el-form-item label="反馈备注" prop="remark">
|
|
|
<el-input
|
|
|
type="textarea"
|
|
|
- placeholder="请输入反馈备注"
|
|
|
- v-model="ruleForm.feedback_remark"
|
|
|
+ placeholder="反馈备注"
|
|
|
+ v-model="ruleForm.remark"
|
|
|
maxlength="250"
|
|
|
show-word-limit
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <el-row v-if="ruleForm.whether_back === 'value1'">
|
|
|
+ <el-row v-if="ruleForm.is_th === '1'">
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="地址省/市/区" prop="return_goods_addr">
|
|
|
- <select-area
|
|
|
- :placeholder="'省/市/区'"
|
|
|
- :value="ruleForm.return_goods_addr"
|
|
|
- :is-detail="id !== 'add'"
|
|
|
- @selectChange="selectAreaAddr_code"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="详细地址" prop="addr_detail">
|
|
|
+ <el-form-item label="收件人" prop="contactor">
|
|
|
<el-input
|
|
|
- v-model="ruleForm.addr_detail"
|
|
|
- placeholder="详细地址"
|
|
|
+ v-model="ruleForm.contactor"
|
|
|
+ placeholder="收件人"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="收件人" prop="addressee">
|
|
|
+ <el-form-item label="收件人电话" prop="mobile">
|
|
|
<el-input
|
|
|
- v-model="ruleForm.addressee"
|
|
|
- placeholder="收件人"
|
|
|
+ v-model="ruleForm.mobile"
|
|
|
+ placeholder="收件人电话"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="收件人电话" prop="addressee_phone">
|
|
|
- <el-input
|
|
|
- v-model="ruleForm.addressee_phone"
|
|
|
- placeholder="收件人电话"
|
|
|
- ></el-input>
|
|
|
+ <el-form-item label="地址省市区" prop="addr_code">
|
|
|
+ <select-area
|
|
|
+ :placeholder="'省市区'"
|
|
|
+ :value="ruleForm.addr_code"
|
|
|
+ :is-detail="id !== 'add'"
|
|
|
+ @selectChange="selectAreaAddr_code"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="物流要求" prop="express_require">
|
|
|
- <el-input
|
|
|
- v-model="ruleForm.express_require"
|
|
|
- placeholder="请输入物流"
|
|
|
- ></el-input>
|
|
|
+ <el-form-item label="详细地址" prop="addr">
|
|
|
+ <el-input v-model="ruleForm.addr" placeholder="详细地址"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
|
|
|
<el-col :span="24" style="text-align: right">
|
|
|
- <el-button type="primary" @click="submitForm" v-if="true"
|
|
|
+ <el-button type="primary" :size="'mini'" @click="submitForm" v-if="true"
|
|
|
>保 存</el-button
|
|
|
>
|
|
|
</el-col>
|
|
@@ -99,8 +88,8 @@ import { isMobile } from "@/utils/validate";
|
|
|
import asyncRequest from "@/apis/service/sheetOrder/zxAfterSale";
|
|
|
import resToken from "@/mixins/resToken";
|
|
|
export default {
|
|
|
- name: "supplier_feedback",
|
|
|
- props: ["id", "showModelThis", "newTime"],
|
|
|
+ name: "zxAfterSaleDetail",
|
|
|
+ props: ["id", "showModelThis", "newTime", "sitem"],
|
|
|
mixins: [resToken],
|
|
|
data() {
|
|
|
const validatemobile = (rule, value, callback) => {
|
|
@@ -119,32 +108,32 @@ export default {
|
|
|
status: "", //存储详情接口返的状态
|
|
|
showModelThis: this.showModel,
|
|
|
ruleForm: {
|
|
|
- whether_back: "", //是否同意退回
|
|
|
- feedback_remark: "", //反馈备注
|
|
|
- return_goods_addr: [], //退货地址
|
|
|
- addr_detail: "", //退货详细地址
|
|
|
- addressee: "", //收件人
|
|
|
- addressee_phone: "", //收件人电话
|
|
|
- express_require: "", //物流要求
|
|
|
+ is_th: "1", //是否同意退回
|
|
|
+ remark: "", //反馈备注
|
|
|
+ addr_code: [], //退货地址
|
|
|
+ addr: "", //退货详细地址
|
|
|
+ contactor: "", //收件人
|
|
|
+ mobile: "", //收件人电话
|
|
|
+ wsm_code: "-",
|
|
|
},
|
|
|
rulesThis: this.rules,
|
|
|
// 验证规则
|
|
|
rules: {
|
|
|
- whether_back: [
|
|
|
+ is_th: [
|
|
|
{
|
|
|
required: true,
|
|
|
trigger: "change",
|
|
|
message: "请选择是否同意退回",
|
|
|
},
|
|
|
],
|
|
|
- feedback_remark: [
|
|
|
+ remark: [
|
|
|
{
|
|
|
required: true,
|
|
|
message: "请输入反馈备注",
|
|
|
trigger: "blur",
|
|
|
},
|
|
|
],
|
|
|
- return_goods_addr: [
|
|
|
+ addr_code: [
|
|
|
{
|
|
|
type: "array",
|
|
|
required: true,
|
|
@@ -152,42 +141,35 @@ export default {
|
|
|
trigger: "change",
|
|
|
},
|
|
|
],
|
|
|
- addr_detail: [
|
|
|
+ addr: [
|
|
|
{
|
|
|
required: true,
|
|
|
message: "请输入详细退货地址",
|
|
|
trigger: "blur",
|
|
|
},
|
|
|
],
|
|
|
- addressee: [
|
|
|
+ contactor: [
|
|
|
{
|
|
|
required: true,
|
|
|
message: "请输入收件人",
|
|
|
trigger: "blur",
|
|
|
},
|
|
|
],
|
|
|
- addressee_phone: [
|
|
|
+ mobile: [
|
|
|
{
|
|
|
required: true,
|
|
|
trigger: "blur",
|
|
|
validator: validatemobile,
|
|
|
},
|
|
|
],
|
|
|
- express_require: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- trigger: "blur",
|
|
|
- message: "请输入物流信息",
|
|
|
- },
|
|
|
- ],
|
|
|
},
|
|
|
- whether_back_options: [
|
|
|
+ is_th_options: [
|
|
|
{
|
|
|
- value: "value1",
|
|
|
+ value: "1",
|
|
|
label: "同意退回",
|
|
|
},
|
|
|
{
|
|
|
- value: "value2",
|
|
|
+ value: "0",
|
|
|
label: "拒绝退回",
|
|
|
},
|
|
|
],
|
|
@@ -197,7 +179,7 @@ export default {
|
|
|
powers() {
|
|
|
let tran =
|
|
|
this.$store.getters.btnList.find(
|
|
|
- (item) => item.menu_route == "supplier_feedback"
|
|
|
+ (item) => item.menu_route == "zxAfterSaleDetail"
|
|
|
) || {};
|
|
|
if (tran && tran.action && tran.action.length > 0) {
|
|
|
return tran.action;
|
|
@@ -210,11 +192,6 @@ export default {
|
|
|
this.initForm();
|
|
|
},
|
|
|
watch: {
|
|
|
- id: function (val) {
|
|
|
- if (val) {
|
|
|
- this.initForm();
|
|
|
- }
|
|
|
- },
|
|
|
newTime: function (val) {
|
|
|
if (val) {
|
|
|
this.initForm();
|
|
@@ -227,33 +204,10 @@ export default {
|
|
|
},
|
|
|
async initForm() {
|
|
|
this.loading = true;
|
|
|
- if (this.id === "add") {
|
|
|
- this.rulesThis = this.rules;
|
|
|
- await this.resetForm();
|
|
|
- } else {
|
|
|
- this.rulesThis = this.rules;
|
|
|
- await this.resetForm();
|
|
|
- // await this.initData();
|
|
|
- }
|
|
|
+ this.rulesThis = this.rules;
|
|
|
+ await this.resetForm();
|
|
|
this.loading = false;
|
|
|
},
|
|
|
- // async initData() {
|
|
|
- // const res = await asyncRequest.detail({ id: this.id });
|
|
|
- // if (res && res.code === 0 && res.data) {
|
|
|
- // let { hand_name, resign_name, hand_uid, resign_uid, status } = res.data;
|
|
|
- // this.resign_name = resign_name;
|
|
|
- // this.hand_name = hand_name;
|
|
|
- // this.status = status;
|
|
|
- // this.ruleForm = {
|
|
|
- // hand_uid: hand_uid.split(","),
|
|
|
- // resign_uid: resign_uid.split(","),
|
|
|
- // };
|
|
|
- // } else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
- // await this.logout();
|
|
|
- // } else {
|
|
|
- // this.$message.warning(res.message);
|
|
|
- // }
|
|
|
- // },
|
|
|
|
|
|
async resetForm() {
|
|
|
// 重置
|
|
@@ -261,73 +215,57 @@ export default {
|
|
|
if (this.$refs.ruleForm) {
|
|
|
this.$refs.ruleForm.resetFields();
|
|
|
this.$refs.ruleForm.clearValidate();
|
|
|
+ const { contactor, is_th, mobile, addr_code, addr, returnCode,remark} =
|
|
|
+ this.sitem;
|
|
|
this.ruleForm = {
|
|
|
- whether_back: "", //是否同意退回
|
|
|
- feedback_remark: "", //反馈备注
|
|
|
- return_goods_addr: [], //退货地址
|
|
|
- addr_detail: "", //退货详细地址
|
|
|
- addressee: "", //收件人
|
|
|
- addressee_phone: "", //收件人电话
|
|
|
- express_require: "", //物流要求
|
|
|
+ returnCode: returnCode || "",
|
|
|
+ is_th: is_th || "1", //是否同意退回
|
|
|
+ remark: remark||"", //反馈备注
|
|
|
+ addr_code: addr_code || [], //退货地址
|
|
|
+ addr: addr || "", //退货详细地址
|
|
|
+ contactor: contactor || "", //收件人
|
|
|
+ mobile: mobile || "", //收件人电话
|
|
|
+ wsm_code: "-",
|
|
|
};
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
async submitForm() {
|
|
|
await this.$refs.ruleForm.validate(async (valid) => {
|
|
|
- // if (valid) {
|
|
|
- // const { resign_uid, hand_uid } = this.ruleForm;
|
|
|
- // let rUid = resign_uid.toString(),
|
|
|
- // hUid = hand_uid.toString();
|
|
|
- // if (rUid === hUid) {
|
|
|
- // this.$message.error("离职人和接收人不能相同");
|
|
|
- // return;
|
|
|
- // }
|
|
|
- // this.loading = true;
|
|
|
- // const model = {
|
|
|
- // id: this.id,
|
|
|
- // resign_uid: rUid,
|
|
|
- // hand_uid: hUid,
|
|
|
- // };
|
|
|
- // let res = {};
|
|
|
- // if (this.id === "add") {
|
|
|
- // delete model["id"];
|
|
|
- // res = await asyncRequest.add(model);
|
|
|
- // } else {
|
|
|
- // res = await asyncRequest.update(model);
|
|
|
- // }
|
|
|
- // this.loading = false;
|
|
|
- // if (res && res.code === 0) {
|
|
|
- // const title = this.id === "add" ? "添加成功!" : "修改成功!";
|
|
|
- // this.$notify.success({
|
|
|
- // title,
|
|
|
- // message: "",
|
|
|
- // });
|
|
|
- // if (this.id === "add") {
|
|
|
- // this.showModelThis = false;
|
|
|
- // this.$emit("refresh", false);
|
|
|
- // } else {
|
|
|
- // this.initForm();
|
|
|
- // }
|
|
|
- // } else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
- // await this.logout();
|
|
|
- // } else {
|
|
|
- // this.$message.warning(res.message);
|
|
|
- // }
|
|
|
- // } else {
|
|
|
- // console.log("error submit!!");
|
|
|
- // return false;
|
|
|
- // }
|
|
|
+ if (valid) {
|
|
|
+ let model = JSON.parse(JSON.stringify(this.ruleForm));
|
|
|
+ this.loading = true;
|
|
|
+
|
|
|
+ let res = await asyncRequest.aftergys(model);
|
|
|
+ this.loading = false;
|
|
|
+ if (res && res.code === 0) {
|
|
|
+ const title = this.id === "add" ? "添加成功!" : "修改成功!";
|
|
|
+ this.$notify.success({
|
|
|
+ title,
|
|
|
+ message: "",
|
|
|
+ });
|
|
|
+ if (this.id === "add") {
|
|
|
+ this.showModelThis = false;
|
|
|
+ this.$emit("refresh", false);
|
|
|
+ } else {
|
|
|
+ this.initForm();
|
|
|
+ }
|
|
|
+ } else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
+ await this.logout();
|
|
|
+ } else {
|
|
|
+ this.$message.warning(res.message);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ console.log("error submit!!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
- handleView(e) {
|
|
|
- this.ruleForm.whether_back = e;
|
|
|
- this.$refs.ruleForm.validateField("return_goods_addr");
|
|
|
- },
|
|
|
+
|
|
|
//退货省市区
|
|
|
selectAreaAddr_code(e) {
|
|
|
- this.ruleForm.return_goods_addr = e;
|
|
|
- this.$refs.ruleForm.validateField("return_goods_addr");
|
|
|
+ this.ruleForm.addr_code = e;
|
|
|
+ this.$refs.ruleForm.validateField("addr_code");
|
|
|
},
|
|
|
},
|
|
|
};
|