gongdanshengchan.vue 57 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345
  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" icon="search" @click="onSubmit"></el-button>
  12. <el-button type="primary" icon="edit" @click="onStatusClick" class="bt">工单状态设置</el-button>
  13. <div v-if="treeType === 'customTree'">
  14. <el-button type="primary" icon="edit" @click="ongxztgzClick" class="bt">工序状态更正</el-button>
  15. <el-button type="primary" icon="edit" disabled @click="pd_yysjcsonClick" class="bt">引用实际参数</el-button>
  16. <el-button type="primary" icon="edit" disabled @click="pd_pccswhonClick" class="bt">排程参数维护</el-button>
  17. <el-button type="primary" icon="edit" disabled @click="pd_pdcsfzonClick" class="bt">排单参数复制</el-button>
  18. <el-button type="primary" icon="edit" disabled @click="pd_editscjhonClick" class="bt">编辑生产计划</el-button>
  19. </div>
  20. <div v-else>
  21. <el-button type="primary" icon="edit" @click="onjrpcClick" class="bt">加入排产</el-button>
  22. <el-button type="primary" icon="edit" @click="onztwgClick" class="bt">暂停排产</el-button>
  23. <el-button type="primary" icon="edit" @click="ongxwgClick" class="bt">工序完工</el-button>
  24. <el-button type="primary" icon="edit" @click="ongxztgzClick" class="bt">工序状态更正</el-button>
  25. <el-button type="primary" icon="edit" disabled @click="onjztzClick" style="margin: 5px">机组调整</el-button>
  26. <el-button type="primary" icon="edit" @click="oncjsbpcClick" style="margin: 5px">车间设备排程</el-button>
  27. </div>
  28. <el-button type="primary" icon="edit" disabled @click="pd_gdprintonClick" class="bt">工单打印</el-button>
  29. <el-button type="primary" icon="edit" disabled @click="pd_gxclhconClick" class="bt">工序产量核查</el-button>
  30. <el-button type="primary" icon="edit" disabled @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="" @click="gxztgzzCancel">退出</el-button>
  58. <div style="width: 100%; height: 60px; padding: 0px; margin: 10px 0px 0px 0px; display: flex; align-items: center;">
  59. <el-form-item label="工单编号 :" prop="currentProcess" style="margin-right: 20px; padding: 0px">
  60. <el-input v-model="gxztgzzformData['gdbh']" @keyup.enter="gxztgzzgetProductValue" placeholder="" style="width: 200px;"/>
  61. </el-form-item>
  62. </div>
  63. <el-table ref="paichengRef"
  64. :show-overflow-tooltip="true"
  65. :row-style="{ height: '0px' }"
  66. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '0px' }"
  67. :header-cell-style="{ padding: '0px' }"
  68. style="width: 100%;height: 74vh" border tooltip-effect="dark"
  69. :data="gxztgzztableData" row-key="ID"
  70. :cell-class-name="gxztgzzCellClass">
  71. <template v-for="(item, idx) in gxztgzztableColumns">
  72. <el-table-column #default="{ row, column, $index }" align="left" :label="item.label" :width="item.width" >
  73. <!-- <div v-if="['完工时间'].includes(item.prop)">-->
  74. <!-- <el-input v-model="row[item.prop]"-->
  75. <!-- :id="`input${idx}${$index}`" @keyup="gxztgzz_handleKeyDown($event, idx, $index, item.prop)"/>-->
  76. <!-- </div>-->
  77. <div v-if="['完工时间'].includes(item.prop)">
  78. <el-date-picker
  79. v-model="row[item.prop]"
  80. type="datetime"
  81. :id="`datepicker${idx}${$index}`"
  82. placeholder="选择日期和时间">
  83. </el-date-picker>
  84. </div>
  85. <div v-else>{{ row[item.prop] }}</div>
  86. </el-table-column>
  87. </template>
  88. </el-table>
  89. </el-dialog>
  90. <!--加入排产【弹窗】-->
  91. <!--暂停完工【弹窗】-->
  92. <!--暂停完工【弹窗】-->
  93. <!--机组调整【弹窗】-->
  94. <!--车间设备排程【弹窗】-->
  95. <el-dialog v-model="cjsbpclist" title="车间设备排程" style="width: 100%;height: 100%;margin: 0px;padding: 0px">
  96. <el-button type="" @click="cjsbpcCancel">退出</el-button>
  97. <div style="width: 100%; height: 60px; padding: 0px; margin: 10px 0px 0px 0px; ">
  98. <div style="width: 100%; height: 60px; padding: 0px; display: flex; align-items: center;">
  99. <el-form-item label="设备代号 :" prop="currentProcess" style="margin-right: 20px; padding: 0px">
  100. <el-input v-model="cjsbpcformData['sbdh']" disabled placeholder="" />
  101. </el-form-item>
  102. <el-form-item label="班次选择:" prop="originalName" style="margin-left: 20px;">
  103. <el-select v-model="cjsbpcformData.banci" placeholder="请选择" allow-create filterable @change="setBanci">
  104. <el-option
  105. v-for="(option, index) in cjsbpcformData.bancis"
  106. :key="index"
  107. :label="option.value"
  108. :value="option.value"
  109. >
  110. {{option.label}}
  111. </el-option>
  112. </el-select>
  113. </el-form-item>
  114. <el-form-item label="" prop="isBanciSelected" style="margin-left: 20px;">
  115. <el-checkbox v-model="cjsbpcformData.isBanciSelected">所有班次</el-checkbox>
  116. </el-form-item>
  117. <el-form-item label="" prop="" style="margin-left: 25px;">
  118. <!-- <el-button type="" icon="edit" @click="oneditpcClick">更新排程</el-button>-->
  119. <el-button type="" icon="edit" disabled @click="oneditpcClick">更新排程</el-button>
  120. </el-form-item>
  121. </div>
  122. <el-table ref="paichengRef"
  123. :show-overflow-tooltip="true"
  124. :row-style="{ height: '0px' }"
  125. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '0px' }"
  126. :header-cell-style="{ padding: '0px' }"
  127. style="width: 100%;height: 74vh" border tooltip-effect="dark"
  128. highlight-current-row="true"
  129. @row-click="cjpc_tableRowClick"
  130. :data="paichengData" row-key="ID"
  131. >
  132. <template v-for="(item, idx) in paichengColumns">
  133. <el-table-column #default="{ row, column, $index }" align="left" :label="item.label" :width="item.width" >
  134. <div v-if="['优先次序', '生产工时', '辅助工时', '班次安排', '排单备注','最早开工时间', '计划开工时间'].includes(item.prop)">
  135. <el-input v-model="row[item.prop]" :clearable="false"
  136. :id="`input${idx}${$index}`"
  137. @keyup="handleKeyDown($event, idx, $index, item.prop)"
  138. />
  139. <!-- <el-date-picker v-model="row[item.prop]" v-if="['最早开工时间', '计划开工时间'].includes(item.prop)" type="datetime" :clearable="false"-->
  140. <!-- :id="`input${idx}${$index}`"-->
  141. <!-- @keyup="handleKeyDown($event, idx, $index , item.prop)"-->
  142. <!-- />-->
  143. </div>
  144. <div v-else>
  145. {{ row[item.prop] }}
  146. </div>
  147. </el-table-column>
  148. </template>
  149. </el-table>
  150. </div>
  151. </el-dialog>
  152. <!--工单打印【弹窗】-->
  153. <!--工序产量核查【弹窗】-->
  154. <el-dialog v-model="gxclhclist" title="工序产量核查" style="width: 100%;height: 100%;margin: 0px;padding: 0px">
  155. <el-button type="" @click="gxclhcCancel">退出</el-button>
  156. <div style="width: 100%; height: 60px; padding: 0px; margin: 10px 0px 0px 0px; display: flex; align-items: center;">
  157. <div style="width: 100%; height: 60px; padding: 0px; display: flex; align-items: center;">
  158. <el-form-item label="工单编号" prop="currentProcess" style="margin-right: 20px; padding: 0px">
  159. <el-input v-model="gxclhcformData['gdbh']" @keyup.enter="gxclhcProductValue" placeholder="" />
  160. </el-form-item>
  161. <el-form-item label="" prop="currentProcess" style="margin-right: 20px; padding: 0px">
  162. <el-input v-model="gxclhcformData['gdmc']" disabled placeholder="" style="width: 340px;"/>
  163. </el-form-item>
  164. </div>
  165. </div>
  166. </el-dialog>
  167. </div>
  168. </layout-header>
  169. <layout>
  170. <layout-sider :resize-directions="['right']" :width="190" style="margin-right: 10px;">
  171. <div class="JKWTree-tree" style="height: 200px">
  172. <el-tree :data="treeData" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
  173. </div>
  174. </layout-sider>
  175. <layout-content>
  176. <el-main>
  177. <div class="gva-table-box" v-if="treeType === 'customTree'">
  178. <el-table ref="multipleTable" style="width: 100%;height: 25vh"
  179. :row-style="{ height: '20px' }" :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  180. :header-cell-style="{ padding: '0px' }" border
  181. tooltip-effect="dark" :data="tableData" row-key="ID"
  182. :highlight-current-row="true" size="small" @row-click="gdtableRowClick"
  183. @selection-change="handleSelectionChange" :show-overflow-tooltip="true">
  184. <template v-for="item in tableFields[currentNode]">
  185. <el-table-column :align="item.align" :label="item.title" :prop="item.prop" :width="item.width" />
  186. </template>
  187. </el-table>
  188. </div>
  189. <el-tabs v-model="activeName" @tab-click="handleClick" v-if="(currentNode == '计划中' || currentNode == '已完工') && treeType === 'customTree'">
  190. <el-tab-pane label="工艺资料" @click="showTable('工艺资料')" name="first">
  191. <el-table ref="multipleTable" :show-overflow-tooltip="true" :row-style="{ height: '20px' }"
  192. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  193. :header-cell-style="{ padding: '0px' }" highlight-current-row="true"
  194. style="width: 100%;height: 50vh" border tooltip-effect="dark" :data="gytableData" row-key="ID" @selection-change="handleSelectionChange">
  195. <el-table-column align="left" label="工单编号" prop="工单编号" width="90"/>
  196. <el-table-column align="left" label="重点工序" prop="重点工序" width="90"/>
  197. <el-table-column align="left" label="印件工序及名称" prop="印件工序及名称" width="500"/>
  198. <el-table-column align="left" label="工序备注" prop="工序备注" width="150"/>
  199. <el-table-column align="left" label="机组" prop="机组" width="80"/>
  200. <el-table-column align="left" label="小时产能" prop="小时产能" width="90"/>
  201. <el-table-column align="left" label="生产工时" prop="生产工时" width="90"/>
  202. <el-table-column align="left" label="辅助工时" prop="辅助工时" width="90"/>
  203. <el-table-column align="left" label="印刷方式" prop="印刷方式" width="90"/>
  204. <el-table-column align="left" label="版距" prop="版距" width="70"/>
  205. <el-table-column align="left" label="创建用户" prop="创建用户" width="100"/>
  206. <el-table-column align="left" label="创建时间" prop="创建时间" width="110"/>
  207. <el-table-column align="left" label="修改时间" prop="修改时间" width="110"/>
  208. <el-table-column align="left" label="UNIQID" prop="UNIQID" width="90"/>
  209. </el-table>
  210. </el-tab-pane>
  211. <el-tab-pane label="印件资料" @click="showTable('印件资料')" name="second">
  212. <el-table ref="multipleTable" :row-style="{ height: '20px' }"
  213. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  214. :header-cell-style="{ padding: '0px' }" :show-overflow-tooltip="true"
  215. :highlight-current-row="true"
  216. style="width: 100%;height: 50vh" border tooltip-effect="dark" :data="yjtableData" row-key="ID" @selection-change="handleSelectionChange">
  217. <el-table-column align="left" label="工单编号" prop="工单编号" width="90"/>
  218. <el-table-column align="left" label="印件号" prop="印件号" width="70"/>
  219. <el-table-column align="left" label="印件代号" prop="印件代号" width="100"/>
  220. <el-table-column align="left" label="印件名称" prop="印件名称" width="240"/>
  221. <el-table-column align="left" label="纸张名称" prop="纸张名称" width="230"/>
  222. <el-table-column align="left" label="投料规格" prop="投料规格" width="100"/>
  223. <el-table-column align="left" label="成品数量" prop="成品数量" width="90"/>
  224. <el-table-column align="left" label="实际投料" prop="实际投料" width="90"/>
  225. <el-table-column align="left" label="投料单位" prop="投料单位" width="85"/>
  226. <el-table-column align="left" label="平张投料" prop="平张投料" width="90"/>
  227. <el-table-column align="left" label="联数" prop="联数" width="70"/>
  228. <el-table-column align="left" label="开数" prop="开数" width="70"/>
  229. <el-table-column align="left" label="创建用户" prop="创建用户" width="110"/>
  230. <el-table-column align="left" label="创建时间" prop="创建时间" width="110"/>
  231. <el-table-column align="left" label="修改时间" prop="修改时间" width="110"/>
  232. <el-table-column align="left" label="UNIQID" prop="UNIQID" width="90"/>
  233. </el-table>
  234. </el-tab-pane>
  235. </el-tabs>
  236. <div v-if="treeType === 'customTree'">
  237. <el-table ref="multipleTable2"
  238. v-if="['排程中', '制程中'].includes(currentNode)"
  239. :show-overflow-tooltip="true" :row-style="{ height: '20px' }"
  240. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  241. :header-cell-style="{ padding: '0px' }" :highlight-current-row="true"
  242. style="width: 100%;height: 50vh" border tooltip-effect="dark" :data="bottomData" row-key="ID" @selection-change="handleSelectionChange">
  243. <template v-for="item in bottomTableF[currentNode]">
  244. <el-table-column :align="item.align" :label="item.title" :prop="item.prop" :width="item.width" />
  245. </template>
  246. </el-table>
  247. </div>
  248. <div v-if="treeType === 'dataTree'">
  249. <el-table ref="chejianRef"
  250. :show-overflow-tooltip="true" :row-style="{ height: '20px' }"
  251. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  252. :header-cell-style="{ padding: '0px' }" :highlight-current-row="true" @row-click="chejianRowClick"
  253. style="width: 100%;height: 25vh" border tooltip-effect="dark" :data="chejianData" row-key="ID" @selection-change="PC_handleChange">
  254. <el-table-column type="selection" width="30" />
  255. <template v-for="item in [
  256. { align:'left', title: '工单编号', prop: '工单编号', width: 85 },
  257. { align:'left', title: '销售订单号', prop: '销售订单号', width: 200 },
  258. { align:'left', title: '印件名称', prop: '印件名称', width: 320 },
  259. { align:'left', title: '印件工序及名称', prop: '印件工序及名称', width: 200 },
  260. { align:'left', title: '工序产量', prop: '工序产量', width: 90 },
  261. { align:'left', title: '已完成产量', prop: '已完成产量', width: 100 },
  262. { align:'left', title: '产品名称', prop: '产品名称', width: 320 },
  263. { align:'left', title: '订单数量', prop: '订单数量', width: 120 },
  264. { align:'left', title: '计量单位', prop: '计量单位', width: 120 },
  265. { align:'left', title: '交货日期', prop: '交货日期', width: 115 },
  266. { align:'left', title: '产品代号', prop: '产品代号', width: 140 },
  267. { align:'left', title: '工序名称', prop: '工序名称', width: 120 },
  268. { align:'left', title: '机组', prop: '机组', width: 90 },
  269. { align:'left', title: '设备编号', prop: '设备编号', width: 90 },
  270. { align:'left', title: 'UNIQID', prop: 'UNIQID', width: 90 },
  271. { align:'left', title: '印件号', prop: '印件号', width: 90 },
  272. { align:'left', title: '工序号', prop: '工序号', width: 90 },
  273. ]">
  274. <el-table-column :align="item.align" :label="item.title" :prop="item.prop" :width="item.width" />
  275. </template>
  276. </el-table>
  277. <el-table ref="chejianfuRef"
  278. :show-overflow-tooltip="true" :row-style="{ height: '20px' }"
  279. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  280. :header-cell-style="{ padding: '0px' }" :highlight-current-row="true" @row-click="chejianfuRowClick"
  281. style="width: 100%;height: 50vh;margin-top: 10px" border tooltip-effect="dark" :data="chejianfuData" row-key="ID" @selection-change="ZP_handleChange">
  282. <el-table-column type="selection" width="30" />
  283. <template v-for="item in [
  284. { align:'left', title: '工单编号', prop: '工单编号', width: 85 },
  285. { align:'left', title: '销售订单号', prop: '销售订单号', width: 200 },
  286. { align:'left', title: '印件名称', prop: '印件名称', width: 320 },
  287. { align:'left', title: '印件工序及名称', prop: '印件工序及名称', width: 200 },
  288. { align:'left', title: '工序产量', prop: '工序产量', width: 90 },
  289. { align:'left', title: '已完成产量', prop: '已完成产量', width: 100 },
  290. { align:'left', title: '小时产能', prop: '小时产能', width: 90 },
  291. { align:'left', title: '产能系数', prop: '产能系数', width: 90 },
  292. { align:'left', title: '生产工时', prop: '生产工时', width: 90 },
  293. { align:'left', title: '辅助工时', prop: '辅助工时', width: 90 },
  294. { align:'left', title: '最早开工时间', prop: '最早开工时间', width: 160 },
  295. { align:'left', title: '计划开工时间', prop: '计划开工时间', width: 160 },
  296. { align:'left', title: '计划完工时间', prop: '计划完工时间', width: 160 },
  297. { align:'left', title: '班次安排', prop: '班次安排', width: 90 },
  298. { align:'left', title: '排单备注', prop: '排单备注', width: 120 },
  299. { align:'left', title: '产品名称', prop: '产品名称', width: 180 },
  300. { align:'left', title: '订单数量', prop: '订单数量', width: 120 },
  301. { align:'left', title: '计量单位', prop: '计量单位', width: 120 },
  302. { align:'left', title: '交货日期', prop: '交货日期', width: 115 },
  303. { align:'left', title: '优先次序', prop: '优先次序', width: 90 },
  304. { align:'left', title: '产品代号', prop: '产品代号', width: 100 },
  305. { align:'left', title: '工序名称', prop: '工序名称', width: 120 },
  306. { align:'left', title: '设备编号', prop: '设备编号', width: 90 },
  307. { align:'left', title: '车间名称', prop: '车间名称', width: 90 },
  308. { align:'left', title: 'GYUID', prop: 'GYUID', width: 90 },
  309. { align:'left', title: '印件号', prop: '印件号', width: 90 },
  310. { align:'left', title: '工序号', prop: '工序号', width: 90 },
  311. ]">
  312. <el-table-column :align="item.align" :label="item.title" :prop="item.prop" :width="item.width" />
  313. </template>
  314. </el-table>
  315. </div>
  316. </el-main>
  317. </layout-content>
  318. </layout>
  319. </layout>
  320. </div>
  321. </template>
  322. <script>
  323. //点击按钮显示下方表格
  324. export default {
  325. data() {
  326. return {
  327. currentTable: '',
  328. activeName: 'first',
  329. // 其他表格数据...
  330. };
  331. },
  332. methods: {
  333. showTable(tableName) {
  334. // console.log("点击了".tableName)
  335. // 根据点击的按钮设置当前展示的表格
  336. this.currentTable = tableName;
  337. },
  338. showTableChange() {
  339. // 处理表格选中事件
  340. },
  341. // 其他方法...
  342. }
  343. };
  344. </script>
  345. <script setup>
  346. // 全量引入格式化工具 请按需保留
  347. import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
  348. import {createCompany, deleteCompany, deleteCompanyByIds, updateCompany, findCompany, getCompanyList} from '@/api/company'
  349. import { getDictFunc, formatDate, formatBoolean, filterDict, ReturnArrImg, onDownloadFile } from '@/utils/format'
  350. import { ElMessage, ElMessageBox } from 'element-plus'
  351. import { ref, reactive } from 'vue'
  352. import {
  353. DataList, getProduct, getProductData,scheduleProcess,ProductionSchedulingAdd,
  354. Project, StatusEdit, EquipmentScheduling, ScheduleSelection,MachineWorkOrderList,
  355. projectCraft, ProcessStatusCorrection,ProductionSchedulingPause,
  356. projectPrint, setProductStatus, workbench, ProcessFlow, Schedule,complete
  357. } from "@/api/yunyin/yunying";
  358. defineOptions({name: 'Company'})
  359. const chejianData = ref([])
  360. const chejianfuData = ref([])
  361. // =========== 左侧树侧形结构 ===========
  362. const sctreeData = ref([
  363. {
  364. label: '排产进程及参数设置',
  365. children:[
  366. {label: '1.计划中工单', number: "计划中", type: '__customer'},
  367. {label: '2.排程中工单', number: "排程中",type: '__customer'},
  368. {label: '3.制程中工单', number: "制程中", type: '__customer'},
  369. {label: '4.已完工工单', number: "已完工", type: '__customer'}
  370. ],
  371. }
  372. ]);
  373. //上方表格
  374. const tableFields = ref(
  375. {
  376. "计划中": [
  377. { title:'获取状态', prop: 'statusColumn', width: 80, align:'center'},
  378. { title:'生产分类', prop: '生产分类', width: 80, align:'left', },
  379. { title: '工单编号', prop: '工单编号', width: 80, align:'center', },
  380. { title: '产品代号', prop: '产品代号', width: 90, align:'center', },
  381. { title: '产品名称', prop: '产品名称', width: 280, align:'left', },
  382. { title: '接单日期', prop: '接单日期', width: 110, align:'left', },
  383. { title: '交货日期', prop: '交货日期', width: 110, align:'left', },
  384. { title: '订单数量', prop: '订单数量', width: 80, align:'left', },
  385. { title: '计量单位', prop: '计量单位', width: 80, align:'center', },
  386. { title: '客户名称', prop: '客户名称', width: 200, align:'left', },
  387. { title: '客户编号', prop: '客户编号', width: 80, align:'center', },
  388. { title: '备注', prop: '备注', width: 230, align:'left', },
  389. { title: '客户料号', prop: '客户料号', width: 120, align:'left', },
  390. { title: '创建用户', prop: '创建用户', width: 110, align:'left', },
  391. { title: '创建时间', prop: '创建时间', width: 110, align:'left', },
  392. { title: '修改时间', prop: '修改时间', width: 110, align:'left', },
  393. { title: 'UNIQID', prop: 'UNIQID', width: 80 , align:'left', },
  394. { title: '投料率', prop: '投料率', width: 100, align:'left', },
  395. { title: '销售订单号', prop: '销售订单号', width: 120, align:'left', },
  396. ],
  397. "排程中": [
  398. // { title: '最早开工时间', prop: '最早开工时间', width: 120, align:'left', },
  399. { title: '工单编号', prop: '工单编号', width: 80, align:'left', },
  400. { title: '产品代号', prop: '产品代号', width: 90, align:'left', },
  401. { title: '产品名称', prop: '产品名称', width: 340, align:'left', },
  402. { title: '接单日期', prop: '接单日期', width: 110, align:'left', },
  403. { title: '交货日期', prop: '交货日期', width: 110, align:'left', },
  404. { title: '订单数量', prop: '订单数量', width: 80, align:'left', },
  405. { title: '计量单位', prop: '计量单位', width: 80, align:'left', },
  406. { title: '销售订单号', prop: '销售订单号', width: 200, align:'left', },
  407. // { title: '排程类型', prop: '排程类型', width: 120, align:'left', },
  408. { title: '客户编号', prop: '客户编号', width: 120, align:'left', },
  409. { title: '客户名称', prop: '客户名称', width: 230, align:'left', },
  410. { title: '创建用户', prop: '创建用户', width: 120, align:'left', },
  411. // { title: 'GDUID', prop: 'GDUID', width: 120, align:'left', },
  412. { title: 'GYUID', prop: 'GYUID', width: 100, align:'left', },
  413. ],
  414. "制程中": [
  415. // { title: '最早开工时间', prop: '最早开工时间', width: 120, align:'left', },
  416. { title: '工单编号', prop: '工单编号', width: 80, align:'left', },
  417. { title: '产品代号', prop: '产品代号', width: 90, align:'left', },
  418. { title: '产品名称', prop: '产品名称', width: 340, align:'left', },
  419. { title: '接单日期', prop: '接单日期', width: 110, align:'left', },
  420. { title: '交货日期', prop: '交货日期', width: 110, align:'left', },
  421. { title: '订单数量', prop: '订单数量', width: 80, align:'left', },
  422. { title: '计量单位', prop: '计量单位', width: 80, align:'left', },
  423. { title: '销售订单号', prop: '销售订单号', width: 200, align:'left', },
  424. // { title: '排程类型', prop: '排程类型', width: 120, align:'left', },
  425. { title: '客户编号', prop: '客户编号', width: 120, align:'left', },
  426. { title: '客户名称', prop: '客户名称', width: 120, align:'left', },
  427. { title: '客户料号', prop: '客户料号', width: 160, align:'left', },
  428. // { title: 'GDUID', prop: 'GDUID', width: 120, align:'left', },
  429. { title: 'GYUID', prop: 'GYUID', width: 100, align:'left', },
  430. ],
  431. "已完工": [
  432. { title: '工单编号', prop: '工单编号', width: 80, align:'left', },
  433. { title: '产品代号', prop: '产品代号', width: 110, align:'left', },
  434. { title: '产品名称', prop: '产品名称', width: 340, align:'left', },
  435. { title: '接单日期', prop: '接单日期', width: 110, align:'left', },
  436. { title: '交货日期', prop: '交货日期', width: 110, align:'left', },
  437. { title: '订单数量', prop: '订单数量', width: 80, align:'left', },
  438. { title: '计量单位', prop: '计量单位', width: 80, align:'left', },
  439. { title: '销售订单号', prop: '销售订单号', width: 120, align:'left', },
  440. { title: '客户编号', prop: '客户编号', width: 80, align:'left', },
  441. { title: '客户名称', prop: '客户名称', width: 120, align:'left', },
  442. { title: '客户料号', prop: '客户料号', width: 120, align:'left', },
  443. // { title: '排程类型', prop: '排程类型', width: 120, align:'left', },
  444. { title: 'GDUID', prop: 'GDUID', width: 80, align:'left', },
  445. ]
  446. }
  447. )
  448. //下方表格
  449. const bottomTableF = ref({
  450. "排程中": [
  451. { title:'工单编号', prop: '工单编号', width: 90, align:'left', },
  452. { title:'印件工序及名称', prop: '印件工序及名称', width: 160, align:'left', },
  453. { title:'机组', prop: '机组', width: 120, align:'left', },
  454. { title:'设备编号', prop: '设备编号', width: 120, align:'left', },
  455. { title:'工序产量', prop: '工序产量', width: 120, align:'left', },
  456. { title:'已完成产量', prop: '已完成产量', width: 120, align:'left', },
  457. { title:'剩余产量', prop: '剩余产量', width: 120, align:'left', },
  458. { title:'小时产能', prop: '小时产能', width: 120, align:'left', },
  459. { title:'产能系数', prop: '产能系数', width: 120, align:'left', },
  460. { title:'生产工时', prop: '生产工时', width: 120, align:'left', },
  461. { title:'辅助工时', prop: '辅助工时', width: 120, align:'left', },
  462. { title:'最早开工时间', prop: '最早开工时间', width: 120, align:'left', },
  463. { title:'计划开工时间', prop: '计划开工时间', width: 120, align:'left', },
  464. { title:'计划完工时间', prop: '计划完工时间', width: 120, align:'left', },
  465. { title:'班次安排', prop: '班次安排', width: 120, align:'left', },
  466. { title:'设备名称', prop: '设备名称', width: 120, align:'left', },
  467. { title:'排单备注', prop: '排单备注', width: 120, align:'left', },
  468. { title:'工序完工', prop: '工序完工', width: 120, align:'left', },
  469. { title:'UNIQID', prop: 'UNIQID', width: 120, align:'left', },
  470. ],
  471. "制程中": [
  472. { title:'工单编号', prop: '工单编号', width: 90, align:'left', },
  473. { title:'印件工序及名称', prop: '印件工序及名称', width: 160, align:'left', },
  474. { title:'机组', prop: '机组', width: 120, align:'left', },
  475. { title:'设备编号', prop: '设备编号', width: 120, align:'left', },
  476. { title:'工序产量', prop: '工序产量', width: 120, align:'left', },
  477. { title:'已完成产量', prop: '已完成产量', width: 120, align:'left', },
  478. { title:'剩余产量', prop: '剩余产量', width: 120, align:'left', },
  479. { title:'小时产能', prop: '小时产能', width: 120, align:'left', },
  480. { title:'产能系数', prop: '产能系数', width: 120, align:'left', },
  481. { title:'生产工时', prop: '生产工时', width: 120, align:'left', },
  482. { title:'辅助工时', prop: '辅助工时', width: 120, align:'left', },
  483. { title:'最早开工时间', prop: '最早开工时间', width: 120, align:'left', },
  484. { title:'计划开工时间', prop: '计划开工时间', width: 120, align:'left', },
  485. { title:'计划完工时间', prop: '计划完工时间', width: 120, align:'left', },
  486. { title:'班次安排', prop: '班次安排', width: 120, align:'left', },
  487. { title:'设备名称', prop: '设备名称', width: 120, align:'left', },
  488. { title:'排单备注', prop: '排单备注', width: 120, align:'left', },
  489. { title:'工序完工', prop: '工序完工', width: 120, align:'left', },
  490. { title:'UNIQID', prop: 'UNIQID', width: 120, align:'left', },
  491. ],
  492. })
  493. //左侧左边栏
  494. const treeData = ref([]);
  495. //默认显示计划中表格
  496. const currentNode = ref("计划中")
  497. //计划中、已完工下方印件资料
  498. const yjtableData = ref([])
  499. //计划中、已完工下方工艺资料
  500. const gytableData = ref([])
  501. //排程中、制程中下方表格
  502. const bottomData = ref([])
  503. //工单侧边栏 设备定额及分配参数设置
  504. const schandleNodeClick = async (node) => {
  505. currentNode.value = node.number
  506. bottomData.value = []
  507. yjtableData.value = []
  508. gytableData.value = []
  509. switch (node.number) {
  510. case "计划中":
  511. console.log(currentNode.value)
  512. const jhz_Projectdata = await Project({status:currentNode.value});
  513. console.log(jhz_Projectdata)
  514. for (let i = 0; i < jhz_Projectdata.data.length; i++) {
  515. const item = jhz_Projectdata.data[i];
  516. if (item.status === 0) {
  517. item.statusColumn = "*";
  518. }
  519. // 如果 status 为 1,可以在相应列中添加其他内容
  520. else if (item.status === 1) {
  521. item.statusColumn = "";
  522. }
  523. }
  524. tableData.value = jhz_Projectdata.data;
  525. break;
  526. case "排程中":
  527. console.log(currentNode.value)
  528. // /Manufacture/Schedule
  529. const pc_Schedule = await Schedule({status:currentNode.value,search:''});
  530. console.log(pc_Schedule)
  531. tableData.value = pc_Schedule.data;
  532. break;
  533. case "制程中":
  534. console.log(currentNode.value)
  535. const zc_Schedule = await Schedule({status:currentNode.value,search:''});
  536. console.log(zc_Schedule)
  537. tableData.value = zc_Schedule.data;
  538. break;
  539. case "已完工":
  540. console.log(currentNode.value)
  541. const ywg_Project = await Project({status:currentNode.value});
  542. for (let i = 0; i < ywg_Project.data.length; i++) {
  543. const item = ywg_Project.data[i];
  544. // 如果 status 为 0,在某一列(比如 statusColumn)中添加 "*"
  545. if (item.status === 0) {
  546. item.statusColumn = "*";
  547. }
  548. else if (item.status === 1) {
  549. item.statusColumn = "";
  550. }
  551. }
  552. tableData.value = ywg_Project.data;
  553. break;
  554. }
  555. };
  556. //车间侧边栏 进入页面自动加载【车间】数据
  557. const workbenchdata = async () => {
  558. try {
  559. const data = await workbench();
  560. const rawData = data.data;
  561. const dataArray =Object.keys(rawData).map(key => ({
  562. label: key,
  563. children: Object.keys(rawData[key]).map(subKey => ({
  564. label: subKey,
  565. children: rawData[key][subKey].map(item => ({
  566. label: item
  567. }))
  568. }))
  569. }));
  570. treeData.value = dataArray;
  571. treeData.value.unshift(sctreeData.value[0])
  572. } catch (error) {
  573. console.error(error);
  574. }
  575. };
  576. workbenchdata();
  577. //全局获取工单编号
  578. const _Gd_gdbh = ref(null)
  579. //点击表格 通过上方表格【工单编号】获取下方表格数据
  580. const chejianRowClick = async (row) => {
  581. _Gd_gdbh.value = row.工单编号;
  582. console.log(_Gd_gdbh.value);
  583. }
  584. const gdtableRowClick = async (row) => {
  585. _Gd_gdbh.value = row.工单编号;
  586. console.log(_Gd_gdbh.value);
  587. if (currentNode.value == "计划中") {
  588. if(row['statusColumn'] === "*"){
  589. gytableData.value = [];
  590. yjtableData.value = [];
  591. return false;
  592. }else{
  593. //计划中工单->工艺资料接口
  594. const gyres = await projectCraft({Gd_gdbh: _Gd_gdbh.value});
  595. //工艺资料表格
  596. gytableData.value.splice(0, gytableData.value.length, ...gyres.data);
  597. //计划中工单->印件资料接口
  598. const yjres = await projectPrint({Gd_gdbh: _Gd_gdbh.value});
  599. //印件资料表格
  600. yjtableData.value.splice(0, yjtableData.value.length, ...(yjres?.data ?? []));
  601. }
  602. }
  603. if (currentNode.value == "排程中") {
  604. const pc_scheduleProcess = await scheduleProcess({Gd_gdbh: _Gd_gdbh.value});
  605. bottomData.value = pc_scheduleProcess.data;
  606. }
  607. if (currentNode.value == "制程中") {
  608. const zc_scheduleProcess = await scheduleProcess({Gd_gdbh: _Gd_gdbh.value});
  609. bottomData.value = zc_scheduleProcess.data;
  610. }
  611. if (currentNode.value == "已完工") {
  612. //工艺资料
  613. const ywg_gyres = await projectCraft({Gd_gdbh: _Gd_gdbh.value});
  614. gytableData.value.splice(0, gytableData.value.length, ...ywg_gyres.data);
  615. //印件资料
  616. const ywg_yjres = await projectPrint({Gd_gdbh: _Gd_gdbh.value});
  617. yjtableData.value.splice(0, yjtableData.value.length, ...ywg_yjres.data);
  618. }
  619. };
  620. //点击左侧树形获取表格列表//机台侧边栏
  621. const tableData = ref([]);
  622. const _machine = ref(null);
  623. const treeType = ref('customTree') // dataTree // 计划中,排产中 ,dataTree 车间
  624. const handleNodeClick = async (node) => {
  625. if (node.type && node.type === '__customer') {
  626. treeType.value = 'customTree'
  627. schandleNodeClick(node)
  628. } else if (!node.children) {
  629. treeType.value = 'dataTree'
  630. const custom_code = node.label;
  631. // 使用字符串分割获取#前面的数据
  632. const dataBeforeHash = custom_code.split('#')[0].trim();
  633. _machine.value = dataBeforeHash + '#';
  634. console.log(_machine.value)
  635. const zhubiao = await MachineWorkOrderList({ machine:_machine.value})
  636. chejianData.value = zhubiao.data['排程'];
  637. chejianfuData.value = zhubiao.data['制程'];
  638. }
  639. };
  640. //计划中已完工搜索
  641. const searchInfo = ref('');
  642. // 提交搜索
  643. const onSubmit = () => {
  644. if (!searchInfo.value || !_machine.value) {
  645. ElMessage({ type: 'warning', message: '请输入工单编号和具体条件' });
  646. return false;
  647. }
  648. const isPureNumber = /^\d+$/.test(searchInfo.value);
  649. if (!isPureNumber) {
  650. ElMessage({ type: 'warning', message: '请输入正确的工单编号' });
  651. return false;
  652. }
  653. if (currentNode.value === '计划中' || currentNode.value === '已完工') {
  654. _Project();
  655. } else if (currentNode.value === '排程中' || currentNode.value === '制程中') {
  656. _Schedule();
  657. } else {
  658. ElMessage({ type: 'warning', message: '查询不到具体条件的工单' });
  659. }
  660. };
  661. // const onSubmit = () => {
  662. // const isPureNumber = /^[\d]+$/.test(searchInfo.value);
  663. // if (isPureNumber) {
  664. // if(_machine.value){
  665. // _MachineWorkOrderList();
  666. // }else if(_machine.value === '' || _machine.value === null){
  667. // ElMessage({type: 'warning',message: '查询不到具体条件的工单'})
  668. // return false;
  669. // }else{
  670. // {
  671. // if(searchInfo.value === '' || searchInfo.value === null ){
  672. // ElMessage({type: 'warning',message: '查询不到具体条件的工单'})
  673. // return false;
  674. // }
  675. // if(currentNode.value === '计划中' || currentNode.value === '已完工'){
  676. // _Project();
  677. // return false;
  678. // }
  679. // if(currentNode.value === '排程中' || currentNode.value === '制程中'){
  680. // _Schedule();
  681. // return false;
  682. // }
  683. // }
  684. // }
  685. // } else {
  686. // ElMessage({type: 'warning',message: '请输入正确的工单编号'})
  687. // }
  688. // };
  689. // 搜索计划中、已完工一条工单
  690. const _Project = async () => {
  691. const status = currentNode.value;
  692. const search = searchInfo.value;
  693. const Project_search = await Project({status:status,search:search});
  694. if(Project_search.msg === '成功'){
  695. tableData.value = Project_search.data;
  696. }else{
  697. ElMessage({type: 'warning',message: '查不到具体条件的工单'})
  698. return false;
  699. }
  700. };
  701. // 搜索排程、制程一条工单
  702. const _Schedule = async () => {
  703. const status = currentNode.value;
  704. const search = searchInfo.value;
  705. const Schedule_search = await Schedule({status:status,search:search});
  706. if(Schedule_search.msg === '成功'){
  707. chejianData.value = Schedule_search.data;
  708. }else{
  709. ElMessage({type: 'warning',message: '查不到具体条件的工单'})
  710. return false;
  711. }
  712. };
  713. //机台搜索一条工单
  714. const _MachineWorkOrderList = async () => {
  715. let params = {}
  716. params.search = searchInfo.value;
  717. params.machine = _machine.value;
  718. const MachineWorkOrderList_search = await MachineWorkOrderList(params);
  719. if(MachineWorkOrderList_search.msg === ''){
  720. ElMessage({type: 'warning',message: '查不到具体条件的工单'})
  721. return false;
  722. }else{
  723. chejianfuData.value = MachineWorkOrderList_search.data['制程'];
  724. chejianData.value = MachineWorkOrderList_search.data['排程'];
  725. }
  726. };
  727. // =========== 【工序状态更正】 ===========
  728. const gxztgzztableColumns = ref(
  729. [
  730. { label: '印件及工序', prop: '印件及工序', width: '600' },
  731. { label: '计划产量/已完成', prop:['计划产量/已完成'], width: '500' },
  732. { label: '完成率', prop: '完成率', width: '240' },
  733. { label: '完工时间', prop: '完工时间', width: '300' },
  734. { label: '设备代号', prop: '设备代号', width: '240' },
  735. ]
  736. )
  737. const gxztgzz_handleKeyDown = (event, x, y, prop) => {
  738. const currentElement = document.getElementById(`input${x}${y}`);
  739. if (currentElement === null && currentElement === undefined) return
  740. switch (event.keyCode) {
  741. case 13: // Enter
  742. case 40: // 向下箭头
  743. if (y < gxztgzztableData.value.length )
  744. document.getElementById(`input${x}${y + 1}`).focus();
  745. break;
  746. case 38: // 向上箭头
  747. if ( y > 0) {
  748. document.getElementById(`input${x}${y - 1}`).focus();
  749. }
  750. break;
  751. default:
  752. break;
  753. }
  754. }
  755. const gxztgzztableData = ref([]);
  756. const gxztgzzlist = ref(false);
  757. const gxztgzzformData = reactive({gdbh: '',});
  758. //工序状态更正【按钮】
  759. const ongxztgzClick = () => {
  760. if(_Gd_gdbh.value == null){
  761. gxztgzzlist.value = false;
  762. ElMessage({type: 'warning',message: '请选择树形后,再操作此功能'})
  763. }else{
  764. gxztgzzformData['gdbh'] = _Gd_gdbh.value;
  765. _ProcessStatusCorrection();
  766. gxztgzzlist.value = true;
  767. }
  768. };
  769. //工序状态更正【回车】
  770. const gxztgzzgetProductValue = () => {
  771. _ProcessStatusCorrection();
  772. };
  773. //工序状态更正
  774. const _ProcessStatusCorrection = async (row) => {
  775. const workOrder = gxztgzzformData['gdbh'];
  776. console.log(workOrder)
  777. const ProcessStatusCorrectiondata = await ProcessStatusCorrection({workOrder:workOrder});
  778. gxztgzztableData.value = ProcessStatusCorrectiondata.data;
  779. };
  780. //工序状态更正【退出】
  781. const gxztgzzCancel = () => {
  782. gxztgzzlist.value = false;
  783. };
  784. //加入排产【按钮】
  785. const onjrpcClick = async () => {
  786. searchInfo.value = '';
  787. if(_PC_gdbh.value == null || _PC_gdbh.value == ''){
  788. ElMessage({type: 'warning',message: '请选择排程中工单'})
  789. }else{
  790. console.log(_PC_xscn.value)
  791. if (_PC_xscn.value === '' || _PC_xscn.value === null || _PC_xscn.value === '0') {
  792. ElMessage({type: 'warning',message: '选择中小时产量为 0'})
  793. return false;
  794. }else{
  795. let params = {}
  796. params.workOrder = _PC_gdbh.value;
  797. params.machine = _machine.value;
  798. params.printCode = _PC_yjno.value;
  799. params.processCode = _PC_gxh.value;
  800. console.log(params)
  801. const ProductionSchedulingAdd_add = await ProductionSchedulingAdd(params);
  802. if (ProductionSchedulingAdd_add.code === 0) {
  803. const pc_zc_table = await MachineWorkOrderList({machine:_machine.value});
  804. chejianData.value = pc_zc_table.data['排程'];
  805. chejianfuData.value = pc_zc_table.data['制程'];
  806. ElMessage({type: 'success',message: '加入排产 更新成功'});
  807. } else {
  808. ElMessage({ type: 'error',message: '更新失败'})
  809. }
  810. }
  811. }
  812. };
  813. //暂停排产【按钮】
  814. const onztwgClick = async () => {
  815. searchInfo.value = '';
  816. if(_ZC_gdbh.value == null || _ZC_gdbh.value == ''){
  817. ElMessage({type: 'warning', message: '请选择制程中工单'})
  818. }else{
  819. let params = {}
  820. params.workOrder = _ZC_gdbh.value;
  821. params.machine = _machine.value;
  822. params.printCode = _ZC_yjno.value;
  823. params.processCode = _ZC_gxh.value;
  824. console.log(params)
  825. const ProductionSchedulingAdd_stop = await ProductionSchedulingPause(params);
  826. if (ProductionSchedulingAdd_stop.code === 0) {
  827. const pc_zc_table = await MachineWorkOrderList({machine:_machine.value});
  828. console.log(pc_zc_table)
  829. chejianData.value = pc_zc_table.data['排程'];
  830. chejianfuData.value = pc_zc_table.data['制程'];
  831. ElMessage({type: 'success',message: '暂停排产 更新成功'});
  832. } else {
  833. ElMessage({ type: 'error',message: '更新失败'})
  834. }
  835. }
  836. };
  837. //工序完工【按钮】
  838. const ongxwgClick = async () => {
  839. searchInfo.value = '';
  840. if(_ZC_gdbh.value == null || _ZC_gdbh.value == ''){
  841. onstatuslist.value = false;
  842. ElMessage({
  843. type: 'warning',
  844. message: '请选择制程中工单'
  845. })
  846. }else{
  847. let params = {}
  848. params.workOrder = _ZC_gdbh.value;
  849. params.processCode = _ZC_gxh.value;
  850. const complete_get = await complete(params);
  851. if (complete_get.code === 0) {
  852. const pc_zc_table = await MachineWorkOrderList({ machine:_machine.value});
  853. // chejianData.value = pc_zc_table.data['排程'];
  854. chejianfuData.value = pc_zc_table.data['制程'];
  855. ElMessage({type: 'success',message: '工序完工 更新成功'})
  856. } else {
  857. ElMessage({ type: 'error',message: '更新失败'})
  858. }
  859. }
  860. };
  861. //加入排程【上面到下面】
  862. const _PC_gxh = ref(null)
  863. const _PC_yjno = ref(null)
  864. const _PC_gdbh = ref(null)
  865. const _PC_xscn = ref(null)
  866. const PC_handleChange = (arr) => {
  867. let gxh = arr.map((val) => val['gxh']).join(",");
  868. let yjno = arr.map((val) => val['yjno']).join(",");
  869. let str = arr.map((val) => val['工单编号']).join(",");
  870. let xscn = arr.map((val) => val['小时产能']).join(",");
  871. _PC_gxh.value = gxh;
  872. _PC_yjno.value = yjno;
  873. _PC_gdbh.value = str;
  874. _PC_xscn.value = xscn;
  875. }
  876. //加入制程【下面到上面】
  877. const _ZC_gxh = ref(null)
  878. const _ZC_yjno = ref(null)
  879. const _ZC_gdbh = ref(null)
  880. const _ZC_xscn = ref(null)
  881. const ZP_handleChange = (arr) => {
  882. console.log(arr)
  883. let gxh = arr.map((val) => val['gxh']).join(",");
  884. let yjno = arr.map((val) => val['yjno']).join(",");
  885. let str = arr.map((val) => val['工单编号']).join(",");
  886. let xscn = arr.map((val) => val['小时产能']).join(",");
  887. _ZC_gxh.value = gxh;
  888. _ZC_yjno.value = yjno;
  889. _ZC_gdbh.value = str;
  890. _ZC_xscn.value = xscn;
  891. }
  892. //机组调整【按钮】
  893. const onjztzClick = async () => {
  894. };
  895. //工序产量核查【按钮】
  896. const onprintClick = async () => {
  897. };
  898. //=========工序产量核查===========
  899. const gxclhclist = ref(false);
  900. const gxclhcformData = reactive({
  901. gdbh: '',
  902. gdmc: '',
  903. });
  904. //工序产量核查【按钮】
  905. const ongxclhcClick = async () => {
  906. gxclhclist.value = true;
  907. };
  908. //工序产量核查【回车】
  909. const _gxclhcgdbh = ref(null)
  910. const gxclhcProductValue = () => {
  911. if(fjformData['dqprocessName'] === ''){
  912. fjformData['dqprocessName'] = '';
  913. }
  914. _gxclhcgdbh.value = gxclhcformData['gdbh'];
  915. _ongetProductclick();
  916. }
  917. const paichengColumns = ref(
  918. [
  919. { label: '优先次序', prop: '优先次序', width: '120' },
  920. { label: '工单编号', prop: '工单编号', width: '200' },
  921. { label: '印件名称', prop: '印件名称', width: '220' },
  922. { label: '接货数', prop: '接货数', width: '110' },
  923. { label: '小时产能', prop: '小时产能', width: '110' },
  924. { label: '生产工时', prop: '生产工时', width: '110' },
  925. { label: '辅助工时', prop: '辅助工时', width: '110' },
  926. { label: '班次安排', prop: '班次安排', width: '110' },
  927. { label: '排单备注', prop: '排单备注', width: '110' },
  928. { label: '最早开工时间', prop: '最早开工时间', width: '200' },
  929. { label: '计划开工时间', prop: '计划开工时间', width: '200' },
  930. { label: '计划完工时间', prop: '计划完工时间', width: '200' },
  931. { label: '销售订单号', prop: '销售订单号', width: '120' },
  932. { label: '印件/工序', prop: '印件/工序', width: '120' },
  933. ]
  934. )
  935. const handleKeyDown = (event, x, y, prop) => {
  936. const currentElement = document.getElementById(`input${x}${y}`);
  937. if (currentElement === null && currentElement === undefined) return
  938. let move = 0
  939. switch (event.keyCode) {
  940. case 13: // Enter
  941. case 40: // 向下箭头
  942. if (y < paichengData.value.length ){
  943. document.getElementById(`input${x}${y + 1}`).focus();
  944. }
  945. break;
  946. case 38: // 向上箭头
  947. if ( y > 0) {
  948. document.getElementById(`input${x}${y - 1}`).focus();
  949. }
  950. break;
  951. case 39: // 向左箭头
  952. if ( x === 0) {
  953. move = x + 5
  954. } else if (x >= 5 && x <10) {
  955. move = x + 1
  956. }
  957. document.getElementById(`input${move}${y}`).focus();
  958. break;
  959. case 37: // 向右箭头
  960. if ( x === 5) {
  961. move = x - 5
  962. } else if (x >= 5 && x <=10) {
  963. move = x - 1
  964. }
  965. document.getElementById(`input${move}${y}`).focus();
  966. break;
  967. default:
  968. break;
  969. }
  970. }
  971. //工序产量核查【退出】
  972. const gxclhcCancel = async () => {
  973. gxclhclist.value = false;
  974. };
  975. //流程单查询【按钮】
  976. const onlcdlistClick = async () => {
  977. };
  978. //状态设置【按钮】
  979. const onstatuslist = ref(false);
  980. const statusformData = reactive({gdbh: '',});
  981. const status = ref('计划中'); // 默认选择
  982. const onStatusClick = () => {
  983. if(_Gd_gdbh.value === null || _Gd_gdbh.value === ''){
  984. onstatuslist.value = false;
  985. ElMessage({
  986. type: 'warning',
  987. message: '请选择树形后,再操作此功能'
  988. })
  989. }else{
  990. statusformData['gdbh'] = _Gd_gdbh.value;
  991. onstatuslist.value = true;
  992. }
  993. };
  994. //工单状态设置【放弃按钮】
  995. const handleCancel = () => {
  996. onstatuslist.value = false;
  997. };
  998. //工单状态设置【执行按钮】
  999. const handleConfirm = async () => {
  1000. //工单编号
  1001. let workOrder = statusformData['gdbh'];
  1002. //状态
  1003. let statusCode;
  1004. if (status.value === '计划中') {
  1005. statusCode = "1-计划中";
  1006. } else if (status.value === '生产中') {
  1007. statusCode = "2-生产中";
  1008. }else if (status.value === '已完工') {
  1009. statusCode = "3-已完工";
  1010. }
  1011. const StatusEditdata = await StatusEdit({workOrder:workOrder,status:statusCode});
  1012. if (StatusEditdata.code === 0) {
  1013. ElMessage({
  1014. type: 'success',
  1015. message: '更新成功'
  1016. })
  1017. } else {
  1018. ElMessage({
  1019. type: 'error',
  1020. message: '更新成功'
  1021. })
  1022. }
  1023. onstatuslist.value = false;
  1024. };
  1025. // handleCancel(_stacode);
  1026. const page = ref(1)
  1027. const total = ref(0)
  1028. const pageSize = ref(10)
  1029. // 分页
  1030. const handleSizeChange = (val) => {
  1031. pageSize.value = val
  1032. getTableData()
  1033. }
  1034. // 修改页面容量
  1035. const handleCurrentChange = (val) => {
  1036. page.value = val
  1037. getTableData()
  1038. }
  1039. // 查询
  1040. const getTableData = async() => {
  1041. }
  1042. getTableData()
  1043. // ============== 表格控制部分结束 ===============
  1044. // 获取需要的字典 可能为空 按需保留
  1045. const setOptions = async () =>{
  1046. }
  1047. // 获取需要的字典 可能为空 按需保留
  1048. setOptions()
  1049. // 多选数据
  1050. const multipleSelection = ref([])
  1051. // 多选
  1052. const handleSelectionChange = (val) => {
  1053. multipleSelection.value = val
  1054. console.log(multipleSelection.value)
  1055. }
  1056. // 行为控制标记(弹窗内部需要增还是改)
  1057. const type = ref('')
  1058. //修改
  1059. const updateCompanyFunc = async (row) => {
  1060. console.log(row);
  1061. dialogFormVisible.value = true;
  1062. };
  1063. // 打开弹窗
  1064. const openDialog = () => {
  1065. dialogFormVisible.value = true
  1066. }
  1067. // 弹窗确定
  1068. const enterDialog = async () => {
  1069. console.log("弹窗确定")
  1070. }
  1071. // 关闭弹窗
  1072. const closeDialog = () => {dialogFormVisible.value = false}
  1073. //=============车间设备排程================
  1074. const cjsbpclist = ref(false);
  1075. const cjsbpcformData = reactive({
  1076. //设备代号
  1077. sbdh: '',
  1078. // 下拉框选项数据
  1079. bancis: [],
  1080. // 设置默认值
  1081. banci: '',
  1082. isBanciSelected: false,
  1083. });
  1084. //车间设备排程【按钮】
  1085. const oncjsbpcClick = () => {
  1086. cjsbpcformData['sbdh'] = _machine.value;
  1087. _EquipmentSchedulingdata();
  1088. _ScheduleSelectiondata();
  1089. cjsbpclist.value = true;
  1090. };
  1091. //调用班次选择列表接口
  1092. const _ScheduleSelectiondata = async ()=>{
  1093. try {
  1094. const ScheduleSelectiondata = await ScheduleSelection();
  1095. // 清空之前的数据
  1096. cjsbpcformData.bancis = [];
  1097. // 循环遍历数组并将每个班次的detail添加到bancis数组中
  1098. for (const option of ScheduleSelectiondata.data) {
  1099. cjsbpcformData.bancis.push({ label: option.detail, value: option.detail.split('||')[0], rename:option.detail});
  1100. }
  1101. //班次列表数据
  1102. // console.log("赋值后的数据:", cjsbpcformData.bancis);
  1103. } catch (error) {
  1104. console.error(error);
  1105. }
  1106. }
  1107. //车间设备排程->数据展示
  1108. const paichengData = ref([])
  1109. //点击车间排程行
  1110. const _bcxz_val = ref(null)
  1111. //点击表格行的时候触发的方法
  1112. const cjpc_tableRowClick = (row) => {
  1113. _bcxz_val.value = row; // 保存点击的行数据
  1114. }
  1115. //班次选择列表下拉框
  1116. const setBanci = (v) => {
  1117. if(cjsbpcformData['isBanciSelected'] === true){
  1118. console.log("已选择所有班次")
  1119. paichengData.value.map( item => item.班次安排 = v)
  1120. }else{
  1121. console.log("未选择所有班次")
  1122. if (_bcxz_val.value) {
  1123. _bcxz_val.value['班次安排'] = v;
  1124. }
  1125. }
  1126. }
  1127. const _EquipmentSchedulingdata = async ()=>{
  1128. // let machine = 'WY01#';
  1129. let machine = _machine.value;
  1130. try {
  1131. const EquipmentSchedulingdata = await EquipmentScheduling({machine:machine});
  1132. if (EquipmentSchedulingdata.code === 0) {
  1133. paichengData.value = EquipmentSchedulingdata.data
  1134. }
  1135. } catch (error) {
  1136. console.error(error);
  1137. }
  1138. }
  1139. //车间设备排程->数据编辑
  1140. //车间设备排程【更新排程】
  1141. const oneditpcClick = async () => {
  1142. // console.log(paichengData)
  1143. const rawValueArray = paichengData._rawValue;
  1144. const formattedData = rawValueArray.map(item => {
  1145. return {
  1146. capacity: item.小时产能,
  1147. ProductionHours: item.生产工时,
  1148. AuxiliaryHours: item.辅助工时,
  1149. shift: item.班次安排,
  1150. remark: item.排单备注,
  1151. start: item.计划开工时间,
  1152. projectTime: item.计划完工时间,
  1153. UniqId: item.UniqId
  1154. };
  1155. });
  1156. console.log(formattedData)
  1157. // const EquipmentSchedulingEdit_edit = await EquipmentSchedulingEdit(formattedData);
  1158. // console.log(EquipmentSchedulingEdit_edit)
  1159. // cjsbpclist.value = true;
  1160. };
  1161. //车间设备排程【退出】
  1162. const cjsbpcCancel = () => {
  1163. cjsbpclist.value = false;
  1164. };
  1165. //工序状态更正颜色
  1166. const gxztgzzCellClass = ({row, column, rowIndex, columnIndex}) =>{
  1167. if(row['完工时间'] === ''){
  1168. return 'lan-plan-usage-low';
  1169. }else{
  1170. return 'hui-plan-usage-low';
  1171. }
  1172. }
  1173. </script>
  1174. <style scoped>
  1175. /*背景颜色*/
  1176. /* 选中某行时的背景色 */
  1177. :deep(.el-table__body tr.current-row) > td {
  1178. background: #ff80ff !important;
  1179. }
  1180. /*:deep(.el-table__body .current-row div div) {*/
  1181. /* background: #ff80ff !important;*/
  1182. /*}*/
  1183. /*文字颜色*/
  1184. /*工序状态更正颜色【灰色】*/
  1185. :deep(.hui-plan-usage-low div) {
  1186. color: #8c939d !important;
  1187. }
  1188. /*工序状态更正颜色【蓝色】*/
  1189. :deep(.lan-plan-usage-low div) {
  1190. color: blue !important;
  1191. }
  1192. :deep(.el-tabs__header){
  1193. margin-bottom: 0;
  1194. }
  1195. :deep(.el-table td .cell) {
  1196. line-height: 30px !important;
  1197. }
  1198. .JKWTree-container {
  1199. display: flex;
  1200. }
  1201. .JKWTree-tree {
  1202. width: 300px;
  1203. background-color: #fff;
  1204. padding: 10px;
  1205. margin-right: 20px;
  1206. }
  1207. .JKWTree-tree h3 {
  1208. font-size: 15px;
  1209. font-weight: 700;
  1210. margin: 10px 0;
  1211. }
  1212. .JKWTree-content {
  1213. flex: 1;
  1214. }
  1215. </style>
  1216. <style scoped>
  1217. :deep(.el-tabs__header){
  1218. margin-bottom: 0;
  1219. }
  1220. .search{
  1221. margin-left: 0px !important;
  1222. margin-right: 10px !important;
  1223. }
  1224. .bt{
  1225. margin-left: 2px !important;
  1226. padding: 3px !important;
  1227. font-size: 12px;
  1228. }
  1229. .el-tabs__header{
  1230. margin: 0px !important;
  1231. }
  1232. .gva-table-box{
  1233. padding: 0px !important;
  1234. }
  1235. .mab{
  1236. margin-bottom: 5px;
  1237. }
  1238. </style>
  1239. <style scoped>
  1240. :deep(.el-table td .cell) {
  1241. line-height: 20px !important;
  1242. }
  1243. :deep(.el-tabs__header){
  1244. margin-bottom: 0;
  1245. }
  1246. .search{
  1247. margin-left: 0px !important;
  1248. margin-right: 10px !important;
  1249. }
  1250. .bt{
  1251. margin-left: 2px !important;
  1252. padding: 3px !important;
  1253. font-size: 12px;
  1254. }
  1255. .el-tabs__header{
  1256. margin: 0px !important;
  1257. }
  1258. .gva-table-box{
  1259. padding: 0px !important;
  1260. }
  1261. .mab{
  1262. margin-bottom: 5px;
  1263. }
  1264. .focusdiv:focus {
  1265. border: 1px solid red;
  1266. }
  1267. </style>