123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836 |
- <template>
- <hc-body split :project-nmae="projectInfo?.projectName">
- <template #tree>
- <TestTree
- :auto-expand-keys="treeAutoExpandKeys" :project-id="projectId" :tenant-id="userInfo?.tenant_id"
- :wbs-temp-id="projectInfo?.referenceWbsTemplateIdTrial" :wbs-type="2" :entrust="1"
- @node-tap="wbsElTreeClick"
- />
- </template>
- <hc-new-card w-to="1919">
- <template #headerToSearch>
- <div class="w-50">
- <el-select v-model="searchForm.contractId" placeholder="选择合同段" filterable block>
- <el-option v-for="item in contractData" :key="item.id" :label="item.contractName" :value="item.id" />
- </el-select>
- </div>
- <div class="ml-2 w-40">
- <el-select v-model="searchForm.status" placeholder="委托单状态" filterable clearable block>
- <el-option v-for="item in entrustStatus" :key="item.value" :label="item.label" :value="item.value" />
- </el-select>
- </div>
- <div class="ml-2 w-350px">
- <hc-search-input v-model="searchForm.entrustName" @search="searchClick" />
- </div>
- </template>
- <template #extraToHeader>
- <hc-tooltip keys="tentative_detect_commission_add">
- <el-button hc-btn type="primary" @click="addFormData">
- <hc-icon name="add-circle" />
- <span>新增</span>
- </el-button>
- </hc-tooltip>
- <el-button :disabled="tableCheckedKeys.length <= 0" :loading="signLoading" hc-btn type="primary" @click="resignClick">re-sign</el-button>
-
- <hc-tooltip keys="tentative_detect_commission_repeal">
- <el-button hc-btn type="danger" :disabled="tableCheckedKeys.length <= 0" @click="repealFormData">
- <hc-icon name="arrow-go-back" />
- <span>废除</span>
- </el-button>
- </hc-tooltip>
-
- <hc-tooltip keys="tentative_detect_commission_del">
- <el-button v-del-com:[delModalClick] :disabled="tableCheckedKeys.length <= 0" hc-btn type="danger">
- <hc-icon name="delete-bin-2" />
- <span>删除</span>
- </el-button>
- </hc-tooltip>
- <hc-tooltip keys="tentative_material_commission_prin">
- <el-button :disabled="tableCheckedKeys.length <= 0" hc-btn color="#567722" @click="batchPrinting">
- <hc-icon name="printer" />
- <span>批量打印</span>
- </el-button>
- </hc-tooltip>
- <hc-tooltip keys="tentative_detect_commission_report">
- <el-button :disabled="tableCheckedKeys.length <= 0" class="text-white" hc-btn color="#FF976A" @click="reportClick">
- <HcIcon name="send-plane-2" />
- <span>上报</span>
- </el-button>
- </hc-tooltip>
- <hc-tooltip keys="tentative_material_commission_null">
- <el-button hc-btn color="#567722" @click="printerNull">
- <hc-icon name="printer" />
- <span>打印空表</span>
- </el-button>
- </hc-tooltip>
- </template>
- <hc-table
- :column="tableColumn" :datas="tableData" :loading="tableLoading" is-check
- :index-style="{ width: 60 }" :check-style="{ width: 29 }" @selection-change="tableSelection"
- >
- <template #status="{ row }">
- <el-tag v-if="row.status === 1" type="info" effect="dark">未上报</el-tag>
- <el-tag v-if="row.status === 2" type="warning" effect="dark">已上报-待审批</el-tag>
- <el-tag v-if="row.status === 3" type="primary" effect="dark">待试验</el-tag>
- <el-tag v-if="row.status === 4" type="success" effect="dark">委托完成</el-tag>
- </template>
- <template #action="{ row }">
- <hc-tooltip keys="tentative_material_commission_edit">
- <el-link v-if="row.status === 1" v-loading="row.rowLoad" type="primary" @click="rowEdit(row)">修改</el-link>
- <el-link v-else type="success" @click="rowView(row)">查看</el-link>
- </hc-tooltip>
- <hc-tooltip keys="tentative_material_commission_fill">
- <el-link v-if="row.status === 4" type="info" disabled>创建成功</el-link>
- <el-link v-else-if="!isNullES(row.testId)" type="danger" :disabled="row.status !== 3" @click="rowFillReports(row)">填写报告</el-link>
- <el-link v-else type="danger" :disabled="row.status !== 3" @click="rowReports(row)">创建报告</el-link>
- </hc-tooltip>
- </template>
- </hc-table>
- <template #action>
- <hc-pages :pages="searchForm" @change="pageChange" />
- </template>
- </hc-new-card>
- <!-- 新增委托 -->
- <hc-new-dialog v-model="delegateModal" ui="hc-delegate-html-modal" is-footer-center is-table :title="`${editHtmlId ? '修改' : '新增'}委托`" widths="60rem" @close="delegateModalClose">
- <div class="hc-delegate-contract hc-flex h-40px">
- <el-select v-model="delegateContractId" placeholder="请先选择合同段" filterable class="w-400px" @change="delegateContractChange">
- <el-option v-for="item in contractData" :key="item.id" :label="item.contractName" :value="item.id" />
- </el-select>
- </div>
- <div class="hc-delegate-html" :class="delegateContractId ? 'is-show' : ''">
- <hc-table-form ref="htmlRef" :pkey="nodeErTreeId" :form="delegateHtmlForm" :html="delegateHtml" :loading="delegateHtmlLoading" @render="delegateHtmlRender" />
- </div>
- <template #footer>
- <el-button @click="delegateModalClose">取消</el-button>
- <el-button hc-btn type="warning" @click="linkSamplingModal = true">关联取样材料</el-button>
- <el-button v-if="editHtmlId" hc-btn type="primary" @click="creatingDelegate">保存</el-button>
- <el-button v-else hc-btn type="primary" :loading="creatingDelegateLoad" @click="creatingDelegate">创建</el-button>
- </template>
- </hc-new-dialog>
- <!-- 关联取样材料 -->
- <SamplingPage v-model="linkSamplingModal" v-model:id="delegateHtmlForm.sampleId" :cid="searchForm.contractId" @change="linkSamplingChange" />
- <!-- 创建报告 -->
- <hc-new-dialog v-model="rowActionModal" is-footer-center title="创建报告" widths="40rem" @close="rowActionModalClose">
- <el-form ref="formRef" :model="formModel" :rules="formRules" label-position="top" label-width="auto">
- <el-row :gutter="20">
- <el-col :span="12">
- <el-form-item label="委托单位:">
- <el-input v-model="formModel.entrustInfo" placeholder="委托单位" disabled />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="委托单位名称:">
- <el-input v-model="formModel.entrustName" placeholder="委托单位名称" disabled />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="取样名称:">
- <el-input v-model="formModel.materialName" placeholder="取样名称" disabled />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="取样数量:">
- <el-input v-model="formModel.materialCount" placeholder="取样数量" disabled />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="样品编号:">
- <el-input v-model="formModel.entrustNo" placeholder="样品编号" disabled />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="试验数量:" prop="expCount">
- <el-input v-model="formModel.expCount" placeholder="试验数量" />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="规格型号:">
- <el-input v-model="formModel.specificationModel" placeholder="规格型号" disabled />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="计算单位:">
- <el-input v-model="formModel.calculationUnit" placeholder="计算单位" disabled />
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <template #footer>
- <el-button @click="rowActionModalClose">取消</el-button>
- <el-button hc-btn type="primary" :loading="rowActionLoading" @click="rowActionSave">创建</el-button>
- </template>
- </hc-new-dialog>
- <!-- 上报审批 -->
- <hc-report-modal
- :show="showReportModal"
- :classify-type="classifyType"
- :addition="reportAddition"
- :contract-id="contractId"
- :ids="reportIds"
- :project-id="projectId"
- :task-name="reportTaskName"
- :trial-self-inspection-record-id="2"
- title="上报审批" type="wbs"
- url="informationWriteQuery/batchTask"
- @finish="showReportFinish"
- @hide="hideReport"
- />
- </hc-body>
- <!-- 一键重签弹窗 -->
- <hc-new-dialog v-model="resignModal" title="一键重签" widths="38rem" :loading="signLoading" @close="cancelresign" @save="signClick">
- <div>
- 是否重新生成pdf:
- <el-radio-group v-model="resignModalRadio">
- <el-radio :value="2">否</el-radio>
- <el-radio :value="1">是</el-radio>
- </el-radio-group>
- </div>
- </hc-new-dialog>
- </template>
- <script setup>
- import { onActivated, onMounted, ref } from 'vue'
- import { useAppStore } from '~src/store'
- import { useRouter } from 'vue-router'
- import { getStoreValue, setStoreValue } from '~src/utils/storage'
- import { arrToId, deepClone, formValidate, getArrValue, getObjVal, getObjValue, isNullES, isString } from 'js-fast-way'
- import { toPdfPage } from '~uti/btn-auth'
- import { getDictionaryData } from '~uti/tools'
- import { getErtractInfo } from '~api/other'
- import mainApi from '~api/tentative/detect/commission'
- import samplingApi from '~api/tentative/material/sampling'
- import TestTree from '~src/views/tentative/material/components/TestTree.vue'
- import SamplingPage from './commission/sampling.vue'
- import wbsApi from '~api/data-fill/wbs'
- import dataApi from '~api/basic/code'
- //变量
- const router = useRouter()
- const useAppState = useAppStore()
- const userInfo = ref(useAppState.getUserInfo)
- const projectId = ref(useAppState.getProjectId)
- const contractId = ref(useAppState.getContractId)
- const projectInfo = ref(useAppState.getProjectInfo)
- const contractInfo = ref(useAppState.getContractInfo)
- //渲染完成
- onActivated(() => {
- getContractData()
- getEntrustStatusData()
-
- })
- //搜索表单
- const searchForm = ref({ entrustName: null, current: 1, size: 20, total: 0 })
- //自动展开缓存
- const treeAutoExpandKeys = ref(getStoreValue('testTreeExpandKeys') || [])
- //树被点击
- const nodeDataInfo = ref({})
- const nodeErTreeId = ref('')
- const wbsElTreeClick = ({ data, keys }) => {
- nodeDataInfo.value = data
- //nodeErTreeId.value = data['erTreeId'] || ''
- //缓存自动展开
- treeAutoExpandKeys.value = keys
- setStoreValue('testTreeExpandKeys', keys)
- searchForm.value.nodeId = data['primaryKeyId'] || ''
- //获取表格
- searchClick()
- }
- //获取合同段信息
- const contractData = ref([])
- const getContractData = async () => {
- const { data } = await getErtractInfo({
- projectId: projectId.value,
- contractId: contractId.value,
- })
- const res = getArrValue(data)
- contractData.value = res
- if (res.length <= 0) return
- let cid
- for (let i = 0; i < res.length; i++) {
- if (contractId.value == res[i].id) {
- cid = res[i].id
- }
- }
- searchForm.value.contractId = isNullES(cid) ? res[0].id : cid
- }
- //获取状态
- const entrustStatus = ref([])
- const getEntrustStatusData = async () => {
- entrustStatus.value = await getDictionaryData('entrust_status', true)
- }
- //搜索
- const searchClick = () => {
- searchForm.value.current = 1
- getTableData()
- }
- //分页被点击
- const pageChange = ({ current, size }) => {
- searchForm.value.current = current
- searchForm.value.size = size
- getTableData()
- }
- //表格数据
- const tableData = ref([])
- const tableColumn = ref([
- { key: 'entrustInfo', name: '委托单位' },
- { key: 'entrustNo', name: '委托单编号' },
- { key: 'entrustName', name: '委托单名称' },
- { key: 'materialName', name: '关联材料名称' },
- { key: 'status', name: '委托单状态', width: 120, align: 'center' },
- { key: 'action', name: '操作', width: 120, align: 'center', fixed: 'right' },
- ])
- //获取数据
- const tableLoading = ref(false)
- const getTableData = async () => {
- tableLoading.value = true
- const { error, code, data } = await mainApi.page(searchForm.value)
- //处理数据
- tableLoading.value = false
- if (!error && code === 200) {
- tableData.value = getArrValue(data['records'])
- searchForm.value.total = data.total || 0
- } else {
- tableData.value = []
- searchForm.value.total = 0
- }
- }
- //多选
- const tableCheckedKeys = ref([])
- const tableSelection = (rows) => {
- tableCheckedKeys.value = rows
- }
- //删除
- const delModalClick = async (_, resolve) => {
- const rows = tableCheckedKeys.value
- if (rows.length <= 0) {
- window.$message.warning('请先勾选需要删除的数据')
- return
- }
- const { error, code, msg } = await mainApi.remove(arrToId(rows))
- resolve()
- if (!error && code === 200) {
- window.$message.success('删除成功')
- getTableData().then()
- } else {
- window.$message.error(msg || '删除失败')
- }
- }
- //委托单变量
- const htmlRef = ref(null)
- const delegateHtml = ref('')
- const delegateHtmlForm = ref({})
- const delegateHtmlLoading = ref(false)
- const delegateContractId = ref(null)
- //新增
- const delegateModal = ref(false)
- const addFormData = () => {
- if ( !searchForm.value.nodeId) {
- window.$message.warning('请先选择节点')
- return
- }
- delegateModal.value = true
- editHtmlId.value = ''
- const { contractId } = deepClone(searchForm.value)
- delegateContractId.value = contractId
- if (!isNullES(contractId)) {
- delegateContractChange()
- }
- }
- //合同段被选择
- const delegateContractChange = async () => {
- delegateHtmlLoading.value = true
- //await getDelegateDataInfo(editHtmlId.value)
-
- await getDelegateExcelHtml()
- getMaterialNumber()
- delegateHtmlLoading.value = false
- }
- //获取委托单编号
- const backObj = ref({})
- const getMaterialNumber = async () => {
- const { error, code, data } = await dataApi.getEntrustNumber({
- contractId: contractId.value,
- pkeyId: searchForm.value.nodeId,
- })
- //处理数据
-
- if (!error && code === 200) {
- backObj.value = getObjVal(data)
- let mergedObject = null
- // 合并对象并赋值给新对象
- if (Object.keys(backObj.value).length > 0 && Object.keys(delegateHtmlForm.value).length > 0) {
- mergedObject = { ...backObj.value, ...delegateHtmlForm.value }
- } else if (Object.keys(backObj.value).length > 0) {
- mergedObject = { ...backObj.value }
- } else if (Object.keys(delegateHtmlForm.value).length > 0) {
- mergedObject = { ...delegateHtmlForm.value }
- } else {
- mergedObject = {}
- }
- // 可以在这里使用 mergedObject.value
- delegateHtmlForm.value = mergedObject
-
- } else {
- backObj.value = {}
- }
- }
- //获取委托html
- const getDelegateExcelHtml = async () => {
- const { error, code, msg, data } = await samplingApi.getExcelHtml({
- nodeId: searchForm.value.nodeId,
- contractId: contractId.value,
- })
- if (!error && code === 200) {
- delegateHtml.value = isString(data) ? data : ''
- nodeErTreeId.value = msg === '未知错误' ? null : msg
- } else {
- delegateHtml.value = ''
- window.$message.error(msg || '获取委托信息失败')
- }
- }
- //关联材料选择
- const cancelRowData = ref({})
- const linkSamplingChange = async ({ id, entrustId }, cancelRow) => {
- await getDelegateExcelHtml()
- if (!id) {
- cancelRowData.value = cancelRow
- await getCancelRow( cancelRow)
- await getDelegateDataInfo('', cancelRow.entrustId, null)
- } else {
- await getDelegateDataInfo(id, entrustId, delegateHtmlForm.value)
- }
-
-
-
- }
- //取消关联取样
- const getCancelRow = async (cancelRow) => {
-
- const { error, code, msg, data } = await samplingApi.cancelSample({
- groupId: cancelRow.entrustId,
- sampleId1: cancelRow.id,
- pkeyId: nodeErTreeId.value,
- contractId: delegateContractId.value,
- })
-
- }
- //获取委托数据
- const getDelegateDataInfo = async (id, entrustId, formData) => {
- const { primaryKeyId } = nodeDataInfo.value
- const { error, code, msg, data } = await samplingApi.getBussDataInfoTrialEntrust({
- id: entrustId,
- sampleId: id,
- pkeyId: nodeErTreeId.value,
- projectId: projectId.value,
- contractId: delegateContractId.value,
- nodeId: primaryKeyId,
- formData: JSON.stringify(formData),
-
- })
- if (!error && code === 200) {
- delegateHtmlForm.value = getObjValue(data[0])
- } else {
- delegateHtmlForm.value = {}
- window.$message.error(msg || '获取委托信息失败')
- }
- }
- //委托单html渲染完成
- const delegateHtmlRender = (form) => {
- delegateHtmlForm.value = form
- }
- //修改
- const editHtmlId = ref('')
- const rowEdit = async (row) => {
- editHtmlId.value = row.id
- const { contractId } = deepClone(searchForm.value)
- delegateContractId.value = contractId
- if (!isNullES(contractId)) {
- // delegateContractChange()
- row.rowLoad = true
- delegateHtmlLoading.value = true
-
- await getDelegateExcelHtml()
- await getDelegateDataInfo('', row.id)
-
- row. rowLoad = false
- delegateHtmlLoading.value = false
- delegateModal.value = true
- }
- }
- //关联取样材料
- const linkSamplingModal = ref(false)
- //创建委托
- const creatingDelegateLoad = ref(false)
- const creatingDelegate = async () => {
- if (isNullES(delegateHtml.value)) {
- window.$message.error('暂无委托单信息')
- return
- }
- const form = delegateHtmlForm.value
- if (isNullES(delegateContractId.value)) {
- window.$message.warning('请先选择合同段')
- return
- }
- // const { title } = nodeDataInfo.value
- // let isCan = (title === '回弹法检测混凝土抗压强度' || title === '路基压实度' || title === '地基承载力' || title === '路基路面弯沉' || title === '锚杆' || title === '喷射混凝土厚度')
- // if (isNullES(form.sampleId) && !isCan ) {
- // window.$message.warning('请先关联取样材料')
- // return
- // }
- const { nodeType } = nodeDataInfo.value
- if (nodeType !== 51 && isNullES(form.sampleId)) {
- window.$message.warning('请先关联取样材料')
- return
- }
- //修改时的id
- if (!isNullES(editHtmlId.value)) {
- form.id = editHtmlId.value
- }
- //处理数据
- const { primaryKeyId } = nodeDataInfo.value
- form.contractId = delegateContractId.value
- form.nodeErTreeId = nodeErTreeId.value
- form.nodeId = primaryKeyId
- form.autoIncrementNumber = backObj.value.autoIncrementNumber
- form.trialNumber = backObj.value.trialNumber
- //发起请求
- creatingDelegateLoad.value = true
- const { error, code, msg } = await mainApi.htmlSave(form)
- creatingDelegateLoad.value = false
- if (!error && code === 200) {
- window.$message.success('创建成功')
- delegateModalClose()
- getTableData().then()
- } else {
- window.$message.error(msg || '创建失败')
- }
- }
- //关闭委托
- const delegateModalClose = () => {
- delegateModal.value = false
- delegateHtmlForm.value = {}
- delegateHtml.value = ''
- delegateContractId.value = null
- delegateHtmlLoading.value = false
- }
- //查看
- const rowView = ({ entrustEPdf, entrustPdf }) => {
- if (isNullES(entrustPdf) && isNullES(entrustEPdf)) {
- window.$message.warning('暂无PDF数据')
- return
- }
- if (!isNullES(entrustEPdf)) {
- toPdfPage(entrustEPdf)
- } else if (!isNullES(entrustPdf)) {
- toPdfPage(entrustPdf)
- }
- }
- //表单数据
- const formRef = ref(null)
- const formModel = ref({})
- const formRules = {
- expCount: {
- required: true,
- trigger: 'blur',
- message: '请填写试验数量',
- },
- }
- //创建报告
- const rowActionModal = ref(false)
- const creatRow = ref({})
- const rowReports = async (row) => {
- rowActionModal.value = true
- const { data } = await mainApi.detail(row.id)
- formModel.value = getObjValue(data)
- creatRow.value = row
- }
- //提交保存
- const rowActionLoading = ref(false)
- const rowActionSave = async () => {
- const isForm = await formValidate(formRef.value)
- if (!isForm) return
- rowActionLoading.value = true
- const { contractType } = contractInfo.value
- const { expCount } = formModel.value
- const { primaryKeyId } = nodeDataInfo.value
- setStoreValue('testTreeItem', nodeDataInfo.value)
- setStoreValue('prenodeDataInfo', nodeDataInfo.value)
- const { repealType, sampleStatus, id } = creatRow.value
- const { error, code, msg } = await mainApi.update({ id, expCount, repealType, sampleStatus })
- if (!error && code === 200) {
- window.$message.success('创建成功')
- rowActionLoading.value = false
- rowActionModalClose()
- router.push({
- path: '/tentative/detect/test-form',
- query: {
- nodeId: primaryKeyId || '',
- dataType: contractType > 0 ? contractType + '' : '1',
- commissionId: id,
- cid: searchForm.value?.contractId,
- isaddType: true,
- },
- }).then()
- } else {
- rowActionLoading.value = false
- window.$message.error(msg || '创建失败')
- }
- }
- //关闭弹窗
- const rowActionModalClose = () => {
- rowActionModal.value = false
- formModel.value = {}
- }
- //填写报告
- const rowFillReports = async ({ id, testId }) => {
- const { error, code, data, msg } = await mainApi.selfDetail(testId)
- if (!error && code === 200) {
- const res = getObjValue(data)
- setStoreValue('test-form', res)
- setStoreValue('testTreeItem', nodeDataInfo.value)
- setStoreValue('prenodeDataInfo', nodeDataInfo.value)
- router.push({
- path: '/tentative/detect/test-form',
- query: {
- id: testId,
- nodeId: res.nodeId,
- dataType: res.type,
- commissionId: id,
- tabTypeKey: 1,
- cid: searchForm.value?.contractId,
- },
- }).then()
- } else {
- window.$message.error(msg || '操作失败')
- }
- }
- //批量打印
- const batchPrinting = () => {
- }
- //上报
- const classifyType = ref('')
- const reportIds = ref('')
- const reportTaskName = ref('')
- const showReportModal = ref(false)
- const reportAddition = ref({})
- const reportClick = async () => {
- const rows = tableCheckedKeys.value
- if (rows.length <= 0) {
- window.$message.warning('请先勾选一条需要上报的数据')
- return
- }
- //判断状态
- const { status, entrustName } = { ...rows[0] }
- if (status !== 1) {
- window.$message.warning('只能选择未上报的数据进行上报')
- return
- }
- // 委托单上报设置为1
- classifyType.value = '1'
- //其它数据
- // reportIds.value = rows[0].id //数据ID
- reportIds.value = arrToId(rows) //数据ID
-
- // reportTaskName.value = entrustName //任务名称
- //附加数据
- const { contractIdRelation } = nodeDataInfo.value
- reportAddition.value = {
- taskType: '1', //用来区分委托单
- classify: classifyType.value,
- contractIdRelation: contractIdRelation,
- }
- //请求文件题名
- const { data } = await wbsApi.queryDocumentTitle({
- // primaryKeyId: info['primaryKeyId'],
- primaryKeyId: rows[0].id,
- classify: '1',
- })
- reportTaskName.value = isString(data) ? data : ''
- //显示任务上报
- showReportModal.value = true
- }
- //上报完成
- const showReportFinish = () => {
- hideReport()
- getTableData()
- }
- //关闭上报弹窗
- const hideReport = () => {
- showReportModal.value = false
- classifyType.value = ''
- reportAddition.value = {}
- reportIds.value = ''
- reportTaskName.value = ''
- }
- //打印空表
- const printerNull = () => {
- }
- //废除
- const repealFormData = async ()=>{
- const rows = tableCheckedKeys.value
- if (rows.length <= 0) {
- window.$message.warning('请先勾选需要废除的数据')
- return
- }
- //判断是否满足条件
- const result = rows.every(({ status, expCount }) => {
- return status === 2 && expCount === 0 || status === 2 && expCount === null || status === 3 && expCount === null || status === 3 && expCount === 0
- })
- if (!result) return window.$message.warning('所选择的数据不能进行废除操作')
- const { error, code, msg } = await mainApi.annul({ id:arrToId(rows) })
- if (!error && code === 200) {
- window.$message.success(msg)
- getTableData().then()
- } else {
- window.$message.error(msg || '删除失败')
- }
- }
- //一键重签
- //一键重签
- const signLoading = ref(false)
- const resignModal = ref(false)
- const resignModalRadio = ref(1)
- const resignClick = async ()=>{
- const rows = tableCheckedKeys.value
- if (rows.length <= 0) {
- window.$message?.warning('请先勾选已审批的数据')
- return
- }
- resignModal.value = true
- }
- const signClick = async () => {
- const rows = tableCheckedKeys.value
- const { primaryKeyId } = nodeDataInfo.value
- let objArr = []
- rows.forEach((item)=>{
- objArr.push({
- // taskId:item.taskId || '',
- entrustId:item.id,
- type:resignModalRadio.value,
- nodeId:primaryKeyId,
- contractId: contractId.value,
- status:item.status,
- })
- })
-
- //发起请求
- signLoading.value = true
- const { error, code, msg } = await mainApi.reSigningEntrust(objArr)
- //处理数据
- signLoading.value = false
- if (!error && code === 200) {
- window.$message?.success(msg ?? '提交成功,请请耐心等待重签,可继续操作其它的功能。')
- getTableData().then()
- } else {
- window.$message?.error(msg ?? '操作失败')
- }
- resignModal.value = false
- }
- const cancelresign = ()=>{
- resignModalRadio.value = 0
- resignModal.value = false
- }
- </script>
- <style lang="scss">
- .el-overlay-dialog .el-dialog.hc-new-dialog.hc-delegate-html-modal {
- .hc-new-dialog-body {
- padding: 0;
- }
- .hc-table-form-data-item {
- padding: 0;
- .el-scrollbar__bar.is-vertical {
- right: 0;
- }
- }
- }
- .hc-delegate-html-modal {
- .hc-delegate-html {
- position: relative;
- height: calc(100% - 40px);
- .hc-table-form-data-item {
- background-color: #efefef;
- }
- &::after {
- content: "";
- position: absolute;
- inset: 0;
- background: rgb(161 161 161 / 40%);
- z-index: 22;
- }
- &.is-show {
- &::after {
- display: none;
- z-index: -1;
- }
- }
- }
- }
- </style>
|