20241116更新

main
lcode 1 week ago
parent 53835d3c98
commit 7a20f97b92

@ -70,7 +70,6 @@
<script>
import module from "./module";
import config from "@/config";
import savePage from "./savePage";
export default {

@ -116,7 +116,6 @@
</template>
<script>
import useTabs from "@/utils/useTabs";
import selectPage from "./selectPage";
import module from "./module";
@ -304,12 +303,6 @@ export default {
}
},
back() {
// useTabs.closeNext((tags) => {
// //'/usercenter'
// console.log(tags);
// this.$router.push(this.path);
// this.$route.is = true;
// });
this.visible = false;
},
save() {

@ -91,8 +91,6 @@
</template>
<script>
import useTabs from "@/utils/useTabs";
import module from "./module";
export default {
@ -304,12 +302,6 @@ export default {
this.detailListData = [...data, ...this.detailListData];
},
back() {
// useTabs.closeNext((tags) => {
// //'/usercenter'
// console.log(tags);
// this.$router.push(this.path);
// this.$route.is = true;
// });
this.visible = false;
},
save() {

@ -4,6 +4,7 @@
v-model="visible"
:width="panelWidth"
destroy-on-close
:append-to-body="true"
@closed="$emit('closed')"
>
<el-container>
@ -24,7 +25,7 @@
clearable
>
</el-input>
<!-- 物料名称输入框 -->
<el-input
v-model="search.materialName"
@ -32,11 +33,7 @@
clearable
>
</el-input>
<el-input
v-model="search.orderNo"
placeholder="订单号"
clearable
>
<el-input v-model="search.orderNo" placeholder="订单号" clearable>
</el-input>
<el-input
v-model="search.customerName"
@ -50,11 +47,7 @@
icon="el-icon-search"
@click="upsearch"
></el-button>
<el-button
type="primary"
plain
@click="add"
>添加</el-button>
<el-button type="primary" plain @click="add"></el-button>
</div>
</el-header>
<el-main class="nopadding">
@ -66,7 +59,10 @@
row-key="id"
@selection-change="selectionChange"
>
<el-table-column type="selection" width="50" :reserve-selection="true"
<el-table-column
type="selection"
width="50"
:reserve-selection="true"
:selectable="selectable"
></el-table-column>
</scTable>
@ -100,14 +96,15 @@ export default {
params: module.tableSelect.params,
selection: [],
materialCategoryItem: {
options: { tb: 'product_material_categories', placeholder: '物料/产品分类' }
options: {
tb: "product_material_categories",
placeholder: "物料/产品分类",
},
},
listData: []
listData: [],
};
},
mounted() {
},
mounted() {},
methods: {
//
open() {
@ -117,26 +114,28 @@ export default {
materialName: "",
productCode: "",
profileModel: "",
}
};
this.$forceUpdate();
this.visible = true;
return this;
},
setData(listData) {
console.log("listData", listData)
console.log(typeof 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)
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.$emit("success", this.selection);
this.visible = false;
},
//
@ -147,5 +146,5 @@ export default {
};
</script>
<style>
<style lang="less" scoped>
</style>

@ -117,19 +117,19 @@ export default {
"title": "选计划排产订单",
"panelWidth": "1000px",
"api": "productionSchedule.list",
"params": { "status": 1 },
"params": { "status": 1, "orderStatus": 1 },
"column": [
{ label: "", prop: "id", width: "200", hide: true },
{ label: "计划单号", prop: "documentNumber", width: "200" },
{ label: "销售单号", prop: "salesOrderCode", width: "200" },
{ "label": "客户名称", "prop": "customerName", "width": "200" },
{ label: "客户名称", prop: "customerName", width: "200" },
{
label: "销售日期",
prop: "salesDate",
width: "200",
},
{ "label": "销售员", "prop": "salespersonName", "width": "200" },
{ "label": "价格", "prop": "price", "width": "200" },
{ label: "销售员", prop: "salespersonName", width: "200" },
{ label: "价格", prop: "price", width: "200" },
{
label: "定价日期",
prop: "pricingDate",
@ -140,9 +140,10 @@ export default {
prop: "deliveryDate",
width: "200",
},
{ "label": "税率", "prop": "taxRate", "width": "200" },
{ "label": "加工费", "prop": "processingFee", "width": "200" },
{ "label": "备注", "prop": "remarks", "width": "200" },
{ label: "税率", prop: "taxRate", width: "200" },
{ label: "加工费", prop: "processingFee", width: "200" },
{ label: "备注", prop: "remarks", width: "200" },
{ label: "订单号", prop: "orderNo", width: "200" },
{ label: "物料编号", prop: "materialCode", width: "200" },
{ label: "型材型号", prop: "profileModel", width: "200" },
{ label: "物料名称", prop: "materialName", width: "200" },
@ -150,7 +151,6 @@ export default {
{ label: "壁厚", prop: "thickness", width: "200" },
{ label: "米重 (kg/m)", prop: "weight", width: "200" },
{ label: "支/扎", prop: "piecesBundle", width: "200" },
{ label: "物料/产品分类", prop: "materialCategoryName", width: "200" },
{ label: "包装方式", prop: "packagingMethod", width: "200" },
],
},

@ -80,7 +80,6 @@
v-model="scoped.row.productionPieces"
:step="1"
:min="1"
:max="Number(scoped.row.plannedPieces) - Number(scoped.row.productionedPieces)"
:precision="0"
:controls="true"
@ -138,14 +137,12 @@ export default {
selection: [],
dialog: {
product: false,
selectPage: false,
},
supplier: {},
path: this.$route.query.path,
detailId: this.$route.query.id,
mode: "add",
dialog: {
selectPage: false,
},
visible: false,
orderInfo: {}
};
@ -175,6 +172,7 @@ export default {
handler(newVal) {
if (!newVal) return;
newVal.forEach((item) => {
/* 支数 */
item["pieces"] = parseFloat(
Number(item["piecesBundle"]) * Number(item["returnQuantity"])
@ -193,8 +191,8 @@ export default {
item["theoreticalWeight"] = parseFloat(
(
Number(item["weight"]) *
Number(item["defaultLength"]) *
Number(item["returnQuantity"])
Number(item["orderLength"]) *
Number(item["plannedPieces"])
).toFixed(2)
);
@ -250,7 +248,7 @@ export default {
this.listData = this.listData.filter(
(item1) =>
!this.selection.some(
(item2) => item2.materialCode === item1.materialCode
(item2) => item2.orderNo === item1.orderNo
)
);
this.selection = [];
@ -265,8 +263,11 @@ export default {
item[key] = _this.initComputed[key];
}
}
item["productionLength"] = item["orderLength"]
item["productionPieces"] = item["plannedPieces"]
});
console.log("2", this, this.listData)
this.listData = [...data];
},
async queryInventoryQuantity(row) {

@ -37,8 +37,7 @@
<script>
import saveDialog from './save'
import module from './module'
import config from "@/config"
import savePage from './savePage'
import savePage from './savePage'
export default {
components: {

@ -107,8 +107,6 @@
</template>
<script>
import useTabs from "@/utils/useTabs";
import module from "./module";
import materialsSelect from "./materialsSelect";
@ -315,12 +313,6 @@ export default {
}
},
back() {
// useTabs.closeNext((tags) => {
// //'/usercenter'
// console.log(tags);
// this.$router.push(this.path);
// this.$route.is = true;
// });
this.visible = false;
},
save() {

@ -37,8 +37,7 @@
<script>
import saveDialog from './save'
import module from './module'
import config from "@/config"
import savePage from './savePage'
import savePage from './savePage'
export default {
components: {

@ -102,8 +102,6 @@
</template>
<script>
import useTabs from "@/utils/useTabs";
import module from "./module";
import materialsSelect from "./materialsSelect";
@ -213,12 +211,6 @@ export default {
},
created() {},
mounted() {
//tab
// this.$store.commit(
// "updateViewTagsTitle",
// this.id ? `CURDID:${this.id}` : "CURD"
// );
// this.loadDetail();
},
methods: {
open(mode="add") {
@ -289,12 +281,6 @@ export default {
}
},
back() {
// useTabs.closeNext((tags) => {
// //'/usercenter'
// console.log(tags);
// this.$router.push(this.path);
// this.$route.is = true;
// });
this.visible = false;
},
save() {

@ -79,6 +79,7 @@
v-model="scoped.row.receiptQuantity"
:step="1"
:min="1"
:max="scoped.row.productionNumber - scoped.row.stockQuantity"
:precision="0"
:controls="true"
v-if="mode=='add'"
@ -293,6 +294,7 @@ export default {
item[key] = _this.initComputed[key];
}
}
item['receiptQuantity'] = item['productionNumber']
});
this.listData = [...data, ...this.listData];
},

@ -6,6 +6,7 @@
type="primary"
icon="el-icon-plus"
@click="page_add"
v-if="isFirst"
></el-button>
</div>
<div class="right-panel-search">
@ -57,6 +58,7 @@
:apiObj="apiObj"
:column="column"
:remoteFilter="config.remoteFilter"
:params="params"
row-key=""
@selection-change="selectionChange"
>
@ -81,7 +83,7 @@
type="text"
size="medium"
@click="table_edit(scope.row, scope.$index)"
v-if="config.option.edit && scope.row.isCompleted != '1'"
v-if="config.option.edit && scope.row.isCompleted != '1' && (!scope.row.nextProcess)"
>完成</el-button
>
</template>
@ -112,7 +114,6 @@
<script>
import saveDialog from "./save";
import module from "./module";
import config from "@/config";
import savePage from "./savePage";
import infoDialog from "./info";
@ -126,6 +127,11 @@ export default {
dicselect,
},
data() {
let currentProcess = "";
if (this.$route.path.startsWith("/processReport/")) {
currentProcess = this.$route.path.replace("/processReport/", "");
}
return {
dialog: {
save: false,
@ -140,7 +146,10 @@ export default {
reportNumber: "",
date: "",
},
params: {
currentProcess: currentProcess
},
isFirst: currentProcess == 'jiya',
apiObj: this.$API[module.name][module.list],
selection: [],
config: module.config,
@ -148,10 +157,19 @@ export default {
column: module.column,
currentProcessItem: {
options: { group: "working", placeholder: "当前工序" },
}
},
};
},
mounted() {},
watch: {
params: {
handler() {
this.$refs.table.upData()
},
deep: true
}
},
created() {
},
methods: {
//
importExcel() {

@ -1,13 +1,21 @@
<template>
<el-dialog
title="查看"
v-model="visible"
:width="panelWidth"
destroy-on-close
@closed="$emit('closed')"
title="查看"
v-model="visible"
:width="panelWidth"
destroy-on-close
@closed="$emit('closed')"
>
<ex-desc v-model="descData" :descProps="descProps" :descInfo="descInfo">
<template #actualWeight="{ item }">
<span>{{ dealData("actualWeight") }}</span>
</template>
<template #scrapWeight="{ item }">
<span>{{ dealData("scrapWeight") }}</span>
</template>
<template #theoreticalWeight="{ item }">
<span>{{ dealData("theoreticalWeight") }}</span>
</template>
</ex-desc>
</el-dialog>
</template>
@ -19,7 +27,7 @@ export default {
data() {
return {
mode: "add",
panelWidth:module.infoOption.panelWidth || "500",
panelWidth: module.infoOption.panelWidth || "500",
visible: false,
isSaveing: false,
loading: false,
@ -30,8 +38,7 @@ export default {
descData: {},
};
},
mounted() {
},
mounted() {},
methods: {
//
open() {
@ -41,7 +48,31 @@ export default {
//
setData(data) {
//
Object.assign(this.descData, data)
Object.assign(this.descData, data);
},
dealData(key) {
switch (key) {
case "actualWeight":
return (
Number(this.descData["productionWeight"]) *
Number(this.descData["productionLength"]) *
Number(this.descData["productionNumber"])
);
case "scrapWeight":
return (
Number(this.descData["productionWeight"]) *
Number(this.descData["productionLength"]) *
Number(this.descData["scrapNumber"])
);
case "theoreticalWeight":
return (
Number(this.descData["weight"]) *
Number(this.descData["productionLength"]) *
Number(this.descData["productionNumber"])
);
default:
return "";
}
},
},
};

@ -1,6 +1,3 @@
import $API from '@/api'
import $CONFIG from '@/config'
export default {
name: "processReport",
dec: "工序报工",
@ -32,7 +29,19 @@ export default {
{ label: "机台", prop: "machine", width: "200" },
{ label: "销售订单编码", prop: "salesOrderCode", width: "200" },
{ label: "挤压排产编码", prop: "scheduleNumber", width: "200" },
{ label: "产品代码", prop: "materialCode", width: "200" },
{ label: "型材型号", prop: "profileModel", width: "200" },
{ label: "物料名称", prop: "materialName", width: "200" },
{ label: "规格型号", prop: "specification", width: "200" },
{ label: "壁厚", prop: "thickness", width: "200" },
{ label: "米重", prop: "weight", width: "200" },
{ label: "订单长度M", prop: "orderLength", width: "200" },
{ label: "表面方式", prop: "surfaceMethod", width: "200" },
{ label: "订单总数", prop: "orderTotalQuantity", width: "200" },
{ label: "排产长度(m)", prop: "productionLength", width: "200" },
{ label: "排产支数", prop: "productionPieces", width: "200" },
{ label: "锯切方式", prop: "sawingMethod", width: "200" },
{ label: "交货日期", prop: "deliveryDate", width: "200" },
{ label: "操作员", prop: "operator", width: "200" },
{ label: "车间", prop: "workshop", width: "200" },
{
@ -57,24 +66,64 @@ export default {
},
items: [
{
label: "完成数量", name: "productionNumber", value: "", component: "", span: 1,
label: "来料支数", name: "sourceNumber", value: "", component: "", span: 1,
hideHandle: "$.currentProcess == 'jiya'"
},
{
label: "实收支数", name: "netReceipts", value: "", component: "", span: 1,
hideHandle: "$.currentProcess == 'jiya'"
},
{
label: "生产支数", name: "productionNumber", value: "", component: "", span: 1,
},
{
label: "完成重量", name: "productionWeight", value: "", component: "ther", span: 1,
label: "实际米重", name: "productionWeight", value: "", component: "", span: 1,
},
{
label: "实际总重量(KG)", name: "actualWeight", value: "", component: "other", span: 1,
},
{ label: "报废支数", name: "scrapNumber", value: "", component: "", span: 1 },
{
label: "报废重量(KG)", name: "scrapWeight", value: "", component: "other", span: 1,
},
{ label: "报废原因", name: "scrapReason", value: "", component: "", span: 1 },
{
label: "理论重量(KG)", name: "theoreticalWeight", value: "", component: "other", span: 1,
},
{ label: "框号", name: "frameNumber", value: "", component: "", span: 1 },
{ label: "模具编码", name: "moldCode", value: "", component: "", span: 1,
hideHandle: "$.currentProcess != 'jiya' && $.currentProcess != 'jingpin'"
},
{ label: "模具型号", name: "moldModel", value: "", component: "", span: 1,
hideHandle: "$.currentProcess != 'jiya' && $.currentProcess != 'jingpin'"
},
{ label: "模厚", name: "moldThickness", value: "", component: "", span: 1,
hideHandle: "$.currentProcess != 'jiya' && $.currentProcess != 'jingpin'"
},
{ label: "模具厂家", name: "moldManufacturer", value: "", component: "", span: 1,
hideHandle: "$.currentProcess != 'jiya' && $.currentProcess != 'jingpin'"
},
{ label: "颜色", name: "moldColor", value: "", component: "", span: 1,
hideHandle: "$.currentProcess != 'jiya' && $.currentProcess != 'jingpin'"
},
{ label: "换模原因", name: "moldChangeReason", value: "", component: "", span: 1,
hideHandle: "$.currentProcess != 'jiya' && $.currentProcess != 'jingpin'"
},
{ label: "用棒支数", name: "rodCount", value: "", component: "", span: 1,
hideHandle: "$.currentProcess != 'jiya' && $.currentProcess != 'jingpin'"
},
{
label: "当前工序", name: "currentProcess", value: "", component: "dic", group: "working", span: 1,
},
{
label: "下一工序", name: "nextProcess", value: "", component: "dic", group: "working", span: 1,
hideHandle: "$.currentProcess == 'bz'"
hideHandle: "$.isCompleted == true"
},
{
label: "是否完成", name: "isCompleted", value: "", component: "", span: 1,
hideHandle: "$.currentProcess != 'bz'",
// hideHandle: "$.currentProcess != 'bz'",
format(value) {
switch (value + "") {
case "1":
@ -96,14 +145,20 @@ export default {
size: 'medium',
formItems: [
{
label: "完成数量", name: "productionNumber", value: "", component: "other", span: 24,
options: { maxlength: "256", placeholder: "请输入完成数量" },
rules: [{ required: true, message: "请输入完成数量", trigger: "blur" }]
label: "实收支数", name: "netReceipts", value: "", component: "other", span: 24,
options: { maxlength: "256", placeholder: "请输入实收支数" },
rules: [{ required: true, message: "请输入实收支数", trigger: "blur" }],
hideHandle: "$.currentProcess == 'jiya'"
},
{
label: "生产支数", name: "productionNumber", value: "", component: "other", span: 24,
options: { maxlength: "256", placeholder: "请输入生产支数" },
rules: [{ required: true, message: "请输入生产支数", trigger: "blur" }]
},
{
label: "完成重量", name: "productionWeight", value: "", component: "other", span: 24,
options: { maxlength: "256", placeholder: "请输入完成重量" },
rules: [{ required: true, message: "请输入完成重量", trigger: "blur" }]
label: "实际米重", name: "productionWeight", value: "", component: "other", span: 24,
options: { maxlength: "256", placeholder: "请输入实际米重" },
rules: [{ required: true, message: "请输入实际米重", trigger: "blur" }]
},
{ label: "报废支数", name: "scrapNumber", value: "", component: "other", span: 24, options: { maxlength: "256", placeholder: "请输入报废支数" }, rules: [{ required: false, message: "请输入报废支数", trigger: "blur" }] },
{ label: "报废原因", name: "scrapReason", value: "", component: "input", span: 24, options: { maxlength: "256", placeholder: "请输入报废原因" }, rules: [{ required: false, message: "请输入报废原因", trigger: "blur" }] },
@ -112,10 +167,11 @@ export default {
label: "下一工序", name: "nextProcess", value: "", component: "dic", span: 24,
options: { group: "working", placeholder: "请输入下一工序" },
rules: [{ required: true, message: "请输入下一工序", trigger: "blur" }],
hideHandle: "$.currentProcess == 'bz'"
// hideHandle: "$.currentProcess == 'bz'"
hideHandle: "$.isCompleted == true"
},
{
label: "是否完成", name: "isCompleted", value: 1, component: "select",
label: "是否完成", name: "isCompleted", value: 0, component: "select",
span: 24,
options: {
multiple: false,
@ -131,27 +187,11 @@ export default {
]
},
rules: [{ required: false, message: "请选择", trigger: "blur" }],
hideHandle: "$.currentProcess != 'bz'"
// hideHandle: "$.currentProcess != 'bz'"
},
{ label: "备注", name: "remarks", value: "", component: "textarea", span: 24, options: { maxlength: "500", placeholder: "请输入备注" } }
]
},
finishFormOption: {
labelWidth: '100px',
labelPosition: 'center',
panelWidth: "800",
size: 'medium',
formItems: [
{ label: "完成数量", name: "completionQuantity", value: "", component: "input", span: 24, options: { maxlength: "256", placeholder: "请输入完成数量" }, rules: [{ required: true, message: "请输入完成数量", trigger: "blur" }] },
{ label: "完成重量", name: "completionWeight", value: "", component: "input", span: 24, options: { maxlength: "256", placeholder: "请输入完成重量" }, rules: [{ required: true, message: "请输入完成重量", trigger: "blur" }] },
{ label: "报废支数", name: "scrapPieces", value: "", component: "input", span: 24, options: { maxlength: "256", placeholder: "请输入报废支数" }, rules: [{ required: false, message: "请输入报废支数", trigger: "blur" }] },
{ label: "报废原因", name: "scrapReason", value: "", component: "input", span: 24, options: { maxlength: "256", placeholder: "请输入报废原因" }, rules: [{ required: false, message: "请输入报废原因", trigger: "blur" }] },
{ label: "框号", name: "frameNumber", value: "", component: "input", span: 24, options: { maxlength: "256", placeholder: "请输入框号" }, rules: [{ required: false, message: "请输入框号", trigger: "blur" }] },
{ label: "下一工序", name: "nextProcess", value: "", component: "input", span: 24, options: { maxlength: "256", placeholder: "请输入下一工序" }, rules: [{ required: false, message: "请输入下一工序", trigger: "blur" }] },
{ label: "是否完成", name: "isCompleted", value: "", component: "input", span: 24, options: { maxlength: "256", placeholder: "请输入是否完成" }, rules: [{ required: false, message: "请输入是否完成", trigger: "blur" }] },
{ label: "备注", name: "remarks", value: "", component: "textarea", span: 24, options: { maxlength: "500", placeholder: "请输入备注" } }
]
},
pageForm: {
title: "工序报工",
form: {
@ -181,11 +221,11 @@ export default {
options: { valueFormat: "YYYY-MM-DD", placeholder: "请选择采购日期" },
rules: [{ required: true, message: "请选择采购日期", trigger: "change" }]
},
{
label: "当前工序", name: "currentProcess", value: "", component: "dic", span: 6,
options: { group: "working" },
rules: [{ required: true, message: "请选择当前工序", trigger: "change" }]
},
// {
// label: "当前工序", name: "currentProcess", value: "", component: "dic", span: 6,
// options: { group: "working" },
// rules: [{ required: true, message: "请选择当前工序", trigger: "change" }]
// },
{ label: "备注", name: "remarks", value: "", component: "textarea", span: 24, options: { maxlength: "500", placeholder: "请输入备注" } },
]
},
@ -221,6 +261,13 @@ export default {
{ label: "生产支数", prop: "productionPieces", width: "200" },
{ label: "锯切方式", prop: "sawingMethod", width: "200" },
{ label: "生产理论重量", prop: "productionWeight", width: "200" },
{ label: "模具编码", prop: "moldCode", width: "200" },
{ label: "模具型号", prop: "moldModel", width: "200" },
{ label: "模厚", prop: "moldThickness", width: "200" },
{ label: "模具厂家", prop: "moldManufacturer", width: "200" },
{ label: "颜色", prop: "moldColor", width: "200" },
{ label: "换模原因", prop: "moldChangeReason", width: "200" },
{ label: "用棒支数", prop: "rodCount", width: "200" },
]
},
tableSelect: {

@ -7,6 +7,17 @@
@closed="$emit('closed')"
>
<sc-form ref="formref" :config="config" v-model="form" :loading="loading" :formMode="mode" @submit="submit">
<!-- 入库数量 -->
<template #netReceipts>
<el-input-number
v-model="form.netReceipts"
:step="1"
:min="0"
:precision="0"
:controls="true"
></el-input-number>
</template>
<!-- 入库数量 -->
<template #productionNumber>
<el-input-number

@ -87,6 +87,34 @@
<span v-else>{{ scoped.row.inventoryQuantity }}</span>
</div>
</template>
<!-- 模具编码 -->
<template #moldCode="scoped">
<el-input v-model="scoped.row['moldCode']" placeholder=""></el-input>
</template>
<!-- 模具型号 -->
<template #moldModel="scoped">
<el-input v-model="scoped.row['moldModel']" placeholder=""></el-input>
</template>
<!-- 模厚 -->
<template #moldThickness="scoped">
<el-input v-model="scoped.row['moldThickness']" placeholder=""></el-input>
</template>
<!-- 模具厂家 -->
<template #moldManufacturer="scoped">
<el-input v-model="scoped.row['moldManufacturer']" placeholder=""></el-input>
</template>
<!-- 颜色 -->
<template #moldColor="scoped">
<el-input v-model="scoped.row['moldColor']" placeholder=""></el-input>
</template>
<!-- 换模原因 -->
<template #moldChangeReason="scoped">
<el-input v-model="scoped.row['moldChangeReason']" placeholder=""></el-input>
</template>
<!-- 用棒支数 -->
<template #rodCount="scoped">
<el-input v-model="scoped.row['rodCount']" placeholder=""></el-input>
</template>
</scTable>
</el-card>
</el-main>
@ -101,8 +129,6 @@
</template>
<script>
import useTabs from "@/utils/useTabs";
import module from "./module";
import materialsSelect from "./materialsSelect";
@ -278,12 +304,6 @@ export default {
}
},
back() {
// useTabs.closeNext((tags) => {
// //'/usercenter'
// console.log(tags);
// this.$router.push(this.path);
// this.$route.is = true;
// });
this.visible = false;
},
save() {

@ -39,8 +39,8 @@
<el-table-column label="操作" fixed="right" align="center" width="120" v-if="config.option">
<template #default="scope">
<el-button type="text" size="medium" @click="table_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-button type="text" size="medium" @click="table_edit(scope.row, scope.$index)" v-if="config.option.edit && scope.row.planStatus == 0"></el-button>
<el-popconfirm title="确定删除吗?" @confirm="table_del(scope.row, scope.$index)" v-if="config.option.del && scope.row.planStatus == 0">
<template #reference>
<el-button type="text" size="medium">删除</el-button>
</template>

@ -142,6 +142,7 @@ export default {
},
column2: [
{ label: "", prop: "id", width: "200", hide: true },
{ label: "订单号", prop: "orderNo", width: "200" },
{ label: "物料编码", prop: "materialCode", width: "200" },
{ label: "物料名称", prop: "materialName", width: "200" },
{ label: "订单长度 (M)", prop: "orderLength", width: "200" },

@ -1,32 +1,74 @@
<template>
<el-container style="position: relative;">
<el-container style="position: relative">
<el-header>
<div class="left-panel">
<!-- <el-button type="primary" icon="el-icon-plus" @click="add"></el-button> -->
<el-button type="primary" icon="el-icon-plus" @click="page_add"></el-button>
<el-button type="danger" v-if="config && config.bathDel" @click="batch_del"></el-button>
<el-button
type="primary"
icon="el-icon-plus"
@click="page_add"
></el-button>
<el-button
type="danger"
v-if="config && config.bathDel"
@click="batch_del"
>删除</el-button
>
</div>
<div class="right-panel-search">
<el-input
v-model="search.documentNumber"
placeholder="单据编号"
clearable>
v-model="search.documentNumber"
placeholder="单据编号"
clearable
>
</el-input>
<el-button type="primary" icon="el-icon-search" @click="upsearch"></el-button>
<el-button
type="primary"
icon="el-icon-search"
@click="upsearch"
></el-button>
</div>
</el-header>
<el-main class="nopadding">
<scTable ref="table" :apiObj="apiObj" :column="column" :remoteFilter="config.remoteFilter" row-key="" @selection-change="selectionChange">
<scTable
ref="table"
:apiObj="apiObj"
:column="column"
:remoteFilter="config.remoteFilter"
row-key=""
@selection-change="selectionChange"
>
<el-table-column type="selection" width="50"></el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="120" v-if="config.option">
<el-table-column
label="操作"
fixed="right"
align="center"
width="200"
v-if="config.option"
>
<template #default="scope">
<!-- <el-button type="text" size="medium" @click="table_edit(scope.row, scope.$index)" v-if="config.option.edit"></el-button> -->
<el-button type="text" size="medium" @click="page_edit(scope.row)" v-if="config.option.edit && scope.row.isWarehouse != 1"></el-button>
<el-popconfirm title="确定删除吗?" @confirm="table_del(scope.row, scope.$index)" v-if="config.option.del && scope.row.isWarehouse != 1">
<el-button
type="text"
size="medium"
@click="page_edit(scope.row)"
v-if="config.option.edit && scope.row.noEdit == 0"
>编辑</el-button
>
<el-button
type="text"
size="medium"
@click="once_add_plan(scope.row)"
v-if="config.option.edit && scope.row.noEdit == 0"
>生成计划单</el-button
>
<el-popconfirm
title="确定删除吗?"
@confirm="table_del(scope.row, scope.$index)"
v-if="config.option.del && scope.row.noEdit == 0"
>
<template #reference>
<el-button type="text" size="medium">删除</el-button>
</template>
@ -35,59 +77,62 @@
</el-table-column>
</scTable>
</el-main>
<save-page ref="savePage" v-if="dialog.savePage" @closed="dialog.savePage = false" @success="handleSuccess"></save-page>
<save-page
ref="savePage"
v-if="dialog.savePage"
@closed="dialog.savePage = false"
@success="handleSuccess"
></save-page>
</el-container>
</template>
<script>
import module from './module'
import config from "@/config"
import module from "./module";
import config from "@/config";
import savePage from './savePage'
import savePage from "./savePage";
export default {
components: {
savePage
savePage,
},
data() {
return {
dialog: {
save: false,
product: false,
savePage: false
savePage: false,
},
loading:false,
file:"",
loading: false,
file: "",
search: {
documentNumber: ""
documentNumber: "",
},
apiObj:this.$API[module.name][module.list],
apiObj: this.$API[module.name][module.list],
selection: [],
config: module.config,
options: module.options,
column: module.column
}
},
mounted(){
column: module.column,
};
},
mounted() {},
methods: {
//
importExcel(){
this.dialog.importExcel = true
importExcel() {
this.dialog.importExcel = true;
this.$nextTick(() => {
this.$refs.importExcelDialog.open()
})
this.$refs.importExcelDialog.open();
});
},
//
handleReset(){
console.log('handleReset method called');
handleReset() {
console.log("handleReset method called");
// 1.
this.search = {};
var search = {
email: ""
var search = {
email: "",
}; // {}
// 2.
@ -97,94 +142,117 @@ export default {
}
},
//
add(){
add() {
// this.dialog.save = true
this.dialog.product = true
this.dialog.product = true;
this.$nextTick(() => {
this.$refs.productMaterialsDialog.open('add', this.list)
this.$refs.productMaterialsDialog.open("add", this.list);
// this.$refs.saveDialog.open('add', this.list)
})
});
},
page_add() {
// this.$router.push({
// path: '/mini/procurement/purchaseOrders/savePage',
// this.$router.push({
// path: '/mini/procurement/purchaseOrders/savePage',
// query: {
// path: '/mini/procurement/purchaseOrders',
// }
// })
this.dialog.savePage = true
// }
// })
this.dialog.savePage = true;
this.$nextTick(() => {
this.$refs.savePage.open('add')
this.$refs.savePage.open("add");
// this.$refs.saveDialog.open('add', this.list)
})
});
},
page_edit(row) {
// this.$router.push({
// path: '/mini/procurement/purchaseOrders/savePage',
// path: '/mini/procurement/purchaseOrders/savePage',
// query: {
// path: '/mini/procurement/purchaseOrders',
// id: row.documentNumber
// }
// })
this.dialog.savePage = true
// }
// })
this.dialog.savePage = true;
this.$nextTick(() => {
this.$refs.savePage.open('edit').setData(row);
this.$refs.savePage.open("edit").setData(row);
// this.$refs.saveDialog.open('add', this.list)
})
});
},
//
async once_add_plan(row) {
const loading = this.$loading();
var reqData = {
type: "once",
orderInfo: row,
form: {
isAuto: true,
},
};
var res = await this.$API.productionSchedule.save.http(reqData);
if (res.code == 0) {
this.$refs.table.refresh();
this.$message.success("计划单生成成功");
} else {
this.$alert(res.message, "提示", { type: "error" });
}
loading.close();
},
//
table_edit(row){
this.dialog.product = true
table_edit(row) {
this.dialog.product = true;
this.$nextTick(() => {
this.$refs.productMaterialsDialog.open('edit', this.list).setData(row)
this.$refs.productMaterialsDialog.open("edit", this.list).setData(row);
// this.$refs.saveDialog.open('edit', this.list).setData(row)
})
});
},
//
async table_del(row, index){
var reqData = {id: row[this.config.delId?this.config.delId:"id"]}
async table_del(row, index) {
var reqData = { id: row[this.config.delId ? this.config.delId : "id"] };
var res = await this.$API[module.name][module.del].http(reqData);
if(res.code == 0){
if (res.code == 0) {
// OR /
this.$refs.table.upData();
this.$message.success("删除成功");
}else{
this.$alert(res.message, "提示", {type: 'error'})
} else {
this.$alert(res.message, "提示", { type: "error" });
}
},
//
async batch_del(){
async batch_del() {
if (this.selection.length == 0) {
this.$alert("请选择需要删除的数据", "提示", {type: 'warning'})
this.$alert("请选择需要删除的数据", "提示", { type: "warning" });
return;
}
this.$confirm(`确定删除选中的 ${this.selection.length} 项吗?`, '提示', {
type: 'warning'
}).then(async () => {
const loading = this.$loading();
console.log(this.selection)
var idArr = [];
this.selection.forEach(item => {
idArr.push(item[this.config.delId?this.config.delId:"id"])
})
var reqData = {type: "batch", ids: idArr.join(",")}
var res = await this.$API[module.name][module.del].http(reqData);
if(res.code == 0){
// OR /
this.$refs.table.refresh();
this.$message.success("删除成功");
}else{
this.$alert(res.message, "提示", {type: 'error'})
}
loading.close();
}).catch(() => {
this.$message.success("操作失败")
this.$confirm(`确定删除选中的 ${this.selection.length} 项吗?`, "提示", {
type: "warning",
})
.then(async () => {
const loading = this.$loading();
console.log(this.selection);
var idArr = [];
this.selection.forEach((item) => {
idArr.push(item[this.config.delId ? this.config.delId : "id"]);
});
var reqData = { type: "batch", ids: idArr.join(",") };
var res = await this.$API[module.name][module.del].http(reqData);
if (res.code == 0) {
// OR /
this.$refs.table.refresh();
this.$message.success("删除成功");
} else {
this.$alert(res.message, "提示", { type: "error" });
}
loading.close();
})
.catch(() => {
this.$message.success("操作失败");
});
},
//
selectionChange(selection){
selectionChange(selection) {
this.selection = selection;
},
filterChange(obj) {
@ -192,20 +260,20 @@ export default {
this.upsearch();
},
//
upsearch(){
upsearch() {
this.$refs.table.upData(this.search);
},
//
handleSuccess(data, mode){
this.$refs.table.upData()
handleSuccess(data, mode) {
this.$refs.table.upData();
},
}
}
},
};
</script>
<style lang="less" scoped>
.upload {
color: #409EFF;
color: #409eff;
background: #ecf5ff;
min-height: 32px;
padding: 9px 15px;

@ -4,6 +4,7 @@
v-model="visible"
:width="panelWidth"
destroy-on-close
:append-to-body="true"
@closed="$emit('closed')"
>
<el-container>
@ -109,7 +110,8 @@ export default {
return this;
},
setData(listData) {
this.listData = listData;
// this.listData = listData;
this.listData = [];
},
selectable(row, index) {
return !this.listData.some(item => row.materialCode == item.materialCode)
@ -130,5 +132,8 @@ export default {
};
</script>
<style>
<style lang="less" scoped>
.el-dialog__header {
padding: 20px 20px 10px;
}
</style>

@ -181,13 +181,11 @@ export default {
},
'form.customerId': {
handler(value, old) {
console.log('form.customerId', value)
const formItems = module.pageForm.form.formItems
const fields = formItems.filter(item => {
return item.name == 'customerId'
})[0]
const items = fields.options.items
console.log(fields)
if (!!items) {
const curObj = items.filter(item => {
return item.value == value
@ -201,7 +199,6 @@ export default {
},
listData: {
handler(newVal) {
console.log(this.form)
newVal.forEach((item) => {
/* 理论支重 */
item["theoreticalWeightPerPiece"] = parseFloat(
@ -240,7 +237,6 @@ export default {
);
/* 含税单价 */
console.log("item", item)
item["priceWithTax"] = parseFloat(
(Number(item["unitPrice"]) +
parseFloat(
@ -310,17 +306,29 @@ export default {
});
},
delete_materials() {
this.listData = this.listData.filter(
(item1) =>
!this.selection.some(
(item2) => item2.materialCode === item1.materialCode
(item2) => item2.curIndex === item1.curIndex
)
);
let curIndex = 0;
this.listData.forEach((item) => {
curIndex = curIndex + 1
item['curIndex'] = curIndex;
});
this.selection = [];
},
handleSuccess(data) {
const _this = this;
let curIndex = this.listData.length
data.forEach((item) => {
curIndex = curIndex + 1
item['curIndex'] = curIndex;
for (let key in _this.initComputed) {
if (!item[key]) {
item[key] = _this.initComputed[key];
@ -328,6 +336,7 @@ export default {
}
});
this.listData = [...data, ...this.listData];
console.log("this.listData", this.listData)
},
async queryInventoryQuantity(row) {
//
@ -343,7 +352,6 @@ export default {
back() {
// useTabs.closeNext((tags) => {
// //'/usercenter'
// console.log(tags);
// this.$router.push(this.path);
// this.$route.is = true;
// });
@ -361,7 +369,6 @@ export default {
materials: this.listData,
orderInfo: this.form,
};
console.log(params);
var res = null;
if (this.mode == "edit") {

@ -166,6 +166,7 @@ export default {
},
column2: [
{ label: "", prop: "id", width: "200", hide: true },
{ label: "订单号", prop: "orderNo", width: "200" },
{ label: "物料编码", prop: "materialCode", width: "200" },
{ label: "物料名称", prop: "materialName", width: "200" },
{ label: "订单长度 (M)", prop: "orderLength", width: "200" },

Loading…
Cancel
Save