| | |
| | | import request from '@/utils/request' |
| | | |
| | | // 查询IFS订单-待报检 |
| | | export function getIfsOrder(query) { |
| | | export function getIfsOrder() { |
| | | return request({ |
| | | url: 'insOrder/getIfsOrder', |
| | | method: 'get', |
| | |
| | | responseType: "blob" |
| | | }) |
| | | } |
| | | // 订单拆分模板下载 |
| | | export function downloadTemplate() { |
| | | return request({ |
| | | url: '/rawMaterialOrder/downloadTemplate', |
| | | method: 'get', |
| | | responseType: 'blob' |
| | | }) |
| | | } |
| | | // 确认拆分订单 |
| | | export function confirmSplitOrder(data) { |
| | | return request({ |
| | | url: '/rawMaterialOrder/confirmSplitOrder', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | |
| | | }); |
| | | }, |
| | | }; |
| | | |
| | | export function transformExcel(response, tempName) { |
| | | const relType = ['application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.ms-excel;charset=UTF-8'] |
| | | let type = response.type |
| | | if (relType.includes(type)) { |
| | | const blob = new Blob([response], {type: 'application/vnd.ms-excel'}) |
| | | let temp = tempName |
| | | if(response.headers){ |
| | | const disposition = response.headers["Content-Disposition"] |
| | | temp = disposition.substring(disposition.lastIndexOf('=') + 1) |
| | | } |
| | | let filename = decodeURI(temp) |
| | | // 创建一个超链接,将文件流赋进去,然后实现这个超链接的单击事件 |
| | | const elink = document.createElement('a') |
| | | elink.download = filename |
| | | elink.style.display = 'none' |
| | | elink.href = URL.createObjectURL(blob) |
| | | document.body.appendChild(elink) |
| | | elink.click() |
| | | URL.revokeObjectURL(elink.href) // 释放URL 对象 |
| | | document.body.removeChild(elink) |
| | | } |
| | | } |
| | |
| | | delete this.formData.updateUser |
| | | const formData = this.HaveJson(this.formData) |
| | | formData.insProductIds = formData.insProductIds ? formData.insProductIds.join() : '' |
| | | if (formData.authorizedPerson.length === 0) { |
| | | if (formData.authorizedPerson && formData.authorizedPerson.length === 0) { |
| | | formData.authorizedPerson = '' |
| | | } else { |
| | | formData.authorizedPerson = JSON.stringify(formData.authorizedPerson) |
| | |
| | | state: this.state, |
| | | typeSource: this.typeSource, |
| | | orderId: this.orderId, |
| | | isSplit: row.isSplitOrder |
| | | }, |
| | | }); |
| | | }, |
| | |
| | | size: 10, |
| | | current: 0, |
| | | }, |
| | | tableLoading: false, |
| | | // 文件列表相关--结束 |
| | | // 任务切换列表--开始 |
| | | tableData0: [], |
| | |
| | | }, |
| | | tableLoading0: false, |
| | | // 任务切换列表--结束 |
| | | isSplit: 0, // 是否是拆单过来的 |
| | | }; |
| | | }, |
| | | // 用于上传文件的信息 |
| | |
| | | }, |
| | | }, |
| | | created() { |
| | | let { sonLaboratory, orderId, state, inspectorList, typeSource } = |
| | | let { sonLaboratory, orderId, state, inspectorList, typeSource,isSplit } = |
| | | this.$route.query; |
| | | this.sonLaboratory = sonLaboratory; |
| | | this.orderId = orderId; |
| | |
| | | this.state = state; |
| | | this.inspectorList = inspectorList; |
| | | this.typeSource = typeSource; |
| | | this.isSplit = isSplit; |
| | | }, |
| | | mounted() { |
| | | this.getTypeDicts(); // 获取紧急程度下拉框选项 |
| | |
| | | openAddVerifyDia() { |
| | | this.addVerifyDia = true; |
| | | }, |
| | | confirmSubmit(registerInsResults){ |
| | | submitPlan({ |
| | | orderId: this.orderId, |
| | | laboratory: this.sonLaboratory, |
| | | verifyUser: this.verifyUser, |
| | | entrustCode: this.insOrder.entrustCode, |
| | | registerInsResults: registerInsResults |
| | | }).then((res) => { |
| | | if (res.code === 200) { |
| | | this.$message.success("操作成功"); |
| | | this.goback(); |
| | | this.submitLoading = false; |
| | | this.addVerifyDia = false; |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | console.error(error); |
| | | this.submitLoading = false; |
| | | }); |
| | | }, |
| | | submit() { |
| | | if (this.verifyUser === null || this.verifyUser === "") { |
| | | this.$message.error("请指定复核人员"); |
| | |
| | | orderId: this.orderId, |
| | | laboratory: this.sonLaboratory, |
| | | }).then((res) => { |
| | | console.log(res) |
| | | if (res.code === 200) { |
| | | if (!res.data || res.data.length == 0) { |
| | | if (!res.data || res.data.errorMsg.length == 0) { |
| | | this.submitLoading = true; |
| | | submitPlan({ |
| | | orderId: this.orderId, |
| | | laboratory: this.sonLaboratory, |
| | | verifyUser: this.verifyUser, |
| | | entrustCode: this.insOrder.entrustCode, |
| | | }).then((res) => { |
| | | if (res.code === 200) { |
| | | this.$message.success("操作成功"); |
| | | this.goback(); |
| | | this.submitLoading = false; |
| | | this.addVerifyDia = false; |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | console.error(error); |
| | | this.submitLoading = false; |
| | | //检验类型为原材料 |
| | | if(this.typeSource==1 && res.data.unInsOrderCount==0 && this.isSplit==1){ |
| | | const htmlStr = "是否登记IFS采购检验结果并移库?该操作会登记<span style='color:#ff4949'>同一零件同一订单的所有拆分批次</span>,请谨慎选择。" |
| | | this.$confirm(htmlStr, '提示', { |
| | | confirmButtonText: '是', |
| | | cancelButtonText: '否', |
| | | type: 'warning', |
| | | dangerouslyUseHTMLString: true |
| | | }).then(() => { |
| | | this.confirmSubmit(true) |
| | | }).catch(() => { |
| | | this.confirmSubmit(false) |
| | | }); |
| | | }else{ |
| | | this.confirmSubmit(false) |
| | | } |
| | | } else { |
| | | let newData = []; |
| | | const h = this.$createElement; |
| | |
| | | }) |
| | | .then(() => { |
| | | this.submitLoading = true; |
| | | submitPlan({ |
| | | orderId: this.orderId, |
| | | laboratory: this.sonLaboratory, |
| | | verifyUser: this.verifyUser, |
| | | }).then((res) => { |
| | | if (res.code === 200) { |
| | | this.$message.success("操作成功"); |
| | | this.addVerifyDia = false; |
| | | this.goback(); |
| | | } |
| | | this.submitLoading = false; |
| | | }) |
| | | .catch((error) => { |
| | | console.error(error); |
| | | this.submitLoading = false; |
| | | }); |
| | | this.confirmSubmit(false) |
| | | // submitPlan({ |
| | | // orderId: this.orderId, |
| | | // laboratory: this.sonLaboratory, |
| | | // verifyUser: this.verifyUser, |
| | | // }).then((res) => { |
| | | // if (res.code === 200) { |
| | | // this.$message.success("操作成功"); |
| | | // this.addVerifyDia = false; |
| | | // this.goback(); |
| | | // } |
| | | // this.submitLoading = false; |
| | | // }) |
| | | // .catch((error) => { |
| | | // console.error(error); |
| | | // this.submitLoading = false; |
| | | // }); |
| | | }) |
| | | .catch(() => { }); |
| | | } |
| | |
| | | } |
| | | } |
| | | }, |
| | | { label: '抵达的采购数量', prop: 'qtyArrived' }, |
| | | { label: '抵达的采购数量', prop: 'purQtyInStore' }, |
| | | { label: '单位', prop: 'buyUnitMeas' }, |
| | | { label: '订单号', prop: 'orderNo' }, |
| | | { label: '接收时间', prop: 'receiverDate' }, |
| | |
| | | } |
| | | } |
| | | }, |
| | | { label: '抵达的采购数量', prop: 'qtyArrived' }, |
| | | { label: '抵达的采购数量', prop: 'purQtyInStore' }, |
| | | { label: '单位', prop: 'buyUnitMeas' }, |
| | | { label: '订单号', prop: 'orderNo' }, |
| | | { label: '接收时间', prop: 'receiverDate' }, |
| | |
| | | } |
| | | }, |
| | | { label: '订单号', prop: 'orderNo' }, |
| | | { label: '抵达的采购数量', prop: 'qtyArrived' }, |
| | | { label: '抵达的采购数量', prop: 'purQtyInStore' }, |
| | | { label: '下发时间', prop: 'sendTime' }, |
| | | { label: '批号', prop: 'updateBatchNo' }, |
| | | { label: '零件号', prop: 'partNo' }, |
| | |
| | | } |
| | | }, |
| | | { label: '订单号', prop: 'orderNo' }, |
| | | { label: '抵达的采购数量', prop: 'qtyArrived' }, |
| | | { label: '抵达的采购数量', prop: 'purQtyInStore' }, |
| | | { label: '下发时间', prop: 'sendTime' }, |
| | | { label: '批号', prop: 'updateBatchNo' }, |
| | | { label: '零件号', prop: 'partNo' }, |
| | |
| | | } |
| | | }, |
| | | { label: '订单号', prop: 'orderNo' }, |
| | | { label: '抵达的采购数量', prop: 'qtyArrived' }, |
| | | { label: '抵达的采购数量', prop: 'purQtyInStore' }, |
| | | { label: '下发时间', prop: 'sendTime' }, |
| | | { label: '批号', prop: 'updateBatchNo' }, |
| | | { label: '零件号', prop: 'partNo' }, |
| | |
| | | <el-input v-model="declareObj.partDesc" :disabled="declareType !== 'add'" class="addObj-info" clearable |
| | | placeholder="" size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item class="declareObj-form-item" label="抵达的采购数量:" prop="qtyArrived"> |
| | | <el-input v-model="declareObj.qtyArrived" :disabled="declareType !== 'add'" class="addObj-info" clearable |
| | | <el-form-item class="declareObj-form-item" label="抵达的采购数量:" prop="purQtyInStore"> |
| | | <el-input v-model="declareObj.purQtyInStore" :disabled="declareType !== 'add'" class="addObj-info" clearable |
| | | placeholder="" size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item v-if="declareType !== 'add'" class="declareObj-form-item" label="供应商编号:" prop="supplierId"> |
| | |
| | | <!--数据查看弹框--> |
| | | <data-look-visible v-if="dataDialogVisible" ref="dataDialogVisible" :dataDialogVisible="dataDialogVisible" |
| | | :dataLookInfo="dataLookInfo" @closeDataLook="closeDataLook"></data-look-visible> |
| | | <el-dialog |
| | | title="订单拆分" |
| | | :visible.sync="orderSplitDialogVisible" |
| | | :before-close="resetOrderSplitData" |
| | | :close-on-click-modal="false" |
| | | :close-on-press-escape="false" |
| | | :show-close="!confirmSplitOrderLoading" |
| | | width="60%"> |
| | | <div> |
| | | <el-divider content-position="left">订单主体</el-divider> |
| | | <el-table |
| | | :data="orderSplitBasicData" |
| | | border |
| | | :header-cell-style="{textAlign:'center'}" |
| | | :cell-style="{textAlign:'center'}" |
| | | > |
| | | <el-table-column label="订单编号" prop="orderNo" :min-width="100" width="100"></el-table-column> |
| | | <el-table-column label="零件编号" prop="partNo" :min-width="150" width="150" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="零件描述" prop="partDesc" :min-width="150" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="抵达的采购数量" prop="purQtyInStore" :min-width="120" width="120"></el-table-column> |
| | | <el-table-column label="供应商编号" prop="supplierId" :min-width="100" width="100" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="供应商名称" prop="supplierName" :min-width="100" width="100" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="批号" prop="lotBatchNo" :min-width="100" width="100"></el-table-column> |
| | | <el-table-column label="单位" prop="buyUnitMeas" :min-width="100" width="100"></el-table-column> |
| | | </el-table> |
| | | <el-divider content-position="left">拆分详情</el-divider> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-checkbox v-model="pushToMes"><span style="font-weight: bold">同步到MES</span></el-checkbox> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div style="width:100%;text-align: right;margin-bottom:5px"> |
| | | <el-upload |
| | | style="display:inline-block;margin: 0 8px;" |
| | | ref="upload" |
| | | class="upload-demo" |
| | | :headers="uploadHeader" |
| | | :action="splitOrderAction" |
| | | :data="{ifsId:declareObj.id}" |
| | | :on-change="beforeUpload" |
| | | :on-error="onError" |
| | | :on-success="handleSuccess" |
| | | accept=".xls,.xlsx" |
| | | :show-file-list="false" |
| | | :multiple="false"> |
| | | <el-button size="mini" type="primary" :loading="upLoading">导入</el-button> |
| | | </el-upload> |
| | | <el-button size="mini" type="primary" @click="downloadTemplate">下载模板</el-button> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table |
| | | :data="orderSplitDetailData" |
| | | v-loading="detailDataLoading" |
| | | :header-cell-style="{textAlign:'center'}" |
| | | :cell-style="{textAlign:'center'}" |
| | | border> |
| | | <el-table-column label="零件编号" prop="partNo" :min-width="150" width="150" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="系统编号" prop="systemNo" :min-width="90" width="90" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="规格" prop="model" :min-width="90" width="90" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="零件批号" prop="lotBatchNo" :min-width="90" width="90" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="库存数量1" prop="length" :min-width="100" width="100" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="库存数量2" prop="qtyStock" :min-width="100" width="100" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="绝缘颜色" prop="insulationColor" :min-width="90" width="90" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="外护颜色" prop="outerColor" :min-width="90" width="90" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="印字信息" prop="letteringInfo" :min-width="90" width="90" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="盘号" prop="drumNo" :min-width="90" width="90" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="库位编号" prop="locationNo" :min-width="90" width="90" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="库位来源" prop="stockSource" :min-width="90" width="90" show-overflow-tooltip></el-table-column> |
| | | <el-table-column label="备注" prop="remark" :min-width="90" show-overflow-tooltip></el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="resetOrderSplitData()" :disabled="confirmSplitOrderLoading">取 消</el-button> |
| | | <el-button type="primary" @click="confirmSplitOrder()" :loading="confirmSplitOrderLoading">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | getIfsByFinish, |
| | | getIfsOrder, |
| | | getWarehouseSubmit, inspectionReport, inspectionReportOne, rawAllExport, |
| | | revokeInspectionReport |
| | | revokeInspectionReport,downloadTemplate,confirmSplitOrder |
| | | } from '@/api/business/materialInspection' |
| | | import limsTable from "@/components/Table/lims-table.vue"; |
| | | import {transformExcel} from '@/utils/file' |
| | | |
| | | export default { |
| | | name: 'RawMaterialInspection', |
| | | // import 引入的组件需要注入到对象中才能使用 |
| | | components: { limsTable, DataLookVisible }, |
| | | computed:{ |
| | | splitOrderAction(){ |
| | | return this.javaApi + '/rawMaterialOrder/importSplitOrderData' |
| | | } |
| | | }, |
| | | data() { |
| | | // 这里存放数据 |
| | | return { |
| | | confirmSplitOrderLoading: false, |
| | | detailDataLoading: false, |
| | | pushToMes:false,//是否同步到mes |
| | | orderSplitDialogVisible: false, |
| | | orderSplitBasicData:[],//订单拆分主体表格数据 |
| | | orderSplitDetailData:[],//订单拆分详情表格数据 |
| | | tableData: [], |
| | | tableLoading: false, |
| | | column: [ |
| | |
| | | } |
| | | }, |
| | | { label: '订单号', prop: 'orderNo' }, |
| | | { label: '抵达的采购数量', prop: 'qtyArrived', width: '140px', }, |
| | | { label: '抵达的采购数量', prop: 'purQtyInStore', width: '140px', }, |
| | | { label: '批号', prop: 'updateBatchNo' }, |
| | | { label: '零件号', prop: 'partNo' }, |
| | | { label: '零件描述', prop: 'partDesc' }, |
| | |
| | | } |
| | | }, |
| | | { label: '订单号', prop: 'orderNo' }, |
| | | { label: '抵达的采购数量', prop: 'qtyArrived' }, |
| | | { label: '抵达的采购数量', prop: 'purQtyInStore',width:'160px' }, |
| | | { label: '报检时间', prop: 'declareDate' }, |
| | | { label: '批号', prop: 'updateBatchNo' }, |
| | | { label: '零件号', prop: 'partNo' }, |
| | |
| | | orderNo: '', // 订单号 |
| | | partNo: '', // 零件号 |
| | | partDesc: '', // 零件描述 |
| | | qtyArrived: '', // 抵达的采购数量 |
| | | purQtyInStore: '', // 抵达的采购数量 |
| | | supplierId: '', // 供应商编号 |
| | | supplierName: '', // 供应商名称 |
| | | updateBatchNo: '', // 批号 |
| | |
| | | { label: '未下单', value: 3 }, |
| | | { label: '让步放行', value: 4 }, |
| | | ], |
| | | outLoading: false |
| | | outLoading: false, |
| | | upLoading: false, |
| | | } |
| | | }, |
| | | mounted() { |
| | |
| | | }, |
| | | // 方法集合 |
| | | methods: { |
| | | resetOrderSplitData(){ |
| | | this.orderSplitBasicData = [] |
| | | this.orderSplitDetailData = [] |
| | | this.pushToMes = false |
| | | this.$nextTick(()=>{ |
| | | this.confirmSplitOrderLoading = false |
| | | this.orderSplitDialogVisible = false |
| | | this.refreshTable() |
| | | }) |
| | | }, |
| | | confirmSplitOrder(){ |
| | | this.confirmSplitOrderLoading = true |
| | | let requestData = { |
| | | ifsId: this.declareObj.id, |
| | | splitDetailList: this.orderSplitDetailData, |
| | | pushToMes: this.pushToMes |
| | | } |
| | | confirmSplitOrder(requestData).then(res=>{ |
| | | if(res.code===200 && res.data){ |
| | | this.$message.success('订单拆分成功') |
| | | }else if(this.pushToMes && res.code===200 && !res.data){ |
| | | this.$message.success('订单拆分成功,同步MES失败,请联系管理员') |
| | | } else { |
| | | let msg = res.msg || res.message |
| | | this.$message({ |
| | | message: '订单拆分失败: '+msg, |
| | | dangerouslyUseHTMLString: true, |
| | | type: 'error' |
| | | }); |
| | | } |
| | | this.resetOrderSplitData() |
| | | }).catch(error=>{ |
| | | console.error(error) |
| | | this.confirmSplitOrderLoading = false |
| | | }) |
| | | }, |
| | | handleSuccess(response) { |
| | | if (response.code === 200) { |
| | | this.$message.success('上传成功'); |
| | | this.orderSplitDetailData = response.data |
| | | } else { |
| | | let msg = response.msg || response.message |
| | | this.$message({ |
| | | message: '上传失败: '+msg, |
| | | dangerouslyUseHTMLString: true, |
| | | type: 'error' |
| | | }); |
| | | } |
| | | this.$nextTick(()=>{ |
| | | this.upLoading = false; |
| | | this.detailDataLoading = false |
| | | }) |
| | | }, |
| | | onError(err, file, fileList) { |
| | | this.$message.error('上传失败: '+err) |
| | | this.$refs.upload.clearFiles() |
| | | }, |
| | | beforeUpload(file) { |
| | | if (file.size > 1024 * 1024 * 10) { |
| | | this.$message.error('上传文件不超过10M'); |
| | | this.$refs.upload.clearFiles() |
| | | return false; |
| | | } else { |
| | | this.upLoading = true; |
| | | this.detailDataLoading = true |
| | | return true; |
| | | } |
| | | }, |
| | | downloadTemplate(){ |
| | | downloadTemplate().then(res=>{ |
| | | transformExcel(res,'订单拆分导入模板.xlsx') |
| | | }).catch(error=>{ |
| | | console.error(error) |
| | | }) |
| | | }, |
| | | // 切换tab表格 |
| | | handleTab(m) { |
| | | this.tabIndex = m; |
| | |
| | | // 打开报检确认弹框 |
| | | declare(row) { |
| | | this.declareObj = { ...row } |
| | | this.declareDialogVisible = true |
| | | this.declareType = 'edit' |
| | | if(row.updateBatchNo && row.updateBatchNo==='*'){ |
| | | this.$confirm('是否要拆分该订单?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.orderSplitBasicData = [row] |
| | | this.orderSplitDialogVisible = true |
| | | }).catch(() => { |
| | | this.declareDialogVisible = true |
| | | }); |
| | | }else{ |
| | | this.declareDialogVisible = true |
| | | } |
| | | }, |
| | | // 提交报检 |
| | | submitDeclare() { |
| | |
| | | orderNo: '', // 订单号 |
| | | partNo: '', // 零件号 |
| | | partDesc: '', // 零件描述 |
| | | qtyArrived: '', // 抵达的采购数量 |
| | | purQtyInStore: '', // 抵达的采购数量 |
| | | supplierId: '', // 供应商编号 |
| | | supplierName: '', // 供应商名称 |
| | | updateBatchNo: '', // 批号 |