20241012更新

main
lcode 4 weeks ago
parent 89f797ee0e
commit c1fa1d3a64

@ -19,6 +19,14 @@ export default {
return await http.post(this.url, params);
}
},
detail: {
url: `${config.API_URL}/web/webExtrusionSchedule/detail`,
name: "挤压排产详情",
method: "post",
http: async function(params={}){
return await http.post(this.url, params);
}
},
save: {
url: `${config.API_URL}/web/webExtrusionSchedule/add`,
name: "新增挤压排产",

@ -479,7 +479,7 @@ export default {
//
hideHandle(item) {
if (item.hideHandle) {
const exp = eval(item.hideHandle.replace(/\$/g, "this.form"));
const exp = eval(item.hideHandle.replace(/\$/g, "this.form").replace(/\@/g, "this"));
return exp;
}
return false;

@ -72,7 +72,19 @@ export default {
size: 'small',
optionHide: true,
formItems: [
{ label: "单据编号", name: "documentNumber", value: "", component: "input", span: 6, options: { editdisable: true, maxlength: "256", placeholder: "请输入单据编号" }, rules: [{ required: true, message: "请输入单据编号", trigger: "blur" }] },
{
label: "单据编号", name: "documentNumber", value: "", component: "input", span: 6,
options: { editdisable: true, maxlength: "256", placeholder: "请输入单据编号" },
rules: [{ required: true, message: "请输入单据编号", trigger: "blur" }],
hideHandle: "$.isAuto && @.formMode=='add'"
},
{
label: "自动生成单号", name: "isAuto", value: true, component: "switch",
span: 6,
options: { editdisable: true },
rules: [{ required: false, message: "请选择", trigger: "blur" }],
hideHandle: "@.formMode=='edit'"
},
{
label: "供应商", name: "supplier", value: "", component: "thirdselect", span: 6,
options: { tb: "supplier_info", placeholder: "请输入物料/产品分类" },

@ -225,7 +225,7 @@ export default {
// "updateViewTagsTitle",
// this.id ? `CURDID:${this.id}` : "CURD"
// );
this.loadDetail();
// this.loadDetail();
},
methods: {
open(mode="add") {

@ -29,6 +29,7 @@ export default {
options: [],
column: [
{ label: "", prop: "id", width: "200", hide: true },
{ label: "供应商编码", prop: "supplierCode", width: "200" },
{ label: "供应商名称", prop: "supplierName", width: "200" },
{ label: "结算币种", prop: "settlementCurrency", width: "200", type: 'dic', group: 'settlementCurrency' },
{ label: "税", prop: "tax", width: "200", type: 'dic', group: 'tax' },
@ -71,6 +72,19 @@ export default {
panelWidth: "800",
size: 'medium',
formItems: [
{
label: "供应商编码", name: "supplierCode", value: "", component: "input", span: 12, options: { editdisable: true, maxlength: "256", placeholder: "请输入供应商编码" },
rules: [{ required: true, message: "请输入供应商编码", trigger: "blur" }],
hideHandle: "$.isAuto && @.formMode=='add'"
},
{
label: "自动编码", name: "isAuto", value: true, component: "switch",
span: 12,
options: { editdisable: true },
rules: [{ required: false, message: "请选择", trigger: "blur" }],
hideHandle: "@.formMode=='edit'"
},
{ label: "供应商名称", name: "supplierName", value: "", component: "input", span: 24, options: { maxlength: "256", placeholder: "请输入供应商名称" }, rules: [{ required: true, message: "请输入供应商名称", trigger: "blur" }] },
{ label: "结算币种", name: "settlementCurrency", value: "", component: "dic", span: 24, options: { group: "settlementCurrency" }, rules: [{ required: true, message: "请输入结算币种", trigger: "blur" }] },
{ label: "税", name: "tax", value: "", component: "dic", span: 24, options: { group: "tax" }, rules: [{ required: true, message: "请输入税", trigger: "blur" }] },

@ -2,25 +2,26 @@
<el-container style="position: relative">
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="page_add"></el-button>
<el-button
type="primary"
icon="el-icon-plus"
@click="page_add"
></el-button>
</div>
<div class="right-panel-search">
<el-input
v-model="search.scheduleNumber"
placeholder="排产单号"
clearable>
clearable
>
</el-input>
<el-input
<thirdselect
v-model="search.extrusionMachine"
placeholder="挤压机台"
clearable>
</el-input>
<el-input
v-model="search.extrusionTeam"
placeholder="挤压班组"
clearable>
</el-input>
:item="extrusionMachineItem"
>
</thirdselect>
<thirdselect v-model="search.extrusionTeam" :item="extrusionTeamItem">
</thirdselect>
<el-date-picker
v-model="search.extrusionDate"
type="date"
@ -29,19 +30,45 @@
style="width: 600px"
></el-date-picker>
<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="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-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"></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>
@ -58,19 +85,26 @@
></save-page>
</el-container>
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSuccess" @closed="dialog.save=false"></save-dialog>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
@success="handleSuccess"
@closed="dialog.save = false"
></save-dialog>
</template>
<script>
import saveDialog from './save'
import module from './module'
import config from "@/config"
import saveDialog from "./save";
import module from "./module";
import config from "@/config";
import savePage from "./savePage";
import thirdselect from "@/components/scForm/items/thirdselect";
export default {
components: {
saveDialog,
savePage
savePage,
thirdselect,
},
data() {
return {
@ -80,40 +114,44 @@ export default {
savePage: false,
},
loading:false,
file:"",
loading: false,
file: "",
search: {
scheduleNumber: "",
extrusionMachine:"",
extrusionTeam:"",
extrusionDate:""
extrusionMachine: "",
extrusionTeam: "",
extrusionDate: "",
},
apiObj:this.$API[module.name][module.list],
apiObj: this.$API[module.name][module.list],
selection: [],
config: module.config,
options: module.options,
column: module.column
}
column: module.column,
extrusionMachineItem: {
options: { tb: "production_machines", placeholder: "挤压机台" },
},
mounted(){
extrusionTeamItem: {
options: { tb: "user", placeholder: "挤压班组" },
},
};
},
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: ""
email: "",
}; // {}
// 2.
@ -123,13 +161,13 @@ 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.dialog.savePage = true;
@ -138,59 +176,61 @@ export default {
});
},
page_edit(row) {
this.dialog.savePage = true
this.dialog.savePage = true;
this.$nextTick(() => {
this.$refs.savePage.open('edit').setData(row);
})
this.$refs.savePage.open("edit").setData(row);
});
},
//
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.preId?this.config.preId:"id"]}
async table_del(row, index) {
var reqData = { id: row[this.config.preId ? this.config.preId : "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(){
this.$confirm(`确定删除选中的 ${this.selection.length} 项吗?`, '提示', {
type: 'warning'
}).then(async () => {
async batch_del() {
this.$confirm(`确定删除选中的 ${this.selection.length} 项吗?`, "提示", {
type: "warning",
})
.then(async () => {
const loading = this.$loading();
console.log(this.selection)
console.log(this.selection);
var idArr = [];
this.selection.forEach(item => {
idArr.push(item[this.config.preId?this.config.preId:"id"])
})
this.selection.forEach((item) => {
idArr.push(item[this.config.preId ? this.config.preId : "id"]);
});
var reqData = {ids: idArr.join(",")}
var reqData = { ids: idArr.join(",") };
var res = await this.$API[module.name][module.del].http(reqData);
if(res.code == 0){
if (res.code == 0) {
// OR /
this.$refs.table.refresh();
this.$message.success("删除成功");
}else{
this.$alert(res.message, "提示", {type: 'error'})
} else {
this.$alert(res.message, "提示", { type: "error" });
}
loading.close();
}).catch(() => {
this.$message.success("操作失败")
})
.catch(() => {
this.$message.success("操作失败");
});
},
//
selectionChange(selection){
selectionChange(selection) {
this.selection = selection;
},
filterChange(obj) {
@ -198,20 +238,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>
.upload {
color: #409EFF;
color: #409eff;
background: #ecf5ff;
min-height: 32px;
padding: 9px 15px;
@ -223,5 +263,4 @@ export default {
.sc-upload-uploader {
border: none !important;
}
</style>

@ -0,0 +1,139 @@
<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.documentNumber"
placeholder="计划单号"
clearable
>
</el-input>
<!-- 型材型号输入框 -->
<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: [],
materialCategoryItem: {
options: { tb: 'product_material_categories', placeholder: '物料/产品分类' }
},
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>

@ -8,8 +8,9 @@ export default {
del: "del",
add: "save",
edit: "edit",
detail: "detail",
importExcel: "importExcel",
upload:"upload",
upload: "upload",
config: {
formIdKey: "id",
preId: "id",
@ -29,9 +30,9 @@ export default {
column: [
{ label: "", prop: "id", width: "200", hide: true },
{ label: "排产单号", prop: "scheduleNumber", width: "200" },
{ label: "挤压排产日期", prop: "extrusionDate", width: "200"},
{ label: "挤压机台", prop: "extrusionMachine", width: "200" },
{ label: "挤压班组", prop: "extrusionTeam", width: "200" },
{ label: "挤压排产日期", prop: "extrusionDate", width: "200" },
{ label: "挤压机台", prop: "extrusionMachineName", width: "200" },
{ label: "挤压班组", prop: "extrusionTeamName", width: "200" },
{ label: "备注", prop: "remarks", width: "200" },
],
formOption: {
@ -55,14 +56,34 @@ export default {
size: 'small',
optionHide: true,
formItems: [
{ label: "排产单号", name: "scheduleNumber", value: "", component: "input", span: 6, options: { editdisable: true, maxlength: "256", placeholder: "请输入单据编号" }, rules: [{ required: true, message: "请输入单据编号", trigger: "blur" }] },
{
label: "排产单号", name: "scheduleNumber", value: "", component: "input", span: 6,
options: { editdisable: true, maxlength: "256", placeholder: "请输入单据编号" },
rules: [{ required: true, message: "请输入单据编号", trigger: "blur" }],
hideHandle: "$.isAuto && @.formMode=='add'"
},
{
label: "自动生成单号", name: "isAuto", value: true, component: "switch",
span: 6,
options: { editdisable: true },
rules: [{ required: false, message: "请选择", trigger: "blur" }],
hideHandle: "@.formMode=='edit'"
},
{
label: "挤压排产日期", name: "extrusionDate", value: "", component: "date", span: 6,
options: { editdisable: true, valueFormat: "YYYY-MM-DD", placeholder: "请选择挤压排产日期" },
rules: [{ required: true, message: "请选择挤压排产日期", trigger: "change" }]
},
{ label: "挤压机台", name: "extrusionMachine", value: "", component: "input", span: 6, options: { editdisable: true, maxlength: "256", placeholder: "请输入挤压机台" }, rules: [{ required: true, message: "请输入挤压机台", trigger: "blur" }] },
{ label: "挤压班组", name: "extrusionTeam", value: "", component: "input", span: 6, options: { editdisable: true, maxlength: "256", placeholder: "请输入挤压班组" }, rules: [{ required: true, message: "请输入挤压班组", trigger: "blur" }] },
{
label: "挤压机台", name: "extrusionMachine", value: "", component: "thirdselect", span: 6,
options: { tb: "production_machines" },
rules: [{ required: true, message: "请输入挤压机台", trigger: "blur" }]
},
{
label: "挤压班组", name: "extrusionTeam", value: "", component: "thirdselect", span: 6,
options: { tb: "user" },
rules: [{ required: true, message: "请输入挤压班组", trigger: "blur" }]
},
{ label: "备注", name: "remarks", value: "", component: "textarea", span: 24, options: { editdisable: true, maxlength: "500", placeholder: "请输入备注" } },
]
},
@ -92,9 +113,50 @@ export default {
{ label: "排产理论重量", prop: "productionWeight", width: "200" },
]
},
tableSelect: {
"title": "选计划排产订单",
"panelWidth": "1000px",
"api": "productionSchedule.list",
"params": { "status": 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: "salesDate",
width: "200",
},
{ "label": "销售员", "prop": "salespersonName", "width": "200" },
{ "label": "价格", "prop": "price", "width": "200" },
{
label: "定价日期",
prop: "pricingDate",
width: "200",
},
{
label: "交货日期",
prop: "deliveryDate",
width: "200",
},
{ "label": "税率", "prop": "taxRate", "width": "200" },
{ "label": "加工费", "prop": "processingFee", "width": "200" },
{ "label": "备注", "prop": "remarks", "width": "200" },
{ label: "物料编号", prop: "materialCode", width: "200" },
{ label: "型材型号", prop: "profileModel", width: "200" },
{ label: "物料名称", prop: "materialName", width: "200" },
{ label: "规格型号 (MM)", prop: "specification", width: "200" },
{ 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" },
],
},
selectForm: {
title: "选计划排产订单",
api: $API.salesOrder.list,
api: $API.productionSchedule.list,
subTitle: "销售订单",
search: {
labelWidth: '100px',
@ -102,7 +164,8 @@ export default {
size: 'small',
optionHide: true,
formItems: [
{ label: "单据编号", name: "documentNumber", value: "", component: "input", span: 6, options: { editdisable: false, maxlength: "256", placeholder: "请输入单据编号" }, rules: [{ required: false, message: "请输入单据编号", trigger: "blur" }] },
{ label: "计划单号", name: "documentNumber", value: "", component: "input", span: 6, options: { editdisable: false, maxlength: "256", placeholder: "请输入计划单号" }, rules: [{ required: false, message: "请输入计划单号", trigger: "blur" }] },
{ label: "销售单号", name: "salesOrderCode", value: "", component: "input", span: 6, options: { editdisable: false, maxlength: "256", placeholder: "请输入单据编号" }, rules: [{ required: false, message: "请输入单据编号", trigger: "blur" }] },
{
label: "销售日期", name: "salesDate", value: "", component: "date", span: 6,
options: { valueFormat: "YYYY-MM-DD", placeholder: "请选择采购日期" },
@ -123,7 +186,8 @@ export default {
},
column: [
{ label: "", prop: "id", width: "200", hide: true },
{ label: "单据编号", prop: "documentNumber", width: "200" },
{ label: "计划单号", prop: "documentNumber", width: "200" },
{ label: "销售单号", prop: "salesOrderCode", width: "200" },
{ "label": "客户名称", "prop": "customerName", "width": "200" },
{
label: "销售日期",

@ -26,7 +26,7 @@
align-items: center;
"
>
<el-button type="primary" plain @click="save" v-if="mode == 'add'"></el-button>
<el-button type="primary" plain @click="save" >保存</el-button>
<el-button type="info" plain @click="back"></el-button>
</div>
</el-card>
@ -43,7 +43,7 @@
</el-card>
<el-card style="margin-top: 15px">
<div style="padding: 0px 10px 10px 0" v-if="mode == 'add'">
<div style="padding: 0px 10px 10px 0" >
<el-button type="primary" plain @click="add_materials"
>添加</el-button
>
@ -60,7 +60,7 @@
row-key=""
@selection-change="selectionChange"
>
<el-table-column v-if="mode == 'add'" type="selection" width="50"></el-table-column>
<el-table-column type="selection" width="50"></el-table-column>
<!-- 退货数量 -->
<template #productionLength="scoped">
@ -83,9 +83,9 @@
:max="Number(scoped.row.plannedPieces) - Number(scoped.row.productionedPieces)"
:precision="0"
:controls="true"
v-if="mode == 'add'"
></el-input-number>
<div v-else> {{ scoped.row.returnQuantity }} </div>
<!-- <div v-else> {{ scoped.row.returnQuantity }} </div> -->
</template>
<!-- 锯切方式 -->
@ -98,12 +98,18 @@
</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>
@ -111,6 +117,7 @@
<script>
import useTabs from "@/utils/useTabs";
import selectPage from "./selectPage";
import materialsSelect from "./materialsSelect";
import module from "./module";
@ -118,6 +125,7 @@ export default {
emits: ["success", "closed"],
components: {
selectPage,
materialsSelect
},
data() {
return {
@ -165,6 +173,7 @@ export default {
},
listData: {
handler(newVal) {
if (!newVal) return;
newVal.forEach((item) => {
/* 支数 */
item["pieces"] = parseFloat(
@ -189,8 +198,8 @@ export default {
).toFixed(2)
);
item["salespersonName"] = this.orderInfo.salespersonName;
item["salesOrderCode"] = this.orderInfo.documentNumber;
// item["salespersonName"] = this.orderInfo.salespersonName;
// item["salesOrderCode"] = this.orderInfo.documentNumber;
item["undeliveredQuantity"] = item["orderTotalQuantity"] - item["producedPieces"]
});
},
@ -199,12 +208,7 @@ export default {
},
created() {},
mounted() {
//tab
// this.$store.commit(
// "updateViewTagsTitle",
// this.id ? `CURDID:${this.id}` : "CURD"
// );
this.loadDetail();
// this.loadDetail();
},
methods: {
open(mode="add") {
@ -213,16 +217,17 @@ export default {
return this;
},
setData(row) {
this.loadDetail(row.documentNumber)
this.loadDetail(row.scheduleNumber)
},
async loadDetail(documentNumber) {
async loadDetail(scheduleNumber) {
var res = await this.$API[module.name][module.detail].http({
documentNumber: documentNumber,
scheduleNumber: scheduleNumber,
});
if (res.code == 0) {
this.form = res.data.orderInfo;
this.listData = res.data.materials;
this.$nextTick(function () {
this.$forceUpdate();
});
@ -232,17 +237,11 @@ 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.dialog.product = true;
this.$nextTick(() => {
this.$refs.selectPage.open().setData(this.orderInfo, this.listData);
this.$refs.materialsSelect.open().setData(this.listData);
});
}
})
@ -300,7 +299,6 @@ export default {
}
const params = {
purchInfo: this.orderInfo,
materials: this.listData,
orderInfo: this.form,
};

@ -84,7 +84,7 @@ export default {
rules: [{ required: true, message: "请选择领料日期", trigger: "change" }]
},
{
label: "客户", name: "customer_id", value: "", component: "thirdselect", span: 6,
label: "客户", name: "customerId", value: "", component: "thirdselect", span: 6,
options: { editdisable: true, tb: "customer_info", placeholder: "请输入客户" },
rules: [{ required: true, message: "请输入客户", trigger: "blur" }]
},

@ -60,7 +60,7 @@
row-key=""
@selection-change="selectionChange"
>
<el-table-column type="selection" width="50"></el-table-column>
<el-table-column type="selection" width="50" v-if="mode=='add'"></el-table-column>
<!-- 入库仓库 -->

@ -59,9 +59,9 @@ export default {
{
label: "完成重量", name: "productionWeight", value: "", component: "ther", span: 1,
},
{ label: "报废支数", name: "scrapNumber", value: "", component: "", span: 1},
{ label: "报废原因", name: "scrapReason", value: "", component: "", span: 1},
{ label: "框号", name: "frameNumber", value: "", component: "", span: 1},
{ label: "报废支数", name: "scrapNumber", value: "", component: "", span: 1 },
{ label: "报废原因", name: "scrapReason", value: "", component: "", span: 1 },
{ label: "框号", name: "frameNumber", value: "", component: "", span: 1 },
{
label: "当前工序", name: "currentProcess", value: "", component: "dic", group: "working", span: 1,
},
@ -73,7 +73,7 @@ export default {
label: "是否完成", name: "isCompleted", value: "", component: "", span: 1,
hideHandle: "$.currentProcess != 'bz'",
format(value) {
switch(value + "") {
switch (value + "") {
case "1":
return "是";
case "0":
@ -83,7 +83,7 @@ export default {
}
}
},
{ label: "备注", name: "remarks", value: "", component: "textarea", span: 2}
{ label: "备注", name: "remarks", value: "", component: "textarea", span: 2 }
]
},
formOption: {
@ -157,7 +157,19 @@ export default {
size: 'small',
optionHide: true,
formItems: [
{ label: "报工单号", name: "reportNumber", value: "", component: "input", span: 6, options: { editdisable: true, maxlength: "256", placeholder: "请输入单据编号" }, rules: [{ required: true, message: "请输入单据编号", trigger: "blur" }] },
{
label: "报工单号", name: "reportNumber", value: "", component: "input", span: 6,
options: { editdisable: true, maxlength: "256", placeholder: "请输入单据编号" },
rules: [{ required: true, message: "请输入报工单号", trigger: "blur" }],
hideHandle: "$.isAuto && @.formMode=='add'"
},
{
label: "自动生成单号", name: "isAuto", value: true, component: "switch",
span: 6,
options: { editdisable: true },
rules: [{ required: false, message: "请选择", trigger: "blur" }],
hideHandle: "@.formMode=='edit'"
},
{ label: "机台", name: "machine", value: "", component: "input", span: 6, options: { maxlength: "256", placeholder: "请输入" } },
{ label: "操作员", name: "operator", value: "", component: "input", span: 6, options: { maxlength: "256", placeholder: "请输入" } },
{ label: "车间", name: "workshop", value: "", component: "input", span: 6, options: { maxlength: "256", placeholder: "请输入" } },

@ -9,7 +9,7 @@ export default {
add: "save",
edit: "edit",
importExcel: "importExcel",
upload:"upload",
upload: "upload",
config: {
formIdKey: "id",
preId: "id",
@ -28,6 +28,7 @@ export default {
options: [],
column: [
{ label: "", prop: "id", width: "200", hide: true },
{ label: "计划单号", prop: "documentNumber", width: "200" },
{ label: "销售订单编号", prop: "salesOrderCode", width: "200" },
{ label: "订单号", prop: "orderNo", width: "200" },
{ label: "产品编码", prop: "materialCode", width: "200" },
@ -80,7 +81,11 @@ export default {
size: 'small',
optionHide: true,
formItems: [
{ label: "单据编号", name: "documentNumber", value: "", component: "input", span: 6, options: { editdisable: false, maxlength: "256", placeholder: "请输入单据编号" }, rules: [{ required: false, message: "请输入单据编号", trigger: "blur" }] },
{
label: "单据编号", name: "documentNumber", value: "", component: "input", span: 6,
options: { editdisable: false, maxlength: "256", placeholder: "请输入单据编号" },
rules: [{ required: false, message: "请输入单据编号", trigger: "blur" }]
},
{
label: "销售日期", name: "salesDate", value: "", component: "date", span: 6,
options: { valueFormat: "YYYY-MM-DD", placeholder: "请选择采购日期" },

@ -32,6 +32,15 @@
</el-card>
</div>
<el-main>
<el-card style="margin-top: 15px">
<div style="font-size: 16px; font-weight: 600; padding: 0 0 20px">
计划单信息
</div>
<div>
<el-input style="width: 200px; magin-right: 5px;" v-model="form.documentNumber" placeholder="输入计划单号" v-if="!form.isAuto"></el-input>
<el-switch v-model="form.isAuto"></el-switch>
</div>
</el-card>
<el-card style="margin-top: 15px">
<div style="font-size: 16px; font-weight: 600; padding: 0 0 20px">
{{ subTitle }}
@ -135,6 +144,10 @@ export default {
orderInfo: [],
visible: false,
updateListDataFg: 0,
form: {
documentNumber: "",
isAuto: true
},
};
},
watch: {
@ -331,6 +344,11 @@ export default {
},
async save() {
console.log(this.selection);
if (!this.form.isAuto && this.form.documentNumber.trim() == "") {
this.$alert("请填写计划单号", "提示", { type: "error" });
return;
}
if (this.selection.length <= 0) {
this.$alert("请选择物料", "提示", { type: "error" });
return;
@ -338,7 +356,8 @@ export default {
const res = await this.$API[module.name][module.add].http({
selection: this.selection,
orderInfo: this.orderInfo
orderInfo: this.orderInfo,
form: this.form
});
if (res.code == 0) {

@ -28,6 +28,7 @@ export default {
options: [],
column: [
{ label: "", prop: "id", width: "200", hide: true },
{ label: "客户编码", prop: "customerCode", width: "200" },
{ label: "客户名称", prop: "customerName", width: "200" },
{ label: "结算币种", prop: "settlementCurrency", width: "200", type: 'dic', group: 'settlementCurrency' },
{ label: "税", prop: "tax", width: "200", type: 'dic', group: 'tax' },
@ -70,6 +71,19 @@ export default {
panelWidth: "800",
size: 'medium',
formItems: [
{
label: "客户编码", name: "customerCode", value: "", component: "input", span: 12, options: { editdisable: true, maxlength: "256", placeholder: "请输入客户编码" },
rules: [{ required: true, message: "请输入客户编码", trigger: "blur" }],
hideHandle: "$.isAuto && @.formMode=='add'"
},
{
label: "自动编码", name: "isAuto", value: true, component: "switch",
span: 12,
options: { editdisable: true },
rules: [{ required: false, message: "请选择", trigger: "blur" }],
hideHandle: "@.formMode=='edit'"
},
{ label: "客户名称", name: "customerName", value: "", component: "input", span: 24, options: { maxlength: "256", placeholder: "请输入客户名称" }, rules: [{ required: true, message: "请输入客户名称", trigger: "blur" }] },
{
label: "结算币种", name: "settlementCurrency", value: "", component: "dic", span: 24,

@ -31,7 +31,7 @@ export default {
options: [],
column: [
{ label: "", prop: "id", width: "200", hide: true },
{ label: "据编号", prop: "documentNumber", width: "200" },
{ label: "销售订单号", prop: "documentNumber", width: "200" },
{ "label": "客户名称", "prop": "customerName", "width": "200" },
{
label: "销售日期",
@ -60,7 +60,7 @@ export default {
panelWidth: "800",
size: 'medium',
formItems: [
{ label: "据编号", name: "documentNumber", value: "", component: "input", span: 26, options: { maxlength: "256", placeholder: "请输入单据编号" }, rules: [{ required: true, message: "请输入单据编号", trigger: "blur" }] },
{ label: "销售订单号", name: "documentNumber", value: "", component: "input", span: 26, options: { maxlength: "256", placeholder: "请输入单据编号" }, rules: [{ required: true, message: "请输入单据编号", trigger: "blur" }] },
{ label: "供应商", name: "supplier", value: "", component: "input", span: 26, options: { maxlength: "256", placeholder: "请输入供应商" }, rules: [{ required: true, message: "请输入供应商", trigger: "blur" }] },
{ label: "采购日期", name: "purchaseDate", value: "", component: "date", span: 26, options: { placeholder: "请选择采购日期" }, rules: [{ required: true, message: "请选择采购日期", trigger: "change" }] },
{ label: "采购员", name: "purchaser", value: "", component: "input", span: 26, options: { maxlength: "256", placeholder: "请输入采购员" }, rules: [{ required: true, message: "请输入采购员", trigger: "blur" }] },
@ -77,7 +77,19 @@ export default {
size: 'small',
optionHide: true,
formItems: [
{ label: "单据编号", name: "documentNumber", value: "", component: "input", span: 6, options: { editdisable: true, maxlength: "256", placeholder: "请输入单据编号" }, rules: [{ required: true, message: "请输入单据编号", trigger: "blur" }] },
{
label: "销售订单号", name: "documentNumber", value: "", component: "input", span: 6,
options: { editdisable: true, maxlength: "256", placeholder: "请输入销售订单号" },
rules: [{ required: true, message: "请输入销售订单号", trigger: "blur" }],
hideHandle: "$.isAuto && @.formMode=='add'"
},
{
label: "自动生成单号", name: "isAuto", value: true, component: "switch",
span: 6,
options: { editdisable: true },
rules: [{ required: false, message: "请选择", trigger: "blur" }],
hideHandle: "@.formMode=='edit'"
},
{
label: "客户名称", name: "customerId", value: "", component: "thirdselect", span: 6,
options: { tb: "customer_info", placeholder: "请输入客户名称" },
@ -140,6 +152,7 @@ export default {
{ label: "", prop: "id", width: "200", hide: true },
{ label: "订单号", prop: "orderNo", width: "200" },
{ label: "物料编码", prop: "materialCode", width: "200" },
{ label: "型材型号", prop: "profileModel", width: "200" },
{ label: "物料名称", prop: "materialName", width: "200" },
{ label: "订单长度 (M)", prop: "orderLength", width: "200" },
{ label: "订单总数 (支)", prop: "orderTotalQuantity", width: "200" },

@ -64,9 +64,15 @@
<!-- 订单号 -->
<template #orderNo="scoped">
<div style="display: flex;align-items: center;">
<el-input
v-model="scoped.row.orderNo"
v-if="!scoped.row.isAuto"
style="margin-right: 5px;"
></el-input>
<el-switch v-model="scoped.row.isAuto"></el-switch>
</div>
</template>
<!-- 订单长度 -->
@ -176,14 +182,18 @@ export default {
'form.customerId': {
handler(value, old) {
console.log('form.customerId', value)
const fields = module.pageForm.form.formItems[1]
const formItems = module.pageForm.form.formItems
const fields = formItems.filter(item => {
return item.name == 'customerId'
})[0]
const items = fields.options.items
console.log(items)
console.log(fields)
if (!!items) {
const curObj = items.filter(item => {
return item.value == value
})
this.form.taxRate = curObj.length > 0 ? curObj[0].tax : "";
this.form.customerName = curObj.length > 0 ? curObj[0].label : "";
}

@ -6,41 +6,52 @@
</div> -->
<div class="right-panel-search">
<el-input
v-model="search.customerName"
placeholder="客户名称"
clearable>
</el-input>
<el-input
v-model="search.isTaxIncluded"
placeholder="是否含税"
clearable>
v-model="search.materialCode"
placeholder="物料编码"
clearable
>
</el-input>
<el-input
v-model="search.contactPhone"
placeholder="联系电话"
clearable>
v-model="search.materialName"
placeholder="物料名称"
clearable
>
</el-input>
<el-input
v-model="search.contactPerson"
placeholder="联系人"
clearable>
v-model="search.profileModel"
placeholder="型材型号"
clearable
>
</el-input>
<el-select
<thirdselect v-model="search.warehouse" :item="warehouseItem">
</thirdselect>
<!-- <el-select
v-model="search.status"
placeholder="请选择状态"
clearable
class="custom-select">
class="custom-select"
>
<el-option label="正常" value="1"></el-option>
<el-option label="暂停" value="2"></el-option>
<el-option label="取消" value="3"></el-option>
</el-select>
</el-select> -->
<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">
@ -57,57 +68,65 @@
</el-main>
</el-container>
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSuccess" @closed="dialog.save=false"></save-dialog>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
@success="handleSuccess"
@closed="dialog.save = false"
></save-dialog>
</template>
<script>
import saveDialog from './save'
import module from './module'
import config from "@/config"
import saveDialog from "./save";
import module from "./module";
import config from "@/config";
import thirdselect from "@/components/scForm/items/thirdselect";
export default {
components: {
saveDialog
saveDialog,
thirdselect,
},
data() {
return {
dialog: {
save: false
save: false,
},
loading:false,
file:"",
loading: false,
file: "",
search: {
customerName: "",
isTaxIncluded:"",
contactPhone:"",
contactPerson:"",
status:""
isTaxIncluded: "",
contactPhone: "",
contactPerson: "",
status: "",
},
apiObj:this.$API[module.name][module.list],
apiObj: this.$API[module.name][module.list],
selection: [],
config: module.config,
options: module.options,
column: module.column
}
column: module.column,
warehouseItem: {
options: { tb: "warehouses", placeholder: "仓库" },
},
mounted(){
};
},
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: ""
email: "",
}; // {}
// 2.
@ -117,59 +136,61 @@ export default {
}
},
//
add(){
this.dialog.save = true
add() {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open('add', this.list)
})
this.$refs.saveDialog.open("add", this.list);
});
},
//
table_edit(row){
this.dialog.save = true
table_edit(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.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.preId?this.config.preId:"id"]}
async table_del(row, index) {
var reqData = { id: row[this.config.preId ? this.config.preId : "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(){
this.$confirm(`确定删除选中的 ${this.selection.length} 项吗?`, '提示', {
type: 'warning'
}).then(async () => {
async batch_del() {
this.$confirm(`确定删除选中的 ${this.selection.length} 项吗?`, "提示", {
type: "warning",
})
.then(async () => {
const loading = this.$loading();
console.log(this.selection)
console.log(this.selection);
var idArr = [];
this.selection.forEach(item => {
idArr.push(item[this.config.preId?this.config.preId:"id"])
})
this.selection.forEach((item) => {
idArr.push(item[this.config.preId ? this.config.preId : "id"]);
});
var reqData = {ids: idArr.join(",")}
var reqData = { ids: idArr.join(",") };
var res = await this.$API[module.name][module.del].http(reqData);
if(res.code == 0){
if (res.code == 0) {
// OR /
this.$refs.table.refresh();
this.$message.success("删除成功");
}else{
this.$alert(res.message, "提示", {type: 'error'})
} else {
this.$alert(res.message, "提示", { type: "error" });
}
loading.close();
}).catch(() => {
this.$message.success("操作失败")
})
.catch(() => {
this.$message.success("操作失败");
});
},
//
selectionChange(selection){
selectionChange(selection) {
this.selection = selection;
},
filterChange(obj) {
@ -177,20 +198,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>
.upload {
color: #409EFF;
color: #409eff;
background: #ecf5ff;
min-height: 32px;
padding: 9px 15px;
@ -205,5 +226,4 @@ export default {
.sc-upload-uploader {
border: none !important;
}
</style>

@ -8,24 +8,36 @@
<el-input
v-model="search.customerName"
placeholder="客户名称"
clearable>
clearable
>
</el-input>
<el-input
v-model="search.isTaxIncluded"
placeholder="是否含税"
clearable>
v-model="search.materialCode"
placeholder="物料编码"
clearable
>
</el-input>
<el-input
v-model="search.materialName"
placeholder="物料名称"
clearable
>
</el-input>
<el-input
v-model="search.contactPhone"
placeholder="联系电话"
clearable>
v-model="search.profileModel"
placeholder="型材型号"
clearable
>
</el-input>
<thirdselect v-model="search.warehouse" :item="warehouseItem">
</thirdselect>
<el-input
v-model="search.contactPerson"
placeholder="联系人"
clearable>
v-model="search.salesOrderCode"
placeholder="销售订单编号"
clearable
>
</el-input>
<el-select
<!-- <el-select
v-model="search.status"
placeholder="请选择状态"
clearable
@ -33,14 +45,24 @@
<el-option label="正常" value="1"></el-option>
<el-option label="暂停" value="2"></el-option>
<el-option label="取消" value="3"></el-option>
</el-select>
</el-select> -->
<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">
@ -57,57 +79,65 @@
</el-main>
</el-container>
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSuccess" @closed="dialog.save=false"></save-dialog>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
@success="handleSuccess"
@closed="dialog.save = false"
></save-dialog>
</template>
<script>
import saveDialog from './save'
import module from './module'
import config from "@/config"
import saveDialog from "./save";
import module from "./module";
import config from "@/config";
import thirdselect from "@/components/scForm/items/thirdselect";
export default {
components: {
saveDialog
saveDialog,
thirdselect,
},
data() {
return {
dialog: {
save: false
save: false,
},
loading:false,
file:"",
loading: false,
file: "",
search: {
customerName: "",
isTaxIncluded:"",
contactPhone:"",
contactPerson:"",
status:""
isTaxIncluded: "",
contactPhone: "",
contactPerson: "",
status: "",
},
apiObj:this.$API[module.name][module.list],
apiObj: this.$API[module.name][module.list],
selection: [],
config: module.config,
options: module.options,
column: module.column
}
column: module.column,
warehouseItem: {
options: { tb: "warehouses", placeholder: "仓库" },
},
mounted(){
};
},
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: ""
email: "",
}; // {}
// 2.
@ -117,59 +147,61 @@ export default {
}
},
//
add(){
this.dialog.save = true
add() {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open('add', this.list)
})
this.$refs.saveDialog.open("add", this.list);
});
},
//
table_edit(row){
this.dialog.save = true
table_edit(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.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.preId?this.config.preId:"id"]}
async table_del(row, index) {
var reqData = { id: row[this.config.preId ? this.config.preId : "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(){
this.$confirm(`确定删除选中的 ${this.selection.length} 项吗?`, '提示', {
type: 'warning'
}).then(async () => {
async batch_del() {
this.$confirm(`确定删除选中的 ${this.selection.length} 项吗?`, "提示", {
type: "warning",
})
.then(async () => {
const loading = this.$loading();
console.log(this.selection)
console.log(this.selection);
var idArr = [];
this.selection.forEach(item => {
idArr.push(item[this.config.preId?this.config.preId:"id"])
})
this.selection.forEach((item) => {
idArr.push(item[this.config.preId ? this.config.preId : "id"]);
});
var reqData = {ids: idArr.join(",")}
var reqData = { ids: idArr.join(",") };
var res = await this.$API[module.name][module.del].http(reqData);
if(res.code == 0){
if (res.code == 0) {
// OR /
this.$refs.table.refresh();
this.$message.success("删除成功");
}else{
this.$alert(res.message, "提示", {type: 'error'})
} else {
this.$alert(res.message, "提示", { type: "error" });
}
loading.close();
}).catch(() => {
this.$message.success("操作失败")
})
.catch(() => {
this.$message.success("操作失败");
});
},
//
selectionChange(selection){
selectionChange(selection) {
this.selection = selection;
},
filterChange(obj) {
@ -177,20 +209,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>
.upload {
color: #409EFF;
color: #409eff;
background: #ecf5ff;
min-height: 32px;
padding: 9px 15px;
@ -205,5 +237,4 @@ export default {
.sc-upload-uploader {
border: none !important;
}
</style>

@ -59,7 +59,7 @@ export default {
{ label: "单价", prop: "unitPrice", width: "200" },
{ label: "订单号", prop: "orderNo", width: "200" },
{ label: "现有库存", prop: "existingInventory", width: "200" },
{ label: "客户", prop: "customerId", width: "200" },
{ label: "客户", prop: "customerName", width: "200" },
{ label: "仓库", prop: "warehouse", width: "200" },
],
formOption: {

Loading…
Cancel
Save