Merge remote-tracking branch 'origin/master'

master
zhaoxiaolin 1 year ago
commit 09d92be6d2

@ -229,7 +229,7 @@
<!-- 表头-工单信息 -->
<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 class="my-print-nav">

@ -43,15 +43,6 @@
/>
</el-select>
</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-date-picker
v-model="queryParams.planDateArray"
@ -111,7 +102,8 @@
size="mini"
@click="handleImport"
v-hasPermi="['mes:pro:order:import']"
>导入</el-button>
>导入
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
@ -124,16 +116,6 @@
>导出
</el-button>
</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>
</el-row>
@ -217,11 +199,13 @@
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<!-- <div class="el-upload__tip" slot="tip">-->
<!-- <el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的订单数据-->
<!-- </div>-->
<!-- <div class="el-upload__tip" slot="tip">-->
<!-- <el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的订单数据-->
<!-- </div>-->
<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>
</el-upload>
<div slot="footer" class="dialog-footer">
@ -239,7 +223,8 @@
:visible.sync="innerVisible"
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-input
v-model="materielQueryParams.productCode"
@ -264,10 +249,10 @@
<!-- 物料列表展示 -->
<el-table v-loading="loading" :data="materielList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column type="selection" width="55" align="center"/>
<el-table-column width="60" align="center" label="序号" type="index"></el-table-column>
<el-table-column label="物料编码" align="center" prop="productCode" />
<el-table-column label="物料名称" align="center" prop="productDescZh" />
<el-table-column label="物料编码" align="center" prop="productCode"/>
<el-table-column label="物料名称" align="center" prop="productDescZh"/>
</el-table>
<pagination
@ -404,10 +389,11 @@
<el-col :offset="1" :span="7">
<el-form-item label="选择设备:">
<el-cascader
:options="eRouteOptions"
:props="eRouteProps"
v-model="splitForm.prodLineCodeArray"
clearable></el-cascader>
@focus="changeEquipment"
:options="eRouteOptions"
:props="eRouteProps"
v-model="splitForm.prodLineCodeArray"
clearable></el-cascader>
</el-form-item>
</el-col>
</el-row>
@ -499,12 +485,8 @@ import {
getProRoutes,
getProShifts,
getWorkOrderList,
getOrderList,
subSplitOrder,
getprodLineShift,
listOrder,
getOrder,
delOrder,
addOrder,
updateOrder,
syncSAP, selectMaterielList
@ -512,8 +494,7 @@ import {
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import moment from 'moment'
import { getToken } from "@/utils/auth"
import {listUser} from "@/api/system/user";
import {getToken} from "@/utils/auth"
export default {
name: 'Order',
@ -523,8 +504,9 @@ export default {
},
data() {
return {
// -list
materiel: [],
materielList:[],
materielList: [],
total: 0,
//
materielQueryParams: {
@ -546,7 +528,7 @@ export default {
//
updateSupport: 0,
//
headers: {poolName: localStorage.getItem("USER_POOL_NAME_CURRENT"), Authorization: "Bearer " + getToken() },
headers: {poolName: localStorage.getItem("USER_POOL_NAME_CURRENT"), Authorization: "Bearer " + getToken()},
//
url: process.env.VUE_APP_BASE_API + "/plan/order/importData"
},
@ -597,25 +579,14 @@ export default {
isExpandAll: true,
//
refreshTable: true,
//
// -
queryParams: {
planDateArray: [],
planFactoryCode: null,
orderType: null,
orderCode: null,
prodCode: null,
prodDesc: null,
quantity: null,
unit: null,
workerOrder: null,
planProDate: null,
planComplete: null,
atrr1: null,
atrr2: null,
atrr3: null,
status: null,
parentOrder: null,
prodType: null
},
//
splitForm: {
@ -631,7 +602,7 @@ export default {
rules: {},
addrules: {},
/**********************************/
eRouteProps: { multiple: true },
eRouteProps: {multiple: true},
eRouteOptions: []
}
},
@ -648,23 +619,23 @@ export default {
})
},
methods: {
//
// -
changeCarNum(num) {
if (num<=0){
if (num <= 0) {
this.form.carNum = 1;
this.$message({
message:"车数不能小于1",
type:"warning"
message: "车数不能小于1",
type: "warning"
})
}
},
//
// -
setUp() {
this.dialogVisible = true;
//
this.form = {}
},
//
// -
subMateriel() {
if (this.materiel.length == 0) {
this.$message({
@ -684,11 +655,11 @@ export default {
this.form.prodDesc = this.materiel[0].productDescZh;
this.innerVisible = false;
},
//
// -
handleSelectionChange(e) {
this.materiel = e;
},
//
// -
getMaterielList() {
this.loading = true;
selectMaterielList(this.materielQueryParams).then(response => {
@ -698,85 +669,168 @@ export default {
}
);
},
//
// -
selectMateriel() {
this.innerVisible = true;
this.getMaterielList();
},
//
changeRoute(routeCode) {
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)
})
}
// -
addQuantity(num) {
if (num <= 0) {
this.form.quantity = 1;
this.$message({
message: "数量不能小于1",
type: "warning"
})
this.splitForm.prodLineCodeArray = selectAll
})
}
},
// 线
changeEquipment(){
if (this.splitForm.routeCode == null) {
// -
submitForm() {
//
if (this.checkNull(this.form.prodCode) == 0) {
this.$message({
message: '请先选择工艺',
message: '物料号不能为空!',
type: 'warning'
})
return
}
},
// -
addQuantity(num){
if (num<=0){
this.form.quantity = 1;
if (this.checkNull(this.form.planProDate) == 0) {
this.$message({
message: '请选择计划生产日期!',
type: 'warning'
})
return
}
if (this.checkNull(this.form.planComplete) == 0) {
this.$message({
message:"数量不能小于1",
type:"warning"
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()
})
}
}
})
},
/** 导入按钮操作 */
// -
handleMaterielQuery() {
this.materielQueryParams.pageNum = 1;
this.getMaterielList();
},
// -
resetMaterielQuery() {
// TODO
console.log("进行了物料重置")
},
// -
handleImport() {
this.upload.title = "订单信息导入";
this.upload.open = true;
},
//
// -
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
//
// -
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
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();
},
//
// -
submitFileForm() {
this.$refs.upload.submit();
},
/** 下载模板操作 */
// -
importTemplate() {
this.download('/plan/order/importTemplate', {
}, `order_example_template_${new Date().getTime()}.xlsx`)
this.download('/plan/order/importTemplate', {}, `order_example_template_${new Date().getTime()}.xlsx`)
},
/** 导出按钮操作 */
// -
handleExport() {
this.download('/plan/order/export', {
...this.queryParams
}, `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) {
//
var row;
getCascadeProOrder(e.orderCode).then(response => {
row = response.data
@ -821,7 +875,7 @@ export default {
})
this.workerLoading = true // true
//
//
getWorkOrderList(row.id).then(response => {
var data = response.data
this.splitData = data
@ -841,10 +895,14 @@ export default {
},
/** 拆分数量方法 */
// -
splitNumChange(e) {
//
if (e <= 0) {
this.$message({
message: '拆分数量不能为负数!',
type: 'warning'
})
e = 1
this.splitForm.splitNum = 1
} else {
@ -863,6 +921,7 @@ export default {
this.proLoading = true // true
var num = this.productData[0].quantity;
//
function setAtrr1(data, splitNum) {
if (data.children !== undefined) {
@ -885,96 +944,7 @@ export default {
}
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) {
if (this.formFields.length > 1) {
for (let i = 0; i < this.formFields.length - 1; i++) {
@ -992,19 +962,19 @@ export default {
}
}
},
/** 校验日期 */
// -
checkDate(e) {
var now = new Date()
if (e < now) {
e = now
this.splitForm.productDate = now
this.$message({
message:"工单日期不能早于今天",
type:"warning"
message: "工单日期不能早于今天",
type: "warning"
})
}
},
/** 拆分提交按钮 */
// -
batchBtn() {
//
if (this.splitForm.splitNum == null) {
@ -1021,7 +991,7 @@ export default {
})
return
}
if (this.splitForm.prodLineCodeArray.length ==0) {
if (this.splitForm.prodLineCodeArray.length == 0) {
this.$message({
message: '请选择各流程节点的设备!',
type: 'warning'
@ -1127,7 +1097,7 @@ export default {
}, 500)
}
},
/** 动态添加表单 */
// -
addField() {
//
let sum = 0
@ -1143,21 +1113,83 @@ export default {
return
}
this.formFields.push({ batchCode: '', batchQuantity: '' })
this.formFields.push({batchCode: '', batchQuantity: ''})
//
this.formFields[this.formFields.length - 1].batchQuantity = Number(this.productData[0].atrr1) - Number(sum)
},
/** 动态删除表单 */
// -
removeField(index) {
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() {
this.loading = true
if (this.queryParams.planDateArray != null) {
this.queryParams.planDateStart = moment(this.queryParams.planDateArray[0]).format('YYYY-MM-DD')
this.queryParams.planDateEnd = moment(this.queryParams.planDateArray[1]).format('YYYY-MM-DD')
}else {
} else {
this.queryParams.planDateStart = null
this.queryParams.planDateEnd = null
}
@ -1166,7 +1198,7 @@ export default {
this.loading = false
})
},
/** 转换订单数据结构 */
// -
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children
@ -1177,21 +1209,6 @@ export default {
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() {
this.form = {
@ -1219,129 +1236,25 @@ export default {
}
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() {
this.getList()
},
//
resetMaterielQuery() {
// TODO
console.log("进行了物料重置")
},
/** 重置按钮操作 */
// -
resetQuery() {
this.queryParams = {
planDateArray: [new Date(), new Date()],
planFactoryCode: null,
orderType: null,
orderCode: null,
prodCode: null,
prodDesc: null,
quantity: null,
unit: null,
workerOrder: null,
planProDate: null,
planComplete: null,
atrr1: null,
atrr2: null,
atrr3: null,
status: null,
parentOrder: null,
prodType: null
planDateArray: [new Date(), new Date()],
planFactoryCode: null,
orderCode: null,
prodCode: null,
prodDesc: null,
status: null,
}
this.handleQuery()
},
/** 拆分按钮操作 */
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同步按钮操作 */
// -SAP
handleSyncSAP() {
this.$modal.confirm('是否确认SAP同步操作步骤').then(function() {
this.$modal.confirm('是否确认SAP同步操作步骤').then(function () {
return syncSAP()
}).then(() => {
this.getList()
@ -1389,7 +1302,8 @@ export default {
margin-top: 40px;
margin-bottom: 10px;
}
.my-materiel-btn{
.my-materiel-btn {
margin-top: 20px;
margin-left: 650px;
}

Loading…
Cancel
Save