| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292 |
- <template>
- <div class="ele-body">
- <div class="page-title">
- <el-page-header @back="$router.go(-1)">
- <div slot="content" class="pageContent">
- <div>详情</div>
- </div>
- </el-page-header>
- <el-button @click="handlePrint">打印工单</el-button>
- </div>
- <progressBox
- v-if="tabList.length"
- :list="tabList"
- :total="infoData.formingNum"
- />
- <el-card>
- <el-descriptions title="" direction="vertical" :column="7" border>
- <el-descriptions-item label="工单号">{{
- infoData.code
- }}</el-descriptions-item>
- <el-descriptions-item label="生产版本">{{
- infoData.produceVersionName
- }}</el-descriptions-item>
- <!-- <el-descriptions-item label="工单类型">苏州市</el-descriptions-item> -->
- <el-descriptions-item label="产线">{{
- infoData.productLine
- }}</el-descriptions-item>
- <el-descriptions-item label="工艺路线版本">{{
- infoData.routingVersion
- }}</el-descriptions-item>
- <el-descriptions-item label="计划编号">{{
- infoData.productionPlanCode
- }}</el-descriptions-item>
- <el-descriptions-item label="计划类型">{{
- typeList[infoData.planType]
- }}</el-descriptions-item>
- <el-descriptions-item label="物料编码">{{
- infoData.productCode
- }}</el-descriptions-item>
- <el-descriptions-item label="产品名称">{{
- infoData.productName
- }}</el-descriptions-item>
- <el-descriptions-item label="牌号 | 型号"
- >{{ infoData.brandNo }} | {{ infoData.model }}</el-descriptions-item
- >
- <el-descriptions-item label="要求成型数量(PCS)">{{
- infoData.formingNum
- }}</el-descriptions-item>
- <el-descriptions-item label="要求成型重量(KG)">{{
- infoData.formingWeight
- }}</el-descriptions-item>
- <el-descriptions-item label="计划开始时间">{{
- infoData.planStartTime
- }}</el-descriptions-item>
- <el-descriptions-item label="实际开始时间">{{
- infoData.startTime
- }}</el-descriptions-item>
- <el-descriptions-item label="已成型数量(PCS)">{{
- infoData.formedNum
- }}</el-descriptions-item>
- <el-descriptions-item label="已成型重量(KG)">{{
- infoData.formedWeight
- }}</el-descriptions-item>
- <el-descriptions-item label="已交付数量(PCS)">{{
- infoData.deliveredQuantity
- }}</el-descriptions-item>
- <el-descriptions-item label="已交付重量(KG)">{{
- infoData.deliveredWeight
- }}</el-descriptions-item>
- <el-descriptions-item label="工单状态">{{
- statusList[infoData.status]
- }}</el-descriptions-item>
- <el-descriptions-item label="完成时间">{{
- infoData.completeTime
- }}</el-descriptions-item>
- <el-descriptions-item label="生产周期">{{
- infoData.productionCycle
- }}</el-descriptions-item>
- </el-descriptions>
- </el-card>
- <el-card v-if="tabList.length">
- <el-tabs v-model="activeName" type="card" @tab-click="handleTabClick">
- <el-tab-pane
- :label="item.taskTypeName"
- :name="JSON.stringify(index)"
- v-for="(item, index) in tabList"
- :key="item.taskCode"
- ></el-tab-pane>
- <!-- <el-tab-pane label="挤压成型" name="1"> </el-tab-pane>
- <el-tab-pane label="自然干燥" name="2"></el-tab-pane>
- <el-tab-pane label="升温干燥" name="3"></el-tab-pane>
- <el-tab-pane label="半加定长" name="4"></el-tab-pane>
- <el-tab-pane label="备炉" name="5"></el-tab-pane>
- <el-tab-pane label="烧结" name="6"></el-tab-pane>
- <el-tab-pane label="深加工" name="7"></el-tab-pane>
- <el-tab-pane label="包装" name="8"></el-tab-pane>
- <el-tab-pane label="入库" name="9"></el-tab-pane> -->
- </el-tabs>
- <ele-pro-table
- :columns="columns"
- :datasource="datasource"
- :key="activeName"
- :cache-key="`produceDetal${activeName}`"
- :initLoad="false"
- ref="table"
- >
- <template v-slot:toolbar>
- <div class="tips-box">
- <ul
- v-if="
- chooseItem == '挤压成型' ||
- chooseItem.includes('模压') ||
- chooseItem.includes('挤压') ||
- (chooseItem.includes('等静压') && activeName == 0)
- "
- >
- <li>
- <span class="label">累计合格品数量</span>
- {{ countMsg.standardTotalNum }}PCS
- </li>
- <li>
- <span class="label">累计合格品重量</span>
- {{ countMsg.standardTotalWeight }}PCS
- </li>
- <li>
- <span class="label">累计投料重量</span>
- {{ countMsg.feedMaterielWeight }}PCS
- </li>
- </ul>
- <ul
- v-else-if="
- ['自然干燥', '升温干燥', '半加定长'].includes(chooseItem) ||
- chooseItem.includes('半加')
- "
- >
- <li>
- <span class="label">累计合格品数量</span>
- {{ countMsg.standardTotalNum }}PCS
- </li>
- <li>
- <span class="label">累计合格品重量</span>
- {{ countMsg.standardTotalWeight }}PCS
- </li>
- <li>
- <span class="label">累计投料产品重量</span>
- {{ countMsg.feedProductWeight }}PCS
- </li>
- </ul>
- <ul v-else-if="['备炉'].includes(chooseItem)">
- <li>
- <span class="label">累计交接数量</span>
- {{ countMsg.joinTotalNum }}PCS
- </li>
- <li>
- <span class="label">累计实际数量</span>
- {{ countMsg.joinTotalNum }}PCS
- </li>
- </ul>
- <ul v-else-if="['烧结', '质检'].includes(chooseItem)">
- <li>
- <span class="label">累计合格品数量</span>
- {{ countMsg.standardTotalNum }}PCS
- </li>
- <li>
- <span class="label">累计合格品重量</span>
- {{ countMsg.standardTotalWeight }}PCS
- </li>
- <li>
- <span class="label">累计投料数量</span>
- {{ countMsg.joinTotalNum }}PCS
- </li>
- </ul>
- <ul v-else-if="['包装'].includes(chooseItem)">
- <li>
- <span class="label">累计交接数量</span>
- {{ countMsg.joinTotalNum }}PCS
- </li>
- <li>
- <span class="label">累计实际数量</span>
- {{ countMsg.joinTotalNum }}PCS
- </li>
- <li>
- <span class="label">累计包装数量</span>
- {{ countMsg.packTotalNum }}PCS
- </li>
- <li>
- <span class="label">累计包装产品数量</span>
- {{ countMsg.packProductTotalNum }}PCS
- </li>
- </ul>
- <ul v-else-if="['入库'].includes(chooseItem)">
- <li>
- <span class="label">累计交接数量</span>
- {{ countMsg.joinTotalNum }}PCS
- </li>
- <li>
- <span class="label">累计批次数量</span>
- {{ countMsg.inStoreBatchNum }}PCS
- </li>
- <li>
- <span class="label">累计产品数量</span>
- {{ countMsg.joinTotalNum }}PCS
- </li>
- </ul>
- <ul v-else>
- <li>
- <span class="label">累计合格品数量</span>
- {{ countMsg.standardTotalNum }}PCS
- </li>
- <li>
- <span class="label">累计合格品重量</span>
- {{ countMsg.standardTotalWeight }}PCS
- </li>
- <li>
- <span class="label">累计投料数量</span>
- {{ countMsg.joinTotalNum }}PCS
- </li>
- </ul>
- <!-- <el-link type="primary" v-if="activeName == 1" @click="openOther"
- >其他任务记录</el-link
- > -->
- </div>
- </template>
- <template v-slot:bom="{ row }">
- <el-link type="primary" @click="check(row)">查看</el-link>
- </template>
- <template v-slot:action="{ row }">
- <el-link type="primary" @click="writeOff(row)">冲销</el-link>
- </template>
- </ele-pro-table>
- </el-card>
- <otherMission ref="otherMissionRef" />
- <bomList ref="bomListRef" />
- <OrderPrint
- ref="orderPrintRef"
- :workOrderId="workOrderId"
- :infoData="infoData"
- :processList="tabList"
- />
- </div>
- </template>
- <script>
- import progressBox from './components/progressBox';
- import otherMission from './components/otherMission';
- import OrderPrint from '@/components/print/OrderPrint';
- import bomList from './components/bomList';
- import dictMixins from '@/mixins/dictMixins';
- import {
- reportPage,
- getInfoById,
- reportCount,
- writeOffWork
- } from '@/api/produceOrder/index.js';
- export default {
- mixins: [dictMixins],
- components: {
- OrderPrint,
- otherMission,
- progressBox,
- bomList
- },
- data() {
- return {
- infoData: {},
- descriptionsShow: true,
- activeName: '0',
- tabList: [],
- columnOpt: {
- 挤压成型: [
- {
- label: '序号',
- type: 'index',
- width: 55,
- align: 'center'
- },
- {
- label: '投料时间',
- prop: 'feedingTime',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '投料重量',
- prop: 'feedingWeight',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '投料执行人',
- prop: 'feedingOperator',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '设备编码',
- prop: 'deviceCode',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '设备名称',
- prop: 'deviceName',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '报工时间',
- prop: 'reportWorkTime',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '报工执行人',
- prop: 'reportingOperator',
- minWidth: 100,
- align: 'center'
- },
- // {
- // label: '周转车编码',
- // prop: 'transferCarCode'
- // },
- {
- label: '合格品数量',
- prop: 'standardNum',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '合格品重量',
- prop: 'standardWeight',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '不合格品数量',
- prop: 'noStandardNum',
- minWidth: 120,
- align: 'center'
- },
- {
- label: '不合格品重量',
- prop: 'noStandardWeight',
- minWidth: 120,
- align: 'center'
- },
- {
- label: '副产品重量',
- prop: 'secondaryProductWeight',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '操作',
- slot: 'action'
- }
- ],
- 自然干燥: [
- {
- label: '序号',
- type: 'index',
- width: 55,
- align: 'center'
- },
- {
- label: '投料时间',
- prop: 'feedingTime',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '投料执行人',
- prop: 'feedingOperator',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '产品数量',
- prop: 'productNum',
- minWidth: 100,
- align: 'center'
- },
- // {
- // label: '周转车编码',
- // prop: 'transferCarCode'
- // },
- {
- label: '区域编码',
- prop: 'areaCode',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '干燥时长',
- prop: 'dryingDuration',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '报工时间',
- prop: 'reportWorkTime',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '报工执行人',
- prop: 'reportingOperator',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '合格品数量',
- prop: 'standardNum',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '合格品重量',
- prop: 'standardWeight',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '不合格品数量',
- prop: 'noStandardNum',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '不合格品重量',
- prop: 'noStandardWeight',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '副产品重量',
- prop: 'secondaryProductWeight',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '操作',
- slot: 'action'
- }
- ],
- 升温干燥: [
- {
- label: '序号',
- type: 'index',
- width: 55,
- align: 'center'
- },
- {
- label: '投料时间',
- prop: 'feedingTime',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '投料执行人',
- prop: 'feedingOperator',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '产品数量',
- prop: 'productNum',
- minWidth: 100,
- align: 'center'
- },
- // {
- // label: '周转车编码',
- // prop: 'transferCarCode'
- // },
- {
- label: '设备编码',
- prop: 'deviceCode',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '设备名称',
- prop: 'deviceName',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '升温曲线',
- prop: 'temperatureRamp',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '报工时间',
- prop: 'reportWorkTime',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '报工执行人',
- prop: 'reportingOperator',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '合格品数量',
- prop: 'standardNum',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '合格品重量',
- prop: 'standardWeight',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '不合格品数量',
- prop: 'noStandardNum',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '不合格品重量',
- prop: 'noStandardWeight',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '副产品重量',
- prop: 'secondaryProductWeight',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '操作',
- slot: 'action'
- }
- ],
- 半加定长: [
- {
- label: '序号',
- type: 'index',
- width: 55,
- align: 'center'
- },
- {
- label: '投料时间',
- prop: 'feedingTime',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '投料执行人',
- prop: 'feedingOperator',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '产品数量',
- prop: 'productNum',
- minWidth: 100,
- align: 'center'
- },
- // {
- // label: '周转车编码',
- // prop: 'transferCarCode'
- // },
- {
- label: '设备编码',
- prop: 'deviceCode',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '设备名称',
- prop: 'deviceName',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '报工时间',
- prop: 'reportWorkTime',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '报工执行人',
- prop: 'reportingOperator',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '合格品数量',
- prop: 'standardNum',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '合格品重量',
- prop: 'standardWeight',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '不合格品数量',
- prop: 'noStandardNum',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '不合格品重量',
- prop: 'noStandardWeight',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '副产品重量',
- prop: 'secondaryProductWeight',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '操作',
- slot: 'action'
- }
- ],
- 备炉: [
- {
- label: '序号',
- type: 'index',
- width: 55,
- align: 'center'
- },
- {
- label: '交接时间',
- prop: 'handoverTime',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '交接执行人',
- prop: 'handoverOperator',
- minWidth: 100,
- align: 'center'
- },
- // {
- // label: '交接数量',
- // prop: 'handoverQuantity',
- // minWidth: 100,
- // align: 'center'
- // },
- {
- label: '实际数量',
- prop: 'billOfMaterials',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '执行时间',
- prop: 'executionTime',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '执行人',
- prop: 'executor',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '设备编码',
- prop: 'deviceCode',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '设备名称',
- prop: 'deviceName',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '烧结曲线',
- prop: 'sinteringCurve',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '操作',
- slot: 'action'
- }
- ],
- 烧结: [
- {
- label: '序号',
- type: 'index',
- width: 55,
- align: 'center'
- },
- {
- label: '报工时间',
- prop: 'reportWorkTime',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '报工执行人',
- prop: 'reportingOperator',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '合格品数量',
- prop: 'standardNum',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '合格品重量',
- prop: 'standardWeight',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '不合格品数量',
- prop: 'noStandardNum',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '不合格品重量',
- prop: 'noStandardWeight',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '副产品重量',
- prop: 'secondaryProductWeight',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '操作',
- slot: 'action'
- }
- ],
- 质检: [
- {
- label: '序号',
- type: 'index',
- width: 55,
- align: 'center'
- },
- {
- label: '报工时间',
- prop: 'reportWorkTime',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '报工执行人',
- prop: 'reportingOperator',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '合格品数量',
- prop: 'standardNum',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '合格品重量',
- prop: 'standardWeight',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '不合格品数量',
- prop: 'noStandardNum',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '不合格品重量',
- prop: 'noStandardWeight',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '副产品重量',
- prop: 'secondaryProductWeight',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '操作',
- slot: 'action'
- }
- ],
- 深加工: [
- {
- label: '序号',
- type: 'index',
- width: 55,
- align: 'center'
- },
- {
- label: '交接时间',
- prop: 'handoverTime',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '交接执行人',
- prop: 'handoverOperator',
- minWidth: 120,
- align: 'center'
- },
- // {
- // label: '交接数量',
- // prop: 'handoverQuantity'
- // },
- // {
- // label: '实际数量',
- // prop: 'billOfMaterials'
- // },
- {
- label: '投料时间',
- prop: 'feedingTime',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '投料执行人',
- prop: 'feedingOperator',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '设备编码',
- prop: 'deviceCode',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '设备名称',
- prop: 'deviceName',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '报工时间',
- prop: 'reportWorkTime',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '报工执行人',
- prop: 'reportingOperator',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '合格品数量',
- prop: 'standardNum',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '合格品重量',
- prop: 'standardWeight',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '不合格品数量',
- prop: 'noStandardNum',
- minWidth: 120,
- align: 'center'
- },
- {
- label: '不合格品重量',
- prop: 'noStandardWeight',
- minWidth: 120,
- align: 'center'
- },
- {
- label: '副产品重量',
- prop: 'secondaryProductWeight',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '操作',
- slot: 'action'
- }
- ],
- 包装: [
- {
- label: '序号',
- type: 'index',
- width: 55,
- align: 'center'
- },
- {
- label: '交接时间',
- prop: 'handoverTime',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '交接执行人',
- prop: 'handoverOperator',
- minWidth: 100,
- align: 'center'
- },
- // {
- // label: '交接数量',
- // prop: 'handoverQuantity',
- // minWidth: 100,
- // align: 'center'
- // },
- {
- label: '实际数量',
- prop: 'billOfMaterials',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '报工时间',
- prop: 'reportWorkTime',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '报工执行人',
- prop: 'reportingOperator',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '包装数量',
- prop: 'packNum',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '包装产品数量',
- prop: 'packagedProductQuantity',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '尾料数量',
- prop: 'surplusNum',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '物料清单',
- prop: 'materialList',
- minWidth: 100,
- align: 'center',
- slot: 'bom'
- },
- {
- label: '操作',
- slot: 'action'
- }
- ],
- 入库: [
- {
- label: '序号',
- type: 'index',
- width: 55,
- align: 'center'
- },
- {
- label: '交接时间',
- prop: 'handoverTime',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '交接执行人',
- prop: 'handoverOperator',
- minWidth: 100,
- align: 'center'
- },
- // {
- // label: '交接数量',
- // prop: 'handoverQuantity',
- // minWidth: 100,
- // align: 'center'
- // },
- {
- label: '实际数量',
- prop: 'billOfMaterials',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '报工时间',
- prop: 'reportWorkTime',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '报工执行人',
- prop: 'reportingOperator',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '批次数量',
- prop: 'batchQuantity',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '入库数量',
- prop: 'inboundQuantity',
- minWidth: 100,
- align: 'center'
- },
- {
- label: '交货仓库',
- prop: 'storageCode',
- minWidth: 100,
- align: 'center',
- formatter: (_row, _column, cellValue) => {
- return this.getDictValue('仓库', _row.storageCode);
- }
- },
- {
- label: '操作',
- slot: 'action'
- }
- ]
- },
- workOrderId: '',
- taskCode: '',
- typeList: {
- 1: '内销订单',
- 2: '外销订单',
- 3: '预制订单'
- },
- statusList: {
- 4: '待生产',
- 5: '生产中',
- 6: '已完成',
- 7: '已延期'
- },
- countMsg: {},
- chooseIndex: 0,
- chooseItem: '',
- request: {
- isLast: 0,
- nextCompleteNum: 0,
- completeNum: 0
- }
- };
- },
- created() {
- this.workOrderId = this.$route.params.id;
- this.getInfo(this.workOrderId);
- this.requestDict('仓库');
- },
- computed: {
- columns() {
- const { taskTypeName: name } = this.tabList[this.activeName];
- if (name.includes('半加')) {
- return this.columnOpt['半加定长'];
- }
- if (
- (name.includes('模压') ||
- name.includes('挤压') ||
- name.includes('等静压')) &&
- this.activeName == 0
- ) {
- return this.columnOpt['挤压成型'];
- }
- return (
- this.columnOpt[this.tabList[this.activeName].taskTypeName] ||
- this.columnOpt['深加工']
- );
- }
- },
- methods: {
- handlePrint() {
- this.$refs.orderPrintRef.open();
- },
- handleTabClick(tab) {
- if (this.chooseIndex != tab.index) {
- this.chooseIndex = Number(tab.index);
- const chooseItem = this.tabList[this.chooseIndex];
- this.chooseItem = this.tabList[this.chooseIndex].taskTypeName;
- this.activeName = tab.index;
- this.taskCode = chooseItem.taskCode || '';
- this.reload({
- workOrderId: this.workOrderId,
- taskCode: this.taskCode
- });
- this.getReportCount();
- this.setData();
- }
- },
- setData() {
- this.request.completeNum = this.tabList[this.chooseIndex].number;
- if (this.chooseIndex == this.tabList.length - 1) {
- this.request.isLast = 1;
- } else {
- this.request.isLast = 0;
- this.request.nextCompleteNum =
- this.tabList[this.chooseIndex + 1].number;
- }
- },
- async datasource({ page, limit, where }) {
- const res = await reportPage({ ...where, pageNum: page, size: limit });
- if (typeof res.list == 'string') {
- res.list = [];
- }
- return res;
- },
- /* 刷新表格 */
- reload(where) {
- this.$nextTick(() =>
- this.$refs.table.reload({ page: 1, limit: 10, where })
- );
- },
- async getInfo(id) {
- const res = await getInfoById(id);
- this.infoData = res;
- if (typeof res.taskTypeProcessDiagrams == 'string') {
- this.tabList = [];
- } else {
- const list = res.taskTypeProcessDiagrams.filter(
- (i) => !i.taskTypeName?.includes('工具')
- );
- const index = list.findIndex((i) =>
- i.taskTypeName.includes('挤压干燥')
- );
- if (index > -1) {
- list[index].taskTypeName = '升温干燥';
- }
- this.tabList = list;
- }
- // this.activeName = this.tabList[0]?.taskTypeName || ''
- this.chooseItem = this.tabList[0]?.taskTypeName;
- this.activeName = 0;
- this.taskCode = this.tabList[0]?.taskCode || '';
- this.chooseIndex = 0;
- this.reload({ workOrderId: this.workOrderId, taskCode: this.taskCode });
- this.getReportCount();
- this.setData();
- },
- async getReportCount() {
- const res = await reportCount({
- taskCode: this.taskCode,
- workOrderId: this.workOrderId
- });
- this.countMsg = res;
- },
- openOther() {
- this.$refs.otherMissionRef.open();
- },
- // 冲销
- writeOff(row) {
- const h = this.$createElement;
- this.$confirm('', {
- message: h('div', null, [
- h('i', {
- class: 'el-icon-question',
- style: 'color:#f90;font-size:30px;'
- }),
- h(
- 'span',
- {
- style:
- 'margin-left:10px;font-size:16px;line-height:30px;font-weight:600;vertical-align:top;'
- },
- '提示'
- ),
- h(
- 'p',
- { style: 'margin:10px 0 0 40px;color:red' },
- '是否要撤销本次报工?'
- )
- ]),
- confirmButtonText: '确定',
- cancelButtonText: '取消'
- })
- .then(() => {
- const data = {
- taskCode: this.taskCode,
- taskName: this.chooseItem,
- reportId: row.id,
- writeOffNum: row.standardNum
- ? row.standardNum
- : row.actualQuantity,
- ...this.request
- };
- writeOffWork(data).then((res) => {
- if (res == 1) {
- this.$message.success('冲销成功');
- this.reload({
- workOrderId: this.workOrderId,
- taskCode: this.taskCode
- });
- this.refreshData();
- } else if (res == 0) {
- this.$confirm('', {
- message: h('div', null, [
- h('i', {
- class: 'el-icon-question',
- style: 'color:#f90;font-size:30px;'
- }),
- h(
- 'span',
- {
- style:
- 'margin-left:10px;font-size:16px;line-height:30px;font-weight:600;vertical-align:top;color:red'
- },
- '冲销失败'
- ),
- h(
- 'p',
- { style: 'margin:10px 0 0 40px' },
- '冲销后的总数不可小于下道工序的总数'
- )
- ]),
- confirmButtonText: '确定',
- showCancelButton: false
- })
- .then(() => {})
- .catch(() => {});
- } else {
- this.$message.error('接口异常');
- }
- });
- })
- .catch(() => {});
- },
- check(row) {
- this.$refs.bomListRef.open(row);
- },
- async refreshData() {
- this.getReportCount();
- const res = await getInfoById(this.workOrderId);
- this.infoData = res;
- if (typeof res.taskTypeProcessDiagrams == 'string') {
- this.tabList = [];
- } else {
- this.tabList = res.taskTypeProcessDiagrams;
- }
- this.setData();
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .el-tabs {
- margin-top: 20px;
- }
- .tips-box {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding-right: 20px;
- ul {
- list-style: none;
- display: flex;
- justify-content: flex-start;
- li {
- margin-right: 40px;
- }
- }
- }
- </style>
|