|
@@ -252,7 +252,7 @@ import { getStoreValue, setStoreValue } from '~src/utils/storage'
|
|
|
import samplingApi from '~api/tentative/material/sampling'
|
|
|
import approachApi from '~api/tentative/material/approach'
|
|
|
import { getContractUserList, getDictionary } from '~api/other'
|
|
|
-import { arrIndex, arrToId, deepClone, formValidate, getArrValue, isNullES, isString } from 'js-fast-way'
|
|
|
+import { arrIndex, arrToId, deepClone, formValidate, getArrValue, getObjValue, isNullES, isString } from 'js-fast-way'
|
|
|
import { toPdfPage } from '~uti/btn-auth'
|
|
|
|
|
|
//变量
|
|
@@ -775,14 +775,45 @@ const delegateHtml = ref('')
|
|
|
const delegateHtmlForm = ref({})
|
|
|
const delegateHtmlLoading = ref(false)
|
|
|
const delegationClick = async () => {
|
|
|
+ const rows = tableCheckedKeys.value
|
|
|
+ if (rows.length <= 0) {
|
|
|
+ window.$message.warning('请先勾选一条需要委托的数据')
|
|
|
+ return
|
|
|
+ } else if (rows.length > 1) {
|
|
|
+ window.$message.warning('只能选择其中一条数据进行委托')
|
|
|
+ return
|
|
|
+ }
|
|
|
delegateModal.value = true
|
|
|
delegateHtmlLoading.value = true
|
|
|
+ await getDelegateExcelHtml()
|
|
|
+ await getDelegateDataInfo(rows[0])
|
|
|
+ delegateHtmlLoading.value = false
|
|
|
+}
|
|
|
+
|
|
|
+//获取委托数据
|
|
|
+const getDelegateDataInfo = async (row) => {
|
|
|
+ const { error, code, msg, data } = await samplingApi.getBussDataInfoTrialEntrust({
|
|
|
+ id: row.id,
|
|
|
+ pkeyId: nodeErTreeId.value,
|
|
|
+ projectId: projectId.value,
|
|
|
+ contractId: contractId.value,
|
|
|
+ })
|
|
|
+ if (!error && code === 200) {
|
|
|
+ console.log(data)
|
|
|
+ delegateHtmlForm.value = getObjValue(data)
|
|
|
+ } else {
|
|
|
+ delegateHtmlForm.value = {}
|
|
|
+ window.$message.error(msg || '获取委托信息失败')
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+//获取委托html
|
|
|
+const getDelegateExcelHtml = async () => {
|
|
|
const { error, code, msg, data } = await samplingApi.getExcelHtml({
|
|
|
primaryKeyId: nodeErTreeId.value,
|
|
|
projectId: projectId.value,
|
|
|
contractId: contractId.value,
|
|
|
})
|
|
|
- delegateHtmlLoading.value = false
|
|
|
if (!error && code === 200) {
|
|
|
delegateHtml.value = isString(data) ? data : ''
|
|
|
} else {
|