20241017更新

main
lcode 3 weeks ago
parent 7542075a54
commit 8c5bc2de32

@ -1,11 +1,19 @@
import config from "@/config"; import config from "@/config";
import http from "@/utils/request"; import http from "@/utils/request";
//工序报工 // 生产领料
export default { export default {
list: { list: {
url: `${config.API_URL}/web/webProductionMaterialRequisition/list`, url: `${config.API_URL}/web/webProductionMaterialRequisition/list`,
name: "工序报工列表", name: "生产领料列表",
method: "post",
http: async function(params={}){
return await http.post(this.url, params);
}
},
materialList: {
url: `${config.API_URL}/web/webProductionMaterialRequisition/material/list`,
name: "生产领料物料列表",
method: "post", method: "post",
http: async function(params={}){ http: async function(params={}){
return await http.post(this.url, params); return await http.post(this.url, params);
@ -13,7 +21,7 @@ export default {
}, },
detail: { detail: {
url: `${config.API_URL}/web/webProductionMaterialRequisition/detail`, url: `${config.API_URL}/web/webProductionMaterialRequisition/detail`,
name: "新增工序报工", name: "新增生产领料",
method: "post", method: "post",
http: async function(params={}){ http: async function(params={}){
return await http.post(this.url, params); return await http.post(this.url, params);
@ -21,7 +29,7 @@ export default {
}, },
save: { save: {
url: `${config.API_URL}/web/webProductionMaterialRequisition/add`, url: `${config.API_URL}/web/webProductionMaterialRequisition/add`,
name: "新增工序报工", name: "新增生产领料",
method: "post", method: "post",
http: async function(params={}){ http: async function(params={}){
return await http.post(this.url, params); return await http.post(this.url, params);
@ -29,7 +37,7 @@ export default {
}, },
edit: { edit: {
url: `${config.API_URL}/web/webProductionMaterialRequisition/edit`, url: `${config.API_URL}/web/webProductionMaterialRequisition/edit`,
name: "编辑工序报工", name: "编辑生产领料",
method: "post", method: "post",
http: async function(params={}){ http: async function(params={}){
return await http.post(this.url, params); return await http.post(this.url, params);
@ -37,7 +45,7 @@ export default {
}, },
del: { del: {
url: `${config.API_URL}/web/webProductionMaterialRequisition/del`, url: `${config.API_URL}/web/webProductionMaterialRequisition/del`,
name: "删除工序报工", name: "删除生产领料",
method: "post", method: "post",
http: async function(params={}){ http: async function(params={}){
return await http.post(this.url, params); return await http.post(this.url, params);

@ -11,6 +11,14 @@ export default {
return await http.post(this.url, params); return await http.post(this.url, params);
} }
}, },
completedList: {
url: `${config.API_URL}/web/webProcessReport/completed/list`,
name: "工序报工完成列表",
method: "post",
http: async function(params={}){
return await http.post(this.url, params);
}
},
save: { save: {
url: `${config.API_URL}/web/webProcessReport/add`, url: `${config.API_URL}/web/webProcessReport/add`,
name: "新增工序报工", name: "新增工序报工",

@ -88,7 +88,8 @@ export default {
}, },
methods: { methods: {
// //
open() { open(params={}) {
this.params = Object.assign({}, this.params, params);
// console.log(this.apiObj) // console.log(this.apiObj)
this.visible = true; this.visible = true;
return this; return this;

@ -30,7 +30,7 @@ export default {
column: [ column: [
{ label: "", prop: "id", width: "200", hide: true }, { label: "", prop: "id", width: "200", hide: true },
{ label: "领料编号", prop: "documentNumber", width: "200" }, { label: "领料编号", prop: "documentNumber", width: "200" },
{ label: "仓库", prop: "warehouse", width: "200" }, { label: "仓库", prop: "warehouseName", width: "200" },
{ label: "领用人", prop: "recipient", width: "200" }, { label: "领用人", prop: "recipient", width: "200" },
{ label: "领料部门", prop: "department", width: "200" }, { label: "领料部门", prop: "department", width: "200" },
{ {
@ -129,6 +129,7 @@ export default {
{ label: "实际重量", prop: "requisitionWeight", width: "200" }, { label: "实际重量", prop: "requisitionWeight", width: "200" },
{ label: "物料编号", prop: "materialCode", width: "200" }, { label: "物料编号", prop: "materialCode", width: "200" },
{ label: "物料名称", prop: "materialName", width: "200" }, { label: "物料名称", prop: "materialName", width: "200" },
{ label: "仓库", prop: "warehouse", width: "200" },
{ label: "型材型号", prop: "profileModel", width: "200" }, { label: "型材型号", prop: "profileModel", width: "200" },
{ label: "米重 (kg/m)", prop: "weight", width: "100" }, { label: "米重 (kg/m)", prop: "weight", width: "100" },
{ label: "长度 (m)", prop: "defaultLength", width: "100" }, { label: "长度 (m)", prop: "defaultLength", width: "100" },

@ -62,7 +62,12 @@
> >
<el-table-column type="selection" width="50"></el-table-column> <el-table-column type="selection" width="50"></el-table-column>
<!-- 领料数量 --> <!-- 仓库 -->
<template #warehouse="scoped">
<span >{{ scoped.row.warehouseName }}</span>
</template>
<!-- 领料数量 -->
<template #requisitionNumber="scoped"> <template #requisitionNumber="scoped">
<el-input-number <el-input-number
v-model="scoped.row.requisitionNumber" v-model="scoped.row.requisitionNumber"
@ -76,13 +81,13 @@
<span v-else>{{ scoped.row.requisitionNumber }}</span> <span v-else>{{ scoped.row.requisitionNumber }}</span>
</template> </template>
<!-- 领料--> <!-- 领料实际重-->
<template #requisitionWeight="scoped"> <template #requisitionWeight="scoped">
<el-input-number <el-input-number
v-model="scoped.row.requisitionWeight" v-model="scoped.row.requisitionWeight"
:step="0.01" :step="0.01"
:min="0" :min="0"
:precision="2" :precision="4"
:controls="true" :controls="true"
v-if="mode=='add'" v-if="mode=='add'"
></el-input-number> ></el-input-number>
@ -132,6 +137,14 @@ export default {
}; };
}, },
watch: { watch: {
"form.warehouse": {
handler(value, old) {
const _this = this;
if (this.mode == 'add') {
this.listData = [];
}
},
},
"form.supplier": { "form.supplier": {
handler(value, old) { handler(value, old) {
const _this = this; const _this = this;
@ -157,7 +170,7 @@ export default {
newVal.forEach((item) => { newVal.forEach((item) => {
/* 支数 */ /* 支数 */
item["pieces"] = parseFloat( item["pieces"] = parseFloat(
Number(item["piecesBundle"]) * Number(item["purchaseQuantity"]) Number(item["piecesBundle"]) * Number(item["requisitionNumber"])
); );
/* 理论重量 */ /* 理论重量 */
@ -165,8 +178,8 @@ export default {
( (
Number(item["weight"]) * Number(item["weight"]) *
Number(item["defaultLength"]) * Number(item["defaultLength"]) *
Number(item["purchaseQuantity"]) Number(item["requisitionNumber"])
).toFixed(2) ).toFixed(4)
); );
/* 单价 */ /* 单价 */
@ -177,7 +190,7 @@ export default {
/* 金额 */ /* 金额 */
item["amount"] = parseFloat( item["amount"] = parseFloat(
( (
Number(item["unitPrice"]) * Number(item["purchaseQuantity"]) Number(item["unitPrice"]) * Number(item["requisitionNumber"])
).toFixed(2) ).toFixed(2)
); );
@ -195,7 +208,7 @@ export default {
/* 含税金额 */ /* 含税金额 */
item["amountWithTax"] = parseFloat( item["amountWithTax"] = parseFloat(
( (
Number(item["priceWithTax"]) * Number(item["purchaseQuantity"]) Number(item["priceWithTax"]) * Number(item["requisitionNumber"])
).toFixed(2) ).toFixed(2)
); );
}); });
@ -242,7 +255,9 @@ export default {
if (valid) { if (valid) {
this.dialog.product = true; this.dialog.product = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.materialsSelect.open().setData(this.listData); this.$refs.materialsSelect.open({
warehouse: this.form.warehouse
}).setData(this.listData);
}); });
} }
}); });
@ -259,6 +274,7 @@ export default {
handleSuccess(data) { handleSuccess(data) {
const _this = this; const _this = this;
data.forEach((item) => { data.forEach((item) => {
item["warehouseName"] = _this.formatWarehouse();
for (let key in _this.initComputed) { for (let key in _this.initComputed) {
if (!item[key]) { if (!item[key]) {
item[key] = _this.initComputed[key]; item[key] = _this.initComputed[key];
@ -267,6 +283,26 @@ export default {
}); });
this.listData = [...data, ...this.listData]; this.listData = [...data, ...this.listData];
}, },
formatWarehouse() {
const _this = this;
const formItems = module.pageForm.form["formItems"]
const warehouse = formItems.filter(item => {
return item.name == 'warehouse'
})
const warehouseItems = warehouse[0]["options"]["items"]
console.log("warehouseItems",warehouseItems)
if (!warehouseItems || warehouseItems.length == 0) {
return "";
}
const itms = warehouseItems.filter(itm => {
return itm.value == _this.form.warehouse
})
if (itms.length > 0) return itms[0].label
return ""
},
async queryInventoryQuantity(row) { async queryInventoryQuantity(row) {
// //
const res = await this.$API.currentInventory.queryInventory.http({ const res = await this.$API.currentInventory.queryInventory.http({

@ -88,8 +88,9 @@ export default {
}, },
methods: { methods: {
// //
open() { open(params) {
// console.log(this.apiObj) // console.log(this.apiObj)
this.params = Object.assign({}, this.params, params)
this.visible = true; this.visible = true;
return this; return this;
}, },

@ -136,9 +136,9 @@ export default {
] ]
}, },
tableSelect: { tableSelect: {
"title": "排产选择", "title": "退料选择",
"panelWidth": "1000px", "panelWidth": "1000px",
"api": "currentInventory.list", "api": "processMaterialRequisition.materialList",
"params": { "status": 1 }, "params": { "status": 1 },
"column": [ "column": [
{ label: "物料编号", prop: "materialCode", width: "200" }, { label: "物料编号", prop: "materialCode", width: "200" },

@ -70,7 +70,7 @@
:min="1" :min="1"
:precision="0" :precision="0"
:controls="true" :controls="true"
:max="scoped.row.existingInventory" :max="scoped.row.requisitionNumber"
v-if="mode=='add'" v-if="mode=='add'"
></el-input-number> ></el-input-number>
<span v-else>{{ scoped.row.returnNumber }}</span> <span v-else>{{ scoped.row.returnNumber }}</span>
@ -132,6 +132,14 @@ export default {
}; };
}, },
watch: { watch: {
"form.warehouse": {
handler(value, old) {
const _this = this;
if (this.mode == 'add') {
this.listData = [];
}
},
},
"form.supplier": { "form.supplier": {
handler(value, old) { handler(value, old) {
const _this = this; const _this = this;
@ -157,7 +165,7 @@ export default {
newVal.forEach((item) => { newVal.forEach((item) => {
/* 支数 */ /* 支数 */
item["pieces"] = parseFloat( item["pieces"] = parseFloat(
Number(item["piecesBundle"]) * Number(item["purchaseQuantity"]) Number(item["piecesBundle"]) * Number(item["returnNumber"])
); );
/* 理论重量 */ /* 理论重量 */
@ -165,7 +173,7 @@ export default {
( (
Number(item["weight"]) * Number(item["weight"]) *
Number(item["defaultLength"]) * Number(item["defaultLength"]) *
Number(item["purchaseQuantity"]) Number(item["returnNumber"])
).toFixed(2) ).toFixed(2)
); );
@ -177,7 +185,7 @@ export default {
/* 金额 */ /* 金额 */
item["amount"] = parseFloat( item["amount"] = parseFloat(
( (
Number(item["unitPrice"]) * Number(item["purchaseQuantity"]) Number(item["unitPrice"]) * Number(item["returnNumber"])
).toFixed(2) ).toFixed(2)
); );
@ -195,7 +203,7 @@ export default {
/* 含税金额 */ /* 含税金额 */
item["amountWithTax"] = parseFloat( item["amountWithTax"] = parseFloat(
( (
Number(item["priceWithTax"]) * Number(item["purchaseQuantity"]) Number(item["priceWithTax"]) * Number(item["returnNumber"])
).toFixed(2) ).toFixed(2)
); );
}); });
@ -242,7 +250,9 @@ export default {
if (valid) { if (valid) {
this.dialog.product = true; this.dialog.product = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.materialsSelect.open().setData(this.listData); this.$refs.materialsSelect.open({
warehouse: this.form.warehouse
}).setData(this.listData);
}); });
} }
}); });

@ -9,12 +9,13 @@
<el-container> <el-container>
<el-header> <el-header>
<div class="right-panel-search"> <div class="right-panel-search">
<thirdselect <!-- 销售单号 -->
v-model="search.materialCategory" <el-input
:item="materialCategoryItem" v-model="search.salesOrderCode"
placeholder="销售订单"
clearable
> >
</thirdselect> </el-input>
<!-- 物料名称输入框 --> <!-- 物料名称输入框 -->
<el-input <el-input
v-model="search.materialCode" v-model="search.materialCode"

@ -136,8 +136,8 @@ export default {
tableSelect: { tableSelect: {
"title": "入库选择", "title": "入库选择",
"panelWidth": "1000px", "panelWidth": "1000px",
"api": "salesOrder.detaillist", "api": "processReport.completedList",
"params": { "status": 1 }, "params": { },
"column": [ "column": [
{ label: "销售订单编号", prop: "salesOrderCode", width: "200" }, { label: "销售订单编号", prop: "salesOrderCode", width: "200" },
{ label: "物料编码", prop: "materialCode", width: "200" }, { label: "物料编码", prop: "materialCode", width: "200" },

@ -65,11 +65,12 @@
<!-- 入库仓库 --> <!-- 入库仓库 -->
<template #warehouse="scoped"> <template #warehouse="scoped">
<thirdselect <thirdselect
v-model="scoped.row.warehouse" v-model="scoped.row.warehouse"
:item="warehousesItem" :item="warehousesItem"
> :formMode="mode"
</thirdselect> >
</thirdselect>
</template> </template>
<!-- 入库数量 --> <!-- 入库数量 -->
@ -155,7 +156,7 @@ export default {
mode: "add", mode: "add",
visible: false, visible: false,
warehousesItem: { warehousesItem: {
options: { tb: 'warehouses' } options: { editdisable: true, tb: 'warehouses' }
} }
}; };
}, },

@ -49,12 +49,12 @@
v-if="config.option.edit" v-if="config.option.edit"
>详情</el-button >详情</el-button
> >
<el-button type="text" size="medium" @click="page_edit(scope.row, scope.$index)" v-if="config.option.edit"></el-button> <!-- <el-button type="text" size="medium" @click="page_edit(scope.row, scope.$index)" v-if="config.option.edit"></el-button>
<el-popconfirm title="确定删除吗?" @confirm="table_del(scope.row, scope.$index)" v-if="config.option.del"> <el-popconfirm title="确定删除吗?" @confirm="table_del(scope.row, scope.$index)" v-if="config.option.del">
<template #reference> <template #reference>
<el-button type="text" size="medium">删除</el-button> <el-button type="text" size="medium">删除</el-button>
</template> </template>
</el-popconfirm> </el-popconfirm> -->
</template> </template>
</el-table-column> </el-table-column>
</scTable> </scTable>

@ -0,0 +1,128 @@
<template>
<el-dialog
:title="title"
v-model="visible"
:width="panelWidth"
destroy-on-close
@closed="$emit('closed')"
>
<el-container>
<el-header>
<div class="right-panel-search">
<!-- 型材型号输入框 -->
<el-input
v-model="search.salesOrderCode"
placeholder="销售单号"
clearable
>
</el-input>
<!-- 物料名称输入框 -->
<el-input
v-model="search.materialName"
placeholder="物料名称"
clearable
>
</el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="upsearch"
></el-button>
<el-button
type="primary"
plain
@click="add"
>添加</el-button>
</div>
</el-header>
<el-main class="nopadding">
<scTable
ref="table"
:apiObj="apiObj"
:column="column"
:params="params"
row-key="id"
@selection-change="selectionChange"
>
<el-table-column type="selection" width="50" :reserve-selection="true"
:selectable="selectable"
></el-table-column>
</scTable>
</el-main>
</el-container>
</el-dialog>
</template>
<script>
import module from "./module";
import thirdselect from "@/components/scForm/items/thirdselect";
export default {
emits: ["success", "closed"],
components: { thirdselect },
data() {
return {
panelWidth: module.tableSelect.panelWidth || "500",
title: module.tableSelect.title,
search: {
materialCategory: "",
materialName: "",
productCode: "",
profileModel: "",
},
visible: false,
isSaveing: false,
loading: false,
apiObj: this.$API.getApi(module.tableSelect.api),
column: module.tableSelect.column,
params: module.tableSelect.params,
selection: [],
listData: []
};
},
mounted() {
},
methods: {
//
open() {
// console.log(this.apiObj)
this.search = {
materialCategory: "",
materialName: "",
productCode: "",
profileModel: "",
}
this.$forceUpdate();
this.visible = true;
return this;
},
setData(listData) {
console.log("listData", listData)
console.log(typeof listData)
this.listData = listData;
},
selectable(row, index) {
console.log("this.listData", this.listData)
return !this.listData.some(item => row.documentNumber == item.documentNumber)
},
//
selectionChange(selection) {
this.selection = selection;
},
add() {
this.$emit("success", this.selection)
this.visible = false;
},
//
upsearch() {
this.$refs.table.upData(this.search);
},
},
};
</script>
<style>
</style>

@ -76,7 +76,8 @@ export default {
] ]
}, },
computed: { computed: {
returnQuantity: 1 shipmentQuantity: 1,
actualWeight: 0
}, },
column: [ column: [
{ label: "", prop: "id", width: "200", hide: true }, { label: "", prop: "id", width: "200", hide: true },
@ -187,5 +188,30 @@ export default {
{ label: "含税单价", prop: "priceWithTax", width: "200" }, { label: "含税单价", prop: "priceWithTax", width: "200" },
{ label: "含税总金额", prop: "amountWithTax", width: "200" }, { label: "含税总金额", prop: "amountWithTax", width: "200" },
] ]
},
tableSelect: {
"title": "选产品",
"panelWidth": "1000px",
"api": "currentInventory.procutlist",
"params": { "status": 1 },
"column": [
{ label: "销售订单编号", prop: "salesOrderCode", width: "200" },
{ label: "订单号", prop: "orderNo", width: "200" },
{ label: "物料编码", prop: "materialCode", width: "200" },
{ label: "物料名称", prop: "materialName", width: "200" },
{ label: "订单长度 (M)", prop: "orderLength", width: "200" },
{ label: "订单总数 (支)", prop: "orderTotalQuantity", width: "200" },
{ label: "表面方式 (颜色)", prop: "surfaceMethod", width: "200" },
{ label: "仓库", prop: "warehouse", width: "200" },
{ label: "出货数量", prop: "shipmentQuantity", width: "200" },
{ label: "规格型号 (MM)", prop: "specification", width: "200" },
{ label: "客方料号", prop: "customerMaterialCode", width: "200" },
{ label: "壁厚", prop: "thickness", width: "200" },
{ label: "理论重量 (KG)", prop: "theoreticalWeight", width: "200" },
{ label: "实际总重量KG)", prop: "actualWeight", width: "200" },
{ label: "包装数量(扎数)", prop: "packingQuantity", width: "200" },
{ label: "未交货数量", prop: "undeliveredQuantity", width: "200" },
{ label: "包装方式", prop: "packagingMethod", width: "200" },
],
} }
} }

@ -26,7 +26,13 @@
align-items: center; align-items: center;
" "
> >
<el-button type="primary" plain @click="save" v-if="mode == 'add' || mode == 'edit'"></el-button> <el-button
type="primary"
plain
@click="save"
v-if="mode == 'add' || mode == 'edit'"
>保存</el-button
>
<el-button type="info" plain @click="back"></el-button> <el-button type="info" plain @click="back"></el-button>
</div> </div>
</el-card> </el-card>
@ -43,7 +49,10 @@
</el-card> </el-card>
<el-card style="margin-top: 15px"> <el-card style="margin-top: 15px">
<div style="padding: 0px 10px 10px 0" v-if="mode == 'add' || mode == 'edit'"> <div
style="padding: 0px 10px 10px 0"
v-if="mode == 'add' || mode == 'edit'"
>
<el-button type="primary" plain @click="add_materials" <el-button type="primary" plain @click="add_materials"
>添加</el-button >添加</el-button
> >
@ -60,7 +69,11 @@
row-key="" row-key=""
@selection-change="selectionChange" @selection-change="selectionChange"
> >
<el-table-column v-if="mode == 'add' || mode == 'edit'" type="selection" width="50"></el-table-column> <el-table-column
v-if="mode == 'add' || mode == 'edit'"
type="selection"
width="50"
></el-table-column>
<!-- 出货数量 --> <!-- 出货数量 -->
<template #shipmentQuantity="scoped"> <template #shipmentQuantity="scoped">
@ -72,45 +85,67 @@
:controls="true" :controls="true"
v-if="mode == 'add' || mode == 'edit'" v-if="mode == 'add' || mode == 'edit'"
></el-input-number> ></el-input-number>
<div v-else> {{ scoped.row.shipmentQuantity }} </div> <div v-else>{{ scoped.row.shipmentQuantity }}</div>
</template> </template>
<!-- :max="Number(scoped.row.purchaseQuantity) - Number(scoped.row.warehousingQuantity) - Number(scoped.row.returningQuantity)" --> <!-- :max="Number(scoped.row.purchaseQuantity) - Number(scoped.row.warehousingQuantity) - Number(scoped.row.returningQuantity)" -->
<!-- 实际重量 --> <!-- 实际重量 -->
<template #actualWeight="scoped"> <template #actualWeight="scoped">
<el-input <el-input-number
v-model="scoped.row.actualWeight" v-model="scoped.row.actualWeight"
:step="1"
:min="1"
:precision="4"
:controls="true"
v-if="mode == 'add' || mode == 'edit'" v-if="mode == 'add' || mode == 'edit'"
></el-input> ></el-input-number>
<div v-else> {{ scoped.row.actualWeight }} </div> <div v-else>{{ scoped.row.actualWeight }}</div>
</template> </template>
<!-- 仓库 --> <!-- 仓库 -->
<template #warehouse="scoped"> <template #warehouse="scoped">
<el-input <!-- <el-input
v-model="scoped.row.warehouse" v-model="scoped.row.warehouse"
v-if="mode == 'add' || mode == 'edit'" v-if="mode == 'add' || mode == 'edit'"
></el-input> ></el-input> -->
<div v-else> {{ scoped.row.warehouse }} </div> <thirdselect
v-model="scoped.row.warehouse"
:item="warehouseItem"
formMode="edit"
>
</thirdselect>
<!-- <div v-else> {{ scoped.row.warehouse }} </div> -->
</template> </template>
<template #inventoryQuantity="scoped"> <template #inventoryQuantity="scoped">
<div> <div>
<el-button type="text" v-if="!scoped.row.inventoryQuantity && scoped.row.inventoryQuantity != 0" @click="queryInventoryQuantity(scoped.row)"></el-button> <el-button
type="text"
v-if="
!scoped.row.inventoryQuantity &&
scoped.row.inventoryQuantity != 0
"
@click="queryInventoryQuantity(scoped.row)"
>查看</el-button
>
<span v-else>{{ scoped.row.inventoryQuantity }}</span> <span v-else>{{ scoped.row.inventoryQuantity }}</span>
</div> </div>
</template> </template>
</scTable> </scTable>
</el-card> </el-card>
</el-main> </el-main>
<select-page <!-- <select-page
ref="selectPage" ref="selectPage"
v-if="dialog.selectPage" v-if="dialog.selectPage"
@success="handleSuccess" @success="handleSuccess"
@closed="dialog.selectPage = false" @closed="dialog.selectPage = false"
></select-page> ></select-page> -->
<materialsSelect
v-if="dialog.product"
ref="materialsSelect"
@success="handleSuccess"
@closed="dialog.product = false"
></materialsSelect>
</el-container> </el-container>
</el-dialog> </el-dialog>
</template> </template>
@ -118,6 +153,8 @@
<script> <script>
import useTabs from "@/utils/useTabs"; import useTabs from "@/utils/useTabs";
import selectPage from "./selectPage"; import selectPage from "./selectPage";
import thirdselect from "@/components/scForm/items/thirdselect";
import materialsSelect from "./materialsSelect";
import module from "./module"; import module from "./module";
@ -125,6 +162,8 @@ export default {
emits: ["success", "closed"], emits: ["success", "closed"],
components: { components: {
selectPage, selectPage,
thirdselect,
materialsSelect,
}, },
data() { data() {
return { return {
@ -144,9 +183,13 @@ export default {
mode: "add", mode: "add",
dialog: { dialog: {
selectPage: false, selectPage: false,
product: false,
}, },
visible: false, visible: false,
orderInfo: {} orderInfo: {},
warehouseItem: {
options: { editdisable: true, tb: "warehouses", placeholder: "仓库" },
},
}; };
}, },
watch: { watch: {
@ -184,13 +227,11 @@ export default {
Number(item["weight"]) * Number(item["weight"]) *
Number(item["defaultLength"]) * Number(item["defaultLength"]) *
Number(item["shipmentQuantity"]) Number(item["shipmentQuantity"])
).toFixed(2) ).toFixed(4)
); );
console.log("this.orderInfo", this.orderInfo) item["undeliveredQuantity"] =
item["salespersonName"] = this.orderInfo.salespersonName; item["orderTotalQuantity"] - item["producedPieces"];
item["salesOrderCode"] = this.orderInfo.documentNumber;
item["undeliveredQuantity"] = item["orderTotalQuantity"] - item["producedPieces"]
}); });
}, },
deep: true, deep: true,
@ -203,16 +244,16 @@ export default {
// "updateViewTagsTitle", // "updateViewTagsTitle",
// this.id ? `CURDID:${this.id}` : "CURD" // this.id ? `CURDID:${this.id}` : "CURD"
// ); // );
this.loadDetail(); // this.loadDetail();
}, },
methods: { methods: {
open(mode="add") { open(mode = "add") {
this.mode = mode; this.mode = mode;
this.visible = true; this.visible = true;
return this; return this;
}, },
setData(row) { setData(row) {
this.loadDetail(row.documentNumber) this.loadDetail(row.documentNumber);
}, },
async loadDetail(documentNumber) { async loadDetail(documentNumber) {
var res = await this.$API[module.name][module.detail].http({ var res = await this.$API[module.name][module.detail].http({
@ -221,7 +262,6 @@ export default {
if (res.code == 0) { if (res.code == 0) {
this.form = res.data.orderInfo; this.form = res.data.orderInfo;
this.orderInfo = res.data.purchInfo;
this.listData = res.data.materials; this.listData = res.data.materials;
this.$nextTick(function () { this.$nextTick(function () {
this.$forceUpdate(); this.$forceUpdate();
@ -232,20 +272,22 @@ export default {
this.selection = selection; this.selection = selection;
}, },
add_materials() { add_materials() {
// this.$router.push({ // this.$refs.formref.validate(async (valid, obj) => {
// path: '/mini/procurement/purchaseReceipt/selectPage', // if (valid) {
// query: { // this.dialog.selectPage = true;
// path: '/mini/procurement/purchaseReceipt/savePage', // this.$nextTick(() => {
// this.$refs.selectPage.open().setData(this.orderInfo, this.listData);
// });
// } // }
// }) // })
this.$refs.formref.validate(async (valid, obj) => { this.$refs.formref.validate(async (valid, obj) => {
if (valid) { if (valid) {
this.dialog.selectPage = true; this.dialog.product = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.selectPage.open().setData(this.orderInfo, this.listData); this.$refs.materialsSelect.open().setData(this.listData);
}); });
} }
}) });
}, },
delete_materials() { delete_materials() {
this.listData = this.listData.filter( this.listData = this.listData.filter(
@ -258,7 +300,6 @@ export default {
}, },
handleSuccess(data, orderInfo) { handleSuccess(data, orderInfo) {
const _this = this; const _this = this;
this.orderInfo = orderInfo;
data.forEach((item) => { data.forEach((item) => {
for (let key in _this.initComputed) { for (let key in _this.initComputed) {
if (!item[key]) { if (!item[key]) {
@ -273,7 +314,7 @@ export default {
const res = await this.$API.currentInventory.queryInventory.http({ const res = await this.$API.currentInventory.queryInventory.http({
materialCode: row.materialCode, materialCode: row.materialCode,
supplier: this.orderInfo.supplier, supplier: this.orderInfo.supplier,
}) });
if (res.code == 0) { if (res.code == 0) {
row.inventoryQuantity = res.data || 0; row.inventoryQuantity = res.data || 0;
@ -298,7 +339,6 @@ export default {
} }
const params = { const params = {
purchInfo: this.orderInfo,
materials: this.listData, materials: this.listData,
orderInfo: this.form, orderInfo: this.form,
}; };

@ -59,6 +59,7 @@ export default {
{ label: "单价", prop: "unitPrice", width: "200" }, { label: "单价", prop: "unitPrice", width: "200" },
{ label: "订单号", prop: "orderNo", width: "200" }, { label: "订单号", prop: "orderNo", width: "200" },
{ label: "现有库存", prop: "existingInventory", width: "200" }, { label: "现有库存", prop: "existingInventory", width: "200" },
{ label: "实际重量(KG)", prop: "actualWeight", width: "200" },
{ label: "客户", prop: "customerName", width: "200" }, { label: "客户", prop: "customerName", width: "200" },
{ label: "仓库", prop: "warehouse", width: "200" }, { label: "仓库", prop: "warehouse", width: "200" },
], ],

Loading…
Cancel
Save