|
@@ -300,7 +300,6 @@ onMounted(() => {
|
|
|
tabTypeKey.value = routerQuery?.tabTypeKey || '1'
|
|
|
const { title, mixRatioTestIds } = getObjValue(testTreeItem.value)
|
|
|
const info = getStoreValue('test-form') || {}
|
|
|
- console.log(info, 'info')
|
|
|
isMixRatioTestIds.value = !(!mixRatioTestIds || mixRatioTestIds <= 0)
|
|
|
listItemBaseData.value.contractId = contractId.value
|
|
|
listItemBaseData.value.trialProjectName = title
|
|
@@ -319,7 +318,6 @@ onMounted(() => {
|
|
|
if (info && info.projectPosition) {
|
|
|
|
|
|
defaultCheckarrIds.value = info.projectPosition.split(',')
|
|
|
- console.log(defaultCheckarrIds.value, 'defaultCheckarrIds.value')
|
|
|
defaultprojectPositionName.value = info?.projectPositionName
|
|
|
|
|
|
}
|
|
@@ -354,11 +352,9 @@ const tabTypeTab = ref([
|
|
|
{ key: '2', name: '报告单' },
|
|
|
])
|
|
|
const tabTypeChange = ({ key }) => {
|
|
|
- console.log(key, '切换key')
|
|
|
// console.log(ListItemRef.value?.getFormData(),'ListItemRef.value?.getFormData()');
|
|
|
tabTypeKey.value = key
|
|
|
let curform = ListItemRef.value?.getFormData()
|
|
|
- console.log(curform, 'curform')
|
|
|
setAllListData(curform)
|
|
|
if (listItemBaseData.value.detectionResult === '' && tabTypeKey.value == 2) {
|
|
|
window.$message?.warning('请选择报告单是否合格')
|
|
@@ -462,7 +458,6 @@ const getSearchNodeTables = async (newaddId) => {
|
|
|
const getSearchNodeTablesall = async (type, newaddId) => {
|
|
|
orgAlllistData.value = []
|
|
|
const isid = dataId.length > 0 ? dataId : nodeIdvalue.value || newaddId || ''
|
|
|
- console.log(isid, 'isid')
|
|
|
const { error, code, data } = await dataApi.searchNodeTables({
|
|
|
id: dataId.length > 0 ? dataId : nodeIdvalue.value || newaddId,
|
|
|
projectId: projectId.value,
|
|
@@ -498,8 +493,7 @@ const getSearchNodeTablesall = async (type, newaddId) => {
|
|
|
reportData.value.forEach((item) => {
|
|
|
let bussDataInfoTrialData = item.bussDataInfoTrial
|
|
|
if (bussDataInfoTrialData && Object.keys(bussDataInfoTrialData).length !== 0) {
|
|
|
- for (var key in bussDataInfoTrialData) {
|
|
|
- console.log(key, bussDataInfoTrialData[key])
|
|
|
+ for (let key in bussDataInfoTrialData) {
|
|
|
item[key] = bussDataInfoTrialData[key]
|
|
|
}
|
|
|
}
|
|
@@ -509,6 +503,7 @@ const getSearchNodeTablesall = async (type, newaddId) => {
|
|
|
}
|
|
|
} else {
|
|
|
// listItemData.value = []
|
|
|
+ // eslint-disable-next-line eqeqeq
|
|
|
if (type == 1) {
|
|
|
testData.value = []
|
|
|
alllistData.value = []
|
|
@@ -562,12 +557,11 @@ const upcheckTableId = (val) => {
|
|
|
}
|
|
|
const singSaveId = ref('')
|
|
|
const iscanclick = ref(true)
|
|
|
-const changeIscanclick = (id) => {
|
|
|
+const changeIscanclick = () => {
|
|
|
iscanclick.value = false
|
|
|
}
|
|
|
const changesingSaveId = (id) => {
|
|
|
singSaveId.value = id
|
|
|
- console.log(id, 'idsave')
|
|
|
}
|
|
|
//关联工程用途及部位 树
|
|
|
const linksRelateModal = ref(false)
|
|
@@ -613,7 +607,6 @@ const checkrelationId = ref([])
|
|
|
const checkrelationString = ref([])
|
|
|
const ElTreeRef = ref(null)
|
|
|
const divisionTreeCheck = (data1, data2) => {
|
|
|
- console.log(data2, 'data2')
|
|
|
checkrelationId.value = data2?.checkedNodes
|
|
|
}
|
|
|
const seaElTreeProps = ref({
|
|
@@ -790,10 +783,7 @@ const linksSampleModal = ref(false)
|
|
|
const linksSampleModalClick = () => {
|
|
|
linksSampleTableData.value = []
|
|
|
linksSampleModal.value = true
|
|
|
-
|
|
|
- console.log(positiondata.value, 'positiondata.value')
|
|
|
let FormData = ListItemRef.value?.getFormData()
|
|
|
- console.log(FormData, 'FormData')
|
|
|
formpositon.value = FormData
|
|
|
getKetarr()
|
|
|
|
|
@@ -814,7 +804,6 @@ const getKetarr = ()=>{
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
- console.log(rekey, 'rekey')
|
|
|
positonkey.value = rekey
|
|
|
}
|
|
|
const formname = ref('')
|
|
@@ -832,23 +821,17 @@ const clearinf = ()=>{
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
- console.log( sampledata.value, ' sampledata11111')
|
|
|
ListItemRef.value.changeSimpleInput( sampledata.value, checkTabId.value)
|
|
|
- }
|
|
|
- //2.表单工程部位有值,替换为工程部位的值
|
|
|
- else if (defaultCheckarrIds.value.length > 0) {
|
|
|
+ } else if (defaultCheckarrIds.value.length > 0) {
|
|
|
+ //2.表单工程部位有值,替换为工程部位的值
|
|
|
sampledata.value.forEach((ele)=>{
|
|
|
let arr = Object.keys(ele)
|
|
|
arr.forEach((ele1)=>{
|
|
|
if (ele1.indexOf('取样对应工程部位Key') !== -1) {
|
|
|
- console.log( ele[ele1], ' ele[ele1]')
|
|
|
- console.log(defaultprojectPositionName.value, 'defaultprojectPositionName.value')
|
|
|
ele[ele[ele1]] = defaultprojectPositionName.value
|
|
|
-
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
- console.log( sampledata.value, ' sampledata.value222222')
|
|
|
ListItemRef.value.changeSimpleInput( sampledata.value, checkTabId.value)
|
|
|
} else {
|
|
|
let rekey = []
|
|
@@ -857,12 +840,9 @@ const clearinf = ()=>{
|
|
|
arr.forEach((item)=>{
|
|
|
if (item.indexOf('取样对应') !== -1) {
|
|
|
rekey.push(ele['取样对应工程部位Key'])
|
|
|
-
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
-
|
|
|
-
|
|
|
formpositon.value.forEach((ele1)=>{
|
|
|
rekey.forEach((ele2)=>{
|
|
|
if (ele1[ele2]) {
|
|
@@ -877,25 +857,17 @@ const clearinf = ()=>{
|
|
|
arr.forEach((ele1)=>{
|
|
|
if (ele1.indexOf(item) !== -1) {
|
|
|
// ele[item]= formname.value
|
|
|
- if (formname.value.length > 0) {
|
|
|
- console.log(222223333)
|
|
|
- ele[item] = formname.value
|
|
|
- } else {
|
|
|
- console.log(454545)
|
|
|
- }
|
|
|
-
|
|
|
+ if (formname.value.length > 0) {
|
|
|
+ ele[item] = formname.value
|
|
|
+ } else {
|
|
|
+ console.log(454545)
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
- // console.log(formpositon.value,formpositon.value);
|
|
|
- console.log( sampledata.value, ' sampledata333333')
|
|
|
- ListItemRef.value.changeSimpleInput( sampledata.value, checkTabId.value)
|
|
|
+ ListItemRef.value.changeSimpleInput( sampledata.value, checkTabId.value)
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|
|
@@ -967,7 +939,6 @@ const getrawMaterialList = async () => {
|
|
|
nextTick(() => {
|
|
|
tableRawRef.value?.toggleRowSelection(iten, true)
|
|
|
})
|
|
|
-
|
|
|
}
|
|
|
})
|
|
|
//searchForm.value.total = data.total || 0
|
|
@@ -999,7 +970,7 @@ const linksSampleModalSave = async () => {
|
|
|
}
|
|
|
//获取关联取样信息key值
|
|
|
const getrecordsamplegetData = async () => {
|
|
|
- const { error, code, data } = await dataApi.recordsamplegetData({
|
|
|
+ const { data } = await dataApi.recordsamplegetData({
|
|
|
sampleIds: listItemBaseData.value.sampleIds,
|
|
|
nodePKeyId: routerQuery?.nodeId,
|
|
|
contractId: contractId.value,
|
|
@@ -1030,26 +1001,14 @@ const linksSampleModalClose = () => {
|
|
|
//保存
|
|
|
const tableFormSaveLoading = ref(false)
|
|
|
const tableFormSaveClick = async () => {
|
|
|
- // console.log(listItemBaseData.value,'.listItemBaseData.value');
|
|
|
-
|
|
|
//false是编辑
|
|
|
-
|
|
|
-
|
|
|
if (tabTypeKey.value === '2' && listItemBaseData.value.detectionResult === '') {
|
|
|
window.$message?.warning('请选择报告单是否合格')
|
|
|
} else {
|
|
|
- // let FormData = ListItemRef.value?.getFormData()
|
|
|
-
|
|
|
-
|
|
|
let FormData
|
|
|
|
|
|
let curform = ListItemRef.value?.getFormData()
|
|
|
setAllListData(curform)
|
|
|
- // alllistData.value.forEach((item)=>{
|
|
|
- // if(item.pKeyId===item1.pkeyId){
|
|
|
-
|
|
|
- console.log(orgAlllistData, 'orgAlllistData')
|
|
|
-
|
|
|
let operTrue = alllistData.value.filter(e => e.oper) //操作的数据
|
|
|
let types = []
|
|
|
operTrue.forEach(e => {
|
|
@@ -1062,14 +1021,10 @@ const tableFormSaveClick = async () => {
|
|
|
listItemBaseData.value.id = newId.value
|
|
|
}
|
|
|
if (isaddType) { //新增
|
|
|
- console.log('xinzeng')
|
|
|
if (setTypes.length > 1) {
|
|
|
- console.log(setTypes.length, 'setTypes.length222222')
|
|
|
FormData = alllistData.value
|
|
|
listItemBaseData.value.tableType = '1,2'
|
|
|
} else {
|
|
|
- console.log(setTypes.length, 'setTypes.length22222255555')
|
|
|
- console.log(afterAdd.value, 'afterAdd.value5')
|
|
|
// FormData = alllistData.value.filter(e => e.type == type);
|
|
|
if (!afterAdd.value) {
|
|
|
FormData = alllistData.value.filter(e => e.type == type)
|
|
@@ -1121,8 +1076,6 @@ const tableFormSaveClick = async () => {
|
|
|
listItemBaseData.value.tableType = '1,2'
|
|
|
}
|
|
|
|
|
|
- console.log(listItemBaseData.value.tableType, 'listItemBaseData.value.tableType ')
|
|
|
-
|
|
|
let notChangeData = []
|
|
|
if (setTypes.length == 0) { //没操作过页面数据
|
|
|
FormData = []
|
|
@@ -1132,7 +1085,6 @@ const tableFormSaveClick = async () => {
|
|
|
}
|
|
|
|
|
|
} else if (setTypes.length == 1) {// 操作过一边的数据
|
|
|
- console.log(FormData, 'FormData1操作过一边')
|
|
|
orgAlllistData.value.forEach((item1) => {
|
|
|
if (item1.tableType.toString() !== tabTypeKey.value) {
|
|
|
let data1 = {
|
|
@@ -1182,8 +1134,6 @@ const tableFormSaveClick = async () => {
|
|
|
}
|
|
|
|
|
|
let FormRegExpJson = ListItemRef.value?.getFormRegExpJson()
|
|
|
- console.log(isaddType, 'isaddType')
|
|
|
- console.log(FormData, 'FormData1111111111')
|
|
|
if (newId.value?.length > 0) {
|
|
|
isaddType = false
|
|
|
}
|
|
@@ -1222,9 +1172,11 @@ const tableFormSaveClick = async () => {
|
|
|
})
|
|
|
console.log( listItemBaseData.value.tableType, ' listItemBaseData.value.tableType')
|
|
|
console.log(FormData, 'lastFormData1')
|
|
|
- if (listItemBaseData.value.tableType && listItemBaseData.value?.tableType.length == 1 && newId.value?.length == 0) {
|
|
|
+ if (listItemBaseData.value.tableType && listItemBaseData.value?.tableType.length === 1 && newId.value?.length === 0) {
|
|
|
console.log('只要一边的数据')
|
|
|
- FormData = FormData.filter((ele)=>{
|
|
|
+ // eslint-disable-next-line array-callback-return
|
|
|
+ FormData = FormData.filter((ele) => {
|
|
|
+ // eslint-disable-next-line eqeqeq
|
|
|
if (ele.type == listItemBaseData.value.tableType) {
|
|
|
return ele
|
|
|
}
|
|
@@ -1261,25 +1213,12 @@ const tableFormSaveClick = async () => {
|
|
|
getSearchNodeTablesall(2)
|
|
|
afterAdd.value = true
|
|
|
isaddType = false
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- // toBackClick()
|
|
|
- // setTimeout(() => {
|
|
|
- // window?.location?.reload() //刷新页面
|
|
|
- // }, 1000);
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
getTableDataAll()
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
const setAllListData = (curform) => {
|