gongdanshengchan.vue 77 KB

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