|
@@ -43,7 +43,7 @@
|
|
|
<el-tabs v-model="activeName" type="card">
|
|
|
<el-tab-pane label="入库明细" name="sale_detail">
|
|
|
<avue-crud :option="optionContacts" v-model="formContacts" ref="formContacts"
|
|
|
- :data="form.orderItemsList" :key="key" @row-save="rowSave" @row-update="rowUpdate"
|
|
|
+ :data="form.planItemsList" :key="key" @row-save="rowSave" @row-update="rowUpdate"
|
|
|
@row-close="rowClose" :before-close="beforeClose"
|
|
|
@selection-change="selectionContacts"
|
|
|
@resetColumn="resetColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 269.1)"
|
|
@@ -112,7 +112,7 @@
|
|
|
@click="hangbaocun(row, index)">保存
|
|
|
</el-button>
|
|
|
<el-button icon="el-icon-delete" :size="size" :disabled="disabled || isDisabled"
|
|
|
- :type="type" @click="rowDelBox(row, index, 'orderItemsList')">删除
|
|
|
+ :type="type" @click="rowDelBox(row, index, 'planItemsList')">删除
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</avue-crud>
|
|
@@ -208,6 +208,7 @@ import check from "@/components/checkL/check";
|
|
|
import {getCorpType, getList} from "@/api/tirePartsMall/basicData/commodityInformation"
|
|
|
import {isProcurement} from "@/api/basicData/configuration";
|
|
|
import commodity from "../../configuration/commodity.json";
|
|
|
+import {submitPlan} from "@/api/storehouse/plan/plan-in";
|
|
|
|
|
|
export default {
|
|
|
name: "detailsPage",
|
|
@@ -308,7 +309,7 @@ export default {
|
|
|
key: 0,
|
|
|
templateUrl: '/api/blade-sales-part/ship/export-item', // 模板url
|
|
|
form: {
|
|
|
- orderItemsList: [],
|
|
|
+ planItemsList: [],
|
|
|
outboundRecordsList: []
|
|
|
},
|
|
|
optionForm: {
|
|
@@ -825,10 +826,10 @@ export default {
|
|
|
this.form.sharedCompanyName = res.data.data.sharedCompanyName
|
|
|
this.sharedCompanyId = res.data.data.sharedCompanyId
|
|
|
console.log(res.data.data.sharedCompanyId);
|
|
|
- console.log(this.form.orderItemsList);
|
|
|
- for (let i = 0; i < this.form.orderItemsList.length; i++) {
|
|
|
- console.log(Number(this.form.orderItemsList[i].sharedCompanyId));
|
|
|
- if (Number(this.form.orderItemsList[i].sharedCompanyId) != Number(res.data.data.sharedCompanyId)) {
|
|
|
+ console.log(this.form.planItemsList);
|
|
|
+ for (let i = 0; i < this.form.planItemsList.length; i++) {
|
|
|
+ console.log(Number(this.form.planItemsList[i].sharedCompanyId));
|
|
|
+ if (Number(this.form.planItemsList[i].sharedCompanyId) != Number(res.data.data.sharedCompanyId)) {
|
|
|
this.isStatus = 0
|
|
|
}
|
|
|
}
|
|
@@ -876,14 +877,14 @@ export default {
|
|
|
methods: {
|
|
|
// 一键入库
|
|
|
oneClickStorage() {
|
|
|
- if (this.form.orderItemsList.length == 0) {
|
|
|
+ if (this.form.planItemsList.length == 0) {
|
|
|
this.$message.warning('请先添加采购明细')
|
|
|
return
|
|
|
}
|
|
|
// 计算合计用于展示
|
|
|
let goodsNumhe = 0
|
|
|
let subTotalMoneyhe = 0
|
|
|
- for (let item of this.form.orderItemsList) {
|
|
|
+ for (let item of this.form.planItemsList) {
|
|
|
goodsNumhe += Number(item.goodsNum)
|
|
|
subTotalMoneyhe += Number(item.subTotalMoney)
|
|
|
}
|
|
@@ -1018,7 +1019,7 @@ export default {
|
|
|
obj.dot = ''
|
|
|
}
|
|
|
}
|
|
|
- this.form.orderItemsList.push({
|
|
|
+ this.form.planItemsList.push({
|
|
|
...obj,
|
|
|
price: item.price,
|
|
|
goodsId: item.id,
|
|
@@ -1057,7 +1058,7 @@ export default {
|
|
|
// 是否是编辑状态
|
|
|
mingxibaocun: true
|
|
|
})
|
|
|
- console.log(this.form.orderItemsList)
|
|
|
+ console.log(this.form.planItemsList)
|
|
|
})
|
|
|
}
|
|
|
this.mingxibaocun = false
|
|
@@ -1113,7 +1114,7 @@ export default {
|
|
|
},
|
|
|
// 采购明细行编辑
|
|
|
hangeditBtn(row, index) {
|
|
|
- for (let item of this.form.orderItemsList) {
|
|
|
+ for (let item of this.form.planItemsList) {
|
|
|
this.picihaolistfun(item.goodsId)
|
|
|
getDetailsLT({id: item.goodsId}).then((res) => {
|
|
|
this.$set(item, 'whether', res.data.data.whether)
|
|
@@ -1172,12 +1173,12 @@ export default {
|
|
|
done();
|
|
|
let picihao = false
|
|
|
if (valid) {
|
|
|
- for (let i in this.form.orderItemsList) {
|
|
|
- console.log(this.form.orderItemsList[i], 1800)
|
|
|
- this.form.orderItemsList[i].subTotalMoney = this.form.orderItemsList[i].goodsNum * this.form.orderItemsList[i].price
|
|
|
- if (!this.form.orderItemsList[i].pid) {
|
|
|
- if (this.form.orderItemsList[i].whether == '1') {
|
|
|
- if (!this.form.orderItemsList[i].dot) {
|
|
|
+ for (let i in this.form.planItemsList) {
|
|
|
+ console.log(this.form.planItemsList[i], 1800)
|
|
|
+ this.form.planItemsList[i].subTotalMoney = this.form.planItemsList[i].goodsNum * this.form.planItemsList[i].price
|
|
|
+ if (!this.form.planItemsList[i].pid) {
|
|
|
+ if (this.form.planItemsList[i].whether == '1') {
|
|
|
+ if (!this.form.planItemsList[i].dot) {
|
|
|
this.$message.warning(`采购明细序号${Number(i) + 1}的批次号不能为空`);
|
|
|
picihao = true
|
|
|
break;
|
|
@@ -1185,12 +1186,12 @@ export default {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
- if (this.form.orderItemsList[i].goodsNum <= 0) {
|
|
|
+ if (this.form.planItemsList[i].goodsNum <= 0) {
|
|
|
this.$message.warning(`采购明细序号${Number(i) + 1}的数量不能为零`);
|
|
|
picihao = true
|
|
|
}
|
|
|
- if (!this.form.orderItemsList[i].sendNum) {
|
|
|
- this.form.orderItemsList[i].sendNum = 0
|
|
|
+ if (!this.form.planItemsList[i].sendNum) {
|
|
|
+ this.form.planItemsList[i].sendNum = 0
|
|
|
}
|
|
|
}
|
|
|
this.mingxibaocun = true
|
|
@@ -1204,8 +1205,8 @@ export default {
|
|
|
background: 'rgba(255,255,255,0.7)'
|
|
|
});
|
|
|
this.form.storageName = this.form.$storageId ? this.form.$storageId : ''
|
|
|
- submit({
|
|
|
- bsType: "CG",
|
|
|
+ submitPlan({
|
|
|
+ bsType: "RP",
|
|
|
...this.form
|
|
|
}).then(res => {
|
|
|
this.$message.success("保存成功");
|
|
@@ -1262,7 +1263,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
- this.form.orderItemsList.forEach((items) => {
|
|
|
+ this.form.planItemsList.forEach((items) => {
|
|
|
if (!items.subTotalMoney) {
|
|
|
items.subTotalMoney = items.goodsNum * items.price
|
|
|
items.grossProfit = items.subTotalMoney - items.costprie
|
|
@@ -1290,7 +1291,7 @@ export default {
|
|
|
}).then(() => {
|
|
|
if (row.id) {
|
|
|
delOrderItem({ids: row.id}).then(res => {
|
|
|
- this.form.orderItemsList.splice(index, 1);
|
|
|
+ this.form.planItemsList.splice(index, 1);
|
|
|
this.$message.success("操作成功!");
|
|
|
});
|
|
|
} else {
|
|
@@ -1315,7 +1316,7 @@ export default {
|
|
|
type: "warning"
|
|
|
}).then(() => {
|
|
|
let multiList = this.selectionMultilist
|
|
|
- let arr = this.form.orderItemsList
|
|
|
+ let arr = this.form.planItemsList
|
|
|
// 获取有id 的数据
|
|
|
const itemsWithId = multiList.filter(item => item.hasOwnProperty('id'));
|
|
|
let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
|