|
@@ -6,95 +6,40 @@
|
|
|
status-icon
|
|
|
:rules="rulesThis"
|
|
|
ref="ruleForm"
|
|
|
- label-width="95px"
|
|
|
+ :size="'mini'"
|
|
|
+ label-width="80px"
|
|
|
class="demo-ruleForm"
|
|
|
>
|
|
|
- <el-form-item label="退换货原因" prop="errorCode">
|
|
|
- <abnormal-cause
|
|
|
- :value="ruleForm.errorCode"
|
|
|
- :placeholder="'退换货原因'"
|
|
|
- :type="'5'"
|
|
|
- @searchChange="errorCode_change"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
+ <el-row :gutter="10">
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="退货原因" prop="errorCode">
|
|
|
+ <abnormal-cause
|
|
|
+ :value="ruleForm.errorCode"
|
|
|
+ :placeholder="'退货原因'"
|
|
|
+ :type="'5'"
|
|
|
+ :size="'mini'"
|
|
|
+ @searchChange="errorCode_change"
|
|
|
+ />
|
|
|
+ </el-form-item> </el-col
|
|
|
+ ><el-col :span="16">
|
|
|
+ <el-form-item label="退货备注" prop="remark">
|
|
|
+ <el-input
|
|
|
+ :disabled="isDetail"
|
|
|
+ type="textarea"
|
|
|
+ maxlength="250"
|
|
|
+ show-word-limit
|
|
|
+ placeholder="请填写备注"
|
|
|
+ v-model="ruleForm.remark"
|
|
|
+ /> </el-form-item></el-col
|
|
|
+ ></el-row>
|
|
|
|
|
|
- <el-form-item label="退货备注" prop="remark">
|
|
|
- <el-input
|
|
|
- :disabled="isDetail"
|
|
|
- type="textarea"
|
|
|
- maxlength="250"
|
|
|
- show-word-limit
|
|
|
- placeholder="请填写备注"
|
|
|
- v-model="ruleForm.remark"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="仓库信息" :size="'mini'" required>
|
|
|
- <el-table
|
|
|
- :data="tableForm.product_go"
|
|
|
- border
|
|
|
- :size="'mini'"
|
|
|
- row-key="key"
|
|
|
- v-if="!isDetail"
|
|
|
- >
|
|
|
- <el-table-column
|
|
|
- label="仓库名称"
|
|
|
- min-width="300"
|
|
|
- show-overflow-tooltip
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- {{ scope.row.wsm_supplier }}{{ scope.row.wsm_name }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="下单总数量" width="100" prop="num" />
|
|
|
- <el-table-column label="已发货数量" width="100" prop="send_num" />
|
|
|
- <el-table-column label="未发货数量" width="100" prop="wsend_num" />
|
|
|
- <el-table-column label="退货数量" width="120">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-form-item style="margin: 0">
|
|
|
- <el-input
|
|
|
- :disabled="!scope.row.edit"
|
|
|
- :size="'mini'"
|
|
|
- v-model="scope.row.return_num"
|
|
|
- ></el-input>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
- <el-table-column fixed="right" label="操作" width="50">
|
|
|
- <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, 0)"
|
|
|
- ></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, 0)"
|
|
|
- ></i>
|
|
|
- </el-tooltip>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- </el-form-item>
|
|
|
<el-form-item label="收货信息" :size="'mini'" required>
|
|
|
<el-table
|
|
|
:data="tableForm.get_product_go"
|
|
|
border
|
|
|
:size="'mini'"
|
|
|
row-key="key"
|
|
|
+ max-height="300px"
|
|
|
>
|
|
|
<el-table-column
|
|
|
label="收货人-联系电话-地址"
|
|
@@ -112,18 +57,23 @@
|
|
|
prop="receipt_quantity"
|
|
|
width="100"
|
|
|
/>
|
|
|
- <el-table-column label="已发货数量" prop="send_num" width="100" />
|
|
|
- <el-table-column label="未发货数量" prop="wsend_num" width="100" />
|
|
|
- <el-table-column label="退货数量" width="120">
|
|
|
+
|
|
|
+ <el-table-column label="退货数量" width="150">
|
|
|
<template slot-scope="scope">
|
|
|
<el-form-item style="margin: 0" :size="'mini'">
|
|
|
- <el-input
|
|
|
- :disabled="!scope.row.edit"
|
|
|
+ <el-input-number
|
|
|
+ size="mini"
|
|
|
v-model="scope.row.return_num"
|
|
|
- ></el-input>
|
|
|
+ :disabled="!scope.row.edit"
|
|
|
+ :min="0"
|
|
|
+ :max="scope.row.wsend_num"
|
|
|
+ :precision="0"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column label="未发货数量" prop="wsend_num" width="90" />
|
|
|
+ <el-table-column label="已发货数量" prop="send_num" width="90" />
|
|
|
|
|
|
<el-table-column fixed="right" label="操作" width="50">
|
|
|
<template slot-scope="scope">
|
|
@@ -157,8 +107,10 @@
|
|
|
</el-form>
|
|
|
</el-col>
|
|
|
<el-col :span="24" style="text-align: right">
|
|
|
- <el-button type="primary" @click="submitForm">保 存 </el-button>
|
|
|
- <el-button @click="showModelThis = false" v-if="!isDetail"
|
|
|
+ <el-button type="primary" @click="submitForm" :size="'mini'"
|
|
|
+ >保 存
|
|
|
+ </el-button>
|
|
|
+ <el-button @click="showModelThis = false" v-if="!isDetail" :size="'mini'"
|
|
|
>关 闭</el-button
|
|
|
>
|
|
|
</el-col>
|
|
@@ -200,7 +152,6 @@ export default {
|
|
|
],
|
|
|
},
|
|
|
tableForm: {
|
|
|
- product_go: [],
|
|
|
get_product_go: [],
|
|
|
},
|
|
|
};
|
|
@@ -234,15 +185,16 @@ export default {
|
|
|
this.$refs.ruleForm.resetFields();
|
|
|
this.$refs.ruleForm.clearValidate();
|
|
|
const { info, addrs, orderCode } = this.sitem;
|
|
|
- console.log(this.sitem)
|
|
|
- let list =info&&info.length>0?JSON.parse(JSON.stringify(info)):[]; //
|
|
|
+ console.log(this.sitem);
|
|
|
+ let list =
|
|
|
+ info && info.length > 0 ? JSON.parse(JSON.stringify(info)) : []; //
|
|
|
list.map((v) => {
|
|
|
v.edit = false;
|
|
|
v.return_num = v.return_num || "0";
|
|
|
return v;
|
|
|
});
|
|
|
- this.tableForm.product_go = [].concat(...list);
|
|
|
- let l_list =addrs&&addrs.length>0? JSON.parse(JSON.stringify(addrs)):[];
|
|
|
+ let l_list =
|
|
|
+ addrs && addrs.length > 0 ? JSON.parse(JSON.stringify(addrs)) : [];
|
|
|
l_list.map((ele) => {
|
|
|
ele.edit = false;
|
|
|
ele.return_num = ele.return_num || "0";
|
|
@@ -254,7 +206,6 @@ export default {
|
|
|
errorCode: "", //退货原因
|
|
|
};
|
|
|
this.tableForm = {
|
|
|
- product_go: [].concat(...list),
|
|
|
get_product_go: [].concat(...l_list),
|
|
|
};
|
|
|
}
|
|
@@ -266,24 +217,12 @@ export default {
|
|
|
if (valid) {
|
|
|
this.loading = true;
|
|
|
let model = JSON.parse(JSON.stringify(this.ruleForm));
|
|
|
- let arr = JSON.parse(JSON.stringify(this.tableForm.product_go));
|
|
|
let arr1 = JSON.parse(JSON.stringify(this.tableForm.get_product_go));
|
|
|
let wsm_code_edit = false,
|
|
|
addr_edit = false,
|
|
|
wsm_code_total = 0,
|
|
|
addr_total = 0;
|
|
|
- let list = [];
|
|
|
- arr.forEach((e) => {
|
|
|
- if (e.edit) {
|
|
|
- wsm_code_edit = true;
|
|
|
- }
|
|
|
- let obj = {
|
|
|
- wsm_code: e.wsm_code,
|
|
|
- return_num: e.return_num,
|
|
|
- };
|
|
|
- wsm_code_total += e.return_num;
|
|
|
- list.push(obj);
|
|
|
- });
|
|
|
+
|
|
|
let addr = [];
|
|
|
arr1.forEach((e) => {
|
|
|
if (e.edit) {
|
|
@@ -296,7 +235,6 @@ export default {
|
|
|
addr_total += e.return_num;
|
|
|
addr.push(obj);
|
|
|
});
|
|
|
- model.list = list;
|
|
|
model.addr = addr;
|
|
|
if (wsm_code_edit) {
|
|
|
this.$message.warning("仓库信息正在编辑,请保存后再试!");
|
|
@@ -337,19 +275,6 @@ export default {
|
|
|
},
|
|
|
//保存某一行
|
|
|
checkRow(rowIndex, type) {
|
|
|
- if (type === 0) {
|
|
|
- const { wsend_num, return_num } = this.tableForm.product_go[rowIndex];
|
|
|
- if (!isnumber(return_num)) {
|
|
|
- this.$message.warning("退货数量不规范!");
|
|
|
- return;
|
|
|
- }
|
|
|
- if (parseInt(wsend_num) < parseInt(return_num)) {
|
|
|
- this.$message.warning("退货数量不能大于未发货总数量!");
|
|
|
- return;
|
|
|
- }
|
|
|
- this.tableForm.product_go[rowIndex].edit = false;
|
|
|
- }
|
|
|
-
|
|
|
if (type === 1) {
|
|
|
const { wsend_num, return_num } =
|
|
|
this.tableForm.get_product_go[rowIndex];
|
|
@@ -366,11 +291,7 @@ export default {
|
|
|
},
|
|
|
//编辑某一行
|
|
|
editRow(rowIndex, type) {
|
|
|
- let list = JSON.parse(
|
|
|
- JSON.stringify(
|
|
|
- type === 0 ? this.tableForm.product_go : this.tableForm.get_product_go
|
|
|
- )
|
|
|
- );
|
|
|
+ let list = JSON.parse(JSON.stringify(this.tableForm.get_product_go));
|
|
|
let index = list.findIndex((v) => {
|
|
|
v.edit;
|
|
|
});
|
|
@@ -378,12 +299,7 @@ export default {
|
|
|
this.$message.warning("请完成其他行的编辑!");
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
- if (type === 0) {
|
|
|
- this.tableForm.product_go[rowIndex].edit = true;
|
|
|
- } else {
|
|
|
- this.tableForm.get_product_go[rowIndex].edit = true;
|
|
|
- }
|
|
|
+ this.tableForm.get_product_go[rowIndex].edit = true;
|
|
|
},
|
|
|
},
|
|
|
};
|