Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
彭枝刚 2024-11-17 14:03:44 +08:00
commit 60a04e90c2
3 changed files with 258 additions and 81 deletions

View File

@ -128,10 +128,10 @@
</div>
</template>
</el-table-column>
<el-table-column prop="outWeight" label="产出重量" header-align="center">
<el-table-column prop="outMeter" label="产出重量" header-align="center">
<template slot-scope="scope">
<div>
<el-input v-model="scope.row.outWeight" type="number" :min="minValue"/>
<el-input v-model="scope.row.outMeter" type="number" :min="minValue"/>
</div>
</template>
</el-table-column>
@ -390,7 +390,7 @@ export default {
return this.$message.warning("请先选中列表中数据!");
} else {
for (let i=0; i<this.selectedRows.length; i++) {
if (!this.selectedRows[i].outWeight) {
if (!this.selectedRows[i].outMeter) {
return this.$message.warning("勾选列表存在未输入的数量!");
}
}
@ -411,6 +411,12 @@ export default {
this.$message.error(response.data.message);
} else {
this.$message.success(`工序【${this.searchForm.operation}】出站完成!`);
// 清除条码和输入框
this.searchForm.operationOutData.forEach(item => {
item.lotNo = '';
item.outMeter = '';
})
this.searchForm = Object.assign({}, this.searchForm)
}
}).catch(() => {
hideLoading();

View File

@ -75,11 +75,19 @@
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-col :span="6">
<el-form-item label="条码号" prop="barCode">
<el-input style="width: 200px" v-model.trim="searchForm.barCode" clearable @keyup.enter.native="barCodeBlur">
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="膜卷类型:" prop="rollType" :rules="[{ required: true, message: '膜卷类型不能为空', trigger: 'change'}]">
<el-select v-model="searchForm.rollType" clearable style="width: 200px">
<el-option v-for="item in selectRollType" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-button type="primary" icon="el-icon-edit-outline" size="small" @click="operationOut">出站</el-button>
@ -128,7 +136,17 @@
</div>
</template>
</el-table-column>
<el-table-column prop="inspectionLevel" label="质检状态" header-align="center">
<el-table-column v-if="getInspecLevel === 'Y'" prop="inspectionLevel" label="质检状态" header-align="center">
<template slot-scope="scope">
<div>
<el-select v-model="scope.row.inspectionLevel" clearable>
<el-option v-for="item in selectInspecLevel" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</div>
</template>
</el-table-column>
<el-table-column v-else prop="inspectionLevel" label="质检状态" header-align="center">
<template slot-scope="scope">
<div>
{{ scope.row.inspectionLevel }}
@ -152,14 +170,21 @@
<el-table-column prop="outMeter" label="产出米数" header-align="center">
<template slot-scope="scope">
<div>
<el-input v-model="scope.row.outMeter" type="number" :min="minValue"/>
<el-input v-model="scope.row.outMeter" type="number" :min="minValue" clearable/>
</div>
</template>
</el-table-column>
<el-table-column prop="outWeight" label="产出重量" header-align="center">
<template slot-scope="scope">
<div>
<el-input v-model="scope.row.outWeight" type="number" :min="minValue"/>
<el-input v-model="scope.row.outWeight" type="number" :min="minValue" clearable/>
</div>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" header-align="center">
<template slot-scope="scope">
<div>
<el-input v-model="scope.row.remark" clearable/>
</div>
</template>
</el-table-column>
@ -185,6 +210,7 @@ import {
import {hideLoading, showLoading} from "@/const/loading";
import { isBlank } from '@/util/string';
import {listByActivityId} from "@/api/admin/activity-option";
import {fetchItemList as fetchDictList} from "@/api/admin/dict";
export default {
name: 'operation-out',
data() {
@ -202,12 +228,15 @@ export default {
shopOrderDialogObj: {...shopOrderDialogObj}, // 生产订单
openShopOrderList: null,
shopOrderDialogVisible: false,
selectRollType: [],// 膜卷类型
selectInspecLevel: [],// 检验等级
minValue: 0, // 最小值,这里是 0,只能输入正整数
resrceIsDisabled: false, // 控制设备输入框是否禁用
operationIsDisabled: false, // 控制工序输入框是否禁用
shopOrderIsDisabled: false, // 控制工单输入框是否禁用
operationList: [], // 作业规则维护的工序列表
selectedRows: [], // 选中行数据列表
getInspecLevel: null, // 判断列表中质检状态是否可选
}
},
created() {
@ -247,6 +276,16 @@ export default {
},
},
methods: {
// 获取数据字典
getDataDictionary(dictType, list) {
fetchDictList({
current: "1",
size: "1000",
dictType: dictType,
}).then((response) => {
this[list] = response.data.data.records
});
},
//选中行赋值
handleSelectionChange(selection) {
this.selectedRows = selection;
@ -264,13 +303,20 @@ export default {
}
let optionList = response.data.data
for(let i=0;i<optionList.length;i++){
// 工序列表
if(optionList[i].optionName === 'AUTO_RELEASABLE_LOT'){
that.operationList = optionList[i].optionValue.split(";")
}
// 判断列表中质检状态是否可选
if(optionList[i].optionName === 'GET_INSPEC_LEVEL'){
that.getInspecLevel = optionList[i].optionValue
}
}
}).catch(e => {
hideLoading()
})
this.getDataDictionary("roll_type", "selectRollType");// 膜卷类型
this.getDataDictionary("INSPEC_LEVEL", "selectInspecLevel");// 检验等级
},
// 选择工单获取列表数据
readOperationOutListByShopOrder(site, shopOrder) {
@ -408,41 +454,59 @@ export default {
},
// 出站
operationOut() {
this.$confirm(`是否确认出站?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
// 不是首工序且不在作业规则内,列表必须有选择的数据且条码不能为空
if (this.selectedRows.length === 0) {
return this.$message.warning("请先选中列表中数据!");
} else {
for (let i=0; i<this.selectedRows.length; i++) {
if (!this.selectedRows[i].outMeter || !this.selectedRows[i].outWeight) {
return this.$message.warning("勾选列表存在未输入的数量!");
}
this.$refs.searchForm.validate((valid) => {
if (valid) {
this.$confirm(`是否确认出站?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
// 不是首工序且不在作业规则内,列表必须有选择的数据且条码不能为空
if (this.selectedRows.length === 0) {
return this.$message.warning("请先选中列表中数据!");
} else {
for (let i=0; i<this.selectedRows.length; i++) {
if (!this.selectedRows[i].outMeter || !this.selectedRows[i].outWeight) {
return this.$message.warning("勾选列表存在未输入的数量!");
}
if (this.getInspecLevel === 'Y' && !this.selectedRows[i].inspectionLevel) {
return this.$message.warning("勾选列表存在未选择的质检等级!");
}
}
}
showLoading();
// 按分号分割工单字符串
let shopOrderList = this.searchForm.shopOrder.split(";")
operationOut({
site: this.searchForm.site,
operation: this.searchForm.operation,
resrce: this.searchForm.resrce,
operationList: this.operationList,
operationOutListDTOList: this.selectedRows,
shopOrderList: shopOrderList
}).then((response) => {
hideLoading();
if (response.data.code !== 0) {
this.$message.error(response.data.message);
} else {
this.$message.success(`工序【${this.searchForm.operation}】出站完成!`);
// 清除条码和输入框
this.searchForm.operationOutData.forEach(item => {
item.lotNo = '';
item.outMeter = '';
item.outWeight = '';
item.remark = '';
if (this.getInspecLevel === 'Y') {
item.inspectionLevel = '';
}
})
this.searchForm = Object.assign({}, this.searchForm)
}
}).catch(() => {
hideLoading();
});
})
}
}
showLoading();
// 按分号分割工单字符串
let shopOrderList = this.searchForm.shopOrder.split(";")
operationOut({
site: this.searchForm.site,
operation: this.searchForm.operation,
resrce: this.searchForm.resrce,
operationList: this.operationList,
operationOutListDTOList: this.selectedRows,
shopOrderList: shopOrderList
}).then((response) => {
hideLoading();
if (response.data.code !== 0) {
this.$message.error(response.data.message);
} else {
this.$message.success(`工序【${this.searchForm.operation}】出站完成!`);
}
}).catch(() => {
hideLoading();
});
})
},
// 清空事件

