|
|
@@ -21,29 +21,41 @@
|
|
|
<!-- <Search></Search> -->
|
|
|
<div class="content_box_tab">
|
|
|
<el-input
|
|
|
- style="width: 180px"
|
|
|
+ style="width: 160px"
|
|
|
clearable
|
|
|
v-model="name"
|
|
|
placeholder="请输入筛选项"
|
|
|
@input="seekInput"
|
|
|
/>
|
|
|
+ <el-button type="text" @click="updataTaskList">刷新</el-button>
|
|
|
<el-tabs
|
|
|
v-model="activeName"
|
|
|
type="card"
|
|
|
stretch
|
|
|
@tab-click="tabClickValue"
|
|
|
>
|
|
|
+ <!-- :render-content="renderContent"-->
|
|
|
<el-tab-pane label="工序" name="0">
|
|
|
- <el-tree
|
|
|
- :data="produceTaskList"
|
|
|
- :props="defaultProps"
|
|
|
- node-key="id"
|
|
|
- :highlight-current="true"
|
|
|
- @node-click="handleNodeClick"
|
|
|
- ref="taskListRef"
|
|
|
- >
|
|
|
- </el-tree>
|
|
|
-
|
|
|
+ <div class="custom-tree-node">
|
|
|
+ <el-tree
|
|
|
+ :data="produceTaskList"
|
|
|
+ :props="defaultProps"
|
|
|
+ node-key="id"
|
|
|
+ :highlight-current="true"
|
|
|
+ @node-click="handleNodeClick"
|
|
|
+ ref="taskListRef"
|
|
|
+ :key="treeKey"
|
|
|
+ >
|
|
|
+ <span class="custom-tree-node" slot-scope="{ node, data }">
|
|
|
+ <span>{{ node.label }}</span>
|
|
|
+ <span
|
|
|
+ style="color: red"
|
|
|
+ v-if="data.number != '0' && data.number"
|
|
|
+ >({{ data.number >= 100 ? '99+' : data.number }})</span
|
|
|
+ >
|
|
|
+ </span>
|
|
|
+ </el-tree>
|
|
|
+ </div>
|
|
|
<!--
|
|
|
v-loading="treeLoading"
|
|
|
:node-key="nodeKey"
|
|
|
@@ -54,6 +66,7 @@
|
|
|
v-bind="$attrs"
|
|
|
:default-expand-all="defaultExpandAll" -->
|
|
|
</el-tab-pane>
|
|
|
+
|
|
|
<!-- <el-tab-pane label="工位" name="second"> -->
|
|
|
<!-- <AssetTree @handleNodeClick="handleNodeClickNew" @setRootId="setRootId" id="0" :paramsType="'type'"
|
|
|
ref="treeList" eqDevice="sb" /> -->
|
|
|
@@ -145,6 +158,7 @@
|
|
|
<div class="top">
|
|
|
<!-- /工单列表 -->
|
|
|
<produceOrder
|
|
|
+ v-if="produceTaskList.length != 0"
|
|
|
@workSelect="workSelect"
|
|
|
@rowClick="rowClick"
|
|
|
ref="produceOrder"
|
|
|
@@ -237,12 +251,14 @@
|
|
|
ref="outsourcingListRef"
|
|
|
@outsourcingAdd="outsourcingAdd"
|
|
|
v-if="!isStep && !isOutsource && !isPleaseEntrust"
|
|
|
+ :chooseType="chooseType"
|
|
|
></outsourcingDetails>
|
|
|
<outsourcing
|
|
|
:outsourceFormVal="outsourceForm"
|
|
|
:taskName="taskObj.name"
|
|
|
@changePlugIn="changePlugIn"
|
|
|
@changeCancel="changeCancel"
|
|
|
+ :chooseType="chooseType"
|
|
|
v-if="isStep"
|
|
|
></outsourcing>
|
|
|
|
|
|
@@ -376,6 +392,7 @@
|
|
|
checkPleaseEntrust
|
|
|
} from '@/api/produce/index';
|
|
|
import prenatalExamination from './components/prenatalExamination/index.vue';
|
|
|
+ import { workorderPage2 } from '@/api/produce/workOrder.js';
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
|
@@ -421,6 +438,7 @@
|
|
|
arr: [],
|
|
|
arrTow: [],
|
|
|
produceTaskList: [],
|
|
|
+ taskDataList: [],
|
|
|
produceTaskInfo: null,
|
|
|
isType: '',
|
|
|
isStep: false,
|
|
|
@@ -468,7 +486,10 @@
|
|
|
{ label: '过程检测', action: 'Edit' },
|
|
|
{ label: '产后检查', action: 'Favorite' }
|
|
|
],
|
|
|
- isPreProductionResult: true
|
|
|
+ isPreProductionResult: true,
|
|
|
+ chooseType: '1',
|
|
|
+ isUpdataTask: false,
|
|
|
+ treeKey: '1'
|
|
|
};
|
|
|
},
|
|
|
|
|
|
@@ -654,6 +675,7 @@
|
|
|
v.newName = `${v.workCenterName}-${v.name}`;
|
|
|
});
|
|
|
this.produceTaskList = res;
|
|
|
+ this.taskDataList = res;
|
|
|
this.arr = JSON.parse(JSON.stringify(this.produceTaskList));
|
|
|
//默认选择第一个工序
|
|
|
if (this.produceTaskList?.length) {
|
|
|
@@ -665,10 +687,27 @@
|
|
|
});
|
|
|
this.produceTaskInfo = this.produceTaskList[0];
|
|
|
}
|
|
|
+ this.getTaskWorkNumber();
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
|
|
|
+ //获取工序下所有的工单集合
|
|
|
+ async getTaskWorkNumber() {
|
|
|
+ for (const [index, item] of this.taskDataList.entries()) {
|
|
|
+ await workorderPage2({
|
|
|
+ pageNum: 1,
|
|
|
+ size: 5000,
|
|
|
+ taskId: item.id
|
|
|
+ }).then((res) => {
|
|
|
+ this.taskDataList[index].number = res.count;
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ this.produceTaskList = this.taskDataList;
|
|
|
+ this.treeKey = Date.now();
|
|
|
+ },
|
|
|
+
|
|
|
// 获取工位
|
|
|
getFactoryworkstationPageList() {
|
|
|
factoryworkstationPage({ pageNum: 1, size: 99999999 }).then((res) => {
|
|
|
@@ -680,16 +719,30 @@
|
|
|
});
|
|
|
},
|
|
|
|
|
|
- changeCancel() {
|
|
|
+ changeCancel(activeType) {
|
|
|
this.isStep = false;
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.outsourcingListRef.getDataList(this.workData.list[0].code);
|
|
|
- });
|
|
|
+ this.chooseType = activeType;
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ // this.$refs.outsourcingListRef.getDataList(this.workData.list[0].code);
|
|
|
+ // });
|
|
|
+ if (this.chooseType == '1') {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.outsourcingListRef.getDataList(
|
|
|
+ this.workData.list[0].code
|
|
|
+ );
|
|
|
+ });
|
|
|
+ } else if (this.chooseType == '2') {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.outsourcingListRef.getPleaseData(
|
|
|
+ this.workData.list[0].code
|
|
|
+ );
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
closeForm() {
|
|
|
this.isOutsource = false;
|
|
|
- // this.isPleaseEntrust = false;
|
|
|
+ this.isPleaseEntrust = false;
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.outsourcingListRef.getDataList(this.workData.list[0].code);
|
|
|
});
|
|
|
@@ -697,12 +750,17 @@
|
|
|
outScucc() {
|
|
|
// this.operationType = null;
|
|
|
this.isOutsource = false;
|
|
|
- // this.isPleaseEntrust = false;
|
|
|
+ this.isPleaseEntrust = false;
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.outsourcingListRef.getDataList(this.workData.list[0].code);
|
|
|
});
|
|
|
},
|
|
|
|
|
|
+ updataTaskList() {
|
|
|
+ this.isUpdataTask = true;
|
|
|
+ this.getTaskList();
|
|
|
+ },
|
|
|
+
|
|
|
// 切换组件
|
|
|
async changePlugIn(e, index) {
|
|
|
if (index == '1') {
|
|
|
@@ -713,7 +771,11 @@
|
|
|
workOrderId: e.workOrderId,
|
|
|
quantity: e.formedNumLast
|
|
|
};
|
|
|
- const res = await checkOutsourceMaterial(req);
|
|
|
+
|
|
|
+ const URL =
|
|
|
+ index == '1' ? checkOutsourceMaterial : checkPleaseEntrust;
|
|
|
+
|
|
|
+ const res = await URL(req);
|
|
|
|
|
|
this.outObj = { ...res.data, ...this.outsourceForm, ...this.outObj };
|
|
|
|
|
|
@@ -740,6 +802,24 @@
|
|
|
}
|
|
|
},
|
|
|
|
|
|
+ renderContent(h, { node, data, store }) {
|
|
|
+ // Use createElement syntax instead of JSX
|
|
|
+ return h('span', { class: 'custom-tree-node' }, [
|
|
|
+ // h('span', node.label),
|
|
|
+ h(
|
|
|
+ 'el-badge',
|
|
|
+ {
|
|
|
+ props: {
|
|
|
+ value: data.number != '0' ? data.number : '',
|
|
|
+ max: 99
|
|
|
+ },
|
|
|
+ class: 'item'
|
|
|
+ },
|
|
|
+ [h('span', node.label)]
|
|
|
+ )
|
|
|
+ ]);
|
|
|
+ },
|
|
|
+
|
|
|
workSelect(data) {
|
|
|
this.workTaskId = data.list.length > 0 ? data.list[0].taskId : null;
|
|
|
this.workStepQueryParam.taskId =
|
|
|
@@ -1005,8 +1085,9 @@
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- outsourcingAdd() {
|
|
|
+ outsourcingAdd(type, activeName) {
|
|
|
this.getTaskInstanceByIdFn(this.workListIds[0]);
|
|
|
+ this.chooseType = activeName;
|
|
|
this.isStep = true;
|
|
|
},
|
|
|
|
|
|
@@ -1021,14 +1102,15 @@
|
|
|
this.outsourceForm = {
|
|
|
...res.data
|
|
|
};
|
|
|
- this.outsourceForm.name = this.taskObj.name + '委外';
|
|
|
+ // this.outsourceForm.name = this.taskObj.name + '委外';
|
|
|
this.isStep = false;
|
|
|
this.isOutsource = false;
|
|
|
+ this.isPleaseEntrust = false;
|
|
|
|
|
|
if (res.data.outsource) {
|
|
|
this.isType = '3';
|
|
|
console.log(this.workData, 'this.workData');
|
|
|
- if (!this.isStep && !this.isOutsource) {
|
|
|
+ if (!this.isStep && !this.isOutsource && !this.isPleaseEntrust) {
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.outsourcingListRef.getDataList(
|
|
|
this.workData.list[0].code
|
|
|
@@ -1437,4 +1519,19 @@
|
|
|
max-width: 500px;
|
|
|
backdrop-filter: blur(5px);
|
|
|
}
|
|
|
+
|
|
|
+ .custom-tree-node {
|
|
|
+ // position: absolute;
|
|
|
+ // flex: 1;
|
|
|
+ // display: flex;
|
|
|
+ // align-items: center;
|
|
|
+ // justify-content: space-between;
|
|
|
+ font-size: 14px;
|
|
|
+ padding-right: 8px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .item {
|
|
|
+ margin-top: 10px;
|
|
|
+ margin-right: 40px;
|
|
|
+ }
|
|
|
</style>
|