|
@@ -9,15 +9,16 @@
|
|
|
style="width: 100%"
|
|
|
class="demo-ruleForm"
|
|
|
>
|
|
|
- <p>退货单号{{ returnCode }}</p>
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="费用承担方" prop="own">
|
|
|
<el-select
|
|
|
- clearable
|
|
|
@change="handleChange"
|
|
|
v-model="ruleForm.own"
|
|
|
- placeholder="请选择"
|
|
|
+ placeholder="费用承担方"
|
|
|
+ :disabled="
|
|
|
+ !(status === '3' && powers.some((item) => item == '040'))
|
|
|
+ "
|
|
|
style="width: 100%"
|
|
|
>
|
|
|
<el-option
|
|
@@ -29,36 +30,53 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="物流公司" prop="express_company">
|
|
|
- <search-express
|
|
|
- :value="ruleForm.express_company"
|
|
|
- :placeholder="'请选择退货物流'"
|
|
|
- :names="''"
|
|
|
- :disabled="false"
|
|
|
- :is-detail="false"
|
|
|
- @searchChange="handleCompany"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
<el-form-item label="物流单号" prop="post_code">
|
|
|
<el-input
|
|
|
- placeholder="请输入物流单号"
|
|
|
+ placeholder="物流单号"
|
|
|
+ :disabled="
|
|
|
+ !(status === '3' && powers.some((item) => item == '040'))
|
|
|
+ "
|
|
|
v-model="ruleForm.post_code"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="12" v-if="isShow">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="物流公司" prop="company">
|
|
|
+ <search-express
|
|
|
+ :value="ruleForm.company"
|
|
|
+ :placeholder="'物流公司'"
|
|
|
+ :names="''"
|
|
|
+ :disabled="
|
|
|
+ !(status === '3' && powers.some((item) => item == '040'))
|
|
|
+ "
|
|
|
+ :is-detail="
|
|
|
+ !(status === '3' && powers.some((item) => item == '040'))
|
|
|
+ "
|
|
|
+ @searchChange="handleCompany"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" v-if="ruleForm.own === '2'">
|
|
|
<el-form-item label="物流费用" prop="post_fee">
|
|
|
- <el-input placeholder="请输入物流费用" v-model="ruleForm.post_fee">
|
|
|
+ <el-input
|
|
|
+ placeholder="物流费用"
|
|
|
+ :disabled="
|
|
|
+ !(status === '3' && powers.some((item) => item == '040'))
|
|
|
+ "
|
|
|
+ v-model="ruleForm.post_fee"
|
|
|
+ >
|
|
|
<template slot="append">元</template>
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
- <el-col :span="24" style="text-align: right; margin: 0 0 10px 0">
|
|
|
- <el-button type="primary" @click="submitForm" v-if="true" size="mini"
|
|
|
+ <el-col
|
|
|
+ :span="24"
|
|
|
+ style="text-align: right; margin: 0 0 10px 0"
|
|
|
+ v-if="status === '3' && powers.some((item) => item == '040')"
|
|
|
+ >
|
|
|
+ <el-button type="primary" @click="submitForm" size="mini"
|
|
|
>保 存</el-button
|
|
|
>
|
|
|
</el-col>
|
|
@@ -68,10 +86,10 @@
|
|
|
<script>
|
|
|
import asyncRequest from "@/apis/service/sellOut/sellAfterApply";
|
|
|
import resToken from "@/mixins/resToken";
|
|
|
-import { isAlphanumeric, isnumber } from "@/utils/validate.js";
|
|
|
+import { isAlphanumeric, isnumber, isnumber2 } from "@/utils/validate.js";
|
|
|
export default {
|
|
|
- name: "purchase_check",
|
|
|
- props: ["id", "showModelThis", "newTime", "returnCode"],
|
|
|
+ name: "sellAfterApplyDetail",
|
|
|
+ props: ["id", "newTime", "sitem"],
|
|
|
mixins: [resToken],
|
|
|
data() {
|
|
|
const validateexpress = (rule, value, callback) => {
|
|
@@ -89,10 +107,12 @@ export default {
|
|
|
if (value === "") {
|
|
|
callback(new Error("物流费用不能为空!"));
|
|
|
} else {
|
|
|
- if (!isnumber(value)) {
|
|
|
- callback(new Error("物流费用只能为数字!"));
|
|
|
- } else {
|
|
|
+ if (isnumber(value)) {
|
|
|
+ callback();
|
|
|
+ } else if (isnumber2(value)) {
|
|
|
callback();
|
|
|
+ } else {
|
|
|
+ callback(new Error("物流费用仅支持整数及两位小数!"));
|
|
|
}
|
|
|
}
|
|
|
};
|
|
@@ -115,9 +135,9 @@ export default {
|
|
|
resign_name: "", //离职人
|
|
|
hand_name: "", //交接人
|
|
|
ruleForm: {
|
|
|
- company: "", //入参快递公司
|
|
|
- own: "", //物流费用承担方
|
|
|
- express_company: [], //物流公司
|
|
|
+ returnCode: "",
|
|
|
+ own: "1", //物流费用承担方
|
|
|
+ company: [], //物流公司
|
|
|
post_code: "", //物流单号
|
|
|
post_fee: 0, //物流费用
|
|
|
},
|
|
@@ -131,12 +151,12 @@ export default {
|
|
|
message: "请选择物流费用承担方",
|
|
|
},
|
|
|
],
|
|
|
- express_company: [
|
|
|
+ company: [
|
|
|
{
|
|
|
type: "array",
|
|
|
required: true,
|
|
|
trigger: "change",
|
|
|
- message: "请选择退回仓库",
|
|
|
+ message: "请选择物流公司",
|
|
|
},
|
|
|
],
|
|
|
post_code: [
|
|
@@ -160,7 +180,7 @@ export default {
|
|
|
powers() {
|
|
|
let tran =
|
|
|
this.$store.getters.btnList.find(
|
|
|
- (item) => item.menu_route == "purchase_check"
|
|
|
+ (item) => item.menu_route == "sellAfterApplyDetail"
|
|
|
) || {};
|
|
|
if (tran && tran.action && tran.action.length > 0) {
|
|
|
return tran.action;
|
|
@@ -196,34 +216,35 @@ export default {
|
|
|
},
|
|
|
async initForm() {
|
|
|
this.loading = true;
|
|
|
- if (this.id === "add") {
|
|
|
- this.status = "";
|
|
|
- this.rulesThis = this.rules;
|
|
|
- await this.resetForm();
|
|
|
- } else {
|
|
|
- this.rulesThis = this.rules;
|
|
|
- await this.resetForm();
|
|
|
- // await this.initData();
|
|
|
- }
|
|
|
+ this.status = "";
|
|
|
+ this.rulesThis = this.rules;
|
|
|
+ await this.resetForm();
|
|
|
this.loading = false;
|
|
|
},
|
|
|
|
|
|
async resetForm() {
|
|
|
- this.resign_name = "";
|
|
|
- this.hand_name = "";
|
|
|
- this.status = "";
|
|
|
// 重置
|
|
|
await this.$nextTick(() => {
|
|
|
if (this.$refs.ruleForm) {
|
|
|
this.$refs.ruleForm.resetFields();
|
|
|
this.$refs.ruleForm.clearValidate();
|
|
|
this.code = this.returnCode;
|
|
|
+ const {
|
|
|
+ returnCode,
|
|
|
+ post_own,
|
|
|
+ post_company,
|
|
|
+ post_code,
|
|
|
+ post_fee,
|
|
|
+ status,
|
|
|
+ } = this.sitem;
|
|
|
+ console.log(this.sitem);
|
|
|
+ this.status = status;
|
|
|
this.ruleForm = {
|
|
|
- own: "",
|
|
|
- company: "", //入参快递公司
|
|
|
- express_company: [], //物流公司
|
|
|
- post_code: "", //物流单号
|
|
|
- post_fee: 0, //物流费用
|
|
|
+ returnCode: returnCode || "",
|
|
|
+ own: post_own || "1",
|
|
|
+ company: post_company ? [post_company] : [], //物流公司
|
|
|
+ post_code: post_code || "", //物流单号
|
|
|
+ post_fee: post_fee || "0", //物流费用
|
|
|
};
|
|
|
}
|
|
|
});
|
|
@@ -232,8 +253,9 @@ export default {
|
|
|
await this.$refs.ruleForm.validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
let model = JSON.parse(JSON.stringify(this.ruleForm));
|
|
|
- model.returnCode = this.code;
|
|
|
- delete model["express_company"];
|
|
|
+ // model.returnCode = this.code;
|
|
|
+ // delete model["company"];
|
|
|
+ model.company = model.company[0];
|
|
|
const res = await asyncRequest.afterPost(model); //售后快递录入
|
|
|
this.loading = false;
|
|
|
if (res && res.code === 0) {
|
|
@@ -256,8 +278,8 @@ export default {
|
|
|
handleCompany(e) {
|
|
|
console.log(e);
|
|
|
if (e && e.code) {
|
|
|
- this.ruleForm.company = e.shortName;
|
|
|
- this.ruleForm.express_company = [e.code];
|
|
|
+ // this.ruleForm.company = e.shortName;
|
|
|
+ this.ruleForm.company = [e.label];
|
|
|
}
|
|
|
},
|
|
|
handleChange(e) {
|