|
@@ -3,8 +3,8 @@
|
|
|
:title="title"
|
|
|
:center="true"
|
|
|
align="left"
|
|
|
- top="5vh"
|
|
|
- width="1040px"
|
|
|
+ top="15vh"
|
|
|
+ width="600px"
|
|
|
@close="closeModel"
|
|
|
:close-on-click-modal="false"
|
|
|
:visible.sync="showModelThis"
|
|
@@ -13,10 +13,7 @@
|
|
|
element-loading-spinner="el-icon-loading"
|
|
|
element-loading-background="rgba(0, 0, 0, 0.8)"
|
|
|
>
|
|
|
- id:{{ id }} isDetail:{{ isDetail }},
|
|
|
- <!-- sitem:{{ sitem }}, -->
|
|
|
- 入参:{{ ruleForm }}
|
|
|
- <el-card>
|
|
|
+ <el-card style="margin: -20px 0 0 0">
|
|
|
<el-row :gutter="10">
|
|
|
<el-col :span="24">
|
|
|
<el-form
|
|
@@ -24,17 +21,20 @@
|
|
|
status-icon
|
|
|
:rules="rulesThis"
|
|
|
ref="ruleForm"
|
|
|
- label-width="110px"
|
|
|
+ label-width="80px"
|
|
|
class="demo-ruleForm"
|
|
|
>
|
|
|
- <el-form-item
|
|
|
- label="退货原因"
|
|
|
- prop="returnReason"
|
|
|
- v-if="id === 'add' || isDetail"
|
|
|
- >
|
|
|
+ <el-form-item label="退货数量" prop="num">
|
|
|
+ <el-input
|
|
|
+ maxlength="250"
|
|
|
+ placeholder="退货数量"
|
|
|
+ v-model="ruleForm.num"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="退货原因" prop="errorCode">
|
|
|
<el-select
|
|
|
style="width: 100%"
|
|
|
- v-model="ruleForm.returnReason"
|
|
|
+ v-model="ruleForm.errorCode"
|
|
|
placeholder="退换货原因"
|
|
|
>
|
|
|
<el-option
|
|
@@ -42,290 +42,19 @@
|
|
|
:key="item.value"
|
|
|
:label="item.label"
|
|
|
:value="item.value"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
+ />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
|
|
|
- <el-form-item label="退货备注" prop="return_remark">
|
|
|
- <!-- <el-input v-model="ruleForm.tel" :disabled="isDetail"></el-input> -->
|
|
|
+ <el-form-item label="退货备注" prop="remark">
|
|
|
<el-input
|
|
|
type="textarea"
|
|
|
maxlength="250"
|
|
|
show-word-limit
|
|
|
placeholder="请填写备注"
|
|
|
- v-model="ruleForm.return_remark"
|
|
|
+ v-model="ruleForm.remark"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="仓库信息">
|
|
|
- <el-table
|
|
|
- :data="tableForm.product_go"
|
|
|
- border
|
|
|
- :size="'mini'"
|
|
|
- row-key="key"
|
|
|
- >
|
|
|
- <el-table-column label="商品总数量" width="100">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.wsend_num'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>{{ scope.row.num }}</p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="已发货数量" width="100">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.send_num'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>
|
|
|
- {{ scope.row.send_num }}
|
|
|
- </p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="未发货数量" width="100">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.wsend_num'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>{{ scope.row.wsend_num }}</p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="退货数量">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.return_num'" -->
|
|
|
- <el-form-item
|
|
|
- :style="!scope.row.edit ? 'margin:0' : ''"
|
|
|
- :rules="{
|
|
|
- required: true,
|
|
|
- message: '退货数量不能为空',
|
|
|
- trigger: 'blur',
|
|
|
- }"
|
|
|
- >
|
|
|
- <el-input
|
|
|
- :disabled="!scope.row.edit"
|
|
|
- v-model="ruleForm.return_num"
|
|
|
- ></el-input>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="采购编码" width="180">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.wsend_num'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>{{ scope.row.orderCode }}</p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="仓库名称" width="150">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.wsm_name'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>{{ scope.row.wsm_name }}</p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="仓库供应商" width="220">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.wsend_num'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>{{ scope.row.wsm_supplier }}</p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="仓库编码" width="200">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.wsend_num'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>{{ scope.row.wsm_code }}</p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
- <!-- <el-table-column label="仓库供应商">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>{{ scope.row.wsm_supplierNo }}</p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column> -->
|
|
|
-
|
|
|
- <el-table-column fixed="right" label="操作" width="80">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-tooltip
|
|
|
- effect="dark"
|
|
|
- content="编辑"
|
|
|
- v-if="!scope.row.edit"
|
|
|
- placement="top"
|
|
|
- >
|
|
|
- <i
|
|
|
- class="el-icon-edit tb-icon"
|
|
|
- @click="editRow(scope.$index, 'return')"
|
|
|
- ></i>
|
|
|
- </el-tooltip>
|
|
|
-
|
|
|
- <el-tooltip
|
|
|
- effect="dark"
|
|
|
- content="保存"
|
|
|
- v-if="scope.row.edit"
|
|
|
- placement="top"
|
|
|
- >
|
|
|
- <i
|
|
|
- class="el-icon-circle-check tb-icon"
|
|
|
- @click="checkRow(scope.$index, 'return')"
|
|
|
- ></i>
|
|
|
- </el-tooltip>
|
|
|
-
|
|
|
- <el-tooltip effect="dark" content="重置" placement="top">
|
|
|
- <i
|
|
|
- v-if="scope.row.edit"
|
|
|
- class="el-icon-refresh-left tb-icon"
|
|
|
- @click="resetRow(scope.$index)"
|
|
|
- ></i>
|
|
|
- </el-tooltip>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <!-- <el-col
|
|
|
- :span="24"
|
|
|
- style="text-align: right; padding: 30px 0 10px 0"
|
|
|
- >
|
|
|
- <el-button type="primary" :size="'mini'" @click="submitForm"
|
|
|
- >保 存
|
|
|
- </el-button>
|
|
|
- </el-col> -->
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="收货信息">
|
|
|
- <el-table
|
|
|
- :data="tableForm.get_product_go"
|
|
|
- border
|
|
|
- :size="'mini'"
|
|
|
- row-key="key"
|
|
|
- >
|
|
|
- <el-table-column label="收货总数量">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.send_num'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>
|
|
|
- {{ scope.row.receipt_quantity }}
|
|
|
- </p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="已发货数量">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.send_num'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>
|
|
|
- {{ scope.row.send_num }}
|
|
|
- </p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="未发货数量">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.wsend_num'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>{{ scope.row.wsend_num }}</p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="退货数量">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.return_num'" -->
|
|
|
- <el-form-item
|
|
|
- :style="!scope.row.edit ? 'margin:0' : ''"
|
|
|
- :rules="{
|
|
|
- required: true,
|
|
|
- message: '退货数量不能为空',
|
|
|
- trigger: 'blur',
|
|
|
- }"
|
|
|
- >
|
|
|
- <el-input
|
|
|
- :disabled="!scope.row.edit"
|
|
|
- v-model="ruleForm.get_return_num"
|
|
|
- ></el-input>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="采购编码" width="200">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.send_num'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>
|
|
|
- {{ scope.row.orderCode }}
|
|
|
- </p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <!-- <el-table-column label="仓库供应商">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>{{ scope.row.wsm_supplierNo }}</p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column> -->
|
|
|
- <el-table-column label="收货联系人 ">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.wsm_name'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>{{ scope.row.contactor }}</p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="联系方式" width="120">
|
|
|
- <template slot-scope="scope">
|
|
|
- <!-- :prop="'product_go.' + scope.$index + '.wsm_name'" -->
|
|
|
- <el-form-item :style="!scope.row.edit ? 'margin:0' : ''">
|
|
|
- <p>{{ scope.row.mobile }}</p>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
- <el-table-column fixed="right" label="操作" width="80">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-tooltip
|
|
|
- effect="dark"
|
|
|
- content="编辑"
|
|
|
- v-if="!scope.row.edit"
|
|
|
- placement="top"
|
|
|
- >
|
|
|
- <i
|
|
|
- class="el-icon-edit tb-icon"
|
|
|
- @click="editRow(scope.$index, 'get')"
|
|
|
- ></i>
|
|
|
- </el-tooltip>
|
|
|
-
|
|
|
- <el-tooltip
|
|
|
- effect="dark"
|
|
|
- content="保存"
|
|
|
- v-if="scope.row.edit"
|
|
|
- placement="top"
|
|
|
- >
|
|
|
- <i
|
|
|
- class="el-icon-circle-check tb-icon"
|
|
|
- @click="checkRow(scope.$index, 'get')"
|
|
|
- ></i>
|
|
|
- </el-tooltip>
|
|
|
-
|
|
|
- <el-tooltip effect="dark" content="重置" placement="top">
|
|
|
- <i
|
|
|
- v-if="scope.row.edit"
|
|
|
- class="el-icon-refresh-left tb-icon"
|
|
|
- @click="resetRow(scope.$index)"
|
|
|
- ></i>
|
|
|
- </el-tooltip>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <!-- <el-col
|
|
|
- :span="24"
|
|
|
- style="text-align: right; padding: 30px 0 10px 0"
|
|
|
- >
|
|
|
- <el-button type="primary" :size="'mini'" @click="submitForm"
|
|
|
- >保 存
|
|
|
- </el-button>
|
|
|
- </el-col> -->
|
|
|
- </el-form-item>
|
|
|
</el-form>
|
|
|
</el-col>
|
|
|
<el-col :span="24" style="text-align: right">
|
|
@@ -341,78 +70,20 @@
|
|
|
</el-dialog>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import asyncRequest from "@/apis/service/sellOut/sellReturnList";
|
|
|
+import asyncRequest from "@/apis/service/sheetOrder/zxReturn";
|
|
|
import resToken from "@/mixins/resToken";
|
|
|
-import {
|
|
|
- isnumber,
|
|
|
- isMobile,
|
|
|
- validEmail,
|
|
|
- isAlphanumeric,
|
|
|
- isChinese,
|
|
|
- isEmoticon,
|
|
|
- validAlphabets,
|
|
|
-} from "@/utils/validate";
|
|
|
+import { isnumber } from "@/utils/validate";
|
|
|
export default {
|
|
|
- name: "sellReturnList",
|
|
|
+ name: "zxReturn",
|
|
|
props: ["showModel", "id", "isDetail", "sitem"],
|
|
|
mixins: [resToken],
|
|
|
data() {
|
|
|
- const validateusername = (rule, value, callback) => {
|
|
|
- if (value === "") {
|
|
|
- callback(new Error("账号不能为空!"));
|
|
|
- } else {
|
|
|
- if (value.length < 6 || value.length > 18) {
|
|
|
- callback(new Error("账号规则为6~18位数字与字母组合!"));
|
|
|
- } else {
|
|
|
- if (isnumber(value)) {
|
|
|
- callback(new Error("账号规则为6~18位数字与字母组合!"));
|
|
|
- } else if (validAlphabets(value)) {
|
|
|
- callback(new Error("账号规则为6~18位数字与字母组合!"));
|
|
|
- } else if (!isAlphanumeric(value)) {
|
|
|
- callback(new Error("账号规则为6~18位数字与字母组合!"));
|
|
|
- } else {
|
|
|
- callback();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- };
|
|
|
- const validatename = (rule, value, callback) => {
|
|
|
- if (value === "") {
|
|
|
- callback(new Error("真实姓名不能为空!"));
|
|
|
- } else {
|
|
|
- if (value.length < 2 || value.length > 12) {
|
|
|
- callback(new Error("真实姓名规则为2~12位汉字!"));
|
|
|
- } else {
|
|
|
- if (!isChinese(value)) {
|
|
|
- console.log(9999);
|
|
|
- callback(new Error("真实姓名规则为2~12位汉字!"));
|
|
|
- } else if (isEmoticon(value)) {
|
|
|
- console.log(2345);
|
|
|
- callback(new Error("真实姓名规则为2~12位汉字!"));
|
|
|
- } else {
|
|
|
- callback();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- };
|
|
|
- const validatemobile = (rule, value, callback) => {
|
|
|
- if (value === "") {
|
|
|
- callback(new Error("手机号不能为空!"));
|
|
|
- } else {
|
|
|
- if (!isMobile(value)) {
|
|
|
- callback(new Error("手机号格式不正确!"));
|
|
|
- } else {
|
|
|
- callback();
|
|
|
- }
|
|
|
- }
|
|
|
- };
|
|
|
-
|
|
|
- const validateEmail = (rule, value, callback) => {
|
|
|
+ const validateWeight = (rule, value, callback) => {
|
|
|
if (value === "") {
|
|
|
- callback();
|
|
|
+ callback(new Error("退货数量不能为空!"));
|
|
|
} else {
|
|
|
- if (!validEmail(value)) {
|
|
|
- callback(new Error("邮箱格式不正确!"));
|
|
|
+ if (!isnumber(value)) {
|
|
|
+ callback(new Error("退货数量仅支持整数!"));
|
|
|
} else {
|
|
|
callback();
|
|
|
}
|
|
@@ -426,34 +97,29 @@ export default {
|
|
|
title: "添加销售退货单",
|
|
|
showModelThis: this.showModel,
|
|
|
ruleForm: {
|
|
|
- get_return_num: "",
|
|
|
+ num: "",
|
|
|
outCode: "", //出库单编号
|
|
|
- return_remark: "", //退货备注
|
|
|
- return_num: "", //退货数量
|
|
|
- returnReason: [], //退货原因
|
|
|
- // email: "",
|
|
|
- // role_id: "",
|
|
|
- // status: "1",
|
|
|
- // item: [],
|
|
|
+ remark: "", //退货备注
|
|
|
+ num: "", //退货数量
|
|
|
+ errorCode: "", //退货原因
|
|
|
},
|
|
|
rulesThis: this.rules,
|
|
|
rules: {
|
|
|
- returnReason: [
|
|
|
+ errorCode: [
|
|
|
{
|
|
|
required: true,
|
|
|
message: "请选择退货原因",
|
|
|
- // type: "array",
|
|
|
trigger: "change",
|
|
|
},
|
|
|
],
|
|
|
- return_num: [
|
|
|
+ num: [
|
|
|
{
|
|
|
required: true,
|
|
|
- validator: validatemobile,
|
|
|
+ validator: validateWeight,
|
|
|
trigger: "blur",
|
|
|
},
|
|
|
],
|
|
|
- return_remark: [
|
|
|
+ remark: [
|
|
|
{
|
|
|
required: true,
|
|
|
message: "请输入退货备注",
|
|
@@ -461,10 +127,6 @@ export default {
|
|
|
},
|
|
|
],
|
|
|
},
|
|
|
- tableForm: {
|
|
|
- product_go: [],
|
|
|
- get_product_go: [],
|
|
|
- },
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -485,108 +147,27 @@ export default {
|
|
|
closeModel() {
|
|
|
console.log("closeModel!!");
|
|
|
},
|
|
|
- // 获取退换货原因
|
|
|
- async getReason() {
|
|
|
- this.loading = true;
|
|
|
- let model = {
|
|
|
- page: 1,
|
|
|
- size: 15,
|
|
|
- type: "5",
|
|
|
- };
|
|
|
- const res = await asyncRequest.getReason(model);
|
|
|
- if (res && res.code === 0 && res.data) {
|
|
|
- // this.tableData = res.data.list;
|
|
|
- // console.log(this.tableData);
|
|
|
- // this.pageInfo.total = Number(res.data.count);
|
|
|
- // this.reason_options =
|
|
|
- res.data.list.forEach((element) => {
|
|
|
- let obj = {
|
|
|
- value: element.result_code,
|
|
|
- label: element.result,
|
|
|
- id: element.id,
|
|
|
- };
|
|
|
- this.reason_options.push(obj);
|
|
|
- });
|
|
|
- console.log(this.reason_options);
|
|
|
- } else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
- await this.logout();
|
|
|
- } else {
|
|
|
- this.tableData = [];
|
|
|
- this.pageInfo.total = 0;
|
|
|
- }
|
|
|
- this.loading = false;
|
|
|
- },
|
|
|
+
|
|
|
async initForm() {
|
|
|
this.loading = true;
|
|
|
- // await this.getRole();
|
|
|
- if (this.id === "add") {
|
|
|
- this.title = "添加销售退货单";
|
|
|
- this.rulesThis = this.rules;
|
|
|
- await this.resetForm();
|
|
|
- } else {
|
|
|
- if (this.isDetail) {
|
|
|
- this.title = "添加销售退货单详情";
|
|
|
- this.rulesThis = {};
|
|
|
- } else {
|
|
|
- this.title = "修改添加销售退货单";
|
|
|
- this.rulesThis = this.rules;
|
|
|
- }
|
|
|
- await this.resetForm(this.sitem);
|
|
|
- // await this.initData()
|
|
|
- }
|
|
|
+ this.title = "添加销售退货单";
|
|
|
this.getReason(); //获取退还货原因
|
|
|
-
|
|
|
+ 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) {
|
|
|
- // this.ruleForm = res.data;
|
|
|
- // this.ruleForm.role_id = this.ruleForm.role;
|
|
|
- // } else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
- // await this.logout();
|
|
|
- // } else {
|
|
|
- // this.$message.warning(res.message);
|
|
|
- // }
|
|
|
- },
|
|
|
- async resetForm(sitem) {
|
|
|
+ async resetForm() {
|
|
|
// 重置
|
|
|
await this.$nextTick(() => {
|
|
|
if (this.$refs.ruleForm) {
|
|
|
this.$refs.ruleForm.resetFields();
|
|
|
this.$refs.ruleForm.clearValidate();
|
|
|
this.outCode = this.sitem.orderCode;
|
|
|
- console.log(this.outCode);
|
|
|
- const { info, addrs } = this.sitem;
|
|
|
- info.forEach((ele) => {
|
|
|
- this.noSendNum += ele.wsend_num;
|
|
|
- });
|
|
|
- let list = JSON.parse(JSON.stringify(info)); //
|
|
|
- list.map((v) => {
|
|
|
- v.edit = false;
|
|
|
- return v;
|
|
|
- });
|
|
|
- this.tableForm.product_go = [].concat(...list);
|
|
|
-
|
|
|
- console.log(list);
|
|
|
- addrs.forEach((ele) => {
|
|
|
- this.noSendNumbers += ele.wsend_num;
|
|
|
- });
|
|
|
- let l_list = JSON.parse(JSON.stringify(addrs));
|
|
|
- l_list.map((ele) => {
|
|
|
- ele.edit = false;
|
|
|
- return ele;
|
|
|
- });
|
|
|
- this.tableForm.get_product_go = [].concat(...l_list);
|
|
|
- console.log(l_list);
|
|
|
this.ruleForm = {
|
|
|
- return_remark: "", //退货备注
|
|
|
- return_num: "", //退货数量
|
|
|
- returnReason: [], //退货原因
|
|
|
- // email: "",
|
|
|
- // role_id: "",
|
|
|
- // status: "1",
|
|
|
- // item: [],
|
|
|
+ orderCode: this.outCode,
|
|
|
+ remark: "", //退货备注
|
|
|
+ num: "", //退货数量
|
|
|
+ errorCode: "", //退货原因
|
|
|
};
|
|
|
}
|
|
|
});
|
|
@@ -596,30 +177,12 @@ export default {
|
|
|
await this.$refs.ruleForm.validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
this.loading = true;
|
|
|
- console.log(this.ruleForm);
|
|
|
const model = JSON.parse(JSON.stringify(this.ruleForm));
|
|
|
- console.log(model);
|
|
|
- model.errorCode = model.returnReason.toString();
|
|
|
- model.num = model.return_num;
|
|
|
- model.remark = model.return_remark;
|
|
|
- model.outCode = this.outCode;
|
|
|
- console.log(model);
|
|
|
- if (model.return_num > this.noSendNum) {
|
|
|
- this.$message.warning("退货数量不能大于未发货数量");
|
|
|
- return;
|
|
|
- }
|
|
|
- let res = {};
|
|
|
- if (this.id === "add") {
|
|
|
- delete model["id"];
|
|
|
- res = await asyncRequest.add(model);
|
|
|
- } else {
|
|
|
- res = await asyncRequest.update(model);
|
|
|
- }
|
|
|
+ const res = await asyncRequest.add(model);
|
|
|
this.loading = false;
|
|
|
if (res && res.code === 0) {
|
|
|
- const title = this.id === "add" ? "添加成功" : "修改成功";
|
|
|
this.$notify.success({
|
|
|
- title,
|
|
|
+ title: "创建成功!",
|
|
|
message: "",
|
|
|
});
|
|
|
this.showModelThis = false;
|
|
@@ -636,82 +199,39 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- //异常原因筛选
|
|
|
- //保存某一行
|
|
|
- checkRow(rowIndex, name) {
|
|
|
- if (name == "return") {
|
|
|
- const model = JSON.parse(JSON.stringify(this.ruleForm));
|
|
|
- console.log(model.return_num);
|
|
|
- console.log(this.noSendNum);
|
|
|
- if (Number(model.return_num) > Number(this.noSendNum)) {
|
|
|
- this.$message.warning("退货数量不能大于未发货数量");
|
|
|
- return;
|
|
|
- }
|
|
|
- const { check_value, check_remark } =
|
|
|
- this.tableForm.product_go[rowIndex];
|
|
|
- if (check_value != "" && check_remark != "") {
|
|
|
- this.tableForm.product_go[rowIndex].edit = false;
|
|
|
- } else {
|
|
|
- this.$message.warning("审核情况或审核备注不能为空");
|
|
|
- }
|
|
|
- } else if (name == "get") {
|
|
|
- const model = JSON.parse(JSON.stringify(this.ruleForm));
|
|
|
- console.log(model);
|
|
|
- console.log(this.noSendNum);
|
|
|
- if (Number(model.get_return_num) > Number(this.noSendNum)) {
|
|
|
- this.$message.warning("退货数量不能大于未发货数量");
|
|
|
- return;
|
|
|
- }
|
|
|
- const { check_value, check_remark } =
|
|
|
- this.tableForm.get_product_go[rowIndex];
|
|
|
- if (check_value != "" && check_remark != "") {
|
|
|
- this.tableForm.get_product_go[rowIndex].edit = false;
|
|
|
- } else {
|
|
|
- this.$message.warning("审核情况或审核备注不能为空");
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- //编辑某一行
|
|
|
- editRow(rowIndex, name) {
|
|
|
- // console.log(this.tableForm.product_go[rowIndex].edit);
|
|
|
- // console.log(rowIndex);
|
|
|
- // console.log(this.tableForm.product_go);
|
|
|
- if (name == "return") {
|
|
|
- let index = this.tableForm.product_go.findIndex((v) => {
|
|
|
- v.edit;
|
|
|
- });
|
|
|
- console.log(index);
|
|
|
- if (index !== -1) {
|
|
|
- this.$message.warning("请完成其他行的编辑!");
|
|
|
- return;
|
|
|
- } else {
|
|
|
- this.tableForm.product_go[rowIndex].edit = true;
|
|
|
- }
|
|
|
- console.log(this.tableForm.product_go[rowIndex].edit);
|
|
|
- } else if (name == "get") {
|
|
|
- let index = this.tableForm.product_go.findIndex((v) => {
|
|
|
- v.edit;
|
|
|
+ // 获取退换货原因
|
|
|
+ async getReason() {
|
|
|
+ this.loading = true;
|
|
|
+ let model = {
|
|
|
+ page: 1,
|
|
|
+ size: 100,
|
|
|
+ type: "5",
|
|
|
+ };
|
|
|
+ const res = await asyncRequest.getReason(model);
|
|
|
+ if (res && res.code === 0 && res.data) {
|
|
|
+ const { list } = res.data;
|
|
|
+ list.forEach((element) => {
|
|
|
+ let obj = {
|
|
|
+ value: element.result_code,
|
|
|
+ label: element.result,
|
|
|
+ id: element.id,
|
|
|
+ };
|
|
|
+ this.reason_options.push(obj);
|
|
|
});
|
|
|
- console.log(index);
|
|
|
- if (index !== -1) {
|
|
|
- this.$message.warning("请完成其他行的编辑!");
|
|
|
- return;
|
|
|
- } else {
|
|
|
- this.tableForm.get_product_go[rowIndex].edit = true;
|
|
|
- }
|
|
|
- console.log(this.tableForm.get_product_go[rowIndex].edit);
|
|
|
+ } else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
+ await this.logout();
|
|
|
+ } else {
|
|
|
+ this.tableData = [];
|
|
|
+ this.pageInfo.total = 0;
|
|
|
}
|
|
|
- },
|
|
|
- resetRow(rowIndex) {
|
|
|
- this.tableForm.product_go[rowIndex].check_remark = "";
|
|
|
- this.tableForm.product_go[rowIndex].check_value = "agree";
|
|
|
+ this.loading = false;
|
|
|
},
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
-.sellReturnList {
|
|
|
+.zxReturn {
|
|
|
}
|
|
|
</style>
|
|
|
|