|
@@ -406,37 +406,67 @@ const linksRawModal = ref(false)
|
|
|
const linksRawModalClick = () => {
|
|
|
linksRawModal.value = true
|
|
|
}
|
|
|
-
|
|
|
+const linkNodeid=ref('')
|
|
|
//树被点击
|
|
|
const linksRawTreeClick = ({data}) => {
|
|
|
-
|
|
|
+ linkNodeid.value=data.primaryKeyId
|
|
|
+ getrawMaterialList()
|
|
|
}
|
|
|
|
|
|
|
|
|
//原材检测报告数据
|
|
|
const tableRawRef = ref(null)
|
|
|
const linksRawTableColumn = ref([
|
|
|
- {key:'key1', name: '报告编号'},
|
|
|
- {key:'key2', name: '试验项目名称'},
|
|
|
- {key:'key3', name: '工程部位及用途'},
|
|
|
- {key:'key4', name: '报告日期'}
|
|
|
+ {key:'reportNo', name: '报告编号'},
|
|
|
+ {key:'trialProjectName', name: '试验项目名称'},
|
|
|
+ {key:'projectPositionName', name: '工程部位及用途'},
|
|
|
+ {key:'reportDate', name: '报告日期'}
|
|
|
])
|
|
|
const linksRawTableData = ref([])
|
|
|
const linksRawTableLoading = ref(false)
|
|
|
|
|
|
//多选
|
|
|
const tableRawCheckedKeys = ref([]);
|
|
|
+const tableRawCheckedKeysid = ref('');
|
|
|
const linksRawTableSelection = (rows) => {
|
|
|
tableRawCheckedKeys.value = rows
|
|
|
-}
|
|
|
-
|
|
|
-const linksRawModalSave = () => {
|
|
|
-
|
|
|
+ let arr=[]
|
|
|
+ tableRawCheckedKeys.value.forEach((item)=>{
|
|
|
+ arr.push(item.id)
|
|
|
+ })
|
|
|
+ tableRawCheckedKeysid.value=arr.join()
|
|
|
+}
|
|
|
+
|
|
|
+const linksRawModalSave =async () => {
|
|
|
+ if(tableRawCheckedKeysid.value.length>0){
|
|
|
+ const { error, code, data } = await dataApi.rawMaterialSubmit({
|
|
|
+ id: dataId,
|
|
|
+ ids:tableRawCheckedKeysid.value,
|
|
|
+ projectId: projectId.value,
|
|
|
+ contractId: contractId.value,
|
|
|
+ primaryKeyId: nodeId,
|
|
|
+ type: authBtnTabKey.value,
|
|
|
+ })
|
|
|
+ if (!error && code === 200) {
|
|
|
+ window.$message?.success('操作成功')
|
|
|
+ tableRawCheckedKeys.value=[]
|
|
|
+ linksRawModal.value = false
|
|
|
+ tableRawRef.value?.clearSelection();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ window.$message?.warning(error)
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ window.$message?.warning('请选择要关联的报告')
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
//关闭原材检测报告
|
|
|
const linksRawModalClose = () => {
|
|
|
linksRawModal.value = false
|
|
|
+ linksRawTableData.value=[]
|
|
|
+ tableRawRef.value?.clearSelection();
|
|
|
}
|
|
|
|
|
|
|
|
@@ -498,7 +528,31 @@ const getLinksSampleData = async () => {
|
|
|
//searchForm.value.total = 0
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+//获取关联原材料检测报告
|
|
|
+const getrawMaterialList = async () => {
|
|
|
+ linksRawTableLoading.value = true
|
|
|
+ const { error, code, data } = await dataApi.rawMaterialList({
|
|
|
+ nodeId: linkNodeid.value,
|
|
|
+ contractId: contractId.value
|
|
|
+ })
|
|
|
+ //处理数据
|
|
|
+ linksRawTableLoading.value = false
|
|
|
+ if (!error && code === 200) {
|
|
|
+ linksRawTableData.value = getArrValue(data)
|
|
|
+ linksRawTableData.value.forEach((iten)=>{
|
|
|
+ if(iten.isRawMaterialRelation===1){
|
|
|
+ nextTick(()=>{
|
|
|
+ tableRawRef.value?.toggleRowSelection(iten,true);
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ //searchForm.value.total = data.total || 0
|
|
|
+ } else {
|
|
|
+ linksRawTableData.value = []
|
|
|
+ //searchForm.value.total = 0
|
|
|
+ }
|
|
|
+}
|
|
|
//多选
|
|
|
const tableSampleCheckedKeys = ref([]);
|
|
|
const linksSampleTableSelection = (rows) => {
|