This commit is contained in:
helloDy
2024-03-22 10:27:57 +08:00
parent e211e585af
commit 99fd016703
20 changed files with 417 additions and 212 deletions

View File

@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-12-12 16:04:44
* @LastEditTime: 2024-03-20 16:20:39
* @Description:
-->
<template>
@@ -130,6 +130,11 @@ export default {
if (this.dataForm.id) {
this.urlOptions.infoURL(id).then(response => {
this.dataForm = response.data;
const tempPic = []
this.dataForm.files?.forEach(item => {
tempPic.push(item.fileUrl)
})
this.files = tempPic.join(',')
if (this.setData) {
this.setDataForm()
}
@@ -150,8 +155,8 @@ export default {
}
this.dataForm.files = []
if (this.files.length > 0) {
this.files.forEach(item => {
if (this.files.split(',').length > 0) {
this.files.split(',').forEach(item => {
const temp = {
fileType: 1,
fileUrl: item

View File

@@ -387,6 +387,7 @@ export default {
label: '设备图片',
prop: 'files2',
fileType: 1,
uploadTips: true
},
],
[{ input: true, label: '备注', prop: 'remark' }],

View File

@@ -161,7 +161,7 @@ export default {
{
upload: true,
label: '上传资料',
prop: 'files',
prop: 'files'
},
],
[{ input: true, label: '备注', prop: 'remark' }],

View File

@@ -186,8 +186,8 @@ export default {
code: '',
planProductId: '',
specifications: '',
planStartTime: '',
planFinishTime: '',
planStartTime: undefined,
planFinishTime: undefined,
planAssignQuantity: 0,
planQuantity: 0,
processFlowId: '',
@@ -248,7 +248,31 @@ export default {
this.dataForm.materialMethod = 1
}
},
reset() {
this.dataForm = {
id: undefined,
workOrderId: '',
name: '',
code: '',
planProductId: '',
specifications: '',
planStartTime: undefined,
planFinishTime: undefined,
planAssignQuantity: 0,
planQuantity: 0,
processFlowId: '',
materialMethod: 1,
triggerOrigin: 1,
priority: '',
productLineIds: [],
type: '',
workers: '',
roomNameDict: '',
status: 1
}
},
init(id) {
this.reset();
this.dataForm.id = id || "";
this.visible = true;
if (this.urlOptions.getOption) {
@@ -256,6 +280,7 @@ export default {
}
this.$nextTick(() => {
this.$refs["dataForm"].resetFields();
console.log('222', this.dataForm)
this.planStartTime = ''
this.planFinishTime = ''
if (this.dataForm.id) {
@@ -264,6 +289,12 @@ export default {
if (this.dataForm.priority !== undefined) {
this.dataForm.priority = String(this.dataForm.priority)
}
if (this.dataForm.planStartTime === 0) {
this.dataForm.planStartTime = undefined
}
if (this.dataForm.planFinishTime === 0) {
this.dataForm.planFinishTime = undefined
}
if (this.dataForm.roomNameDict !== undefined) {
this.dataForm.roomNameDict = String(this.dataForm.roomNameDict)
}

View File

@@ -2,16 +2,19 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2024-03-15 15:34:58
* @LastEditTime: 2024-03-22 08:53:20
* @Description:
-->
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
:wrapper-closable="false"
:wrapper-closable="true"
class="drawer"
size="55%">
size="55%"
:before-close="beforeClose"
@closed="$emit('destroy')"
>
<small-title slot="title" :no-padding="true">
{{ '分配产量' }}
</small-title>
@@ -52,60 +55,47 @@
<el-date-picker
v-model="dataForm.finishProduceTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期时间" />
value-format="timestamp"
placeholder="选择实际生产完成时间" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<div class="attr-list">
<div v-show="!isdetail" class="attr-list">
<!-- <el-button v-show="!isdetail" type="success" size="small" style="float: right" @click="addRow()">添加一行</el-button> -->
<el-table
:data="tableData"
style="width: 100%">
<el-table-column type="index" label="序号" />
<el-table-column prop="orderName" label="订单名称" />
<el-table-column prop="orderCode" label="订单编码" />
<el-table-column prop="priority" label="优先级" />
<el-table-column prop="planAssignmentQuantity" label="计划分配数量" >
<template slot-scope="scope">
<el-input v-model="scope.row.planAssignmentQuantity" :disabled="scope.row.isallocation"></el-input>
</template>
</el-table-column>
<el-table-column prop="actualAssignmentQuantity" label="实际分配数量">
<template slot-scope="scope">
<el-input v-model="scope.row.actualAssignmentQuantity" :disabled="scope.row.isallocation"></el-input>
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="saveData(scope.row)">保存</el-button>
<!-- <el-tooltip v-if="!scope.row.isEdit" placement="top" content="编辑">
<el-button
type="text"
:style="{color:'#0B58FF'}"
size="mini"
@click="edit(scope.row)"
>
<svg-icon style="width: 18px; height: 18px" class="item-icon" icon-class="edit" />
</el-button>
</el-tooltip> -->
<!-- <el-tooltip placement="top" content="删除">
<el-button
type="text"
:style="{color:'#FF5454'}"
size="mini"
@click="deleteDetail(scope.row)"
>
<svg-icon style="width: 18px; height: 18px" class="item-icon" icon-class="table_delete" />
</el-button>
</el-tooltip> -->
</template>
</el-table-column>
</el-table>
<el-form ref="tableForm" :model="form" style="padding: 0">
<el-table
ref="table"
:data="form.tableData"
row-key="id"
style="width: 100%">
<el-table-column type="index" label="序号" />
<el-table-column prop="orderName" label="订单名称" />
<el-table-column prop="orderCode" label="订单编码" />
<el-table-column prop="priority" label="优先级" />
<el-table-column prop="planAssignmentQuantity" label="计划分配数量" >
<template slot-scope="scope">
<el-form-item prop="planAssignmentQuantity">
<el-input v-model.number="scope.row.planAssignmentQuantity" :disabled="scope.row.isallocation"></el-input>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="*实际分配数量">
<template slot-scope="scope">
<el-form-item :prop="`tableData.${scope.$index}.actualAssignmentQuantity`" :rules="[{ required: true, message: '实际分配数量不能为空', trigger: 'blur' }]">
<el-input v-model.number="scope.row.actualAssignmentQuantity" :disabled="scope.row.isallocation"></el-input>
</el-form-item>
</template>
</el-table-column>
<!-- <el-table-column label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="saveData(scope.row)">保存</el-button>
</template>
</el-table-column> -->
</el-table>
</el-form>
<pagination
v-show="listQuery.total > 0"
:total="listQuery.total"
@@ -134,7 +124,7 @@
<script>
import basicAdd from '../../core/mixins/basic-add';
import { getConOrderList, updateConCoreWOr, getCoreWO, statusChange } from '@/api/base/coreWorkOrder';
import { getConOrderList, updateConCoreWOr, updateBatchConCoreWOr, getCoreWO, statusChange } from '@/api/base/coreWorkOrder';
import SmallTitle from '../material/SmallTitle';
// import { parseTime } from '../../core/mixins/code-filter';
// import attrAdd from './attr-add';
@@ -158,6 +148,10 @@ export default {
code: undefined,
productId: '',
remark: undefined,
},
form: {
tableData: []
},
productList: [],
materialAttrList: [],
@@ -174,26 +168,77 @@ export default {
},
mounted() {},
methods: {
beforeClose(done) {
// if (this.mode.includes('edit')) {
this.$confirm('确认关闭?')
.then(_ => {
done();
})
.catch(_ => {});
},
// 表单提交
dataFormSubmit() {
// console.log('嗨害嗨', this.$refs['table'])
console.log('nihc ', this.form.tableData)
// this.$refs['tableForm'].validate((valid) => {
// if (valid) {
// alert('提交成功!');
// } else {
// alert('表单验证失败!');
// return false;
// }
// });
this.$refs["dataForm"].validate((valid) => {
if (!valid) {
return false;
}
this.$refs['tableForm'].validate((valid) => {
if (!valid) {
return false;
}
// 修改的提交
console.log('aaaaaaa', this.form.tableData)
// 判断分配数量
let num = 0
const tempList = this.form.tableData.map((item) => {
item.workOrderId = this.dataForm.id
num += item.actualAssignmentQuantity
return item
})
if (num <= this.dataForm.actualQuantity) {
if (this.dataForm.id) {
statusChange({
id: this.dataForm.id,
status: 4,
finishProduceTime: this.dataForm.finishProduceTime,
actualQuantity: this.dataForm.actualQuantity
}).then(response => {
this.$modal.msgSuccess("操作成功!工单状态稍后将会更新!");
this.saveData(tempList)
this.visible = false;
this.$emit("refreshDataList");
});
return;
}
} else {
this.$message.error('实际分配数量超过实际生产数量!')
}
console.log('2111', num, tempList)
});
// 修改的提交
if (this.dataForm.id) {
statusChange({
id: this.dataForm.id,
status: 4,
finishProduceTime: this.dataForm.finishProduceTime,
actualQuantity: this.dataForm.actualQuantity
}).then(response => {
this.$modal.msgSuccess("操作成功!工单状态稍后将会更新!");
this.visible = false;
this.$emit("refreshDataList");
});
return;
}
// if (this.dataForm.id) {
// statusChange({
// id: this.dataForm.id,
// status: 4,
// finishProduceTime: this.dataForm.finishProduceTime,
// actualQuantity: this.dataForm.actualQuantity
// }).then(response => {
// this.$modal.msgSuccess("操作成功!工单状态稍后将会更新!");
// this.visible = false;
// this.$emit("refreshDataList");
// });
// return;
// }
// 添加的提交
// this.urlOptions.createURL(this.dataForm).then(response => {
// this.$modal.msgSuccess("新增成功");
@@ -209,30 +254,14 @@ export default {
edit(row) {
row.isEdit = true
},
saveData(row) {
if (row.actualAssignmentQuantity) {
if (row.id) {
// updateMaterialPBDet({
// ...row
// }).then((response) => {
// this.$modal.msgSuccess('修改成功');
// // this.visible = false;
// this.getList();
// });
// return;
}
// 修改的提交
updateConCoreWOr({
...row,
workOrderId: this.dataForm.id
}).then((response) => {
this.$modal.msgSuccess('分配成功');
// this.visible = false;
this.getList();
});
} else {
this.$message.warning('请填写实际分配数量');
}
saveData(list) {
console.log('你好', list)
// 修改的提交
updateBatchConCoreWOr(list).then((response) => {
this.$modal.msgSuccess('分配成功');
// this.visible = false;
this.getList();
});
},
getList() {
// 获取工单分配详细列表
@@ -245,6 +274,7 @@ export default {
item.isallocation = item.actualAssignmentQuantity ? true : false
return item
});
this.$set(this.form, 'tableData', this.tableData)
this.listQuery.total = response.data.length;
});
},

View File

@@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2024-03-15 15:40:24
* @LastEditTime: 2024-03-21 16:52:46
* @Description:
-->
<template>
@@ -16,7 +16,13 @@
<!-- <small-title slot="title" :no-padding="true">
{{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
</small-title> -->
<div v-show="workOrderButton.length" class="buttonDiv">
<div v-show="workOrderButton.length" style="position: relative;padding-right: 90px;">
<topTabVue :orderIdList='workOrderButton' :orderId="workorderId" @emitFun='toggleName' />
<el-button type="primary" plain size="small"
style="position: absolute;right: 0; top: 0;height: 48px;font-size: 14px;" @click="goback"><svg-icon
icon-class="return" /> 返回</el-button>
</div>
<!-- <div v-show="workOrderButton.length" class="buttonDiv">
<div style="display: flex; width: 100%;">
<el-button v-show="showScroll" type="text" style="width: 30px; background: white; margin-right: 8px" @click="scrollLeft" icon="el-icon-caret-left"></el-button>
<div ref="content" class="scrollDiv">
@@ -27,7 +33,7 @@
<svg-icon icon-class="return"/>返回
</el-button>
</div>
</div>
</div> -->
<div class="content">
<div class="card">
<div class="boxTitle">
@@ -157,7 +163,7 @@
</el-col>
<el-col :span="3">
<div class="blodTip">废片数量</div>
<div class="lightTip">{{ dataForm.nokQuantity }}</div>
<div class="lightTip">{{ dataForm.nokNum }}</div>
</el-col>
<el-col :span="3">
<div class="blodTip">检测瑕疵数</div>
@@ -222,12 +228,13 @@
<script>
// import basicAdd from '../../core/mixins/basic-add';
import { getCoreWO, getCoreWOMaPage, getConOrderList, getCoreWOListById } from "@/api/base/coreWorkOrder";
import { getCoreWO, getCoreWOMaPage, getlistByProductId, getlistByFlowId, getConOrderList, getCoreWOListById } from "@/api/base/coreWorkOrder";
// import { orderList } from "@/api/base/orderManage";
import { getProcessFlowList } from '@/api/base/orderManage'
import SmallTitle from './SmallTitle';
import { publicFormatter } from "@/utils/dict";
import { parseTime } from '@/utils/ruoyi'
import topTabVue from '../../order/base/orderManage/components/topTab.vue';
const tableBtn = [
{
@@ -265,9 +272,9 @@ const tableProps = [
const tableProps1 = [
{
prop: 'material',
label: '物料名称',
filter: publicFormatter('material')
prop: 'materialName',
label: '物料名称'
// filter: publicFormatter('material')
},
{
prop: 'unit',
@@ -285,7 +292,7 @@ const tableProps1 = [
];
export default {
components: { SmallTitle },
components: { SmallTitle, topTabVue },
data() {
return {
tableBtn,
@@ -308,6 +315,7 @@ export default {
dataForm: {},
orderList: [],
materialList: [],
workorderId: '',
// orderArray: [],
visible: false,
isdetail: false,
@@ -331,13 +339,15 @@ export default {
name: work.name
}
})
const contentRef = this.$refs.content
if (contentRef.scrollWidth > contentRef.clientWidth) {
this.showScroll = true
} else {
this.showScroll = false
}
console.log(contentRef.scrollWidth, contentRef.clientWidth)
this.workorderId = this.workOrderButton[0].id
console.log('wawa ew', this.workorderId, this.workOrderButton)
// const contentRef = this.$refs.content
// if (contentRef.scrollWidth > contentRef.clientWidth) {
// this.showScroll = true
// } else {
// this.showScroll = false
// }
// console.log(contentRef.scrollWidth, contentRef.clientWidth)
this.init(this.workOrderButton[0].id, true)
})
} else {
@@ -345,6 +355,11 @@ export default {
}
},
methods: {
// 切换tab获取订单详情
toggleName(val) {
this.workorderId = val
this.init(val, true)
},
scrolRight() {
// let contentRef = this.$refs.content
// console.log('你好啊啊', contentRef.scrollWidth, contentRef.clientWidth)
@@ -442,17 +457,38 @@ export default {
// 获取预使用原料列表
console.log()
if (this.dataForm.id) {
getCoreWOMaPage({
workOrderId: this.dataForm.id,
pageNo: 1,
pageSize: 100
}).then((response) => {
this.materialList = response.data.records.map((item) => {
item.remaining = item?.num * this.dataForm.remainingQuantity || 0
return item
if (this.dataForm.materialMethod === 1) {
// 产品
getlistByProductId({
id: this.dataForm.planProductId
}).then((response) => {
this.materialList = response.data.map((item) => {
item.remaining = item?.num * this.dataForm.remainingQuantity || 0
return item
});
});
// this.listQuery.total = response.data.length;
});
} else {
// 工艺流程
getlistByFlowId({
id: this.dataForm.processFlowId
}).then((response) => {
this.materialList = response.data.map((item) => {
item.remaining = item?.num * this.dataForm.remainingQuantity || 0
return item
});
});
}
// getCoreWOMaPage({
// workOrderId: this.dataForm.id,
// pageNo: 1,
// pageSize: 100
// }).then((response) => {
// this.materialList = response.data.records.map((item) => {
// item.remaining = item?.num * this.dataForm.remainingQuantity || 0
// return item
// });
// // this.listQuery.total = response.data.length;
// });
}
// 获取订单相关信息
// orderList({

View File

@@ -43,7 +43,8 @@
<allocation
v-if="allocationVisible"
ref="allocation"
@refreshDataList="getDataList" />
@refreshDataList="searchStatus"
@destroy="allocationVisible = false" />
</div>
</template>
@@ -353,6 +354,11 @@ export default {
this.getDataList()
},
methods: {
searchStatus() {
setTimeout(() => {
this.getDataList()
}, 20000)
},
getWorkOrder() {
getCoreWOList().then(res => {
this.formConfig[0].selectOptions = res.data.map(item => {
@@ -444,7 +450,7 @@ export default {
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList();
this.searchStatus();
// 分配产量
// if (param.status === 4) {
// this.allocationOrder(param);
@@ -478,7 +484,7 @@ export default {
// 有绑定订单带id
this.$refs.allocation.init(val.id);
} else {
this.$refs.allocation.init();
this.$refs.allocation.init(val.id, true);
}
});
})

View File

@@ -2,14 +2,15 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2024-02-21 09:41:39
* @LastEditTime: 2024-03-21 15:21:32
* @Description:
-->
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
:wrapper-closable="isdetail"
:wrapper-closable="true"
:before-close="beforeClose"
class="drawer"
size="60%">
<small-title slot="title" :no-padding="true">
@@ -256,6 +257,17 @@ export default {
this.getDict()
},
methods: {
beforeClose(done) {
if (!this.isdetail) {
this.$confirm('确认关闭?')
.then(_ => {
done();
})
.catch(_ => {});
} else {
done()
}
},
async getDict() {
// 物料类型列表
// const res = await listData({

View File

@@ -2,14 +2,15 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2023-11-27 19:50:36
* @LastEditTime: 2024-03-21 14:39:52
* @Description:
-->
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
:wrapper-closable="isdetail"
:wrapper-closable="true"
:before-close="beforeClose"
class="drawer"
size="70%">
<small-title slot="title" :no-padding="true">
@@ -196,6 +197,17 @@ export default {
this.getDict()
},
methods: {
beforeClose(done) {
if (!this.isdetail) {
this.$confirm('确认关闭?')
.then(_ => {
done();
})
.catch(_ => {});
} else {
done()
}
},
handleClick(raw) {
if (raw.type === 'delete') {
this.deleteDetail(raw.data);
@@ -246,7 +258,7 @@ export default {
});
},
initData() {
// this.materialAttrList.splice(0);
this.tableData.splice(0);
this.listQuery.total = 0;
},
deleteDetail(raw) {
@@ -284,18 +296,18 @@ export default {
});
},
// 构造一行
addRow() {
const row = {
bomId: this.dataForm.id,
materialId: '',
num: 0,
materialCode: undefined,
unit: undefined,
remark: '',
isEdit: true
}
this.tableData.push(row)
},
// addRow() {
// const row = {
// bomId: this.dataForm.id,
// materialId: '',
// num: 0,
// materialCode: undefined,
// unit: undefined,
// remark: '',
// isEdit: true
// }
// this.tableData.push(row)
// },
init(id, isdetail) {
this.initData();
this.isdetail = isdetail || false;