gongdanshengchan.vue 73 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705
  1. <template>
  2. <div>
  3. <layout>
  4. <layout-header>
  5. <div class="">
  6. <!-- 按钮部分-->
  7. <el-form ref="elSearchFormRef" :model="searchInfo" class="demo-form-inline" :rules="searchRule" @keyup.enter="onSubmit">
  8. <el-form-item>
  9. <!--按钮 clearable-->
  10. <el-input v-model="searchInfo" placeholder="搜索工单编号" style="width: 180px;"></el-input>
  11. <el-button type="primary" title="搜索" icon="search" @click="onSubmit"></el-button>
  12. <el-button type="primary" title="设置工单的状态-->【计划中】 【生产中】 【已完成】" icon="edit" @click="onStatusClick" class="bt">工单状态设置</el-button>
  13. <div v-if="treeType === 'customTree'">
  14. <el-button type="primary" title="设置工单各个工序的 【完工】 状态" icon="edit" @click="ongxztgzClick" class="bt">工序状态更正</el-button>
  15. <el-button type="primary" title="引用当前产品最近一次的生产参数【设备、显示产能、辅助工时】" icon="edit" @click="pd_yysjcsonClick" class="bt">引用实际参数</el-button>
  16. <!-- <el-button type="primary" title="批量维护工序生产的排程参数" icon="edit" disabled @click="pd_pccswhonClick" class="bt">排程参数维护</el-button>-->
  17. <!-- <el-button type="primary" title="将已经维护好的排产参数,复制给对应产品的对应工艺" icon="edit" disabled @click="pd_pdcsfzonClick" class="bt">排单参数复制</el-button>-->
  18. <!-- <el-button type="primary" title="根据当前生产任务设备状态排程 编辑生产计划" icon="edit" disabled @click="pd_editscjhonClick" class="bt">编辑生产计划</el-button>-->
  19. </div>
  20. <div v-else>
  21. <el-button type="primary" title="将当前已选的生产任务,【加入到设备生产任务清单中】" icon="edit" @click="onjrpcClick" class="bt">加入排产</el-button>
  22. <el-button type="primary" title="暂停工序生产任务,【返回当前设备待产任务清单中】" icon="edit" @click="onztwgClick" class="bt">暂停排产</el-button>
  23. <el-button type="primary" title="将工序佘总为【完工状态】" icon="edit" @click="ongxwgClick" class="bt">工序完工</el-button>
  24. <el-button type="primary" title="设置工单各个工序的【完工】状态" icon="edit" @click="ongxztgzClick" class="bt">工序状态更正</el-button>
  25. <el-button type="primary" title="可【批量设置】所选择的生产任务的生产机台" icon="edit" @click="onjztzClick" class="bt">机组调整</el-button>
  26. <el-button type="primary" title="给担负起那设备做生产任务排程" icon="edit" @click="oncjsbpcClick" class="bt">车间设备制程排序</el-button>
  27. </div>
  28. <el-button type="primary" title="打印生产工单" icon="edit" @click="pd_gdprintonClick" class="bt">工单打印</el-button>
  29. <el-button type="primary" icon="edit" @click="pd_gxclhconClick" class="bt">工序产量核查</el-button>
  30. <el-button type="primary" icon="edit" @click="pd_lcdlistonClick" class="bt">流程单查询</el-button>
  31. </el-form-item>
  32. </el-form>
  33. <!-- 状态设置【弹窗】-->
  34. <el-dialog v-model="onstatuslist" title="工单状态设置" width="30%" style="top: 15%">
  35. <div style="width: 100%;height: 100%;">
  36. <div style="width: 100%; display: flex; align-items: center;">
  37. <el-form-item label="工单编号 :" prop="currentProcess">
  38. <el-input v-model="statusformData['gdbh']" placeholder="" />
  39. </el-form-item>
  40. </div>
  41. <div style="width: 100%; display: flex; align-items: center; margin-top: 30px;">
  42. <span>状态设置:</span>
  43. <el-radio-group v-model="status" style="margin-left: 10px;">
  44. <el-radio label="计划中">计划中</el-radio>
  45. <el-radio label="生产中">生产中</el-radio>
  46. <el-radio label="已完工">已完工</el-radio>
  47. </el-radio-group>
  48. </div>
  49. <div class="dialog-footer" style="text-align: right; margin-top: 40px;">
  50. <el-button @click="handleCancel">取消</el-button>
  51. <el-button type="primary" @click="handleConfirm">确认</el-button>
  52. </div>
  53. </div>
  54. </el-dialog>
  55. <!-- 工序状态更正【弹窗】-->
  56. <el-dialog v-model="gxztgzzlist" title="工序状态更正" style="width: 100%;height: 100%;margin: 0px;padding: 0px">
  57. <el-button type="primary" @click="edit_gxztgzzCancel">更新时间</el-button>
  58. <el-button type="" @click="gxztgzzCancel">退出</el-button>
  59. <div style="width: 100%; height: 60px; padding: 0px; margin: 10px 0px 0px 0px; display: flex; align-items: center;">
  60. <el-form-item label="工单编号 :" prop="currentProcess" style="margin-right: 20px; padding: 0px">
  61. <el-input v-model="gxztgzzformData['gdbh']" @keyup.enter="gxztgzzgetProductValue" placeholder="" style="width: 200px;"/>
  62. </el-form-item>
  63. </div>
  64. <el-table ref="paichengRef"
  65. :show-overflow-tooltip="true"
  66. :row-style="{ height: '0px' }"
  67. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '0px' }"
  68. :header-cell-style="{ padding: '0px' }"
  69. style="width: 100%;height: 74vh" border tooltip-effect="dark"
  70. :data="gxztgzztableData" row-key="ID"
  71. :cell-class-name="gxztgzzCellClass">
  72. <template v-for="(item, idx) in gxztgzztableColumns">
  73. <el-table-column #default="{ row, column, $index }" align="left" :label="item.label" :width="item.width" >
  74. <!-- <div v-if="['完工时间'].includes(item.prop)">-->
  75. <!-- <el-input v-model="row[item.prop]"-->
  76. <!-- :id="`input${idx}${$index}`" @keyup="gxztgzz_handleKeyDown($event, idx, $index, item.prop)"/>-->
  77. <!-- </div>-->
  78. <div v-if="['完工时间'].includes(item.prop)">
  79. <el-date-picker
  80. v-model="row[item.prop]"
  81. type="datetime"
  82. :id="`datepicker${idx}${$index}`"
  83. placeholder="选择日期和时间">
  84. </el-date-picker>
  85. </div>
  86. <div v-else>{{ row[item.prop] }}</div>
  87. </el-table-column>
  88. </template>
  89. </el-table>
  90. </el-dialog>
  91. <!--机组调整【弹窗】-->
  92. <el-dialog v-model="jizuDisplay" title="机组调整" style="width: 600px;">
  93. <el-row class="">
  94. <el-col :span="18">
  95. <el-tree :data="jizuList"
  96. :props="{label:'label', value: 'value', chidlren: 'children'}"
  97. node-key="value"
  98. show-checkbox
  99. :default-expanded-keys="jizuList[0].value"
  100. @check="checkTreeHandle"
  101. style="margin-right: 10px; padding: 10px; border-1px solid #ececec"></el-tree>
  102. </el-col>
  103. <el-col :span="6">
  104. <div><el-button type="primary" @click="saveJizuTiaozheng">确定</el-button></div>
  105. <div style="margin-top: 20px"><el-button @click="()=>jizuDisplay = false">取消</el-button> </div>
  106. </el-col>
  107. </el-row>
  108. </el-dialog>
  109. <!--车间设备排程【弹窗】-->
  110. <el-dialog v-model="cjsbpclist" title="车间设备制程排序" style="width: 100%;height: 100%;margin: 0px;padding: 0px">
  111. <el-button type="" @click="cjsbpcCancel">退出</el-button>
  112. <div style="width: 100%; height: 60px; padding: 0px; margin: 10px 0px 0px 0px; ">
  113. <div style="width: 100%; height: 60px; padding: 0px; display: flex; align-items: center;">
  114. <el-form-item label="设备代号 :" prop="currentProcess" style="margin-right: 20px; padding: 0px">
  115. <el-input v-model="cjsbpcformData['sbdh']" disabled placeholder="" />
  116. </el-form-item>
  117. <el-form-item label="班次选择:" prop="originalName" style="margin-left: 20px;">
  118. <el-select v-model="cjsbpcformData.banci" placeholder="请选择" style="width: 230px;" allow-create filterable @change="setBanci">
  119. <el-option
  120. v-for="(option, index) in cjsbpcformData.bancis"
  121. :key="index"
  122. :label="option.value"
  123. :value="option.value"
  124. >
  125. {{option.label}}
  126. </el-option>
  127. </el-select>
  128. </el-form-item>
  129. <el-form-item label="" prop="isBanciSelected" style="margin-left: 20px;">
  130. <el-checkbox v-model="cjsbpcformData.isBanciSelected">所有班次</el-checkbox>
  131. </el-form-item>
  132. <el-form-item label="" prop="" style="margin-left: 25px;">
  133. <el-button type="" icon="edit" @click="oneditpcClick">更新排程</el-button>
  134. </el-form-item>
  135. </div>
  136. <el-table ref="paichengRef"
  137. :show-overflow-tooltip="true"
  138. :row-style="{ height: '0px' }"
  139. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '0px' }"
  140. :header-cell-style="{ padding: '0px' }"
  141. style="width: 100%;height: 74vh" border tooltip-effect="dark"
  142. @row-click="cjpc_tableRowClick"
  143. :data="paichengData" row-key="ID"
  144. :cell-class-name="cjzcCellClass"
  145. >
  146. <!-- highlight-current-row="true"-->
  147. <template v-for="(item, idx) in paichengColumns">
  148. <el-table-column #default="{ row, column, $index }" align="left" :label="item.label" :width="item.width" >
  149. <div v-if="['优先次序', '小时产能', '生产工时', '辅助工时', '班次安排', '排单备注','最早开工时间', '计划开工时间'].includes(item.prop)">
  150. <el-input v-model="row[item.prop]"
  151. :id="`input${idx}${$index}`"
  152. @blur="handleBlur(item['label'], item)"
  153. @keyup="handleKeyDown($event, idx, $index, item.prop)"
  154. />
  155. <!-- <el-date-picker v-model="row[item.prop]" v-if="['最早开工时间', '计划开工时间'].includes(item.prop)" type="datetime" :clearable="false"-->
  156. <!-- :id="`input${idx}${$index}`"-->
  157. <!-- @keyup="handleKeyDown($event, idx, $index , item.prop)"-->
  158. <!-- />-->
  159. </div>
  160. <div v-else>
  161. {{ row[item.prop] }}
  162. </div>
  163. </el-table-column>
  164. </template>
  165. </el-table>
  166. </div>
  167. </el-dialog>
  168. <!--工序产量核查【弹窗】-->
  169. <el-dialog v-model="pd_gxclhclist" title="工序产量核查" style="width: 100%;height: 100%;margin: 0px;padding: 0px">
  170. <el-button type="" @click="gxclhcCancel">退出</el-button>
  171. <div style="width: 100%; height: 60px; padding: 0px; margin: 10px 0px 0px 0px; display: flex; align-items: center;">
  172. <div style="width: 100%; height: 60px; padding: 0px; display: flex; align-items: center;">
  173. <el-form-item label="工单编号" prop="currentProcess" style="margin-right: 20px; padding: 0px">
  174. <el-input v-model="gxclhcformData['gdbh']" @keyup.enter="gxclhcProductValue" placeholder="" />
  175. </el-form-item>
  176. </div>
  177. </div>
  178. <el-table ref="paichengRef"
  179. :show-overflow-tooltip="true"
  180. :row-style="{ height: '0px' }"
  181. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '0px' }"
  182. :header-cell-style="{ padding: '0px' }"
  183. style="width: 100%;height: 70vh" border tooltip-effect="dark"
  184. highlight-current-row="true"
  185. @row-click="gxclhc_tableRowClick"
  186. :data="gxclhc_Data" row-key="ID"
  187. :cell-class-name="gxclhcCellClass"
  188. >
  189. <template v-for="(item, idx) in gxclhc_Columns">
  190. <el-table-column #default="{ row, column, $index }" align="left" :label="item.label" :width="item.width" >
  191. {{row[item.prop]}}
  192. </el-table-column>
  193. </template>
  194. </el-table>
  195. </el-dialog>
  196. <!--流程单查询【弹窗】-->
  197. <el-dialog v-model="pd_lcdlist" title="工单工序生产进程" style="width: 100%;height: 100%;margin: 0px;padding: 0px;">
  198. <div style="width: 100%;height: 100%;">
  199. <el-button type="" @click="pd_lcdCancel">退出</el-button>
  200. </div>
  201. <div style="width: 100%; height: 100%; display: flex; align-items: center;">
  202. <el-form-item label="工单编号" style="margin-right: 20px; padding: 0;">
  203. <el-input v-model="pd_lcdformData['gdbh']" @keyup.enter="pd_lcdProductValue"/>
  204. </el-form-item>
  205. <el-form-item label="" style="margin-right: 5px; padding: 0;">
  206. <el-input v-model="pd_lcdformData['code']" disabled/>
  207. </el-form-item>
  208. <el-form-item label="" style="margin-right: 5px; padding: 0;">
  209. <el-input v-model="pd_lcdformData['name']" disabled style="width: 500px"/>
  210. </el-form-item>
  211. </div>
  212. <div style="width: 100%; height: 70vh; display: flex;">
  213. <layout>
  214. <layout-sider :resize-directions="['right']" :width="240" style="margin-right: 10px;height: 70vh;">
  215. <div class="JKWTree-tree">
  216. <el-tree :data="pd_lcd_treeData" @node-click="pd_lcd_handleNodeClick" default-expand-all></el-tree>
  217. </div>
  218. </layout-sider>
  219. <layout-main>
  220. <!-- 这里放右侧的内容 -->
  221. <el-space wrap>
  222. <!-- 右侧内容 -->
  223. <template v-for="item in processList.total_process">
  224. <el-button disabled :type="! processList.process.includes(item) ? 'danger' : 'info'" plain style="width: 50px">{{ item }}</el-button>
  225. </template>
  226. </el-space>
  227. </layout-main>
  228. </layout>
  229. </div>
  230. </el-dialog>
  231. </div>
  232. </layout-header>
  233. <layout>
  234. <layout-sider :resize-directions="['right']" :width="190" style="margin-right: 10px;">
  235. <div class="JKWTree-tree" style="height: 200px">
  236. <el-tree :data="treeData" :props="defaultProps" :current-node-key="currentNodeKey" @node-click="handleNodeClick"></el-tree>
  237. </div>
  238. </layout-sider>
  239. <layout-content>
  240. <el-main>
  241. <div class="gva-table-box" v-if="treeType === 'customTree'">
  242. <el-table ref="multipleTable" style="width: 100%;height: 25vh"
  243. :row-style="{ height: '20px' }" :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  244. :header-cell-style="{ padding: '0px' }" border
  245. tooltip-effect="dark" :data="tableData" row-key="ID"
  246. :highlight-current-row="true" size="small" @row-click="gdtableRowClick"
  247. @selection-change="handleSelectionChange" :show-overflow-tooltip="true">
  248. <template v-for="item in tableFields[currentNode]">
  249. <el-table-column :align="item.align" :label="item.title" :prop="item.prop" :width="item.width" />
  250. </template>
  251. </el-table>
  252. <!-- 分页 -->
  253. <div class="gva-pagination" v-if="(currentNode == '计划中' || currentNode == '已完工') && treeType === 'customTree'">
  254. <el-pagination
  255. @size-change="jhz_handleSizeChange"
  256. @current-change="jhz_handleCurrentChange"
  257. :current-page="jhz_page"
  258. :page-sizes="[10,30,50,100]"
  259. :page-size="30"
  260. layout="total, sizes, prev, pager, next, jumper"
  261. :total="jhz_total">
  262. </el-pagination>
  263. </div>
  264. </div>
  265. <el-tabs v-model="activeName" @tab-click="handleClick" v-if="(currentNode == '计划中' || currentNode == '已完工') && treeType === 'customTree'">
  266. <el-tab-pane label="工艺资料" @click="showTable('工艺资料')" name="first">
  267. <el-table ref="multipleTable" :show-overflow-tooltip="true" :row-style="{ height: '20px' }"
  268. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  269. :header-cell-style="{ padding: '0px' }" highlight-current-row="true"
  270. style="width: 100%;height: 42vh" border tooltip-effect="dark" :data="gytableData" row-key="ID" @selection-change="handleSelectionChange">
  271. <el-table-column align="left" label="工单编号" prop="工单编号" width="90"/>
  272. <el-table-column align="left" label="重点工序" prop="重点工序" width="90"/>
  273. <el-table-column align="left" label="印件工序及名称" prop="印件工序及名称" width="500"/>
  274. <el-table-column align="left" label="工序备注" prop="工序备注" width="150"/>
  275. <el-table-column align="left" label="机组" prop="机组" width="80"/>
  276. <el-table-column align="left" label="小时产能" prop="小时产能" width="90"/>
  277. <el-table-column align="left" label="生产工时" prop="生产工时" width="90"/>
  278. <el-table-column align="left" label="辅助工时" prop="辅助工时" width="90"/>
  279. <el-table-column align="left" label="印刷方式" prop="印刷方式" width="90"/>
  280. <el-table-column align="left" label="版距" prop="版距" width="70"/>
  281. <el-table-column align="left" label="创建用户" prop="创建用户" width="100"/>
  282. <el-table-column align="left" label="创建时间" prop="创建时间" width="110"/>
  283. <el-table-column align="left" label="修改时间" prop="修改时间" width="110"/>
  284. <el-table-column align="left" label="UNIQID" prop="UNIQID" width="90"/>
  285. </el-table>
  286. </el-tab-pane>
  287. <el-tab-pane label="印件资料" @click="showTable('印件资料')" name="second">
  288. <el-table ref="multipleTable" :row-style="{ height: '20px' }"
  289. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  290. :header-cell-style="{ padding: '0px' }" :show-overflow-tooltip="true"
  291. :highlight-current-row="true"
  292. style="width: 100%;height: 42vh" border tooltip-effect="dark" :data="yjtableData" row-key="ID" @selection-change="handleSelectionChange">
  293. <el-table-column align="left" label="工单编号" prop="工单编号" width="90"/>
  294. <el-table-column align="left" label="印件号" prop="印件号" width="70"/>
  295. <el-table-column align="left" label="印件代号" prop="印件代号" width="100"/>
  296. <el-table-column align="left" label="印件名称" prop="印件名称" width="240"/>
  297. <el-table-column align="left" label="纸张名称" prop="纸张名称" width="230"/>
  298. <el-table-column align="left" label="投料规格" prop="投料规格" width="100"/>
  299. <el-table-column align="left" label="成品数量" prop="成品数量" width="90"/>
  300. <el-table-column align="left" label="实际投料" prop="实际投料" width="90"/>
  301. <el-table-column align="left" label="投料单位" prop="投料单位" width="85"/>
  302. <el-table-column align="left" label="平张投料" prop="平张投料" width="90"/>
  303. <el-table-column align="left" label="联数" prop="联数" width="70"/>
  304. <el-table-column align="left" label="开数" prop="开数" width="70"/>
  305. <el-table-column align="left" label="创建用户" prop="创建用户" width="110"/>
  306. <el-table-column align="left" label="创建时间" prop="创建时间" width="110"/>
  307. <el-table-column align="left" label="修改时间" prop="修改时间" width="110"/>
  308. <el-table-column align="left" label="UNIQID" prop="UNIQID" width="90"/>
  309. </el-table>
  310. </el-tab-pane>
  311. </el-tabs>
  312. <div v-if="treeType === 'customTree'">
  313. <el-table ref="multipleTable2"
  314. v-if="['排程中', '制程中'].includes(currentNode)"
  315. :show-overflow-tooltip="true" :row-style="{ height: '20px' }"
  316. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  317. :header-cell-style="{ padding: '0px' }" :highlight-current-row="true"
  318. :cell-class-name="pczc_planUsageCellClass"
  319. style="width: 100%;height: 42vh" border tooltip-effect="dark" :data="bottomData" row-key="ID" @selection-change="handleSelectionChange">
  320. <template v-for="item in bottomTableF[currentNode]">
  321. <el-table-column :align="item.align" :label="item.title" :prop="item.prop" :width="item.width" />
  322. </template>
  323. </el-table>
  324. </div>
  325. <div v-if="treeType === 'dataTree'">
  326. <el-table ref="chejianRef"
  327. :show-overflow-tooltip="true" :row-style="{ height: '20px' }"
  328. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  329. :header-cell-style="{ padding: '0px' }" :highlight-current-row="true" @row-click="chejianRowClick"
  330. style="width: 100%;height: 25vh" border tooltip-effect="dark" :data="chejianData" row-key="ID" @selection-change="PC_handleChange"
  331. >
  332. <el-table-column type="selection" width="30" />
  333. <template v-for="item in [
  334. { align:'left', title: '工单编号', prop: '工单编号', width: 85 },
  335. { align:'left', title: '销售订单号', prop: '销售订单号', width: 200 },
  336. { align:'left', title: '印件名称', prop: '印件名称', width: 320 },
  337. { align:'left', title: '印件工序及名称', prop: '印件工序及名称', width: 200 },
  338. { align:'left', title: '工序产量', prop: '工序产量', width: 90 },
  339. { align:'left', title: '已完成产量', prop: '已完成产量', width: 100 },
  340. { align:'left', title: '产品名称', prop: '产品名称', width: 320 },
  341. { align:'left', title: '订单数量', prop: '订单数量', width: 120 },
  342. { align:'left', title: '计量单位', prop: '计量单位', width: 120 },
  343. { align:'left', title: '交货日期', prop: '交货日期', width: 115 },
  344. { align:'left', title: '产品代号', prop: '产品代号', width: 140 },
  345. { align:'left', title: '工序名称', prop: '工序名称', width: 120 },
  346. { align:'left', title: '机组', prop: '机组', width: 90 },
  347. { align:'left', title: '设备编号', prop: '设备编号', width: 90 },
  348. { align:'left', title: 'UNIQID', prop: 'UNIQID', width: 90 },
  349. { align:'left', title: '印件号', prop: '印件号', width: 90 },
  350. { align:'left', title: '工序号', prop: '工序号', width: 90 },
  351. ]">
  352. <el-table-column :align="item.align" :label="item.title" :prop="item.prop" :width="item.width" />
  353. </template>
  354. </el-table>
  355. <el-table ref="chejianfuRef"
  356. :show-overflow-tooltip="true" :row-style="{ height: '20px' }"
  357. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  358. :header-cell-style="{ padding: '0px' }" :highlight-current-row="true" @row-click="chejianfuRowClick"
  359. style="width: 100%;height: 49vh;margin-top: 10px" border tooltip-effect="dark" :data="chejianfuData" row-key="ID" @selection-change="ZP_handleChange">
  360. <el-table-column type="selection" width="30" />
  361. <template v-for="item in [
  362. { align:'left', title: '工单编号', prop: '工单编号', width: 85 },
  363. { align:'left', title: '销售订单号', prop: '销售订单号', width: 200 },
  364. { align:'left', title: '印件名称', prop: '印件名称', width: 320 },
  365. { align:'left', title: '印件工序及名称', prop: '印件工序及名称', width: 200 },
  366. { align:'left', title: '工序产量', prop: '工序产量', width: 90 },
  367. { align:'left', title: '已完成产量', prop: '已完成产量', width: 100 },
  368. { align:'left', title: '小时产能', prop: '小时产能', width: 90 },
  369. { align:'left', title: '产能系数', prop: '产能系数', width: 90 },
  370. { align:'left', title: '生产工时', prop: '生产工时', width: 90 },
  371. { align:'left', title: '辅助工时', prop: '辅助工时', width: 90 },
  372. { align:'left', title: '最早开工时间', prop: '最早开工时间', width: 160 },
  373. { align:'left', title: '计划开工时间', prop: '计划开工时间', width: 160 },
  374. { align:'left', title: '计划完工时间', prop: '计划完工时间', width: 160 },
  375. { align:'left', title: '班次安排', prop: '班次安排', width: 90 },
  376. { align:'left', title: '排单备注', prop: '排单备注', width: 120 },
  377. { align:'left', title: '产品名称', prop: '产品名称', width: 180 },
  378. { align:'left', title: '订单数量', prop: '订单数量', width: 120 },
  379. { align:'left', title: '计量单位', prop: '计量单位', width: 120 },
  380. { align:'left', title: '交货日期', prop: '交货日期', width: 115 },
  381. { align:'left', title: '优先次序', prop: '优先次序', width: 90 },
  382. { align:'left', title: '产品代号', prop: '产品代号', width: 100 },
  383. { align:'left', title: '工序名称', prop: '工序名称', width: 120 },
  384. { align:'left', title: '设备编号', prop: '设备编号', width: 90 },
  385. { align:'left', title: '车间名称', prop: '车间名称', width: 90 },
  386. { align:'left', title: 'GYUID', prop: 'GYUID', width: 90 },
  387. { align:'left', title: '印件号', prop: '印件号', width: 90 },
  388. { align:'left', title: '工序号', prop: '工序号', width: 90 },
  389. ]">
  390. <el-table-column :align="item.align" :label="item.title" :prop="item.prop" :width="item.width" />
  391. </template>
  392. </el-table>
  393. </div>
  394. </el-main>
  395. </layout-content>
  396. </layout>
  397. </layout>
  398. <PrintPage ref="printPageRef" />
  399. </div>
  400. </template>
  401. <script>
  402. //点击按钮显示下方表格
  403. export default {
  404. data() {
  405. return {
  406. currentTable: '',
  407. activeName: 'first',
  408. // 其他表格数据...
  409. };
  410. },
  411. methods: {
  412. showTable(tableName) {
  413. // 根据点击的按钮设置当前展示的表格
  414. this.currentTable = tableName;
  415. },
  416. showTableChange() {
  417. // 处理表格选中事件
  418. },
  419. // 其他方法...
  420. }
  421. };
  422. </script>
  423. <script setup>
  424. // 全量引入格式化工具 请按需保留
  425. import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
  426. import {createCompany, deleteCompany, deleteCompanyByIds, updateCompany, findCompany, getCompanyList} from '@/api/company'
  427. import { getDictFunc, formatDate, formatBoolean, filterDict, ReturnArrImg, onDownloadFile } from '@/utils/format'
  428. import { ElMessage, ElMessageBox } from 'element-plus'
  429. import { ref, reactive } from 'vue'
  430. import dayjs from 'dayjs'
  431. import {
  432. DataList,
  433. getProduct,
  434. getProductData,
  435. scheduleProcess,
  436. ProductionSchedulingAdd,
  437. Project,
  438. StatusEdit,
  439. EquipmentScheduling,
  440. ScheduleSelection,
  441. MachineWorkOrderList,
  442. projectCraft,
  443. ProcessStatusCorrection,
  444. ProductionSchedulingPause,
  445. ProcessStatusCorrectionEdit,
  446. projectPrint,
  447. setProductStatus,
  448. workbench,
  449. ProcessFlow,
  450. Schedule,
  451. complete,
  452. getOrderProcessCount,
  453. getOrderProcessLeft,
  454. getOrderProcessRight,
  455. gdzl_MachineList,
  456. EquipmentSchedulingEdit,
  457. MachineTeamEdit
  458. } from "@/api/yunyin/yunying";
  459. import PrintPage from './components/print.vue'
  460. defineOptions({name: 'Company'})
  461. const printPageRef = ref()
  462. // =========== 左侧树侧形结构 ===========
  463. const sctreeData = ref([
  464. {
  465. label: '排产进程及参数设置',
  466. children:[
  467. {label: '1.计划中工单', number: "计划中", type: '__customer'},
  468. {label: '2.排程中工单', number: "排程中",type: '__customer'},
  469. {label: '3.制程中工单', number: "制程中", type: '__customer'},
  470. {label: '4.已完工工单', number: "已完工", type: '__customer'}
  471. ],
  472. }
  473. ]);
  474. //上方表格
  475. const tableFields = ref({
  476. "计划中": [
  477. { title:'获取状态', prop: 'statusColumn', width: 80, align:'center'},
  478. { title:'生产分类', prop: '生产分类', width: 80, align:'left', },
  479. { title: '工单编号', prop: '工单编号', width: 80, align:'center', },
  480. { title: '产品代号', prop: '产品代号', width: 90, align:'center', },
  481. { title: '产品名称', prop: '产品名称', width: 280, align:'left', },
  482. { title: '接单日期', prop: '接单日期', width: 110, align:'left', },
  483. { title: '交货日期', prop: '交货日期', width: 110, align:'left', },
  484. { title: '订单数量', prop: '订单数量', width: 80, align:'left', },
  485. { title: '计量单位', prop: '计量单位', width: 80, align:'center', },
  486. { title: '客户名称', prop: '客户名称', width: 200, align:'left', },
  487. { title: '客户编号', prop: '客户编号', width: 80, align:'center', },
  488. { title: '备注', prop: '备注', width: 230, align:'left', },
  489. { title: '客户料号', prop: '客户料号', width: 120, align:'left', },
  490. { title: '创建用户', prop: '创建用户', width: 110, align:'left', },
  491. { title: '创建时间', prop: '创建时间', width: 110, align:'left', },
  492. { title: '修改时间', prop: '修改时间', width: 110, align:'left', },
  493. { title: 'UNIQID', prop: 'UNIQID', width: 80 , align:'left', },
  494. { title: '投料率', prop: '投料率', width: 100, align:'left', },
  495. { title: '销售订单号', prop: '销售订单号', width: 120, align:'left', },
  496. ],
  497. "排程中": [
  498. // { title: '最早开工时间', prop: '最早开工时间', width: 120, align:'left', },
  499. { title: '工单编号', prop: '工单编号', width: 80, align:'left', },
  500. { title: '产品代号', prop: '产品代号', width: 90, align:'left', },
  501. { title: '产品名称', prop: '产品名称', width: 340, align:'left', },
  502. { title: '接单日期', prop: '接单日期', width: 110, align:'left', },
  503. { title: '交货日期', prop: '交货日期', width: 110, align:'left', },
  504. { title: '订单数量', prop: '订单数量', width: 80, align:'left', },
  505. { title: '计量单位', prop: '计量单位', width: 80, align:'left', },
  506. { title: '销售订单号', prop: '销售订单号', width: 200, align:'left', },
  507. // { title: '排程类型', prop: '排程类型', width: 120, align:'left', },
  508. { title: '客户编号', prop: '客户编号', width: 120, align:'left', },
  509. { title: '客户名称', prop: '客户名称', width: 230, align:'left', },
  510. { title: '创建用户', prop: '创建用户', width: 120, align:'left', },
  511. // { title: 'GDUID', prop: 'GDUID', width: 120, align:'left', },
  512. { title: 'GYUID', prop: 'GYUID', width: 100, align:'left', },
  513. ],
  514. "制程中": [
  515. // { title: '最早开工时间', prop: '最早开工时间', width: 120, align:'left', },
  516. { title: '工单编号', prop: '工单编号', width: 80, align:'left', },
  517. { title: '产品代号', prop: '产品代号', width: 90, align:'left', },
  518. { title: '产品名称', prop: '产品名称', width: 340, align:'left', },
  519. { title: '接单日期', prop: '接单日期', width: 110, align:'left', },
  520. { title: '交货日期', prop: '交货日期', width: 110, align:'left', },
  521. { title: '订单数量', prop: '订单数量', width: 80, align:'left', },
  522. { title: '计量单位', prop: '计量单位', width: 80, align:'left', },
  523. { title: '销售订单号', prop: '销售订单号', width: 200, align:'left', },
  524. // { title: '排程类型', prop: '排程类型', width: 120, align:'left', },
  525. { title: '客户编号', prop: '客户编号', width: 120, align:'left', },
  526. { title: '客户名称', prop: '客户名称', width: 120, align:'left', },
  527. { title: '客户料号', prop: '客户料号', width: 160, align:'left', },
  528. // { title: 'GDUID', prop: 'GDUID', width: 120, align:'left', },
  529. { title: 'GYUID', prop: 'GYUID', width: 100, align:'left', },
  530. ],
  531. "已完工": [
  532. { title: '工单编号', prop: '工单编号', width: 80, align:'left', },
  533. { title: '产品代号', prop: '产品代号', width: 110, align:'left', },
  534. { title: '产品名称', prop: '产品名称', width: 340, align:'left', },
  535. { title: '接单日期', prop: '接单日期', width: 110, align:'left', },
  536. { title: '交货日期', prop: '交货日期', width: 110, align:'left', },
  537. { title: '订单数量', prop: '订单数量', width: 80, align:'left', },
  538. { title: '计量单位', prop: '计量单位', width: 80, align:'left', },
  539. { title: '销售订单号', prop: '销售订单号', width: 120, align:'left', },
  540. { title: '客户编号', prop: '客户编号', width: 80, align:'left', },
  541. { title: '客户名称', prop: '客户名称', width: 120, align:'left', },
  542. { title: '客户料号', prop: '客户料号', width: 120, align:'left', },
  543. // { title: '排程类型', prop: '排程类型', width: 120, align:'left', },
  544. { title: 'GDUID', prop: 'GDUID', width: 80, align:'left', },
  545. ]
  546. })
  547. //排程中、制程中下方表格列表
  548. const bottomTableF = ref({
  549. "排程中": [
  550. { title:'工单编号', prop: '工单编号', width: 90, align:'left', },
  551. { title:'印件工序及名称', prop: '印件工序及名称', width: 160, align:'left', },
  552. { title:'机组', prop: '机组', width: 120, align:'left', },
  553. { title:'设备编号', prop: '设备编号', width: 120, align:'left', },
  554. { title:'工序产量', prop: '工序产量', width: 120, align:'left', },
  555. { title:'已完成产量', prop: '产量', width: 120, align:'left', },
  556. { title:'剩余产量', prop: '剩余产量', width: 120, align:'left', },
  557. { title:'小时产能', prop: '小时产能', width: 120, align:'left', },
  558. { title:'产能系数', prop: '产能系数', width: 120, align:'left', },
  559. { title:'生产工时', prop: '生产工时', width: 120, align:'left', },
  560. { title:'辅助工时', prop: '辅助工时', width: 120, align:'left', },
  561. { title:'最早开工时间', prop: '最早开工时间', width: 120, align:'left', },
  562. { title:'计划开工时间', prop: '计划开工时间', width: 120, align:'left', },
  563. { title:'计划完工时间', prop: '计划完工时间', width: 120, align:'left', },
  564. { title:'班次安排', prop: '班次安排', width: 120, align:'left', },
  565. { title:'设备名称', prop: '设备名称', width: 120, align:'left', },
  566. { title:'排单备注', prop: '排单备注', width: 120, align:'left', },
  567. { title:'工序完工', prop: '工序完工', width: 160, align:'left', },
  568. { title:'UNIQID', prop: 'UNIQID', width: 120, align:'left', },
  569. ],
  570. "制程中": [
  571. { title:'工单编号', prop: '工单编号', width: 90, align:'left', },
  572. { title:'印件工序及名称', prop: '印件工序及名称', width: 160, align:'left', },
  573. { title:'机组', prop: '机组', width: 120, align:'left', },
  574. { title:'设备编号', prop: '设备编号', width: 120, align:'left', },
  575. { title:'工序产量', prop: '工序产量', width: 120, align:'left', },
  576. { title:'已完成产量', prop: '产量', width: 120, align:'left', },
  577. { title:'剩余产量', prop: '剩余产量', width: 120, align:'left', },
  578. { title:'小时产能', prop: '小时产能', width: 120, align:'left', },
  579. { title:'产能系数', prop: '产能系数', width: 120, align:'left', },
  580. { title:'生产工时', prop: '生产工时', width: 120, align:'left', },
  581. { title:'辅助工时', prop: '辅助工时', width: 120, align:'left', },
  582. { title:'最早开工时间', prop: '最早开工时间', width: 120, align:'left', },
  583. { title:'计划开工时间', prop: '计划开工时间', width: 120, align:'left', },
  584. { title:'计划完工时间', prop: '计划完工时间', width: 120, align:'left', },
  585. { title:'班次安排', prop: '班次安排', width: 120, align:'left', },
  586. { title:'设备名称', prop: '设备名称', width: 120, align:'left', },
  587. { title:'排单备注', prop: '排单备注', width: 120, align:'left', },
  588. { title:'工序完工', prop: '工序完工', width: 160, align:'left', },
  589. { title:'UNIQID', prop: 'UNIQID', width: 120, align:'left', },
  590. ],
  591. })
  592. //左侧左边栏
  593. const treeData = ref([]);
  594. //车间侧边栏 进入页面自动加载【车间】数据
  595. const workbenchdata = async () => {
  596. try {
  597. const data = await workbench();
  598. const rawData = data.data;
  599. const dataArray =Object.keys(rawData).map(key => ({
  600. label: key,
  601. children: Object.keys(rawData[key]).map(subKey => ({
  602. label: subKey,
  603. children: rawData[key][subKey].map(item => ({
  604. label: item
  605. }))
  606. }))
  607. }));
  608. treeData.value = dataArray;
  609. treeData.value.unshift(sctreeData.value[0])
  610. } catch (error) {
  611. console.error(error);
  612. }
  613. };
  614. workbenchdata();
  615. //全局获取工单编号
  616. const _Gd_gdbh = ref(null)
  617. //点击表格 通过上方表格【工单编号】获取下方表格数据
  618. const chejianRowClick = async (row) => {
  619. _Gd_gdbh.value = row.工单编号;
  620. }
  621. const gdtableRowClick = async (row) => {
  622. _Gd_gdbh.value = row.工单编号;
  623. if (currentNode.value == "计划中") {
  624. if(row['statusColumn'] === "*"){
  625. gytableData.value = [];
  626. yjtableData.value = [];
  627. return false;
  628. }else{
  629. //计划中工单->工艺资料接口
  630. const gyres = await projectCraft({Gd_gdbh: _Gd_gdbh.value});
  631. //工艺资料表格
  632. gytableData.value.splice(0, gytableData.value.length, ...gyres.data);
  633. //计划中工单->印件资料接口
  634. const yjres = await projectPrint({Gd_gdbh: _Gd_gdbh.value});
  635. //印件资料表格
  636. yjtableData.value.splice(0, yjtableData.value.length, ...(yjres?.data ?? []));
  637. }
  638. }
  639. if (currentNode.value == "排程中") {
  640. const pc_scheduleProcess = await scheduleProcess({Gd_gdbh: _Gd_gdbh.value});
  641. // console.log(pc_scheduleProcess)
  642. bottomData.value = pc_scheduleProcess.data;
  643. }
  644. if (currentNode.value == "制程中") {
  645. const zc_scheduleProcess = await scheduleProcess({Gd_gdbh: _Gd_gdbh.value});
  646. bottomData.value = zc_scheduleProcess.data;
  647. }
  648. if (currentNode.value == "已完工") {
  649. //工艺资料
  650. const ywg_gyres = await projectCraft({Gd_gdbh: _Gd_gdbh.value});
  651. gytableData.value.splice(0, gytableData.value.length, ...ywg_gyres.data);
  652. //印件资料
  653. const ywg_yjres = await projectPrint({Gd_gdbh: _Gd_gdbh.value});
  654. yjtableData.value.splice(0, yjtableData.value.length, ...ywg_yjres.data);
  655. }
  656. };
  657. //点击左侧树形获取机台侧边栏列表
  658. const tableData = ref([]);
  659. const _machine = ref(null);
  660. const treeType = ref('customTree') // dataTree // 计划中,排产中 ,dataTree 车间
  661. const handleNodeClick = async (node) => {
  662. // console.log(node)
  663. // console.log(node['$treeNodeId'])
  664. if (node.type && node.type === '__customer') {
  665. treeType.value = 'customTree'
  666. schandleNodeClick(node)
  667. } else if (!node.children) {
  668. treeType.value = 'dataTree'
  669. const custom_code = node.label;
  670. // 使用字符串分割获取#前面的数据
  671. const dataBeforeHash = custom_code.split('#')[0].trim();
  672. _machine.value = dataBeforeHash + '#';
  673. // if(_machine.value && node['$treeNodeId']){
  674. // console.log(_machine.value)
  675. // console.log(node['$treeNodeId'])
  676. // return 'el-background-color';
  677. // }
  678. console.log('机台' + _machine.value)
  679. const zhubiao = await MachineWorkOrderList({ machine:_machine.value})
  680. chejianData.value = zhubiao.data['排程'];
  681. chejianfuData.value = zhubiao.data['制程'];
  682. }
  683. };
  684. //默认显示计划中表格
  685. const currentNode = ref("计划中")
  686. //计划中、已完工下方印件资料
  687. const yjtableData = ref([])
  688. //计划中、已完工下方工艺资料
  689. const gytableData = ref([])
  690. //排程中、制程中下方表格
  691. const bottomData = ref([])
  692. //车间机台排程列表
  693. const chejianData = ref([])
  694. //车间机台制程列表
  695. const chejianfuData = ref([])
  696. //点击侧边栏获取参数
  697. const _cname = ref(null)
  698. //工单侧边栏 设备定额及分配参数设置
  699. const schandleNodeClick = async (node) => {
  700. currentNode.value = node.number
  701. bottomData.value = []
  702. yjtableData.value = []
  703. gytableData.value = []
  704. console.log(node.number)
  705. switch (node.number) {
  706. case "计划中":
  707. const jhz_Projectdata = await Project({status:currentNode.value,search:'',page:1,limit:30});
  708. for (let i = 0; i < jhz_Projectdata.data.data.length; i++) {
  709. const item = jhz_Projectdata.data.data[i];
  710. if (item.status === 0) {
  711. //获取状态
  712. item.statusColumn = "*";
  713. }
  714. else if (item.status === 1) {
  715. item.statusColumn = "";
  716. }
  717. }
  718. tableData.value = jhz_Projectdata.data.data;
  719. //共多少条数据
  720. jhz_total.value = jhz_Projectdata.data.total;
  721. _cname.value = '计划中';
  722. _jhz_Projectdata_page();
  723. break;
  724. case "排程中":
  725. const pc_Schedule = await Schedule({status:currentNode.value,search:''});
  726. tableData.value = pc_Schedule.data;
  727. break;
  728. case "制程中":
  729. const zc_Schedule = await Schedule({status:currentNode.value,search:''});
  730. tableData.value = zc_Schedule.data;
  731. break;
  732. case "已完工":
  733. const ywg_Project = await Project({status:currentNode.value,search:'',page:1,limit:30});
  734. jhz_total.value = ywg_Project.data.total;//共多少条
  735. for (let i = 0; i < ywg_Project.data.data.length; i++) {
  736. const item = ywg_Project.data.data[i];
  737. // 如果 status 为 0,在某一列(比如 statusColumn)中添加 "*"
  738. if (item.status === 0) {
  739. item.statusColumn = "*";
  740. }
  741. else if (item.status === 1) {
  742. item.statusColumn = "";
  743. }
  744. }
  745. tableData.value = ywg_Project.data.data;
  746. jhz_total.value = ywg_Project.data.total;//共多少条
  747. _cname.value = '已完工';
  748. break;
  749. }
  750. };
  751. //分页
  752. const jhz_page = ref(1)//前往多少页
  753. const jhz_total = ref(0)//共多少条
  754. const jhz_pageSize = ref(30)//一页多少条
  755. const jhz_handleCurrentChange = (val) => {
  756. jhz_page.value = val;
  757. _jhz_Projectdata_page();
  758. };
  759. // 修改页面容量 点击多少条/页
  760. const jhz_handleSizeChange = (val) => {
  761. jhz_pageSize.value = val;
  762. _jhz_Projectdata_page();
  763. };
  764. //分页查询调用接口
  765. const _jhz_Projectdata_page = async () => {
  766. if( _cname.value === null || _cname.value === ''){
  767. return false;
  768. }
  769. const jhz_Projectdata = await Project({status: _cname.value,search:'',page:jhz_page.value,limit:jhz_pageSize.value});
  770. for (let i = 0; i < jhz_Projectdata.data.data.length; i++) {
  771. const item = jhz_Projectdata.data.data[i];
  772. if (item.status === 0) {
  773. //获取状态
  774. item.statusColumn = "*";
  775. }
  776. // 如果 status 为 1,可以在相应列中添加其他内容
  777. else if (item.status === 1) {
  778. item.statusColumn = "";
  779. }
  780. }
  781. tableData.value = jhz_Projectdata.data.data;
  782. jhz_total.value = jhz_Projectdata.data.total;//共多少条
  783. };
  784. //左上角搜索计划中、已完工工单编号
  785. const searchInfo = ref('');
  786. //搜索按钮
  787. const onSubmit = () => {
  788. if (!searchInfo.value) {
  789. ElMessage({ type: 'warning', message: '搜索条件为空' });
  790. return false;
  791. }
  792. if(!_machine.value){
  793. if (currentNode.value === '计划中' || currentNode.value === '已完工') {
  794. _Project();
  795. } else if (currentNode.value === '排程中' || currentNode.value === '制程中') {
  796. _Schedule();
  797. } else {
  798. ElMessage({ type: 'warning', message: '查询不到具体条件的工单' });
  799. }
  800. }else{
  801. _MachineWorkOrderList();
  802. }
  803. };
  804. //搜索计划中、已完工一条工单接口
  805. const _Project = async () => {
  806. const status = currentNode.value;
  807. const search = searchInfo.value;
  808. const Project_search = await Project({status:status,search:search,page:1,limit:30});
  809. if(Project_search.msg === '成功'){
  810. tableData.value = Project_search.data.data;
  811. }else{
  812. ElMessage({type: 'warning',message: '查不到具体条件的工单'})
  813. return false;
  814. }
  815. };
  816. // 搜索排程、制程一条工单接口
  817. const _Schedule = async () => {
  818. const status = currentNode.value;
  819. const search = searchInfo.value;
  820. const Schedule_search = await Schedule({status:status,search:search});
  821. if(Schedule_search.msg === '成功'){
  822. tableData.value = Schedule_search.data;
  823. }else{
  824. ElMessage({type: 'warning',message: '查不到具体条件的工单'})
  825. return false;
  826. }
  827. };
  828. //机台搜索一条工单接口
  829. const _MachineWorkOrderList = async () => {
  830. let params = {}
  831. params.search = searchInfo.value;
  832. params.machine = _machine.value;
  833. const MachineWorkOrderList_search = await MachineWorkOrderList(params);
  834. if(MachineWorkOrderList_search.msg === ''){
  835. ElMessage({type: 'warning',message: '查不到具体条件的工单'})
  836. return false;
  837. }else{
  838. chejianfuData.value = MachineWorkOrderList_search.data['制程'];
  839. chejianData.value = MachineWorkOrderList_search.data['排程'];
  840. }
  841. };
  842. //加入排产按钮
  843. const onjrpcClick = async () => {
  844. searchInfo.value = '';
  845. if(_PC_gdbh.value == null || _PC_gdbh.value == ''){
  846. ElMessage({type: 'warning',message: '请勾选排程中工单'})
  847. }else{
  848. if (_PC_xscn.value === '' || _PC_xscn.value === null || _PC_xscn.value === '0') {
  849. ElMessage({type: 'warning',message: '选择中小时产量为 0'})
  850. return false;
  851. }else{
  852. let params = {}
  853. params.workOrder = _PC_gdbh.value;
  854. params.machine = _machine.value;
  855. params.printCode = _PC_yjno.value;
  856. params.processCode = _PC_gxh.value;
  857. const ProductionSchedulingAdd_add = await ProductionSchedulingAdd(params);
  858. if (ProductionSchedulingAdd_add.code === 0) {
  859. const pc_zc_table = await MachineWorkOrderList({machine:_machine.value});
  860. chejianData.value = pc_zc_table.data['排程'];
  861. chejianfuData.value = pc_zc_table.data['制程'];
  862. ElMessage({type: 'success',message: '加入排产 更新成功'});
  863. } else {
  864. ElMessage({ type: 'error',message: '更新失败'})
  865. }
  866. }
  867. }
  868. };
  869. //暂停排产按钮
  870. const onztwgClick = async () => {
  871. searchInfo.value = '';
  872. if(_ZC_gdbh.value == null || _ZC_gdbh.value == ''){
  873. ElMessage({type: 'warning', message: '请勾选制程中工单'})
  874. }else{
  875. let params = {}
  876. params.workOrder = _ZC_gdbh.value;
  877. params.machine = _machine.value;
  878. params.printCode = _ZC_yjno.value;
  879. params.processCode = _ZC_gxh.value;
  880. const ProductionSchedulingAdd_stop = await ProductionSchedulingPause(params);
  881. if (ProductionSchedulingAdd_stop.code === 0) {
  882. const pc_zc_table = await MachineWorkOrderList({machine:_machine.value});
  883. chejianData.value = pc_zc_table.data['排程'];
  884. chejianfuData.value = pc_zc_table.data['制程'];
  885. ElMessage({type: 'success',message: '暂停排产 更新成功'});
  886. } else {
  887. ElMessage({ type: 'error',message: '更新失败'})
  888. }
  889. }
  890. };
  891. //工序完工按钮
  892. const ongxwgClick = async () => {
  893. searchInfo.value = '';
  894. if(_ZC_gdbh.value == null || _ZC_gdbh.value == ''){
  895. onstatuslist.value = false;
  896. ElMessage({type: 'warning',message: '请勾选制程中工单'})
  897. }else{
  898. let params = {}
  899. params.workOrder = _ZC_gdbh.value;
  900. params.processCode = _ZC_gxh.value;
  901. const complete_get = await complete(params);
  902. if (complete_get.code === 0) {
  903. const pc_zc_table = await MachineWorkOrderList({ machine:_machine.value});
  904. // chejianData.value = pc_zc_table.data['排程'];
  905. chejianfuData.value = pc_zc_table.data['制程'];
  906. ElMessage({type: 'success',message: '工序完工 更新成功'})
  907. } else {
  908. ElMessage({ type: 'error',message: '更新失败'})
  909. }
  910. }
  911. };
  912. //加入排程【上面到下面】
  913. const _PC_gxh = ref(null)
  914. const _PC_yjno = ref(null)
  915. const _PC_gdbh = ref(null)
  916. const _PC_xscn = ref(null)
  917. const jitaiArr = ref([])
  918. const PC_handleChange = (arr) => {
  919. let gxh = arr.map((val) => val['gxh']).join(",");
  920. let yjno = arr.map((val) => val['yjno']).join(",");
  921. let str = arr.map((val) => val['工单编号']).join(",");
  922. let xscn = arr.map((val) => val['小时产能']).join(",");
  923. _PC_gxh.value = gxh;
  924. _PC_yjno.value = yjno;
  925. _PC_gdbh.value = str;
  926. _PC_xscn.value = xscn;
  927. jitaiArr.value = arr
  928. }
  929. //加入制程【下面到上面】
  930. const _ZC_gxh = ref(null)
  931. const _ZC_yjno = ref(null)
  932. const _ZC_gdbh = ref(null)
  933. const _ZC_xscn = ref(null)
  934. const ZP_handleChange = (arr) => {
  935. let gxh = arr.map((val) => val['gxh']).join(",");
  936. let yjno = arr.map((val) => val['yjno']).join(",");
  937. let str = arr.map((val) => val['工单编号']).join(",");
  938. let xscn = arr.map((val) => val['小时产能']).join(",");
  939. _ZC_gxh.value = gxh;
  940. _ZC_yjno.value = yjno;
  941. _ZC_gdbh.value = str;
  942. _ZC_xscn.value = xscn;
  943. }
  944. //=========工序产量核查===========
  945. const pd_gxclhclist = ref(false);
  946. const gxclhc_Data = ref([]);
  947. const gxclhc_Columns = ref(
  948. [
  949. { label: '印件及工序名称', prop: 'concatenatedData', width: '380' },
  950. // { label: '印件', prop: 'Gy0_yjno', width: '130' },
  951. // { label: '工序', prop: 'Gy0_gxh', width: '130' },
  952. // { label: '名称', prop: 'Gy0_gxmc', width: '130' },
  953. { label: '工序计划产量', prop: 'Gy0_计划接货数', width: '120' },
  954. { label: '联数', prop: 'Gy0_ls', width: '70' },
  955. { label: '折算车头产量', prop: '折算车头产量', width: '120' },
  956. { label: '实际上报产量', prop: 'sczl_cl', width: '120' },
  957. { label: '制程废品', prop: 'sczl_zcfp', width: '120' },
  958. { label: '制程废品率', prop: '制程废品率', width: '120' },
  959. { label: '来料异常', prop: '来料异常', width: '90' },
  960. { label: '流程单数', prop: 'process_num', width: '90' },
  961. { label: '当前设备', prop: 'Gy0_sbbh', width: '120' },
  962. { label: '工序状态', prop: 'PD_WG', width: '90'},
  963. { label: '首板生产日期', prop: 'sczl_rq', width: '160' },
  964. ]
  965. )
  966. const gxclhcformData = reactive({
  967. gdbh: '',
  968. gdmc: '',
  969. });
  970. // 工序产量核查按钮
  971. const pd_gxclhconClick = async () => {
  972. if(_Gd_gdbh.value === '' || _Gd_gdbh.value === null){
  973. ElMessage({type: 'warning',message: '请选择具体的工单,在进行操作'})
  974. return false;
  975. }
  976. gxclhcformData['gdbh'] = _Gd_gdbh.value;
  977. pd_gxclhclist.value = true;
  978. _getOrderProcessCount();
  979. };
  980. //工序产量核查回车
  981. const gxclhcProductValue = async () => {
  982. _getOrderProcessCount();
  983. }
  984. //工序产量核查退出
  985. const gxclhcCancel = async () => {
  986. pd_gxclhclist.value = false;
  987. };
  988. //工序产量核查方法接口
  989. const _getOrderProcessCount = async () => {
  990. const order = gxclhcformData['gdbh'];
  991. const getOrderProcessCount_list = await getOrderProcessCount({order:order});
  992. const concatenatedData = getOrderProcessCount_list.data.map(item => {
  993. // 优化后的代码,使用模板字符串连接字段值并在单个数字前添加零
  994. const formattedYjno = item.Gy0_yjno.length === 1 ? `0${item.Gy0_yjno}` : item.Gy0_yjno;
  995. const formattedGxh = item.Gy0_gxh.length === 1 ? `0${item.Gy0_gxh}` : item.Gy0_gxh;
  996. const concatenatedValue = `${formattedYjno}-${formattedGxh} ${item.Gy0_gxmc}`;
  997. return {
  998. ...item,
  999. concatenatedData: concatenatedValue, // 使用新属性名
  1000. };
  1001. });
  1002. gxclhc_Data.value = concatenatedData;
  1003. };
  1004. //工序产量核查
  1005. const gxclhcCellClass = ({row, column, rowIndex, columnIndex}) =>{
  1006. if (column.label === '实际上报产量' ||column.label === '制程废品' || column.label === '制程废品率' ||
  1007. column.label === '来料异常' || column.label === '流程单数' || column.label === '当前设备') {
  1008. return 'lan-plan-usage-lows';
  1009. }
  1010. if (column.label === '折算车头产量') {
  1011. return 'gxclhc—color-column-red';
  1012. }
  1013. // 如果不是 'PD_WG' 列,返回空字符串或其他样式类
  1014. if (column.label === '工序状态'){
  1015. if(row['PD_WG'] === '完工'){
  1016. return 'lan-plan-usage-lowshui';
  1017. }else{
  1018. return 'pczccolor-column-lan';
  1019. }
  1020. }
  1021. }
  1022. //===========工单状态设置按钮=======
  1023. const onstatuslist = ref(false);
  1024. const statusformData = reactive({gdbh: '',});
  1025. const status = ref('计划中'); // 默认选择
  1026. const onStatusClick = () => {
  1027. if(_Gd_gdbh.value === null || _Gd_gdbh.value === ''){
  1028. onstatuslist.value = false;
  1029. ElMessage({
  1030. type: 'warning',
  1031. message: '请选择树形后,再操作此功能'
  1032. })
  1033. }else{
  1034. statusformData['gdbh'] = _Gd_gdbh.value;
  1035. onstatuslist.value = true;
  1036. }
  1037. };
  1038. //工单状态设置【放弃按钮】
  1039. const handleCancel = () => {
  1040. onstatuslist.value = false;
  1041. };
  1042. //工单状态设置【执行按钮】
  1043. const handleConfirm = async () => {
  1044. //工单编号
  1045. let workOrder = statusformData['gdbh'];
  1046. //状态
  1047. let statusCode;
  1048. if (status.value === '计划中') {
  1049. statusCode = "3-计划中";
  1050. } else if (status.value === '生产中') {
  1051. statusCode = "2-生产中";
  1052. }else if (status.value === '已完工') {
  1053. statusCode = "1-已完工";
  1054. }
  1055. const StatusEditdata = await StatusEdit({workOrder:workOrder,status:statusCode});
  1056. if (StatusEditdata.code === 0) {
  1057. ElMessage({type: 'success',message: '更新成功'})
  1058. } else {
  1059. ElMessage({type: 'error',message: '更新失败'})
  1060. }
  1061. onstatuslist.value = false;
  1062. };
  1063. // =========== 【工序状态更正】 ===========
  1064. const gxztgzztableColumns = ref(
  1065. [
  1066. { label: '印件及工序', prop: '印件及工序', width: '600' },
  1067. { label: '计划产量/已完成', prop:['计划产量/已完成'], width: '500' },
  1068. { label: '完成率', prop: '完成率', width: '240' },
  1069. { label: '完工时间', prop: '完工时间', width: '300' },
  1070. { label: '设备代号', prop: '设备代号', width: '240' },
  1071. ]
  1072. )
  1073. const gxztgzztableData = ref([]);
  1074. const gxztgzzlist = ref(false);
  1075. const gxztgzzformData = reactive({gdbh: '',});
  1076. //工序状态更正按钮
  1077. const ongxztgzClick = () => {
  1078. if(_Gd_gdbh.value == null){
  1079. gxztgzzlist.value = false;
  1080. ElMessage({type: 'warning',message: '请选择树形后,再操作此功能'})
  1081. }else{
  1082. gxztgzzformData['gdbh'] = _Gd_gdbh.value;
  1083. _ProcessStatusCorrection();
  1084. gxztgzzlist.value = true;
  1085. }
  1086. };
  1087. //工序状态更正回车
  1088. const gxztgzzgetProductValue = () => {
  1089. _ProcessStatusCorrection();
  1090. };
  1091. //工序状态更正接口获取
  1092. const _ProcessStatusCorrection = async (row) => {
  1093. const workOrder = gxztgzzformData['gdbh'];
  1094. const ProcessStatusCorrectiondata = await ProcessStatusCorrection({workOrder:workOrder});
  1095. gxztgzztableData.value = ProcessStatusCorrectiondata.data;
  1096. };
  1097. //工序状态更正更新
  1098. const edit_gxztgzzCancel = async () => {
  1099. const formatDate = (inputDateString) => {
  1100. const timestamp = Date.parse(inputDateString);
  1101. if (isNaN(timestamp)) {
  1102. return ''; // 返回空字符串表示日期无效
  1103. }
  1104. const date = new Date(timestamp);
  1105. const year = date.getFullYear();
  1106. const month = ('0' + (date.getMonth() + 1)).slice(-2);
  1107. const day = ('0' + date.getDate()).slice(-2);
  1108. const hour = ('0' + date.getHours()).slice(-2);
  1109. const minute = ('0' + date.getMinutes()).slice(-2);
  1110. const second = ('0' + date.getSeconds()).slice(-2);
  1111. return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
  1112. };
  1113. const formattedData = gxztgzztableData.value.map(item => {
  1114. return {
  1115. UniqId: item['UniqId'],
  1116. PD_WG: formatDate(item['完工时间']),
  1117. };
  1118. });
  1119. const ProcessStatusCorrectionEdit_status = await ProcessStatusCorrectionEdit(formattedData);
  1120. if (ProcessStatusCorrectionEdit_status.code === 0) {
  1121. ElMessage({ type: 'success',message: '更新成功' })
  1122. } else {
  1123. ElMessage({type: 'error',message: '更新失败'})
  1124. }
  1125. gxztgzzlist.value = false;
  1126. };
  1127. //工序状态更正退出
  1128. const gxztgzzCancel = () => {
  1129. gxztgzzlist.value = false;
  1130. };
  1131. //机组调整按钮
  1132. const jizuDisplay = ref(false)
  1133. const jizuList = ref([])
  1134. const jizuSelection = ref([])
  1135. const onjztzClick = async () => {
  1136. if (jitaiArr.value.length === 0) {
  1137. ElMessage.warning('请选择数据')
  1138. return
  1139. }
  1140. jizuList.value = [
  1141. {
  1142. label: jitaiArr.value[0].车间名称,
  1143. value: jitaiArr.value[0].车间名称,
  1144. disabled: true,
  1145. children: []
  1146. }
  1147. ]
  1148. const res = await gdzl_MachineList({address:jitaiArr.value[0].车间名称})
  1149. jizuList.value[0].children = res.data.map(item => {
  1150. return { label: item, value: item.match(/^\w+#/)[0]}
  1151. })
  1152. jizuDisplay.value = true
  1153. };
  1154. const checkTreeHandle = (data, tree) => {
  1155. jizuSelection.value = tree.checkedNodes
  1156. }
  1157. const saveJizuTiaozheng = async () => {
  1158. if (jizuSelection.value.length === 0) {
  1159. ElMessage.warning('请先勾选机组')
  1160. return
  1161. }
  1162. const uid = jitaiArr.value.map(item => item.GYUID).join(' ')
  1163. const jizu = jizuSelection.value.map(item=>item.value).join(' ')
  1164. try {
  1165. const res = await MachineTeamEdit({UniqId: uid, machine: jizu})
  1166. if (res.code == 0) ElMessage.success('调整成功')
  1167. const pc_zc_table = await MachineWorkOrderList({machine:_machine.value});
  1168. chejianData.value = pc_zc_table.data['排程'];
  1169. chejianfuData.value = pc_zc_table.data['制程'];
  1170. jizuDisplay.value = false
  1171. } catch(e) {
  1172. ElMessage.error(e)
  1173. }
  1174. }
  1175. //=============引用实际参数================
  1176. const pd_yysjcsonClick = () => {
  1177. if(_Gd_gdbh.value == null){
  1178. gxztgzzlist.value = false;
  1179. ElMessage({type: 'warning',message: '请选择树形后,再操作此功能'})
  1180. }else{
  1181. console.log(_Gd_gdbh.value)
  1182. ElMessage({type: 'warning',message: '没有找到该产品的入仓完工记录,不能继续进行'})
  1183. }
  1184. };
  1185. //=============车间设备排程================
  1186. const paichengColumns = ref(
  1187. [
  1188. { label: '优先次序', prop: '优先次序', width: '105' },
  1189. { label: '工单编号', prop: '工单编号', width: '100' },
  1190. // { label: '印件名称', prop: '印件名称', width: '200' },
  1191. { label: '接货数', prop: '计划接货数', width: '90' },
  1192. { label: '已完成', prop: '已完成', width: '90' },
  1193. { label: '小时产能', prop: '小时产能', width: '100' },
  1194. { label: '生产工时', prop: '生产工时', width: '100' },
  1195. { label: '辅助工时', prop: '辅助工时', width: '100' },
  1196. { label: '班次安排', prop: '班次安排', width: '100' },
  1197. { label: '排单备注', prop: '排单备注', width: '150' },
  1198. { label: '最早开工时间', prop: '最早开工时间', width: '180' },
  1199. { label: '计划开工时间', prop: '计划开工时间', width: '180' },
  1200. { label: '计划完工时间', prop: '计划完工时间', width: '180' },
  1201. { label: '销售订单号', prop: '销售订单号', width: '120' },
  1202. { label: '印件/工序', prop: '印件/工序', width: '110' },
  1203. ])
  1204. const handleDataSortAndSettingDate = () => {
  1205. paichengData.value.sort((a, b) => {
  1206. const priorityA = parseFloat(a['优先次序']);
  1207. const priorityB = parseFloat(b['优先次序']);
  1208. // 将空白值放在最后
  1209. if (isNaN(priorityA)) return 1;
  1210. if (isNaN(priorityB)) return -1;
  1211. // 按优先次序升序排序
  1212. return priorityA - priorityB;
  1213. });
  1214. paichengData.value.map((item, index) => {
  1215. console.log(Math.round(((item['计划接货数'] ?? 0) - Number(item['已完成'] ?? 0)) / item['小时产能']).toFixed(1))
  1216. if(item['小时产能'] !== '' && item['小时产能'] !== 0){
  1217. item['生产工时'] = Math.round(((item['计划接货数'] ?? 0) - Number(item['已完成'] ?? 0)) / item['小时产能']).toFixed(1);
  1218. }
  1219. if(item['生产工时'] === 'Infinity' || item['生产工时'] === '-Infinity'){
  1220. item['生产工时'] = 0;
  1221. }
  1222. let hour = parseFloat(item['生产工时']) + parseFloat(item['辅助工时'])
  1223. if ( ((Math.floor(hour) * 10) % 10) !== 5) {
  1224. hour = Math.round(hour)
  1225. }
  1226. const sec = hour * 3600
  1227. const startTime = dayjs(item['计划开工时间']).unix()
  1228. item['计划完工时间'] = dayjs((startTime + sec) * 1000).format('YYYY-MM-DD HH:mm:ss')
  1229. if (index > 0) {
  1230. item['计划开工时间'] = paichengData.value[index-1]['计划完工时间']
  1231. hour = parseFloat(item['生产工时']) + parseFloat(item['辅助工时'])
  1232. if ( ((Math.floor(hour) * 10) % 10) !== 5) {
  1233. hour = Math.round(hour)
  1234. }
  1235. const sec = hour * 3600
  1236. const startTime = dayjs(item['计划开工时间']).unix()
  1237. item['计划完工时间'] = dayjs((startTime + sec) * 1000).format('YYYY-MM-DD HH:mm:ss')
  1238. }
  1239. })
  1240. }
  1241. const handleBlur = (name, item) => {
  1242. console.log(name)
  1243. console.log(item)
  1244. if (name === '优先次序' || name === '计划开工时间' || name === '生产工时' || name === '辅助工时' || name === '最早开工时间') {
  1245. handleDataSortAndSettingDate()
  1246. }
  1247. if (name === '小时产能') {
  1248. // console.log(item)
  1249. // item['生产工时'] = Math.round( ( (item['计划接货数'] ?? 0) - Number(item['已完成'] ?? 0) ) / item['小时产能'] ).toFixed(1)
  1250. // console.log(item['计划接货数'])
  1251. // console.log(item['已完成'])
  1252. // console.log(item['生产工时'])
  1253. handleDataSortAndSettingDate()
  1254. }
  1255. }
  1256. const handleKeyDown = (event, x, y, prop) => {
  1257. const currentElement = document.getElementById(`input${x}${y}`);
  1258. if (currentElement === null && currentElement === undefined) return
  1259. let move = 0
  1260. switch (event.keyCode) {
  1261. case 13: // Enter
  1262. if (x === 0 && y === +y) {
  1263. handleDataSortAndSettingDate()
  1264. }
  1265. const nextInputElement = document.getElementById(`input${x}${y + 1}`);
  1266. if (nextInputElement) {
  1267. nextInputElement.focus();
  1268. }
  1269. break;
  1270. case 40: // 向下箭头
  1271. if (y < paichengData.value.length ){
  1272. const nextInputElement = document.getElementById(`input${x}${y + 1}`);
  1273. if (nextInputElement) {
  1274. nextInputElement.focus();
  1275. }
  1276. }
  1277. break;
  1278. case 38: // 向上箭头
  1279. if ( y > 0) {
  1280. document.getElementById(`input${x}${y - 1}`).focus();
  1281. }
  1282. break;
  1283. case 39: // 向右箭头
  1284. if ( x === 0) {
  1285. move = x + 5
  1286. } else if (x >= 5 && x <=10) {
  1287. move = x + 1
  1288. }
  1289. const nextInputElements = document.getElementById(`input${move}${y}`);
  1290. if (nextInputElements) {
  1291. nextInputElements.focus();
  1292. }
  1293. break;
  1294. case 37: // 向左箭头
  1295. if ( x === 5) {
  1296. move = x - 5
  1297. } else if (x >= 5 && x <=10) {
  1298. move = x - 1
  1299. }
  1300. document.getElementById(`input${move}${y}`).focus();
  1301. break;
  1302. default:
  1303. break;
  1304. }
  1305. }
  1306. const cjsbpclist = ref(false);
  1307. const cjsbpcformData = reactive({
  1308. //设备代号
  1309. sbdh: '',
  1310. // 下拉框选项数据
  1311. bancis: [],
  1312. // 设置默认值
  1313. banci: '',
  1314. isBanciSelected: false,
  1315. });
  1316. const pd_gdprintonClick = () => {
  1317. printPageRef.value.open(_Gd_gdbh.value)
  1318. }
  1319. //车间设备排程【按钮】
  1320. const oncjsbpcClick = async () => {
  1321. cjsbpcformData['sbdh'] = _machine.value;
  1322. paichengData.value = [];
  1323. _EquipmentSchedulingdata();
  1324. _ScheduleSelectiondata();
  1325. cjsbpclist.value = true;
  1326. };
  1327. //调用班次选择列表接口
  1328. const _ScheduleSelectiondata = async ()=>{
  1329. try {
  1330. const ScheduleSelectiondata = await ScheduleSelection();
  1331. // 清空之前的数据
  1332. cjsbpcformData.bancis = [];
  1333. // 循环遍历数组并将每个班次的detail添加到bancis数组中
  1334. for (const option of ScheduleSelectiondata.data) {
  1335. cjsbpcformData.bancis.push({ label: option.detail, value: option.detail.split('||')[0], rename:option.detail});
  1336. }
  1337. } catch (error) {
  1338. console.error(error);
  1339. }
  1340. }
  1341. //车间设备排程->数据展示
  1342. const paichengData = ref([])
  1343. //点击车间排程行
  1344. const _bcxz_val = ref(null)
  1345. //点击表格行的时候触发的方法
  1346. const cjpc_tableRowClick = (row) => {
  1347. _bcxz_val.value = row; // 保存点击的行数据
  1348. }
  1349. //班次选择列表下拉框
  1350. const setBanci = (v) => {
  1351. if(cjsbpcformData['isBanciSelected'] === true){
  1352. paichengData.value.map( item => item.班次安排 = v)
  1353. }else{
  1354. if (_bcxz_val.value) {
  1355. _bcxz_val.value['班次安排'] = v;
  1356. }
  1357. }
  1358. }
  1359. const _EquipmentSchedulingdata = async ()=>{
  1360. // let machine = 'WY01#';
  1361. let machine = _machine.value;
  1362. try {
  1363. const EquipmentSchedulingdata = await EquipmentScheduling({machine:machine});
  1364. console.log(EquipmentSchedulingdata)
  1365. if (EquipmentSchedulingdata.code === 0) {
  1366. paichengData.value = EquipmentSchedulingdata.data
  1367. paichengData.value.map((item, index) => {
  1368. item['优先次序'] = 50 + index
  1369. })
  1370. handleDataSortAndSettingDate()
  1371. }
  1372. } catch (error) {
  1373. console.error(error);
  1374. }
  1375. }
  1376. //车间设备制程->数据编辑
  1377. //车间设备制程【更新排程】
  1378. const oneditpcClick = async () => {
  1379. const rawValueArray = paichengData._rawValue;
  1380. const formattedData = rawValueArray.map(item => {
  1381. return {
  1382. capacity: item.小时产能,
  1383. ProductionHours: item.生产工时,
  1384. AuxiliaryHours: item.辅助工时,
  1385. shift: item.班次安排,
  1386. remark: item.排单备注,
  1387. start: item.最早开工时间,
  1388. projectTime: item.计划开工时间,
  1389. endTime: item.计划完工时间,
  1390. UniqId: item.UniqId
  1391. };
  1392. });
  1393. console.log(formattedData);
  1394. const EquipmentSchedulingEdit_edit = await EquipmentSchedulingEdit(formattedData);
  1395. // console.log(EquipmentSchedulingEdit_edit)
  1396. if (EquipmentSchedulingEdit_edit.code === 0) {
  1397. ElMessage({ type: 'success', message: '更新成功' });
  1398. console.log(_machine.value)
  1399. const zhubiao = await MachineWorkOrderList({ machine:_machine.value})
  1400. chejianData.value = zhubiao.data['排程'];
  1401. chejianfuData.value = zhubiao.data['制程'];
  1402. cjsbpclist.value = false;
  1403. } else {
  1404. ElMessage({ type: 'error', message: '更新失败' });
  1405. }
  1406. // cjsbpclist.value = true;
  1407. };
  1408. //车间设备制程【退出】
  1409. const cjsbpcCancel = () => {
  1410. cjsbpclist.value = false;
  1411. };
  1412. // =========== 流程单查询 ===========
  1413. const pd_lcdlist = ref(false);
  1414. const pd_lcdformData = reactive({
  1415. gdbh: '',
  1416. code: '',
  1417. name: '',
  1418. });
  1419. // 流程单查询按钮
  1420. const processList = ref([]);
  1421. const pd_lcdlistonClick = async () => {
  1422. if(_Gd_gdbh.value === '' || _Gd_gdbh.value === null){
  1423. ElMessage({type: 'warning',message: '请选择具体的工单,在进行操作'})
  1424. return false;
  1425. }else{
  1426. pd_lcdformData['gdbh'] = _Gd_gdbh.value;
  1427. pd_lcdlist.value = true;
  1428. processList.value = []
  1429. _getOrderProcessLeft_list();
  1430. }
  1431. }
  1432. const pd_lcdProductValue = async () => {
  1433. _getOrderProcessLeft_list();
  1434. }
  1435. const pd_lcd_treeData = ref([]);
  1436. const _getOrderProcessLeft_list = async () => {
  1437. const order = pd_lcdformData['gdbh'];
  1438. // console.log(order)
  1439. try {
  1440. //5.1流程单查询-工单工序生产进程菜单栏
  1441. const getOrderProcessLeft_list = await getOrderProcessLeft({ order:order});
  1442. console.log(getOrderProcessLeft_list)
  1443. pd_lcdformData['code'] = getOrderProcessLeft_list.data.Gd_info['code'];
  1444. pd_lcdformData['name'] = getOrderProcessLeft_list.data.Gd_info['name'];
  1445. pd_lcd_treeData.value = [{
  1446. label: order + '-' + getOrderProcessLeft_list.data.Gd_info['name'],
  1447. // label: order + '-' + getOrderProcessLeft_list.data.Gd_info['code'] + '-' + getOrderProcessLeft_list.data.Gd_info['name'],
  1448. value: undefined,
  1449. children: []
  1450. }]
  1451. const newData = [];
  1452. for (let key in getOrderProcessLeft_list.data.Gy_info) {
  1453. let temp = getOrderProcessLeft_list.data.Gy_info[key];
  1454. let concatenatedValue = `${temp.Gy0_yjno}-${temp.Gy0_gxh} ---> ${temp.Gy0_gxmc}`;
  1455. newData.push({ label: concatenatedValue,value: temp.Gy0_gxh });
  1456. }
  1457. pd_lcd_treeData.value[0].children = newData;
  1458. //5.2流程单查询-获取工单工序生产进程右侧【进入页面默认显示第一个】
  1459. const getOrderProcessRight_list = await getOrderProcessRight({order:order, gxNo:newData[0].value});
  1460. processList.value = getOrderProcessRight_list.data
  1461. } catch (error) {
  1462. console.error(error);
  1463. }
  1464. };
  1465. const pd_lcd_handleNodeClick = async (node) => {
  1466. if (node.value === undefined) return
  1467. const order = pd_lcdformData['gdbh'];
  1468. ////5.2流程单查询-获取工单工序生产进程右侧
  1469. const getOrderProcessRight_list = await getOrderProcessRight({order:order, gxNo:node.value});
  1470. console.log(getOrderProcessRight_list)
  1471. processList.value = getOrderProcessRight_list.data
  1472. };
  1473. // 流程单查询退出
  1474. const pd_lcdCancel = async () => {
  1475. pd_lcdlist.value = false;
  1476. }
  1477. //颜色
  1478. //工序状态更正颜色
  1479. const gxztgzzCellClass = ({row, column, rowIndex, columnIndex}) =>{
  1480. if(row['完工时间'] === ''){
  1481. return 'lan-plan-usage-low';
  1482. }else{
  1483. return 'hui-plan-usage-low';
  1484. }
  1485. }
  1486. //车间设备制程排序背景
  1487. const cjzcCellClass = ({row, column, rowIndex, columnIndex}) =>{
  1488. if (column.label === '小时产能' || column.label === '优先次序' || column.label === '生产工时' || column.label === '辅助工时' || column.label === '班次安排' || column.label === '排单备注' || column.label === '最早开工时间' || column.label === '计划开工时间') {
  1489. return 'background-color-column-fen';
  1490. }
  1491. if (row) {
  1492. return 'color-column-lan';
  1493. }
  1494. }
  1495. //排程中、制程中 下方表格文字变色
  1496. const pczc_planUsageCellClass = ({row, column, rowIndex, columnIndex}) =>{
  1497. if (row['工序完工'].substring(0, 2) === "20") {
  1498. return 'pczccolor-column-hui';
  1499. } else {
  1500. return 'pczccolor-column-lan';
  1501. }
  1502. }
  1503. // 右键勾选
  1504. const rowContextMenu = (row) => {
  1505. // console.log(row)
  1506. return false
  1507. }
  1508. </script>
  1509. <style scoped>
  1510. /* 选中某行背景粉色 */
  1511. :deep(.el-table__body tr.current-row) > td {
  1512. background: #ff80ff !important;
  1513. }
  1514. /*工序产量核查*/
  1515. :deep(.gxclhc—color-column-red div) {
  1516. color: red !important;
  1517. }
  1518. :deep(.lan-plan-usage-lows div) {
  1519. color: blue !important;
  1520. font-weight: bold;
  1521. }
  1522. :deep(.lan-plan-usage-lowshui div) {
  1523. color: #8c939d !important;
  1524. }
  1525. /*排程中、制程中 下方表格文字变色*/
  1526. :deep(.pczccolor-column-hui div) {
  1527. color: #8c939d !important;
  1528. }
  1529. :deep(.pczccolor-column-lan div) {
  1530. color: blue !important;
  1531. }
  1532. /*车间设备制程背景粉色*/
  1533. :deep(.el-table__body .background-color-column-fen div div div) {
  1534. background: #ff80ff !important;
  1535. }
  1536. /*文字蓝色*/
  1537. :deep(.color-column-lan div) {
  1538. color: red !important;
  1539. }
  1540. :deep(.color-column-lan div div div) {
  1541. color: blue !important;
  1542. }
  1543. /*文字灰色*/
  1544. :deep(.hui-plan-usage-low div) {
  1545. color: #8c939d !important;
  1546. }
  1547. /*点击车间机台*/
  1548. :deep(.el-background-color) {
  1549. color: red !important;
  1550. }
  1551. /*工序状态更正颜色【蓝色】*/
  1552. :deep(.lan-plan-usage-low div) {
  1553. color: blue !important;
  1554. }
  1555. :deep(.el-tabs__header){
  1556. margin-bottom: 0;
  1557. }
  1558. :deep(.el-table td .cell) {
  1559. line-height: 30px !important;
  1560. }
  1561. .JKWTree-container {
  1562. display: flex;
  1563. }
  1564. .JKWTree-tree {
  1565. width: 300px;
  1566. background-color: #fff;
  1567. padding: 10px;
  1568. margin-right: 20px;
  1569. }
  1570. .JKWTree-tree h3 {
  1571. font-size: 15px;
  1572. font-weight: 700;
  1573. margin: 10px 0;
  1574. }
  1575. .JKWTree-content {
  1576. flex: 1;
  1577. }
  1578. /*分页*/
  1579. .el-pagination{
  1580. margin-top: 0px !important;
  1581. }
  1582. </style>
  1583. <style scoped>
  1584. :deep(.el-tabs__header){
  1585. margin-bottom: 0;
  1586. }
  1587. .search{
  1588. margin-left: 0px !important;
  1589. margin-right: 10px !important;
  1590. }
  1591. .bt{
  1592. margin-left: 2px !important;
  1593. padding: 3px !important;
  1594. font-size: 12px;
  1595. }
  1596. .el-tabs__header{
  1597. margin: 0px !important;
  1598. }
  1599. .gva-table-box{
  1600. padding: 0px !important;
  1601. }
  1602. .mab{
  1603. margin-bottom: 5px;
  1604. }
  1605. </style>
  1606. <style scoped>
  1607. :deep(.el-table td .cell) {
  1608. line-height: 20px !important;
  1609. }
  1610. :deep(.el-tabs__header){
  1611. margin-bottom: 0;
  1612. }
  1613. .search{
  1614. margin-left: 0px !important;
  1615. margin-right: 10px !important;
  1616. }
  1617. .bt{
  1618. margin-left: 2px !important;
  1619. padding: 3px !important;
  1620. font-size: 12px;
  1621. }
  1622. .el-tabs__header{
  1623. margin: 0px !important;
  1624. }
  1625. .gva-table-box{
  1626. padding: 0px !important;
  1627. }
  1628. .mab{
  1629. margin-bottom: 5px;
  1630. }
  1631. .focusdiv:focus {
  1632. border: 1px solid red;
  1633. }
  1634. </style>