|
@@ -29,7 +29,7 @@
|
|
<div class="hc-process-box" v-if="menuItem?.nodeType === 7 || menuItem?.nodeType === 11">
|
|
<div class="hc-process-box" v-if="menuItem?.nodeType === 7 || menuItem?.nodeType === 11">
|
|
<el-scrollbar>
|
|
<el-scrollbar>
|
|
<div class="process-item-box" v-for="(item,index) in processDataList">
|
|
<div class="process-item-box" v-for="(item,index) in processDataList">
|
|
- <div class="process-item">{{item.pathName}}</div>
|
|
|
|
|
|
+ <div class="process-item">{{item.path}}</div>
|
|
<HcIcon name="close-circle" fill class="process-icon" @click="deleProcess(index)"/>
|
|
<HcIcon name="close-circle" fill class="process-icon" @click="deleProcess(index)"/>
|
|
</div>
|
|
</div>
|
|
</el-scrollbar>
|
|
</el-scrollbar>
|
|
@@ -226,7 +226,6 @@ const getTheLogBusinessData = async (excelId, recordDate) => {
|
|
formArrData = [setFormDefaultData()]
|
|
formArrData = [setFormDefaultData()]
|
|
}
|
|
}
|
|
formLogDataList.value = formArrData
|
|
formLogDataList.value = formArrData
|
|
- console.log(formArrData)
|
|
|
|
getBussDataInfo()
|
|
getBussDataInfo()
|
|
}
|
|
}
|
|
|
|
|
|
@@ -318,25 +317,18 @@ const processNodeClick = () => {
|
|
const keys = processElTree.value.getCheckedKeys()
|
|
const keys = processElTree.value.getCheckedKeys()
|
|
const formIndex = formLogIndex.value
|
|
const formIndex = formLogIndex.value
|
|
const formData = formLogDataList.value[formIndex]
|
|
const formData = formLogDataList.value[formIndex]
|
|
- const linkTabIds = formData['']
|
|
|
|
-
|
|
|
|
- let NodesArr = []
|
|
|
|
|
|
+ const linkTabIds = getArrValue(formData?.linkTabIds)
|
|
for (let index = 0; index < keys.length; index++) {
|
|
for (let index = 0; index < keys.length; index++) {
|
|
let pathArr = [];
|
|
let pathArr = [];
|
|
let node = processElTree.value.getNode(keys[index]);
|
|
let node = processElTree.value.getNode(keys[index]);
|
|
getPathName(node, pathArr);
|
|
getPathName(node, pathArr);
|
|
- //path: item['pathName'],
|
|
|
|
- //primaryKeyId: item['primaryKeyId']
|
|
|
|
- NodesArr.push({
|
|
|
|
- primaryKeyId: keys[index],
|
|
|
|
- pathName: pathArr.join('/')
|
|
|
|
- })
|
|
|
|
- /*linkTabIds.push({
|
|
|
|
- path: item['pathName'],
|
|
|
|
- primaryKeyId: item['primaryKeyId']
|
|
|
|
- });*/
|
|
|
|
|
|
+ linkTabIds.push({
|
|
|
|
+ path: pathArr.join('/'),
|
|
|
|
+ primaryKeyId: keys[index]
|
|
|
|
+ });
|
|
}
|
|
}
|
|
- processDataList.value = NodesArr
|
|
|
|
|
|
+ formLogDataList.value[formIndex]['linkTabIds'] = linkTabIds
|
|
|
|
+ processDataList.value = linkTabIds
|
|
processNodeModal.value = false
|
|
processNodeModal.value = false
|
|
}
|
|
}
|
|
|
|
|
|
@@ -352,7 +344,12 @@ const getPathName = (node, pathArr) => {
|
|
|
|
|
|
//移除工序
|
|
//移除工序
|
|
const deleProcess = (index) => {
|
|
const deleProcess = (index) => {
|
|
- processDataList.value.splice(index, 1);
|
|
|
|
|
|
+ const formIndex = formLogIndex.value
|
|
|
|
+ const formData = formLogDataList.value[formIndex]
|
|
|
|
+ const linkTabIds = getArrValue(formData?.linkTabIds)
|
|
|
|
+ linkTabIds.splice(index, 1)
|
|
|
|
+ formLogDataList.value[formIndex]['linkTabIds'] = linkTabIds
|
|
|
|
+ processDataList.value = linkTabIds
|
|
}
|
|
}
|
|
|
|
|
|
//保存数据
|
|
//保存数据
|
|
@@ -366,9 +363,8 @@ const tableFormSaveClick = async () => {
|
|
|
|
|
|
//保存
|
|
//保存
|
|
const saveExcelBussData = async () => {
|
|
const saveExcelBussData = async () => {
|
|
- console.log(formLogDataList.value)
|
|
|
|
- let linkTabIds = setProcessData(); //处理工序ID
|
|
|
|
- if (linkTabIds) {
|
|
|
|
|
|
+ let isLinkTabIds = getLinkTabIds(); //处理工序ID
|
|
|
|
+ if (isLinkTabIds) {
|
|
tableFormSaveLoading.value = true
|
|
tableFormSaveLoading.value = true
|
|
const { error, code } = await queryApi.saveExcelBussData({
|
|
const { error, code } = await queryApi.saveExcelBussData({
|
|
dataInfo: {orderList: formLogDataList.value}
|
|
dataInfo: {orderList: formLogDataList.value}
|
|
@@ -385,19 +381,14 @@ const saveExcelBussData = async () => {
|
|
}
|
|
}
|
|
|
|
|
|
//处理工序数据
|
|
//处理工序数据
|
|
-const setProcessData = () => {
|
|
|
|
- let linkTabIds = [], {nodeType} = menuItem.value;
|
|
|
|
|
|
+const getLinkTabIds = () => {
|
|
|
|
+ let {nodeType} = menuItem.value;
|
|
if (nodeType === 7 || nodeType === 11) {
|
|
if (nodeType === 7 || nodeType === 11) {
|
|
- const nodes = processDataList.value || [];
|
|
|
|
- if (nodes.length > 0) {
|
|
|
|
- for (let i = 0; i < nodes.length; i++) {
|
|
|
|
- let item = nodes[i];
|
|
|
|
- linkTabIds.push({
|
|
|
|
- path: item['pathName'],
|
|
|
|
- primaryKeyId: item['primaryKeyId']
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- return linkTabIds
|
|
|
|
|
|
+ const formIndex = formLogIndex.value
|
|
|
|
+ const formData = formLogDataList.value[formIndex]
|
|
|
|
+ const linkTabIds = getArrValue(formData?.linkTabIds)
|
|
|
|
+ if (linkTabIds.length > 0) {
|
|
|
|
+ return true
|
|
} else {
|
|
} else {
|
|
window?.$message?.warning('请先关联工序')
|
|
window?.$message?.warning('请先关联工序')
|
|
return false
|
|
return false
|
|
@@ -436,23 +427,25 @@ const getBussPdfInfo = async () => {
|
|
|
|
|
|
//获取当前日志资料关联的工序节点信息
|
|
//获取当前日志资料关联的工序节点信息
|
|
const queryCurrentLogSelectProcessList = async (bid) => {
|
|
const queryCurrentLogSelectProcessList = async (bid) => {
|
|
- const { error, code, data, msg } = await queryApi.queryCurrentLogSelectProcessList({
|
|
|
|
- contractId: contractId.value || '',
|
|
|
|
- businessId: bid ?? ''
|
|
|
|
- }, false)
|
|
|
|
- //处理数据
|
|
|
|
- if (!error && code === 200) {
|
|
|
|
- let dataKeys = getArrValue(data), NodesArr = []
|
|
|
|
- for (let i = 0; i < dataKeys.length; i++) {
|
|
|
|
- NodesArr.push({
|
|
|
|
- primaryKeyId: dataKeys[i]?.primaryKeyId,
|
|
|
|
- pathName: dataKeys[i]?.path
|
|
|
|
- })
|
|
|
|
|
|
+ if (bid) {
|
|
|
|
+ const { error, code, data, msg } = await queryApi.queryCurrentLogSelectProcessList({
|
|
|
|
+ contractId: contractId.value || '',
|
|
|
|
+ businessId: bid ?? ''
|
|
|
|
+ }, false)
|
|
|
|
+ //处理数据
|
|
|
|
+ const formIndex = formLogIndex.value
|
|
|
|
+ if (!error && code === 200) {
|
|
|
|
+ let linkTabIds = getArrValue(data)
|
|
|
|
+ formLogDataList.value[formIndex]['linkTabIds'] = linkTabIds
|
|
|
|
+ processDataList.value = linkTabIds
|
|
|
|
+ } else {
|
|
|
|
+ processDataList.value = []
|
|
|
|
+ if(msg) window?.$message?.warning(msg)
|
|
}
|
|
}
|
|
- processDataList.value = NodesArr
|
|
|
|
} else {
|
|
} else {
|
|
- processDataList.value = []
|
|
|
|
- if(msg) window?.$message?.warning(msg)
|
|
|
|
|
|
+ const formIndex = formLogIndex.value
|
|
|
|
+ const formData = formLogDataList.value[formIndex]
|
|
|
|
+ processDataList.value = getArrValue(formData?.linkTabIds)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|