Merge remote-tracking branch 'origin/master'

yangwl
zhaoxiaolin 1 year ago
commit 09d92be6d2

@ -229,7 +229,7 @@
<!-- 表头-工单信息 --> <!-- 表头-工单信息 -->
<el-row class="my-print-head"> <el-row class="my-print-head">
<el-col :offset="10" :span="4">生产订单备料单(订单物料)</el-col> <el-col :offset="10" :span="5">生产订单备料单(订单物料)</el-col>
</el-row> </el-row>
<!-- 导航栏 --> <!-- 导航栏 -->
<el-row class="my-print-nav"> <el-row class="my-print-nav">

@ -43,15 +43,6 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- <el-form-item label-width="100px" label="计划生产日期" prop="planProDate">-->
<!-- <el-date-picker clearable-->
<!-- v-model="queryParams.planProDate"-->
<!-- type="date"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- placeholder="选择计划生产日期"-->
<!-- >-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<el-form-item label-width="100px" label="计划生产日期" prop="productDateArray"> <el-form-item label-width="100px" label="计划生产日期" prop="productDateArray">
<el-date-picker <el-date-picker
v-model="queryParams.planDateArray" v-model="queryParams.planDateArray"
@ -111,7 +102,8 @@
size="mini" size="mini"
@click="handleImport" @click="handleImport"
v-hasPermi="['mes:pro:order:import']" v-hasPermi="['mes:pro:order:import']"
>导入</el-button> >导入
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -124,16 +116,6 @@
>导出 >导出
</el-button> </el-button>
</el-col> </el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="info"-->
<!-- plain-->
<!-- icon="el-icon-sort"-->
<!-- size="mini"-->
<!-- @click="toggleExpandAll"-->
<!-- >展开/折叠-->
<!-- </el-button>-->
<!-- </el-col>-->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
@ -221,7 +203,9 @@
<!-- <el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的订单数据--> <!-- <el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的订单数据-->
<!-- </div>--> <!-- </div>-->
<span>仅允许导入xlsxlsx格式文件</span> <span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate"></el-link> <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
@click="importTemplate">下载模板
</el-link>
</div> </div>
</el-upload> </el-upload>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@ -239,7 +223,8 @@
:visible.sync="innerVisible" :visible.sync="innerVisible"
append-to-body> append-to-body>
<el-form :model="materielQueryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="materielQueryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
label-width="68px">
<el-form-item label="物料编码" prop="productCode"> <el-form-item label="物料编码" prop="productCode">
<el-input <el-input
v-model="materielQueryParams.productCode" v-model="materielQueryParams.productCode"
@ -404,6 +389,7 @@
<el-col :offset="1" :span="7"> <el-col :offset="1" :span="7">
<el-form-item label="选择设备:"> <el-form-item label="选择设备:">
<el-cascader <el-cascader
@focus="changeEquipment"
:options="eRouteOptions" :options="eRouteOptions"
:props="eRouteProps" :props="eRouteProps"
v-model="splitForm.prodLineCodeArray" v-model="splitForm.prodLineCodeArray"
@ -499,12 +485,8 @@ import {
getProRoutes, getProRoutes,
getProShifts, getProShifts,
getWorkOrderList, getWorkOrderList,
getOrderList,
subSplitOrder, subSplitOrder,
getprodLineShift,
listOrder, listOrder,
getOrder,
delOrder,
addOrder, addOrder,
updateOrder, updateOrder,
syncSAP, selectMaterielList syncSAP, selectMaterielList
@ -513,7 +495,6 @@ import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import moment from 'moment' import moment from 'moment'
import {getToken} from "@/utils/auth" import {getToken} from "@/utils/auth"
import {listUser} from "@/api/system/user";
export default { export default {
name: 'Order', name: 'Order',
@ -523,6 +504,7 @@ export default {
}, },
data() { data() {
return { return {
// -list
materiel: [], materiel: [],
materielList: [], materielList: [],
total: 0, total: 0,
@ -597,25 +579,14 @@ export default {
isExpandAll: true, isExpandAll: true,
// //
refreshTable: true, refreshTable: true,
// // -
queryParams: { queryParams: {
planDateArray: [], planDateArray: [],
planFactoryCode: null, planFactoryCode: null,
orderType: null,
orderCode: null, orderCode: null,
prodCode: null, prodCode: null,
prodDesc: null, prodDesc: null,
quantity: null,
unit: null,
workerOrder: null,
planProDate: null,
planComplete: null,
atrr1: null,
atrr2: null,
atrr3: null,
status: null, status: null,
parentOrder: null,
prodType: null
}, },
// //
splitForm: { splitForm: {
@ -648,7 +619,7 @@ export default {
}) })
}, },
methods: { methods: {
// // -
changeCarNum(num) { changeCarNum(num) {
if (num <= 0) { if (num <= 0) {
this.form.carNum = 1; this.form.carNum = 1;
@ -658,13 +629,13 @@ export default {
}) })
} }
}, },
// // -
setUp() { setUp() {
this.dialogVisible = true; this.dialogVisible = true;
// //
this.form = {} this.form = {}
}, },
// // -
subMateriel() { subMateriel() {
if (this.materiel.length == 0) { if (this.materiel.length == 0) {
this.$message({ this.$message({
@ -684,11 +655,11 @@ export default {
this.form.prodDesc = this.materiel[0].productDescZh; this.form.prodDesc = this.materiel[0].productDescZh;
this.innerVisible = false; this.innerVisible = false;
}, },
// // -
handleSelectionChange(e) { handleSelectionChange(e) {
this.materiel = e; this.materiel = e;
}, },
// // -
getMaterielList() { getMaterielList() {
this.loading = true; this.loading = true;
selectMaterielList(this.materielQueryParams).then(response => { selectMaterielList(this.materielQueryParams).then(response => {
@ -698,61 +669,113 @@ export default {
} }
); );
}, },
// // -
selectMateriel() { selectMateriel() {
this.innerVisible = true; this.innerVisible = true;
this.getMaterielList(); this.getMaterielList();
}, },
// // -
changeRoute(routeCode) { addQuantity(num) {
getProEquipment(routeCode).then(response => { if (num <= 0) {
this.eRouteOptions = response.data this.form.quantity = 1;
// this.$message({
let selectAll = []; message: "数量不能小于1",
this.eRouteOptions.forEach(it => { type: "warning"
var children = it.children;
if(children != null){
children.forEach(it2=>{
let arr = []
arr.push(it.value)
arr.push(it2.value)
selectAll.push(arr)
}) })
} }
},
// -
submitForm() {
//
if (this.checkNull(this.form.prodCode) == 0) {
this.$message({
message: '物料号不能为空!',
type: 'warning'
}) })
this.splitForm.prodLineCodeArray = selectAll return
}
if (this.checkNull(this.form.planProDate) == 0) {
this.$message({
message: '请选择计划生产日期!',
type: 'warning'
}) })
}, return
// 线 }
changeEquipment(){ if (this.checkNull(this.form.planComplete) == 0) {
if (this.splitForm.routeCode == null) {
this.$message({ this.$message({
message: '请先选择工艺', message: '请选择计划完成日期',
type: 'warning' type: 'warning'
}) })
return return
} }
}, if (this.checkNull(this.form.prodDesc) == 0) {
// -
addQuantity(num){
if (num<=0){
this.form.quantity = 1;
this.$message({ this.$message({
message:"数量不能小于1", message: '物料名称不能为空!',
type:"warning" type: 'warning'
})
return
}
if (this.checkNull(this.form.quantity) == 0) {
this.$message({
message: '请填写订单数量!',
type: 'warning'
})
return
}
if (this.checkNull(this.form.unit) == 0) {
this.$message({
message: '请填写单位!',
type: 'warning'
})
return
}
if (this.checkNull(this.form.prodType) == 0) {
this.$message({
message: '请选择产品类型!',
type: 'warning'
})
return
}
this.$refs['form'].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateOrder(this.form).then(response => {
this.$modal.msgSuccess('修改成功')
this.dialogVisible = false
this.reset()
this.getList()
})
} else {
addOrder(this.form).then(response => {
this.$modal.msgSuccess('新增成功')
this.dialogVisible = false
this.reset()
this.getList()
}) })
} }
}
})
},
// -
handleMaterielQuery() {
this.materielQueryParams.pageNum = 1;
this.getMaterielList();
},
// -
resetMaterielQuery() {
// TODO
console.log("进行了物料重置")
}, },
/** 导入按钮操作 */ // -
handleImport() { handleImport() {
this.upload.title = "订单信息导入"; this.upload.title = "订单信息导入";
this.upload.open = true; this.upload.open = true;
}, },
// // -
handleFileUploadProgress(event, file, fileList) { handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true; this.upload.isUploading = true;
}, },
// // -
handleFileSuccess(response, file, fileList) { handleFileSuccess(response, file, fileList) {
this.upload.open = false; this.upload.open = false;
this.upload.isUploading = false; this.upload.isUploading = false;
@ -760,23 +783,54 @@ export default {
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", {dangerouslyUseHTMLString: true}); this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", {dangerouslyUseHTMLString: true});
this.getList(); this.getList();
}, },
// // -
submitFileForm() { submitFileForm() {
this.$refs.upload.submit(); this.$refs.upload.submit();
}, },
/** 下载模板操作 */ // -
importTemplate() { importTemplate() {
this.download('/plan/order/importTemplate', { this.download('/plan/order/importTemplate', {}, `order_example_template_${new Date().getTime()}.xlsx`)
}, `order_example_template_${new Date().getTime()}.xlsx`)
}, },
/** 导出按钮操作 */ // -
handleExport() { handleExport() {
this.download('/plan/order/export', { this.download('/plan/order/export', {
...this.queryParams ...this.queryParams
}, `order_${new Date().getTime()}.xlsx`) }, `order_${new Date().getTime()}.xlsx`)
}, },
/** 拆分按钮操作 */ // -
changeRoute(routeCode) {
console.log("点击了拆分-选择工艺")
getProEquipment(routeCode).then(response => {
this.eRouteOptions = response.data
//
let selectAll = [];
this.eRouteOptions.forEach(it => {
var children = it.children;
if (children != null) {
children.forEach(it2 => {
let arr = []
arr.push(it.value)
arr.push(it2.value)
selectAll.push(arr)
})
}
})
this.splitForm.prodLineCodeArray = selectAll
})
},
// -线
changeEquipment() {
if (this.splitForm.routeCode == null) {
this.$message({
message: '请先选择工艺!',
type: 'warning'
})
return
}
},
// -
splitBtn(e) { splitBtn(e) {
//
var row; var row;
getCascadeProOrder(e.orderCode).then(response => { getCascadeProOrder(e.orderCode).then(response => {
row = response.data row = response.data
@ -821,7 +875,7 @@ export default {
}) })
this.workerLoading = true // true this.workerLoading = true // true
// //
getWorkOrderList(row.id).then(response => { getWorkOrderList(row.id).then(response => {
var data = response.data var data = response.data
this.splitData = data this.splitData = data
@ -841,10 +895,14 @@ export default {
}, },
/** 拆分数量方法 */ // -
splitNumChange(e) { splitNumChange(e) {
// //
if (e <= 0) { if (e <= 0) {
this.$message({
message: '拆分数量不能为负数!',
type: 'warning'
})
e = 1 e = 1
this.splitForm.splitNum = 1 this.splitForm.splitNum = 1
} else { } else {
@ -863,6 +921,7 @@ export default {
this.proLoading = true // true this.proLoading = true // true
var num = this.productData[0].quantity; var num = this.productData[0].quantity;
// //
function setAtrr1(data, splitNum) { function setAtrr1(data, splitNum) {
if (data.children !== undefined) { if (data.children !== undefined) {
@ -885,96 +944,7 @@ export default {
} }
this.product = this.productData[0] this.product = this.productData[0]
}, },
// // -
checkNull(entity) {
if (entity !== undefined && entity !== '' && entity !== null) {
return 1
}
return 0
},
/** 确认关闭 */
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
this.reset()
done()
})
.catch(_ => {
})
},
/** 新增-提交按钮 */
submitForm() {
//
if (this.checkNull(this.form.prodCode) == 0) {
this.$message({
message: '物料号不能为空!',
type: 'warning'
})
return
}
if (this.checkNull(this.form.planProDate) == 0) {
this.$message({
message: '请选择计划生产日期!',
type: 'warning'
})
return
}
if (this.checkNull(this.form.planComplete) == 0) {
this.$message({
message: '请选择计划完成日期!',
type: 'warning'
})
return
}
if (this.checkNull(this.form.prodDesc) == 0) {
this.$message({
message: '物料名称不能为空!',
type: 'warning'
})
return
}
if (this.checkNull(this.form.quantity) == 0) {
this.$message({
message: '请填写订单数量!',
type: 'warning'
})
return
}
if (this.checkNull(this.form.unit) == 0) {
this.$message({
message: '请填写单位!',
type: 'warning'
})
return
}
if (this.checkNull(this.form.prodType) == 0) {
this.$message({
message: '请选择产品类型!',
type: 'warning'
})
return
}
this.$refs['form'].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateOrder(this.form).then(response => {
this.$modal.msgSuccess('修改成功')
this.dialogVisible = false
this.reset()
this.getList()
})
} else {
addOrder(this.form).then(response => {
this.$modal.msgSuccess('新增成功')
this.dialogVisible = false
this.reset()
this.getList()
})
}
}
})
},
/** 检验批次编码是否重复 */
batchCodeChange(e) { batchCodeChange(e) {
if (this.formFields.length > 1) { if (this.formFields.length > 1) {
for (let i = 0; i < this.formFields.length - 1; i++) { for (let i = 0; i < this.formFields.length - 1; i++) {
@ -992,7 +962,7 @@ export default {
} }
} }
}, },
/** 校验日期 */ // -
checkDate(e) { checkDate(e) {
var now = new Date() var now = new Date()
if (e < now) { if (e < now) {
@ -1004,7 +974,7 @@ export default {
}) })
} }
}, },
/** 拆分提交按钮 */ // -
batchBtn() { batchBtn() {
// //
if (this.splitForm.splitNum == null) { if (this.splitForm.splitNum == null) {
@ -1127,7 +1097,7 @@ export default {
}, 500) }, 500)
} }
}, },
/** 动态添加表单 */ // -
addField() { addField() {
// //
let sum = 0 let sum = 0
@ -1147,11 +1117,73 @@ export default {
// //
this.formFields[this.formFields.length - 1].batchQuantity = Number(this.productData[0].atrr1) - Number(sum) this.formFields[this.formFields.length - 1].batchQuantity = Number(this.productData[0].atrr1) - Number(sum)
}, },
/** 动态删除表单 */ // -
removeField(index) { removeField(index) {
this.formFields.splice(index, 1) this.formFields.splice(index, 1)
}, },
/** 查询订单列表 */ // -
resetBatch() {
this.eRouteOptions = [],
this.splitForm = {
prodLineCodeArray: [],
id: null,
prodLineCode: [],
splitNum: null,
productDate: null,
shiftId: null,
formFields: []
}
this.splitData = []
this.productData = []
this.proline = []
this.splitnum = null
this.workShift = []
this.formFields = [{
batchCode: '',
batchQuantity: ''
}]
},
// -
inBatch(e) {
//
if (e <= 0) {
this.formFields[this.formFields.length - 1].batchQuantity = 1
}
//
let sum = 0
for (let i = 0; i < this.formFields.length; i++) {
sum += Number(this.formFields[i].batchQuantity)
}
//
if (sum > this.productData[0].atrr1) {
this.$message({
message: '你的批次数量总和不能超过拆分数量!',
type: 'warning'
})
this.formFields[this.formFields.length - 1].batchQuantity = Number(this.productData[0].atrr1) - Number(Number(sum) - Number(e))
if (this.formFields[this.formFields.length - 1].batchQuantity <= 0) {
this.formFields[this.formFields.length - 1].batchQuantity = 1
}
}
//
if (this.productData[0].atrr1 == '' || this.productData[0].atrr1 == null) {
this.formFields[this.formFields.length - 1].batchQuantity = ''
}
},
// --
cancel() {
this.dialogVisible = false;
this.splitOpen = false;
this.reset();
},
//
checkNull(entity) {
if (entity !== undefined && entity !== '' && entity !== null) {
return 1
}
return 0
},
// -
getList() { getList() {
this.loading = true this.loading = true
if (this.queryParams.planDateArray != null) { if (this.queryParams.planDateArray != null) {
@ -1166,7 +1198,7 @@ export default {
this.loading = false this.loading = false
}) })
}, },
/** 转换订单数据结构 */ // -
normalizer(node) { normalizer(node) {
if (node.children && !node.children.length) { if (node.children && !node.children.length) {
delete node.children delete node.children
@ -1177,21 +1209,6 @@ export default {
children: node.children children: node.children
} }
}, },
//
cancel() {
this.dialogVisible = false;
this.splitOpen = false;
this.reset();
},
/** 查询订单下拉树结构 */
getTreeselect() {
listOrder().then(response => {
this.orderOptions = []
const data = { orderCode: 0, orderCode: '顶级节点', children: [] }
data.children = this.handleTree(response.data, 'orderCode', 'parentOrder')
this.orderOptions.push(data)
})
},
// //
reset() { reset() {
this.form = { this.form = {
@ -1219,127 +1236,23 @@ export default {
} }
this.resetForm('form') this.resetForm('form')
}, },
/** 拆分表单重置 */
resetBatch() {
this.eRouteOptions= [],
this.splitForm = {
prodLineCodeArray: [],
id: null,
prodLineCode: [],
splitNum: null,
productDate: null,
shiftId: null,
formFields: []
}
this.splitData = []
this.productData = []
this.proline = []
this.splitnum = null
this.workShift = []
this.formFields = [{
batchCode: '',
batchQuantity: ''
}]
},
//
handleMaterielQuery() {
this.materielQueryParams.pageNum = 1;
this.getMaterielList();
},
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.getList() this.getList()
}, },
// // -
resetMaterielQuery() {
// TODO
console.log("进行了物料重置")
},
/** 重置按钮操作 */
resetQuery() { resetQuery() {
this.queryParams = { this.queryParams = {
planDateArray: [new Date(), new Date()], planDateArray: [new Date(), new Date()],
planFactoryCode: null, planFactoryCode: null,
orderType: null,
orderCode: null, orderCode: null,
prodCode: null, prodCode: null,
prodDesc: null, prodDesc: null,
quantity: null,
unit: null,
workerOrder: null,
planProDate: null,
planComplete: null,
atrr1: null,
atrr2: null,
atrr3: null,
status: null, status: null,
parentOrder: null,
prodType: null
} }
this.handleQuery() this.handleQuery()
}, },
/** 拆分按钮操作 */ // -SAP
handleAdd(row) {
this.reset()
this.getTreeselect()
if (row != null && row.orderCode) {
this.splitForm.parentOrder = row.orderCode
} else {
this.splitForm.parentOrder = 0
}
this.splitOpen = true
this.title = '拆分'
},
/** 展开/折叠操作 */
toggleExpandAll() {
this.refreshTable = false
this.isExpandAll = !this.isExpandAll
this.$nextTick(() => {
this.refreshTable = true
})
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
this.getTreeselect()
if (row != null) {
this.splitForm.parentOrder = row.orderCode
}
getOrder(row.id).then(response => {
this.splitForm = response.data
this.splitOpen = true
this.title = '修改订单'
})
},
/** 填写批次数量 */
inBatch(e) {
//
if (e <= 0) {
this.formFields[this.formFields.length - 1].batchQuantity = 1
}
//
let sum = 0
for (let i = 0; i < this.formFields.length; i++) {
sum += Number(this.formFields[i].batchQuantity)
}
//
if (sum > this.productData[0].atrr1) {
this.$message({
message: '你的批次数量总和不能超过拆分数量!',
type: 'warning'
})
this.formFields[this.formFields.length - 1].batchQuantity = Number(this.productData[0].atrr1) - Number(Number(sum) - Number(e))
if (this.formFields[this.formFields.length - 1].batchQuantity <= 0) {
this.formFields[this.formFields.length - 1].batchQuantity = 1
}
}
//
if (this.productData[0].atrr1 == '' || this.productData[0].atrr1 == null) {
this.formFields[this.formFields.length - 1].batchQuantity = ''
}
},
/** SAP同步按钮操作 */
handleSyncSAP() { handleSyncSAP() {
this.$modal.confirm('是否确认SAP同步操作步骤').then(function () { this.$modal.confirm('是否确认SAP同步操作步骤').then(function () {
return syncSAP() return syncSAP()
@ -1389,6 +1302,7 @@ export default {
margin-top: 40px; margin-top: 40px;
margin-bottom: 10px; margin-bottom: 10px;
} }
.my-materiel-btn { .my-materiel-btn {
margin-top: 20px; margin-top: 20px;
margin-left: 650px; margin-left: 650px;

Loading…
Cancel
Save