gongdanshengchan.vue 73 KB

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