| | |
| | | <el-table-column align="center" label="序号" type="index"></el-table-column> |
| | | <el-table-column label="委托单号" prop="inspectionOrderCode" min-width="160" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="试样名称" prop="sampleName" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="委托编号" prop="entrustCode" show-overflow-tooltip> |
| | | <template slot-scope="scope">{{ scope.row.entrustCode || '待生成' }}</template> |
| | | </el-table-column> |
| | | <el-table-column label="关联状态" min-width="90"> |
| | | <template slot-scope="scope">{{ scope.row.bindingStatus === 1 ? '已绑定' : '未绑定' }}</template> |
| | | </el-table-column> |
| | | <el-table-column label="下单状态" min-width="90"> |
| | | <template slot-scope="scope">{{ orderStateText(scope.row.orderState) }}</template> |
| | | </el-table-column> |
| | | <el-table-column label="检验进度" prop="insProgress" min-width="90"> |
| | | <template slot-scope="scope">{{ scope.row.insProgress || '--' }}</template> |
| | | </el-table-column> |
| | | <el-table-column label="检验结果" min-width="90"> |
| | | <template slot-scope="scope">{{ insResultText(scope.row.insResult) }}</template> |
| | | </el-table-column> |
| | | <el-table-column label="报告状态" min-width="90"> |
| | | <template slot-scope="scope">{{ reportStatusText(scope.row.reportStatus) }}</template> |
| | | <el-table-column label="下单次数" min-width="90"> |
| | | <template slot-scope="scope">{{ scope.row.bindingCount || 0 }}</template> |
| | | </el-table-column> |
| | | <el-table-column label="委托时间" prop="commissionDate" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="型号" prop="modelNo" show-overflow-tooltip></el-table-column> |
| | |
| | | <el-button size="mini" type="text" @click="goUpdate(scope.row)">编辑</el-button> |
| | | <el-button size="mini" type="text" @click="handleLook(scope.row)">查看</el-button> |
| | | <el-button size="mini" style="color:#F56C6C" type="text" @click="deleteOrder(scope.row)">删除</el-button> |
| | | <el-button :disabled="!scope.row.fileUrl" size="mini" type="text" @click="openDownloadDia(scope.row)">下载</el-button> |
| | | <el-button v-if="canChangeBinding(scope.row)" size="mini" type="text" @click="openChangeBinding(scope.row)">变更关联</el-button> |
| | | <el-upload ref='upload' :action="action" :data="{ inspectionOrderId: scope.row.inspectionOrderId }" |
| | | :headers="uploadHeader" :on-error="onError" :on-success="handleSuccessUp" :show-file-list="false" |
| | | accept='image/jpg,image/jpeg,image/png,application/pdf,.doc,.docx,.xlsx' name="file" |
| | | style="background: transparent;display: inline;margin-left: 4px"> |
| | | <span style="color: #409EFF">上传</span> |
| | | </el-upload> |
| | | <el-button size="mini" type="text" @click="openDownloadDia(scope.row)">导出</el-button> |
| | | <el-button size="mini" type="text" @click="openBindingRecords(scope.row)">下单记录</el-button> |
| | | <el-button size="mini" type="text" @click="openAllAttachments(scope.row)">全部附件</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog :visible.sync="bindingRecordsVisible" title="历次下单记录" width="1000px" append-to-body> |
| | | <el-table v-loading="bindingRecordsLoading" :data="bindingRecords" border> |
| | | <el-table-column prop="entrustCode" label="委托编号" min-width="150"> |
| | | <template slot-scope="scope">{{ scope.row.entrustCode || '待生成' }}</template> |
| | | </el-table-column> |
| | | <el-table-column label="下单状态" width="90"> |
| | | <template slot-scope="scope">{{ scope.row.orderDeleted === 1 ? '已删除' : orderStateText(scope.row.orderState) }}</template> |
| | | </el-table-column> |
| | | <el-table-column prop="insProgress" label="检验进度" width="90" /> |
| | | <el-table-column label="检验结果" width="90"> |
| | | <template slot-scope="scope">{{ insResultText(scope.row.insResult) }}</template> |
| | | </el-table-column> |
| | | <el-table-column prop="sampleTakerUser" label="领样人" width="100" /> |
| | | <el-table-column prop="sampleData" label="领样日期" width="110" /> |
| | | <el-table-column prop="reportCount" label="正式报告" width="90" /> |
| | | <el-table-column label="操作" width="230"> |
| | | <template slot-scope="scope"> |
| | | <el-button size="mini" type="text" :disabled="scope.row.orderDeleted === 1" |
| | | @click="openBindingAttachments(scope.row)">附件</el-button> |
| | | <el-button size="mini" type="text" @click="downloadBindingOrder(scope.row)">导出</el-button> |
| | | <el-button v-if="canChangeBinding(scope.row)" size="mini" type="text" |
| | | @click="openChangeBinding(scope.row)">变更关联</el-button> |
| | | <el-upload v-if="scope.row.orderDeleted !== 1" :action="bindingUploadAction" |
| | | :data="{ bindingId: scope.row.id }" :headers="uploadHeader" :show-file-list="false" |
| | | :on-success="handleBindingUploadSuccess" :on-error="onError" :before-upload="beforeUpload" |
| | | accept="image/jpg,image/jpeg,image/png,application/pdf,.doc,.docx,.xlsx" name="file" |
| | | style="display:inline;margin-left:8px"> |
| | | <span style="color:#409EFF">上传</span> |
| | | </el-upload> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-pagination :current-page="bindingPage.current" :page-size="bindingPage.size" :total="bindingPage.total" |
| | | layout="->,total, prev, pager, next" @current-change="changeBindingPage" /> |
| | | </el-dialog> |
| | | <el-dialog :visible.sync="attachmentVisible" title="下单附件" width="650px" append-to-body> |
| | | <el-table :data="attachmentList" border> |
| | | <el-table-column prop="fileName" label="文件名" show-overflow-tooltip /> |
| | | <el-table-column prop="sourceType" label="来源" width="100" /> |
| | | <el-table-column prop="createTime" label="上传时间" width="160" /> |
| | | <el-table-column label="操作" width="80"> |
| | | <template slot-scope="scope"><el-button type="text" @click="$download.saveAs(scope.row.fileUrl, scope.row.fileName)">下载</el-button></template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-dialog> |
| | | <el-dialog :visible.sync="downloadDialog" title="下载" width="600px"> |
| | | <span> |
| | | <el-button :loading="outLoading" plain type="primary" @click="orderReportDown">下载委托单</el-button> |
| | | <el-button :loading="outLoading" plain type="primary" @click="orderFormDown">下载委托报告</el-button> |
| | | </span> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="downloadDialog = false">取 消</el-button> |
| | |
| | | addInspectionOrder, delInspectionOrder, exportInspectionOrder, |
| | | changeInspectionOrderBinding, |
| | | getInspectionOrderOne, |
| | | pageUnboundInspectionOrder, |
| | | pageSelectableInspectionOrder, |
| | | pageInspectionOrderBindings, |
| | | listInspectionOrderAttachments, |
| | | pageInspectionOrder, |
| | | updateInspectionOrder |
| | | } from "@/api/cnas/process/demand/demand"; |
| | |
| | | inspectionOrderId: [{ required: true, message: '请选择新的委托单', trigger: 'change' }], |
| | | reason: [{ required: true, message: '请输入变更原因', trigger: 'blur' }] |
| | | }, |
| | | bindingRecordsVisible: false, |
| | | bindingRecordsLoading: false, |
| | | bindingRecords: [], |
| | | bindingInspectionOrderId: null, |
| | | bindingPage: { current: 1, size: 10, total: 0 }, |
| | | attachmentVisible: false, |
| | | attachmentList: [], |
| | | commissionUnitDialogVisible: false, |
| | | commissionUnitLoading: false, |
| | | commissionUnitList: [], |
| | |
| | | this.refreshTable() |
| | | }, |
| | | computed: { |
| | | action() { |
| | | return this.javaApi + '/inspectionOrder/uploadInspectionOrderFile' |
| | | bindingUploadAction() { |
| | | return this.javaApi + '/inspectionOrder/uploadInspectionOrderBindingFile' |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | }, |
| | | searchUnboundInspectionOrders(keyword) { |
| | | this.bindingLoading = true |
| | | pageUnboundInspectionOrder({ current: 1, size: 20, inspectionOrderCode: keyword }).then(res => { |
| | | pageSelectableInspectionOrder({ current: 1, size: 20, inspectionOrderCode: keyword }).then(res => { |
| | | this.unboundInspectionOrders = res.data.records || [] |
| | | }).finally(() => { |
| | | this.bindingLoading = false |
| | |
| | | this.$message.success('关联已变更') |
| | | this.changeBindingVisible = false |
| | | this.refreshTable() |
| | | this.loadBindingRecords() |
| | | }).finally(() => { |
| | | this.bindingSubmitting = false |
| | | }) |
| | | }) |
| | | }, |
| | | openBindingRecords(row) { |
| | | this.bindingInspectionOrderId = row.inspectionOrderId |
| | | this.bindingPage.current = 1 |
| | | this.bindingRecordsVisible = true |
| | | this.loadBindingRecords() |
| | | }, |
| | | loadBindingRecords() { |
| | | if (!this.bindingInspectionOrderId) return |
| | | this.bindingRecordsLoading = true |
| | | pageInspectionOrderBindings({ |
| | | inspectionOrderId: this.bindingInspectionOrderId, |
| | | current: this.bindingPage.current, |
| | | size: this.bindingPage.size |
| | | }).then(res => { |
| | | this.bindingRecords = res.data.records || [] |
| | | this.bindingPage.total = res.data.total || 0 |
| | | }).finally(() => { this.bindingRecordsLoading = false }) |
| | | }, |
| | | changeBindingPage(page) { |
| | | this.bindingPage.current = page |
| | | this.loadBindingRecords() |
| | | }, |
| | | openBindingAttachments(binding) { |
| | | listInspectionOrderAttachments({ |
| | | inspectionOrderId: binding.inspectionOrderId, |
| | | bindingId: binding.id |
| | | }).then(res => { |
| | | this.attachmentList = res.data || [] |
| | | this.attachmentVisible = true |
| | | }) |
| | | }, |
| | | openAllAttachments(row) { |
| | | listInspectionOrderAttachments({ inspectionOrderId: row.inspectionOrderId }).then(res => { |
| | | this.attachmentList = res.data || [] |
| | | this.attachmentVisible = true |
| | | }) |
| | | }, |
| | | downloadBindingOrder(binding) { |
| | | exportInspectionOrder({ |
| | | inspectionOrderId: binding.inspectionOrderId, |
| | | bindingId: binding.id |
| | | }).then(res => { |
| | | const blob = new Blob([res], { type: 'application/octet-stream' }) |
| | | this.$download.saveAs(blob, `${binding.inspectionOrderCode || '检验委托单'}_${binding.entrustCode || binding.insOrderId}.docx`) |
| | | }) |
| | | }, |
| | | handleBindingUploadSuccess(response) { |
| | | if (response && response.code === 200) { |
| | | this.$message.success('上传成功') |
| | | } else { |
| | | this.$message.error((response && response.message) || '上传失败') |
| | | } |
| | | }, |
| | | addOrderDetailList() { |
| | | if (this.currentInfo.orderDetailList == null) { |
| | |
| | | this.downloadDialog = true |
| | | this.download = row |
| | | }, |
| | | // 委托单下载 |
| | | orderFormDown() { |
| | | let url = this.download.fileUrl; |
| | | const link = document.createElement('a'); |
| | | link.href = this.javaApi + url; |
| | | link.target = '_blank'; |
| | | document.body.appendChild(link); |
| | | link.click(); |
| | | }, |
| | | // 委托报告下载 |
| | | orderReportDown() { |
| | | this.outLoading = true; |
| | |
| | | this.outLoading = false; |
| | | }) |
| | | }, |
| | | // 上传 |
| | | handleSuccessUp(response,) { |
| | | if (response.code == 200) { |
| | | this.$message.success('上传成功'); |
| | | this.refreshTable() |
| | | } |
| | | }, |
| | | beforeUpload(file) { |
| | | if (file.size > 1024 * 1024 * 10) { |
| | | this.$message.error('上传文件不超过10M'); |
| | | this.$refs.upload.clearFiles() |
| | | return false; |
| | | } else { |
| | | return true; |