|
@@ -794,6 +794,7 @@ const delegationClick = () => {
|
|
|
}
|
|
|
delegateModal.value = true
|
|
|
editHtmlId.value = rows[0].id
|
|
|
+ entrustId.value = rows[0].entrustId
|
|
|
const { contractId } = deepClone(searchForm.value)
|
|
|
delegateContractId.value = contractId
|
|
|
if (!isNullES(contractId)) {
|
|
@@ -803,10 +804,11 @@ const delegationClick = () => {
|
|
|
|
|
|
//合同段被选择
|
|
|
const editHtmlId = ref('')
|
|
|
+const entrustId = ref('')
|
|
|
const delegateContractChange = async () => {
|
|
|
delegateHtmlLoading.value = true
|
|
|
- if (!isNullES(editHtmlId.value)) {
|
|
|
- await getDelegateDataInfo(editHtmlId.value)
|
|
|
+ if (!isNullES(entrustId.value)) {
|
|
|
+ await getDelegateDataInfo(entrustId.value)
|
|
|
}
|
|
|
await getDelegateExcelHtml()
|
|
|
delegateHtmlLoading.value = false
|
|
@@ -817,11 +819,10 @@ const getDelegateDataInfo = async (editId) => {
|
|
|
const { error, code, msg, data } = await samplingApi.getBussDataInfoTrialEntrust({
|
|
|
id: editId,
|
|
|
pkeyId: nodeErTreeId.value,
|
|
|
- projectId: projectId.value,
|
|
|
contractId: delegateContractId.value,
|
|
|
})
|
|
|
if (!error && code === 200) {
|
|
|
- delegateHtmlForm.value = getObjValue(data)
|
|
|
+ delegateHtmlForm.value = getObjValue(data[0])
|
|
|
} else {
|
|
|
delegateHtmlForm.value = {}
|
|
|
window.$message.error(msg || '获取委托信息失败')
|
|
@@ -851,6 +852,7 @@ const delegateHtmlRender = (form) => {
|
|
|
//创建委托
|
|
|
const creatingDelegateLoading = ref(false)
|
|
|
const creatingDelegate = async () => {
|
|
|
+ const rows = tableCheckedKeys.value
|
|
|
if (isNullES(delegateHtml.value)) {
|
|
|
window.$message.error('暂无委托单信息')
|
|
|
return
|
|
@@ -862,6 +864,8 @@ const creatingDelegate = async () => {
|
|
|
}
|
|
|
form.contractId = delegateContractId.value
|
|
|
form.nodeErTreeId = nodeErTreeId.value
|
|
|
+ form.sampleId = editHtmlId.value
|
|
|
+ form.nodeId = rows[0].nodeId
|
|
|
const { error, code, msg } = await commissionApi.htmlSave(form)
|
|
|
if (!error && code === 200) {
|
|
|
window.$message.success('创建成功')
|