|
@@ -111,7 +111,7 @@
|
|
<el-link type="primary" @click="changeShowClick">添加</el-link>
|
|
<el-link type="primary" @click="changeShowClick">添加</el-link>
|
|
</template>
|
|
</template>
|
|
<div class="hc-table-ref-box no-border">
|
|
<div class="hc-table-ref-box no-border">
|
|
- <el-table class="w-full" :data="tableData1" row-key="id" height="100%" highlight-current-row border>
|
|
|
|
|
|
+ <el-table class="w-full" :data="tableData[tableIndex]?.formList" row-key="id" height="100%" highlight-current-row border>
|
|
<el-table-column type="index" label="序号" />
|
|
<el-table-column type="index" label="序号" />
|
|
<el-table-column prop="formNumber" label="清单编号" />
|
|
<el-table-column prop="formNumber" label="清单编号" />
|
|
<el-table-column prop="formName" label="清单名称" />
|
|
<el-table-column prop="formName" label="清单名称" />
|
|
@@ -162,7 +162,7 @@
|
|
import { nextTick, ref, watch } from 'vue'
|
|
import { nextTick, ref, watch } from 'vue'
|
|
import { useAppStore } from '~src/store'
|
|
import { useAppStore } from '~src/store'
|
|
import { getDictionaryData } from '~uti/tools'
|
|
import { getDictionaryData } from '~uti/tools'
|
|
-import { arrIndex, arrToKey, getArrValue, getObjValue, isNullES } from 'js-fast-way'
|
|
|
|
|
|
+import { arrIndex, arrToKey, getArrValue, getObjValue, isArray, isNullES } from 'js-fast-way'
|
|
|
|
|
|
//子组件
|
|
//子组件
|
|
import ChangeRequest from './changeRequest.vue'
|
|
import ChangeRequest from './changeRequest.vue'
|
|
@@ -318,39 +318,41 @@ const addChangeNode = async () => {
|
|
//删除变更申请部位
|
|
//删除变更申请部位
|
|
const delChangeNode = (index) => {
|
|
const delChangeNode = (index) => {
|
|
tableData.value.splice(index, 1)
|
|
tableData.value.splice(index, 1)
|
|
|
|
+ tableIndex.value = -1
|
|
}
|
|
}
|
|
|
|
|
|
//变更申请部位 行被点击
|
|
//变更申请部位 行被点击
|
|
const changeNodeItem = ref({})
|
|
const changeNodeItem = ref({})
|
|
-const tableData1 = ref([])
|
|
|
|
|
|
+const tableIndex = ref(-1)
|
|
const rowChangeNodeClick = ({ row, index }) => {
|
|
const rowChangeNodeClick = ({ row, index }) => {
|
|
- console.log(index)
|
|
|
|
|
|
+ if (!isArray(row.formList)) {
|
|
|
|
+ tableData.value[index].formList = []
|
|
|
|
+ }
|
|
|
|
+ tableIndex.value = index
|
|
changeNodeItem.value = row
|
|
changeNodeItem.value = row
|
|
- tableData1.value = getArrValue(row.formList)
|
|
|
|
}
|
|
}
|
|
|
|
|
|
//删除变更申请清单
|
|
//删除变更申请清单
|
|
const tableFormListDel = (index) => {
|
|
const tableFormListDel = (index) => {
|
|
- tableData1.value.splice(index, 1)
|
|
|
|
|
|
+ tableData.value[tableIndex.value].formList.splice(index, 1)
|
|
}
|
|
}
|
|
|
|
|
|
//变更清单的添加弹窗
|
|
//变更清单的添加弹窗
|
|
const isChangeShow = ref(false)
|
|
const isChangeShow = ref(false)
|
|
const changeIds = ref('')
|
|
const changeIds = ref('')
|
|
const changeShowClick = () => {
|
|
const changeShowClick = () => {
|
|
- const row = changeNodeItem.value
|
|
|
|
- if (isNullES(row.id)) {
|
|
|
|
|
|
+ if (isNullES(changeNodeItem.value['id'])) {
|
|
window.$message.warning('请先选择变更申请部位')
|
|
window.$message.warning('请先选择变更申请部位')
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
- changeIds.value = arrToKey(tableData1.value, 'id')
|
|
|
|
|
|
+ changeIds.value = arrToKey(tableData.value[tableIndex.value].formList, 'id')
|
|
isChangeShow.value = true
|
|
isChangeShow.value = true
|
|
}
|
|
}
|
|
|
|
|
|
//确认选择完成
|
|
//确认选择完成
|
|
const changeNodeFinish = (data) => {
|
|
const changeNodeFinish = (data) => {
|
|
- tableData1.value.push(...data)
|
|
|
|
-
|
|
|
|
|
|
+ tableData.value[tableIndex.value].formList.push(...data)
|
|
|
|
+ console.log(tableData.value)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|