1.修改复制单据页面,添加单据详情页面

master
x_z 3 years ago
parent 7b3b95cccc
commit d35c30fe23

@ -154,6 +154,35 @@
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<el-table v-loading="detailLoading"
:data="detailList"
@selection-change="changeFun"
style="width: 100%; margin-top: 20px;">
<el-table-column label="产品通用名" width="200" prop="productName"></el-table-column>
<el-table-column label="包装规格" width="200" prop="spec"></el-table-column>
<el-table-column label="批次号" width="100" prop="batchNo"></el-table-column>
<el-table-column label="生产日期" width="120" prop="productDate"></el-table-column>
<el-table-column label="失效日期" width="120" prop="expireDate"></el-table-column>
<el-table-column label="单据数量" width="100" prop="count"></el-table-column>
<el-table-column label="实际数量" width="100" prop="reCount"></el-table-column>
<el-table-column label="价格" width="120" prop="price"></el-table-column>
<el-table-column label="销售清单号(第二票)" width="180" prop="secSalesListNo"></el-table-column>
<el-table-column label="销售发票号(第一票)" width="180" prop="firstSalesInvNo"></el-table-column>
<el-table-column label="销售发票号(第二票)" width="180" prop="secSalesInvNo"></el-table-column>
<el-table-column label="发票日期" width="150" prop="invoiceDate"></el-table-column>
<el-table-column label="操作" width="100" prop="price" fixed="right">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click="deleteOrderDetail(scope.$index, scope.row)"
>删除
</el-button>
</template>
</el-table-column>
</el-table>
</div> </div>
</template> </template>
@ -163,7 +192,7 @@ import {getBasicUnitMaintains} from "@/api/basic/basicUnitMaintain";
import {parseTime} from "@/filtres"; import {parseTime} from "@/filtres";
import {getLocalJoinByUser} from "@/api/basic/busLocalType"; import {getLocalJoinByUser} from "@/api/basic/busLocalType";
import {submitOrderWeb} from "@/api/warehouse/order"; import {submitOrderWeb} from "@/api/warehouse/order";
import {stockOrderChange} from "@/api/warehouse/stockOrder"; import {stockOrderChange, stockOrderDetail} from "@/api/warehouse/stockOrder";
export default { export default {
name: "DialogcChangeNewOrder", name: "DialogcChangeNewOrder",
@ -189,6 +218,7 @@ export default {
actDate: new Date(), actDate: new Date(),
action: null, action: null,
locStorageCode: null, locStorageCode: null,
mainAction: null
}, },
fromStorageOptions: [], fromStorageOptions: [],
curAction: { curAction: {
@ -198,7 +228,7 @@ export default {
busTypes: [], busTypes: [],
fromOptions: [], fromOptions: [],
loading:false, loading:false,
detailList: []
} }
}, },
methods: { methods: {
@ -216,16 +246,35 @@ export default {
this.$message.error('当前往来单位不能为空'); this.$message.error('当前往来单位不能为空');
return; return;
} }
if (this.detailList.length == 0) {
this.$message.error("产品列表不能为空");
return;
}
let products = [];
this.detailList.forEach(item => {
let product = {
relId: item.relId,
batchNo: item.batchNo
};
products.push(product);
});
this.busTypes.forEach(item => {
if (item.action === this.formData.action) {
this.formData.mainAction = item.mainAction;
}
})
let tQuery = { let tQuery = {
stockOrderId: this.curRow.id, stockOrderId: this.curRow.id,
locStorageCode: this.formData.locStorageCode, locStorageCode: this.formData.locStorageCode,
action: this.formData.action, action: this.formData.action,
mainAction: this.formData.mainAction,
fromCorp: this.formData.fromCorp, fromCorp: this.formData.fromCorp,
fromCorpId: this.formData.fromCorpId, fromCorpId: this.formData.fromCorpId,
} products: products
};
stockOrderChange(tQuery) stockOrderChange(tQuery)
.then((response) => { .then((response) => {
console.log(response)
if (response.code === 20000) { if (response.code === 20000) {
this.$message.success("提交成功"); this.$message.success("提交成功");
this.closeDialog(); this.closeDialog();
@ -257,7 +306,6 @@ export default {
}, },
findMethod(query) { findMethod(query) {
console.log(query);
this.fromOptions = []; this.fromOptions = [];
let cQuery = { let cQuery = {
key: query, key: query,
@ -300,7 +348,6 @@ export default {
}, },
unitChange(row) { unitChange(row) {
console.log(row);
this.formData.fromCorpId = row.erpId; this.formData.fromCorpId = row.erpId;
this.formData.fromCorp = row.name; this.formData.fromCorp = row.name;
}, },
@ -337,7 +384,28 @@ export default {
.catch(() => { .catch(() => {
}); });
}, },
getStockOrderDetailList(orderId) {
let query = {
orderIdFk: orderId
}
stockOrderDetail(query)
.then((response) => {
this.detailLoading = false;
this.detailList = response.data.list || [];
})
.catch(() => {
this.detailLoading = false;
this.detailList = [];
});
},
deleteOrderDetail(index) {
for (let i = 0; i < this.detailList.length; i++) {
if (index === i) {
this.detailList.splice(index, 1);
break
}
}
}
}, },
created() { created() {
if (this.$isBlank(this.formData.corpOrderId)) { if (this.$isBlank(this.formData.corpOrderId)) {
@ -346,6 +414,7 @@ export default {
} }
this.getBusType(); this.getBusType();
this.getStorage(); this.getStorage();
this.getStockOrderDetailList(this.curRow.id);
} }
} }
</script> </script>

Loading…
Cancel
Save