|
@@ -114,9 +114,10 @@
|
|
|
border
|
|
|
:size="'mini'"
|
|
|
style="width: 100%"
|
|
|
- height="300px"
|
|
|
+ max-height="300px"
|
|
|
row-key="key"
|
|
|
>
|
|
|
+ <el-table-column type="index" width="80" show-overflow-tooltip />
|
|
|
<el-table-column
|
|
|
prop="receipt_quantity"
|
|
|
label="收货总数"
|
|
@@ -211,7 +212,9 @@
|
|
|
@selectChange="select_area_change($event, scope.$index)"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <span v-if="!scope.row.edit">{{ scope.row.addr_code }}</span>
|
|
|
+ <span v-if="!scope.row.edit">{{
|
|
|
+ scope.row.addr_code_name
|
|
|
+ }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
@@ -233,7 +236,7 @@
|
|
|
:disabled="!scope.row.edit"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <span v-if="!scope.row.edit">{{ scope.row.addr_code }}</span>
|
|
|
+ <span v-if="!scope.row.edit">{{ scope.row.addr }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
@@ -503,11 +506,6 @@ export default {
|
|
|
this.addrForm.order_addr.push(...list);
|
|
|
},
|
|
|
|
|
|
- // refresh(e) {
|
|
|
- // this.showModelThis = e;
|
|
|
- // this.$emit("refresh", true);
|
|
|
- // },
|
|
|
-
|
|
|
getNewTime() {
|
|
|
this.newTime = new Date().valueOf();
|
|
|
},
|
|
@@ -556,8 +554,32 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
//省市区选择
|
|
|
- select_area_change(e, index) {
|
|
|
+ async select_area_change(e, index) {
|
|
|
this.addrForm.order_addr[index].addr_code = e;
|
|
|
+ const { addr_code } = this.addrForm.order_addr[index];
|
|
|
+ if (addr_code && addr_code.length === 3) {
|
|
|
+ let arrCode = addr_code[addr_code.length - 1];
|
|
|
+ // console.log(model);
|
|
|
+ let { code, data, message } = await asyncRequest.addrall({
|
|
|
+ code: arrCode,
|
|
|
+ });
|
|
|
+ if (code === 0) {
|
|
|
+ const { province, city, area } = data;
|
|
|
+ let province_name = province && province.name ? province.name : "";
|
|
|
+ let city_name = city && city.name ? city.name : "";
|
|
|
+ let area_name = area && area.name ? area.name : "";
|
|
|
+ this.addrForm.order_addr[index].addr_code_name =
|
|
|
+ province_name && city_name && area_name
|
|
|
+ ? `${province_name}/${city_name}/${area_name}`
|
|
|
+ : "";
|
|
|
+ } else if (code >= 100 && code <= 104) {
|
|
|
+ await this.logout();
|
|
|
+ } else {
|
|
|
+ this.$message.warning(message);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.addrForm.order_addr[index].addr_code_name = "";
|
|
|
+ }
|
|
|
},
|
|
|
//省市区保存某一行
|
|
|
checkRow(rowIndex) {
|
|
@@ -579,21 +601,23 @@ export default {
|
|
|
if (valid) {
|
|
|
this.loading = true;
|
|
|
let model = JSON.parse(JSON.stringify(this.ruleForm));
|
|
|
- const { sendtype } = model;
|
|
|
+ model.order_addr = [];
|
|
|
+ const { sendtype, good_num } = model;
|
|
|
const { order_addr } = JSON.parse(JSON.stringify(this.addrForm));
|
|
|
if (sendtype === "2" && order_addr && order_addr.length === 0) {
|
|
|
this.$message.warning("至少上传一个地址信息!");
|
|
|
this.loading = false;
|
|
|
return;
|
|
|
}
|
|
|
- let isAEdit = false;
|
|
|
+ let addrT = 0,
|
|
|
+ isAEdit = false;
|
|
|
order_addr.forEach((v2) => {
|
|
|
if (v2.edit) {
|
|
|
isAEdit = true;
|
|
|
}
|
|
|
- addrT += parseInt(v2.receipt_quantity);
|
|
|
+ addrT += parseInt(v2.receipt_quantity + "");
|
|
|
let model2 = {
|
|
|
- addr_code: v2.addr_code,
|
|
|
+ addr_code: v2.addr_code.toString(),
|
|
|
contactor: v2.contactor,
|
|
|
mobile: v2.mobile,
|
|
|
addr: v2.addr,
|
|
@@ -607,12 +631,13 @@ export default {
|
|
|
this.loading = false;
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
- this.loading = false;
|
|
|
+ if (parseInt(good_num + "") !== addrT) {
|
|
|
+ this.$message.warning("收货总数量与购买不一致!");
|
|
|
+ this.loading = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
console.log(model);
|
|
|
- return;
|
|
|
let res = await asyncRequest.consultorder(model);
|
|
|
-
|
|
|
this.loading = false;
|
|
|
if (res && res.code === 0) {
|
|
|
this.$notify.success({
|