|
@@ -186,8 +186,15 @@
|
|
|
></el-cascader>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="6">剩余库存:{{ ruleForm.stock }}</el-col>
|
|
|
- <el-col :span="18">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="剩余库存">
|
|
|
+ <el-input
|
|
|
+ v-model="ruleForm.activity_stock"
|
|
|
+ disabled
|
|
|
+ placeholder="剩余库存"
|
|
|
+ /> </el-form-item
|
|
|
+ ></el-col>
|
|
|
+ <el-col :span="12">
|
|
|
<el-form-item label="凭证文件" prop="proof_id">
|
|
|
<el-tooltip
|
|
|
effect="dark"
|
|
@@ -362,6 +369,7 @@
|
|
|
border
|
|
|
:size="'mini'"
|
|
|
style="width: 100%"
|
|
|
+ max-height="200px"
|
|
|
row-key="key"
|
|
|
>
|
|
|
<el-table-column type="index" width="50" show-overflow-tooltip />
|
|
@@ -601,7 +609,7 @@ import { isnumber, isMobile } from "@/utils/validate";
|
|
|
import inAddrModel from "@/components/in-addr-model";
|
|
|
import showVoucherModel from "@/components/show-voucher-model";
|
|
|
import searchGoodOnlineModal from "@/components/search-good-online-modal";
|
|
|
-import {addColumns} from "./ShowDataTableColumns";
|
|
|
+import { addColumns } from "./ShowDataTableColumns";
|
|
|
export default {
|
|
|
name: "salesOrderDetail",
|
|
|
mixins: [mixinPage, resToken],
|
|
@@ -663,6 +671,7 @@ export default {
|
|
|
showVoucher: false,
|
|
|
companyName: "",
|
|
|
showModel: false,
|
|
|
+ addrmodel: false,
|
|
|
addshowModel: {},
|
|
|
pickerOptions: {
|
|
|
disabledDate(time) {
|
|
@@ -713,7 +722,7 @@ export default {
|
|
|
proof_id: "", //凭证ID
|
|
|
proof_type: "", //凭证类型
|
|
|
proof_url: "", //凭证地址
|
|
|
-
|
|
|
+ activity_stock: "0",
|
|
|
is_activity: "0", //是否参与活动,
|
|
|
goodtype: ["is_activity_0", "1"], //活动类型
|
|
|
good_num: "", //商品数量
|
|
@@ -879,6 +888,7 @@ export default {
|
|
|
proof_id: "", //凭证ID
|
|
|
proof_type: "", //凭证类型
|
|
|
proof_url: "", //凭证地址
|
|
|
+ activity_stock: "0",
|
|
|
goodtype: ["is_activity_0", "1"], //活动类型
|
|
|
good_num: "10", //商品数量
|
|
|
good_price: "0", //商品单价
|
|
@@ -937,6 +947,10 @@ export default {
|
|
|
this.ruleForm.proof_url = "";
|
|
|
this.$refs.ruleForm.validateField("proof_id");
|
|
|
},
|
|
|
+ addrRefresh(e) {
|
|
|
+ const { list } = e;
|
|
|
+ this.addrForm.order_addr.push(...list);
|
|
|
+ },
|
|
|
async resultList(e) {
|
|
|
this.showModel = false;
|
|
|
if (e.length === 1) {
|
|
@@ -963,15 +977,25 @@ export default {
|
|
|
companyNo: supplierNo,
|
|
|
platform_id,
|
|
|
};
|
|
|
- let { code, data, message } = await asyncRequest.goods_active(model);
|
|
|
+ const { code, data, message } = await asyncRequest.goods_active(model);
|
|
|
if (code === 0) {
|
|
|
- let list =
|
|
|
- data && data.length > 0 ? JSON.parse(JSON.stringify(data)) : [];
|
|
|
- list.forEach((a) => {
|
|
|
+ const { act, good } = data;
|
|
|
+ let actlist = act.length > 0 ? JSON.parse(JSON.stringify(act)) : [];
|
|
|
+ actlist.forEach((a) => {
|
|
|
a.value = a.activity_code;
|
|
|
a.label = a.activity_name;
|
|
|
});
|
|
|
- this.goodtype_options[1].children = list;
|
|
|
+ this.goodtype_options[1].children = [];
|
|
|
+ this.goodtype_options[1].children.push(...actlist);
|
|
|
+ let goodItem =
|
|
|
+ good.length > 0 ? JSON.parse(JSON.stringify(good[0])) : {};
|
|
|
+ if (goodItem.good_name) {
|
|
|
+ this.goodtype_options[0].children.map((b) => {
|
|
|
+ b.activity_stock = goodItem ? goodItem.stock_num + "" : "0";
|
|
|
+ return b;
|
|
|
+ });
|
|
|
+ console.log(this.goodtype_options);
|
|
|
+ }
|
|
|
} else if (code >= 100 && code <= 104) {
|
|
|
await this.logout();
|
|
|
} else {
|
|
@@ -1038,8 +1062,6 @@ export default {
|
|
|
async get_new_price() {
|
|
|
const { goodtype, good_num } = this.ruleForm;
|
|
|
|
|
|
-
|
|
|
-
|
|
|
let oldGood_type = goodtype.length === 2 ? goodtype[1] : "";
|
|
|
const { ogood_type, ogood_num } = this.order_good_num;
|
|
|
console.log(
|
|
@@ -1052,38 +1074,32 @@ export default {
|
|
|
};
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
+ //activity_stock
|
|
|
+ if (goodtype.length === 2) {
|
|
|
+ this.goodtype_options.forEach((a) => {
|
|
|
+ if (a.children && a.children.length) {
|
|
|
+ a.children.forEach((b) => {
|
|
|
+ if (b.value === goodtype[1]) {
|
|
|
+ console.log(b.activity_stock);
|
|
|
+ this.ruleForm.activity_stock = b.activity_stock || "0";
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.ruleForm.activity_stock = 0 + "";
|
|
|
+ }
|
|
|
if (!this.priceLoding) {
|
|
|
const { isok, price } = await this.set_salegetprice();
|
|
|
this.ruleForm.good_price = isok ? price : "0";
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
this.order_good_num = {
|
|
|
ogood_type: goodtype.length === 2 ? goodtype[1] : "",
|
|
|
ogood_num: this.ruleForm.good_num,
|
|
|
};
|
|
|
},
|
|
|
- async get_goods_active() {
|
|
|
- const { good_code, supplierNo, platform_id } = this.ruleForm;
|
|
|
- let model = {
|
|
|
- skuCode: good_code,
|
|
|
- companyNo: supplierNo,
|
|
|
- platform_id,
|
|
|
- };
|
|
|
- let { code, data, message } = await asyncRequest.goods_active(model);
|
|
|
- if (code === 0) {
|
|
|
- let list =
|
|
|
- data && data.length > 0 ? JSON.parse(JSON.stringify(data)) : [];
|
|
|
- list.forEach((a) => {
|
|
|
- a.value = a.activity_code;
|
|
|
- a.label = a.activity_name;
|
|
|
- });
|
|
|
- this.goodtype_options[1].children = list;
|
|
|
- } else if (code >= 100 && code <= 104) {
|
|
|
- await this.logout();
|
|
|
- } else {
|
|
|
- this.$message.warning(message);
|
|
|
- }
|
|
|
- },
|
|
|
change_good_code() {
|
|
|
const { supplierNo, platform_id } = this.ruleForm;
|
|
|
if (supplierNo === "") {
|
|
@@ -1179,12 +1195,7 @@ export default {
|
|
|
JSON.stringify(this.ruleForm)
|
|
|
);
|
|
|
const { order_addr } = JSON.parse(JSON.stringify(this.addrForm));
|
|
|
- console.log(sendtype, sendtype.length);
|
|
|
- if (goodtype.length !== 2) {
|
|
|
- this.$message.warning("请选择商品类型!");
|
|
|
- this.loading = false;
|
|
|
- return;
|
|
|
- }
|
|
|
+
|
|
|
let key_0 = goodtype[0];
|
|
|
let key_1 = goodtype[1];
|
|
|
if (order_addr.length === 0 && sendtype === "1") {
|