|
@@ -9,11 +9,50 @@
|
|
|
{{ item.title }}
|
|
|
</span>
|
|
|
<span
|
|
|
+ v-if="item.prop == 'taskNo'"
|
|
|
class="content"
|
|
|
style="background: rgb(235, 237, 242); color: rgb(232, 83, 152)"
|
|
|
>
|
|
|
- {{ item.content }}
|
|
|
+ {{ form.master_task[item.prop] }}
|
|
|
</span>
|
|
|
+ <span
|
|
|
+ v-else-if="item.prop == 'mapNumber'"
|
|
|
+ class="content"
|
|
|
+ style="background: rgb(235, 237, 242); color: rgb(232, 83, 152)"
|
|
|
+ >
|
|
|
+ {{ form.master_task[item.prop] }}
|
|
|
+ </span>
|
|
|
+ <span
|
|
|
+ v-else-if="item.prop == 'mapName'"
|
|
|
+ class="content"
|
|
|
+ style="background: rgb(235, 237, 242); color: rgb(232, 83, 152)"
|
|
|
+ >
|
|
|
+ {{ form.master_task[item.prop] }}
|
|
|
+ </span>
|
|
|
+ <span
|
|
|
+ v-else-if="item.prop == 'modelNumber'"
|
|
|
+ class="content"
|
|
|
+ style="background: rgb(235, 237, 242); color: rgb(232, 83, 152)"
|
|
|
+ >
|
|
|
+ {{ form.master_task[item.prop] }}
|
|
|
+ </span>
|
|
|
+ <span
|
|
|
+ v-else-if="item.prop == 'craftRoute'"
|
|
|
+ class="content"
|
|
|
+ style="background: rgb(235, 237, 242); color: rgb(232, 83, 152)"
|
|
|
+ >
|
|
|
+ {{ form.master_task[item.prop] }}
|
|
|
+ </span>
|
|
|
+ <span
|
|
|
+ v-else
|
|
|
+ class="content"
|
|
|
+ style="background: rgb(235, 237, 242); color: rgb(232, 83, 152)"
|
|
|
+ >
|
|
|
+ {{ form.record_quality_control_card[item.prop] }}
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+
|
|
|
</div>
|
|
|
<div class="content"></div>
|
|
|
</div>
|
|
@@ -22,36 +61,33 @@
|
|
|
<div class="state">
|
|
|
<div class="list">
|
|
|
<span>工序状态:</span>
|
|
|
- <p>初始</p>
|
|
|
+ <p id="state">{{form.state? stateObj[form.state] : '初始'}}</p>
|
|
|
</div>
|
|
|
<div class="list">
|
|
|
<span>是否外协:</span>
|
|
|
- <p>初始</p>
|
|
|
+ <p><el-checkbox @change="(val)=>{updateHandler(form.state,val)}" v-model="checked"></el-checkbox></p>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="button">
|
|
|
- <el-button-group>
|
|
|
- <el-button type="primary" icon="el-icon-video-play" plain round
|
|
|
+ <el-button-group prop="state">
|
|
|
+ <el-button type="primary" icon="el-icon-video-play" plain round @click="updateHandler('1',checked)"
|
|
|
>开始</el-button
|
|
|
>
|
|
|
- <el-button type="danger" icon="el-icon-video-pause" plain
|
|
|
+ <el-button type="danger" icon="el-icon-video-pause" plain @click="updateHandler('2',checked)"
|
|
|
>暂停</el-button
|
|
|
>
|
|
|
- <el-button type="success" icon="el-icon-circle-check" plain
|
|
|
+ <el-button type="success" icon="el-icon-circle-check" plain @click=" updateHandler('3',checked)"
|
|
|
>完成</el-button
|
|
|
>
|
|
|
- <el-button type="info" icon="el-icon-refresh" plain round
|
|
|
+ <el-button type="info" icon="el-icon-refresh" plain round @click=" updateHandler('0',checked)"
|
|
|
>重置</el-button
|
|
|
>
|
|
|
</el-button-group>
|
|
|
</div>
|
|
|
- <div class="middle">
|
|
|
- <el-table :data="tableData2" border>
|
|
|
- <el-table-column> </el-table-column>
|
|
|
- </el-table>
|
|
|
+ <div class="middle" v-show="!checked">
|
|
|
<div class="name">人员及工时分配</div>
|
|
|
- <el-table :data="tableData1" border ref="addTableRowRef">
|
|
|
+ <el-table :data="tableData" border ref="addTableRowRef">
|
|
|
<el-table-column label="人员姓名">
|
|
|
<template slot-scope="scope">
|
|
|
<el-input v-model="scope.row.name"></el-input>
|
|
@@ -98,56 +134,180 @@
|
|
|
@click="saveTableRow(newRow)"
|
|
|
>保 存</el-button
|
|
|
>
|
|
|
- </div>
|
|
|
- <div class="footer">
|
|
|
<div class="total">
|
|
|
<span>当前工序总工时: 10</span>
|
|
|
<span>当前已分配工时: 10</span>
|
|
|
<span>当前剩余工时: 10</span>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
+import { submitNodeForm,changeNodeState } from "@/api/bpmprocess/runDialogApi/index";
|
|
|
export default {
|
|
|
name: "ProductionProcesses",
|
|
|
+ props: ["formData", "row"],
|
|
|
data() {
|
|
|
return {
|
|
|
- tableData1: [],
|
|
|
- tableData2: [],
|
|
|
+ checked: true,
|
|
|
+ isEdit: false,
|
|
|
+ form:{},
|
|
|
+ tableData: [],
|
|
|
newRow: {},
|
|
|
+
|
|
|
baseMessage: [
|
|
|
- { title: "任务", content: "47as04-51-1238" },
|
|
|
- { title: "图号", content: "1CG12-38" },
|
|
|
- { title: "名称", content: "支架" },
|
|
|
- { title: "数量", content: "1" },
|
|
|
- { title: "工艺", content: "1" },
|
|
|
- { title: "质控", content: "1" },
|
|
|
+ { title: "任务", prop: "taskNo" },
|
|
|
+ { title: "图号", prop: "mapNumber" },
|
|
|
+ { title: "名称", prop: "mapName" },
|
|
|
+ { title: "数量", prop: "modelNumber" },
|
|
|
+ { title: "工艺", prop: "craftRoute" },
|
|
|
+ { title: "质控", prop: "qualityControlCard" },
|
|
|
],
|
|
|
+ stateObj:{
|
|
|
+ '0':'初始',
|
|
|
+ '1':'开始',
|
|
|
+ '2':'暂停',
|
|
|
+ '3':'完成',
|
|
|
+ }
|
|
|
};
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ myFormData() {
|
|
|
+ return this.formData;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ myFormData: {
|
|
|
+ handler(nval) {
|
|
|
+ if(!nval) return
|
|
|
+ this.form = JSON.parse(JSON.stringify(nval?.resultMap));
|
|
|
+ // this.$set(this.form, 'card', nval?.resultMap.qualityControlCard);
|
|
|
+ this.$set(this.form, 'state', nval?.resultMap.taskNnodeOtherState);
|
|
|
+ this.isEdit = this.form.taskKey && this.form.taskNodeKey;
|
|
|
+ },
|
|
|
+ deep: true,
|
|
|
+ immediate: true,
|
|
|
+ },
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ async updateHandler(state,flag){
|
|
|
+ flag=flag ? 'true' : 'false'
|
|
|
+ let payLoad={
|
|
|
+ conditionMap:
|
|
|
+ {
|
|
|
+ taskProcessKey: this.row.benTaskProcessKey,
|
|
|
+ taskNodeKey: this.row.benTaskNodeKey,
|
|
|
+ },
|
|
|
+ commMap: {
|
|
|
+ taskNodeOtherState: state,
|
|
|
+ task1:flag
|
|
|
+ },
|
|
|
+ }
|
|
|
+
|
|
|
+ changeNodeState(payLoad).then((response) => {
|
|
|
+ if (response.code == 200) {
|
|
|
+ this.$modal.msgSuccess("修改成功");
|
|
|
+ this.form.state=state;
|
|
|
+
|
|
|
+ } else {
|
|
|
+ this.$modal.error("修改失败,请稍后再试");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ async submitHandler() {
|
|
|
+ console.log(this.row);
|
|
|
+ let res = await this.$refs.form?.validate();
|
|
|
+ if (res) {
|
|
|
+ let payLoad = {};
|
|
|
+ let { state } = this.form;
|
|
|
+ console.log(this.form);
|
|
|
+ if (this.isEdit) {
|
|
|
+ let { taskKey, taskNodeKey } = this.myFormData.resultMap;
|
|
|
+ payLoad.updateCommonEntityList = [
|
|
|
+ {
|
|
|
+ basicMap: {
|
|
|
+ tableName: "bpm_execute_node",
|
|
|
+ },
|
|
|
+ conditionMap: {
|
|
|
+ task_key: taskKey,
|
|
|
+ task_node_key: taskNodeKey,
|
|
|
+ },
|
|
|
+ commMap: {
|
|
|
+ task_node_other_state: state
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ } else {
|
|
|
+ payLoad.insertCommonEntityList = [
|
|
|
+ {
|
|
|
+ basicMap: {
|
|
|
+ tableName: "bpm_execute_node",
|
|
|
+ },
|
|
|
+ addListMap: [
|
|
|
+ {
|
|
|
+ task_node_other_state: state,
|
|
|
+ taskKey: this.row.benTaskProcessKey,
|
|
|
+ taskNodeKey: this.row.benTaskNodeKey,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ }
|
|
|
+ submitNodeForm(payLoad).then((response) => {
|
|
|
+ if (response.code == 200) {
|
|
|
+ this.$modal.msgSuccess("保存成功");
|
|
|
+ } else {
|
|
|
+ this.$modal.error("保存失败,请稍后再试");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async getFormData() {
|
|
|
+ return {
|
|
|
+ flag:true,
|
|
|
+ data:{}
|
|
|
+ }
|
|
|
+
|
|
|
+ let formData = {
|
|
|
+ flag: false,
|
|
|
+ msg: "",
|
|
|
+ };
|
|
|
+ try {
|
|
|
+ let valid = await this.$refs.form.validate();
|
|
|
+ if (valid) {
|
|
|
+ formData.flag = true;
|
|
|
+ formData.data = this.form;
|
|
|
+ return formData;
|
|
|
+ } else {
|
|
|
+ formData.msg = "表单校验异常,请规范填写表单数据";
|
|
|
+ return formData;
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ // console.log(error);
|
|
|
+ formData.msg = "表单校验异常,请规范填写表单数据";
|
|
|
+ return formData;
|
|
|
+ }
|
|
|
+ },
|
|
|
addTableRow() {
|
|
|
const newRow = {
|
|
|
name: "",
|
|
|
time: 0.25,
|
|
|
};
|
|
|
- this.tableData1.push(newRow);
|
|
|
+ this.tableData.push(newRow);
|
|
|
},
|
|
|
deleteTableRow(row) {
|
|
|
- const index = this.tableData1.indexOf(row);
|
|
|
+ const index = this.tableData.indexOf(row);
|
|
|
if (index !== -1) {
|
|
|
- this.tableData1.splice(index, 1);
|
|
|
+ this.tableData.splice(index, 1);
|
|
|
}
|
|
|
},
|
|
|
- saveTableRow(tableData1) {
|
|
|
+ saveTableRow(tableData) {
|
|
|
let item = "";
|
|
|
- for (let i = 0; i < this.tableData1.length; i++) {
|
|
|
- item += tableData1[i];
|
|
|
+ for (let i = 0; i < this.tableData.length; i++) {
|
|
|
+ item += tableData[i];
|
|
|
}
|
|
|
- this.tableData2 = this.item;
|
|
|
- this.tableData1 = [];
|
|
|
+ this.tableData = [];
|
|
|
},
|
|
|
handleChange(value) {
|
|
|
console.log(value);
|
|
@@ -158,13 +318,17 @@ export default {
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
.app-container {
|
|
|
+::v-deep .el-checkbox {
|
|
|
+ /* font-size: 8px; */
|
|
|
+ color: white;
|
|
|
+ }
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
justify-content: space-between;
|
|
|
.leftMessage {
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
- width: 180px;
|
|
|
+ width: 145px;
|
|
|
.list {
|
|
|
padding: 10px 0px;
|
|
|
span {
|
|
@@ -186,13 +350,13 @@ export default {
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
padding: 10px 20px;
|
|
|
- span {
|
|
|
- padding-right: 150px;
|
|
|
+ .list:first-child {
|
|
|
+ padding-right: 180px;
|
|
|
}
|
|
|
- p {
|
|
|
+ /* p {
|
|
|
padding-top: 5px;
|
|
|
font-size: 10px;
|
|
|
- }
|
|
|
+ } */
|
|
|
}
|
|
|
}
|
|
|
.button {
|
|
@@ -200,7 +364,7 @@ export default {
|
|
|
padding: 20px 0px;
|
|
|
.el-button {
|
|
|
width: 140px;
|
|
|
- background: none;
|
|
|
+ /* background: none; */
|
|
|
}
|
|
|
.el-button--info {
|
|
|
width: 80px;
|
|
@@ -216,8 +380,7 @@ export default {
|
|
|
.block {
|
|
|
text-align: center;
|
|
|
}
|
|
|
- }
|
|
|
- .footer {
|
|
|
+ .total {
|
|
|
display: inline-block;
|
|
|
flex-direction: row;
|
|
|
margin-top: 10px;
|
|
@@ -226,6 +389,8 @@ export default {
|
|
|
color: black;
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
</style>
|