View File

@ -93,6 +93,12 @@
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="原膜类型" prop="membraneType">
<el-input style="width: 200px" v-model.trim="searchForm.membraneType" disabled clearable>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="日期" prop="currentDate">
<el-input style="width: 200px" v-model.trim="searchForm.currentDate" disabled clearable>
@ -107,11 +113,19 @@
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-col :span="6">
<el-form-item label="条码号" prop="barCode">
<el-input style="width: 200px" v-model.trim="searchForm.barCode" clearable @keyup.enter.native="barCodeBlur">
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item v-if="autoRollType === 'Y'" label="膜卷类型:" prop="rollType" :rules="[{ required: true, message: '膜卷类型不能为空', trigger: 'change'}]">
<el-select v-model="searchForm.rollType" clearable style="width: 200px">
<el-option v-for="item in selectRollType" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-button type="primary" icon="el-icon-edit-outline" size="small" @click="operationOut">出站</el-button>
@ -160,7 +174,17 @@
</div>
</template>
</el-table-column>
<el-table-column prop="inspectionLevel" label="质检状态" header-align="center">
<el-table-column v-if="getInspecLevel === 'Y'" prop="inspectionLevel" label="质检状态" header-align="center">
<template slot-scope="scope">
<div>
<el-select v-model="scope.row.inspectionLevel" clearable>
<el-option v-for="item in selectInspecLevel" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</div>
</template>
</el-table-column>
<el-table-column v-else prop="inspectionLevel" label="质检状态" header-align="center">
<template slot-scope="scope">
<div>
{{ scope.row.inspectionLevel }}
@ -191,7 +215,14 @@
<el-table-column prop="outMeter" label="产出数量(米/卷)" header-align="center">
<template slot-scope="scope">
<div>
<el-input v-model="scope.row.outMeter" type="number" :min="minValue"/>
<el-input v-model="scope.row.outMeter" type="number" :min="minValue" clearable/>
</div>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" header-align="center">
<template slot-scope="scope">
<div>
<el-input v-model="scope.row.remark" clearable/>
</div>
</template>
</el-table-column>
@ -212,18 +243,21 @@ import {
fetchShopOrderPage,
fetchUserWorkShift,
readOperationOutListByShopOrder,
readOperationOutListByBarCode, operationOut
readOperationOutListByBarCode,
operationOut
} from "@/api/mes/prd/operation-out";
import {hideLoading, showLoading} from "@/const/loading";
import { isBlank } from '@/util/string';
import {listByActivityId} from "@/api/admin/activity-option";
import {fetchItemList as fetchDictList} from "@/api/admin/dict";
export default {
name: 'operation-out',
data() {
return {
searchForm: {
searchData: {
currentDate: this.formattedDate()
},
searchForm: {},
site: getStore({name: 'tenantId'}),
resrceDialogObj: {...resrceDialogObj}, // 设备
openResrceList: null,
@ -234,16 +268,20 @@ export default {
shopOrderDialogObj: {...shopOrderDialogObj}, // 生产订单
openShopOrderList: null,
shopOrderDialogVisible: false,
selectRollType: [],// 膜卷类型
selectInspecLevel: [],// 检验等级
minValue: 0, // 最小值,这里是 0,只能输入正整数
resrceIsDisabled: false, // 控制设备输入框是否禁用
operationIsDisabled: false, // 控制工序输入框是否禁用
shopOrderIsDisabled: false, // 控制工单输入框是否禁用
operationList: [], // 作业规则维护的工序列表
selectedRows: [], // 选中行数据列表
autoRollType: null, // 是否展示膜卷类型
getInspecLevel: null, // 判断列表中质检状态是否可选
}
},
created() {
this.searchForm = Object.assign({}, this.searchForm);
this.searchForm = Object.assign({}, this.searchData);
// 获取跳转参数
if (this.$route.query.resrce) {
this.searchForm.resrce = this.$route.query.resrce
@ -267,6 +305,35 @@ export default {
}
this.initList(activityId, this);
},
//监听路由变化
watch: {
$route:function (){
window.location.reload();
this.searchForm = Object.assign({}, this.searchData); // 切换标签时不可使用原有搜索对象,不然会把上一个标签的内容带出来(同一路径情况)
// 获取跳转参数
if (this.$route.query.resrce) {
this.searchForm.resrce = this.$route.query.resrce
this.resrceIsDisabled = !this.resrceIsDisabled; // 切换禁用状态
// 获取原膜数据
this.getMembrane(this.site, this.$route.query.resrce);
}
if (this.$route.query.operation) {
this.searchForm.operation = this.$route.query.operation
this.operationIsDisabled = !this.operationIsDisabled; // 切换禁用状态
}
// 获取班次
this.getUserWorkShift(this.site);
// 获取作业规则
let activityId = this.$route.query.ACTIVITY_ID
// 处理作业规则数据,跳转过来的会带上?pure-page=Y
let index = activityId.indexOf("?");
if (index !== -1) {
// 截取 "?" 之前的部分
activityId = activityId.substring(0, index);
}
this.initList(activityId, this);
}
},
computed: {
//读取权限
...mapGetters(['permissions', 'userInfo']),
@ -279,6 +346,16 @@ export default {
},
},
methods: {
// 获取数据字典
getDataDictionary(dictType, list) {
fetchDictList({
current: "1",
size: "1000",
dictType: dictType,
}).then((response) => {
this[list] = response.data.data.records
});
},
//选中行赋值
handleSelectionChange(selection) {
this.selectedRows = selection;
@ -296,13 +373,24 @@ export default {
}
let optionList = response.data.data
for(let i=0;i<optionList.length;i++){
// 工序列表
if(optionList[i].optionName === 'AUTO_RELEASABLE_LOT'){
that.operationList = optionList[i].optionValue.split(";")
}
// 是否展示膜卷类型
if(optionList[i].optionName === 'AUTO_ROLL_TYPE'){
that.autoRollType = optionList[i].optionValue
}
// 判断列表中质检状态是否可选
if(optionList[i].optionName === 'GET_INSPEC_LEVEL'){
that.getInspecLevel = optionList[i].optionValue
}
}
}).catch(e => {
hideLoading()
})
this.getDataDictionary("roll_type", "selectRollType");// 膜卷类型
this.getDataDictionary("INSPEC_LEVEL", "selectInspecLevel");// 检验等级
},
// 选择工单获取列表数据
readOperationOutListByShopOrder(site, shopOrder) {
@ -404,6 +492,7 @@ export default {
this.searchForm.membraneRemainMeter = response.data.data.membraneRemainMeter
this.searchForm.membraneLevel = response.data.data.membraneLevel
this.searchForm.membraneWidth = response.data.data.membraneWidth
this.searchForm.membraneType = response.data.data.membraneType
} else {
// 置空
const k = ""
@ -412,6 +501,7 @@ export default {
this.searchForm.membraneRemainMeter = k
this.searchForm.membraneLevel = k
this.searchForm.membraneWidth = k
this.searchForm.membraneType = k
}
this.searchForm = Object.assign({}, this.searchForm)
}
@ -442,41 +532,58 @@ export default {
},
// 出站
operationOut() {
this.$confirm(`是否确认出站?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
// 不是首工序且不在作业规则内,列表必须有选择的数据且条码不能为空
if (this.selectedRows.length === 0) {
return this.$message.warning("请先选中列表中数据!");
} else {
for (let i=0; i<this.selectedRows.length; i++) {
if (!this.selectedRows[i].outMeter) {
return this.$message.warning("勾选列表存在未输入的数量!");
}
this.$refs.searchForm.validate((valid) => {
if (valid) {
this.$confirm(`是否确认出站?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
// 不是首工序且不在作业规则内,列表必须有选择的数据且条码不能为空
if (this.selectedRows.length === 0) {
return this.$message.warning("请先选中列表中数据!");
} else {
for (let i=0; i<this.selectedRows.length; i++) {
if (!this.selectedRows[i].outMeter) {
return this.$message.warning("勾选列表存在未输入的数量!");
}
if (this.getInspecLevel === 'Y' && !this.selectedRows[i].inspectionLevel) {
return this.$message.warning("勾选列表存在未选择的质检等级!");
}
}
}
showLoading();
// 按分号分割工单字符串
let shopOrderList = this.searchForm.shopOrder.split(";")
operationOut({
site: this.site,
operation: this.searchForm.operation,
resrce: this.searchForm.resrce,
operationList: this.operationList,
operationOutListDTOList: this.selectedRows,
shopOrderList: shopOrderList
}).then((response) => {
hideLoading();
if (response.data.code !== 0) {
this.$message.error(response.data.message);
} else {
this.$message.success(`工序【${this.searchForm.operation}】出站完成!`);
// 清除条码和输入框
this.searchForm.operationOutData.forEach(item => {
item.lotNo = '';
item.outMeter = '';
item.remark = '';
if (this.getInspecLevel === 'Y') {
item.inspectionLevel = '';
}
})
this.searchForm = Object.assign({}, this.searchForm)
}
}).catch(() => {
hideLoading();
});
})
}
}
showLoading();
// 按分号分割工单字符串
let shopOrderList = this.searchForm.shopOrder.split(";")
operationOut({
site: this.site,
operation: this.searchForm.operation,
resrce: this.searchForm.resrce,
operationList: this.operationList,
operationOutListDTOList: this.selectedRows,
shopOrderList: shopOrderList
}).then((response) => {
hideLoading();
if (response.data.code !== 0) {
this.$message.error(response.data.message);
} else {
this.$message.success(`工序【${this.searchForm.operation}】出站完成!`);
}
}).catch(() => {
hideLoading();
});
})
},
// 清空事件