20241017更新

main
lcode 1 month ago
parent 7542075a54
commit 8c5bc2de32

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

@ -11,6 +11,14 @@ export default {
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: {
url: `${config.API_URL}/web/webProcessReport/add`,
name: "新增工序报工",

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

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

@ -61,8 +61,13 @@
@selection-change="selectionChange"
>
<el-table-column type="selection" width="50"></el-table-column>
<!-- 仓库 -->
<template #warehouse="scoped">
<span >{{ scoped.row.warehouseName }}</span>
</template>
<!-- 领料数量 -->
<!-- 领料数量 -->
<template #requisitionNumber="scoped">
<el-input-number
v-model="scoped.row.requisitionNumber"
@ -76,13 +81,13 @@
<span v-else>{{ scoped.row.requisitionNumber }}</span>
</template>
<!-- 领料-->
<!-- 领料实际重-->
<template #requisitionWeight="scoped">
<el-input-number
v-model="scoped.row.requisitionWeight"
:step="0.01"
:min="0"
:precision="2"
:precision="4"
:controls="true"
v-if="mode=='add'"
></el-input-number>
@ -132,6 +137,14 @@ export default {
};
},
watch: {
"form.warehouse": {
handler(value, old) {
const _this = this;
if (this.mode == 'add') {
this.listData = [];
}
},
},
"form.supplier": {
handler(value, old) {
const _this = this;
@ -157,7 +170,7 @@ export default {
newVal.forEach((item) => {
/* 支数 */
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["defaultLength"]) *
Number(item["purchaseQuantity"])
).toFixed(2)
Number(item["requisitionNumber"])
).toFixed(4)
);
/* 单价 */
@ -177,7 +190,7 @@ export default {
/* 金额 */
item["amount"] = parseFloat(
(
Number(item["unitPrice"]) * Number(item["purchaseQuantity"])
Number(item["unitPrice"]) * Number(item["requisitionNumber"])
).toFixed(2)
);
@ -195,7 +208,7 @@ export default {
/* 含税金额 */
item["amountWithTax"] = parseFloat(
(
Number(item["priceWithTax"]) * Number(item["purchaseQuantity"])
Number(item["priceWithTax"]) * Number(item["requisitionNumber"])
).toFixed(2)
);
});
@ -242,7 +255,9 @@ export default {
if (valid) {
this.dialog.product = true;
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) {
const _this = this;
data.forEach((item) => {
item["warehouseName"] = _this.formatWarehouse();
for (let key in _this.initComputed) {
if (!item[key]) {
item[key] = _this.initComputed[key];
@ -267,6 +283,26 @@ export default {
});
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) {
//
const res = await this.$API.currentInventory.queryInventory.http({

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

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

@ -70,7 +70,7 @@
:min="1"
:precision="0"
:controls="true"
:max="scoped.row.existingInventory"
:max="scoped.row.requisitionNumber"
v-if="mode=='add'"
></el-input-number>
<span v-else>{{ scoped.row.returnNumber }}</span>
@ -132,6 +132,14 @@ export default {
};
},
watch: {
"form.warehouse": {
handler(value, old) {
const _this = this;
if (this.mode == 'add') {
this.listData = [];
}
},
},
"form.supplier": {
handler(value, old) {
const _this = this;
@ -157,7 +165,7 @@ export default {
newVal.forEach((item) => {
/* 支数 */
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["defaultLength"]) *
Number(item["purchaseQuantity"])
Number(item["returnNumber"])
).toFixed(2)
);
@ -177,7 +185,7 @@ export default {
/* 金额 */
item["amount"] = parseFloat(
(
Number(item["unitPrice"]) * Number(item["purchaseQuantity"])
Number(item["unitPrice"]) * Number(item["returnNumber"])
).toFixed(2)
);
@ -195,7 +203,7 @@ export default {
/* 含税金额 */
item["amountWithTax"] = parseFloat(
(
Number(item["priceWithTax"]) * Number(item["purchaseQuantity"])
Number(item["priceWithTax"]) * Number(item["returnNumber"])
).toFixed(2)
);
});
@ -242,7 +250,9 @@ export default {
if (valid) {
this.dialog.product = true;
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-header>
<div class="right-panel-search">
<thirdselect
v-model="search.materialCategory"
:item="materialCategoryItem"
<!-- 销售单号 -->
<el-input
v-model="search.salesOrderCode"
placeholder="销售订单"
clearable
>
</thirdselect>
</el-input>
<!-- 物料名称输入框 -->
<el-input
v-model="search.materialCode"

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

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

@ -49,12 +49,12 @@
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-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">
<template #reference>
<el-button type="text" size="medium">删除</el-button>
</template>
</el-popconfirm>
</el-popconfirm> -->
</template>
</el-table-column>
</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: {
returnQuantity: 1
shipmentQuantity: 1,
actualWeight: 0
},
column: [
{ label: "", prop: "id", width: "200", hide: true },
@ -187,5 +188,30 @@ export default {
{ label: "含税单价", prop: "priceWithTax", 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;
"
>
<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>
</div>
</el-card>
@ -43,7 +49,10 @@
</el-card>
<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
>
@ -60,7 +69,11 @@
row-key=""
@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">
@ -72,45 +85,67 @@
:controls="true"
v-if="mode == 'add' || mode == 'edit'"
></el-input-number>
<div v-else> {{ scoped.row.shipmentQuantity }} </div>
<div v-else>{{ scoped.row.shipmentQuantity }}</div>
</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">
<el-input
<el-input-number
v-model="scoped.row.actualWeight"
:step="1"
:min="1"
:precision="4"
:controls="true"
v-if="mode == 'add' || mode == 'edit'"
></el-input>
<div v-else> {{ scoped.row.actualWeight }} </div>
></el-input-number>
<div v-else>{{ scoped.row.actualWeight }}</div>
</template>
<!-- 仓库 -->
<template #warehouse="scoped">
<el-input
<!-- <el-input
v-model="scoped.row.warehouse"
v-if="mode == 'add' || mode == 'edit'"
></el-input>
<div v-else> {{ scoped.row.warehouse }} </div>
></el-input> -->
<thirdselect
v-model="scoped.row.warehouse"
:item="warehouseItem"
formMode="edit"
>
</thirdselect>
<!-- <div v-else> {{ scoped.row.warehouse }} </div> -->
</template>
<template #inventoryQuantity="scoped">
<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>
</div>
</template>
</scTable>
</el-card>
</el-main>
<select-page
<!-- <select-page
ref="selectPage"
v-if="dialog.selectPage"
@success="handleSuccess"
@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-dialog>
</template>
@ -118,6 +153,8 @@
<script>
import useTabs from "@/utils/useTabs";
import selectPage from "./selectPage";
import thirdselect from "@/components/scForm/items/thirdselect";
import materialsSelect from "./materialsSelect";
import module from "./module";
@ -125,6 +162,8 @@ export default {
emits: ["success", "closed"],
components: {
selectPage,
thirdselect,
materialsSelect,
},
data() {
return {
@ -144,9 +183,13 @@ export default {
mode: "add",
dialog: {
selectPage: false,
product: false,
},
visible: false,
orderInfo: {}
orderInfo: {},
warehouseItem: {
options: { editdisable: true, tb: "warehouses", placeholder: "仓库" },
},
};
},
watch: {
@ -184,13 +227,11 @@ export default {
Number(item["weight"]) *
Number(item["defaultLength"]) *
Number(item["shipmentQuantity"])
).toFixed(2)
).toFixed(4)
);
console.log("this.orderInfo", this.orderInfo)
item["salespersonName"] = this.orderInfo.salespersonName;
item["salesOrderCode"] = this.orderInfo.documentNumber;
item["undeliveredQuantity"] = item["orderTotalQuantity"] - item["producedPieces"]
item["undeliveredQuantity"] =
item["orderTotalQuantity"] - item["producedPieces"];
});
},
deep: true,
@ -203,16 +244,16 @@ export default {
// "updateViewTagsTitle",
// this.id ? `CURDID:${this.id}` : "CURD"
// );
this.loadDetail();
// this.loadDetail();
},
methods: {
open(mode="add") {
open(mode = "add") {
this.mode = mode;
this.visible = true;
return this;
},
setData(row) {
this.loadDetail(row.documentNumber)
this.loadDetail(row.documentNumber);
},
async loadDetail(documentNumber) {
var res = await this.$API[module.name][module.detail].http({
@ -221,7 +262,6 @@ export default {
if (res.code == 0) {
this.form = res.data.orderInfo;
this.orderInfo = res.data.purchInfo;
this.listData = res.data.materials;
this.$nextTick(function () {
this.$forceUpdate();
@ -232,20 +272,22 @@ export default {
this.selection = selection;
},
add_materials() {
// this.$router.push({
// path: '/mini/procurement/purchaseReceipt/selectPage',
// query: {
// path: '/mini/procurement/purchaseReceipt/savePage',
// this.$refs.formref.validate(async (valid, obj) => {
// if (valid) {
// this.dialog.selectPage = true;
// this.$nextTick(() => {
// this.$refs.selectPage.open().setData(this.orderInfo, this.listData);
// });
// }
// })
this.$refs.formref.validate(async (valid, obj) => {
if (valid) {
this.dialog.selectPage = true;
this.dialog.product = true;
this.$nextTick(() => {
this.$refs.selectPage.open().setData(this.orderInfo, this.listData);
this.$refs.materialsSelect.open().setData(this.listData);
});
}
})
});
},
delete_materials() {
this.listData = this.listData.filter(
@ -258,7 +300,6 @@ export default {
},
handleSuccess(data, orderInfo) {
const _this = this;
this.orderInfo = orderInfo;
data.forEach((item) => {
for (let key in _this.initComputed) {
if (!item[key]) {
@ -273,7 +314,7 @@ export default {
const res = await this.$API.currentInventory.queryInventory.http({
materialCode: row.materialCode,
supplier: this.orderInfo.supplier,
})
});
if (res.code == 0) {
row.inventoryQuantity = res.data || 0;
@ -298,7 +339,6 @@ export default {
}
const params = {
purchInfo: this.orderInfo,
materials: this.listData,
orderInfo: this.form,
};

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

Loading…
Cancel
Save