shebeiyunxing.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820
  1. <template>
  2. <div>
  3. <el-container>
  4. <el-aside width="200px">
  5. <div class="JKWTree-tree">
  6. <h3 > 组织列表</h3>
  7. <el-tree :data="treeData" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
  8. </div>
  9. </el-aside>
  10. <el-container>
  11. <!-- <el-header>dd</el-header>-->
  12. <el-main>
  13. <div class="gva-search-box">
  14. <el-row :gutter="500">
  15. <el-col :span="25">
  16. <el-row :gutter="20">
  17. <el-col :span="6">
  18. <el-form-item label="工单编号" prop="name">
  19. <el-row :gutter="20">
  20. <el-col :span="12">
  21. <el-input v-model="formData.code" :clearable="true" placeholder="ZT01733" />
  22. </el-col>
  23. <el-col :span="12">
  24. <el-input v-model="formData.code" :clearable="true" placeholder="ZT01733" />
  25. </el-col>
  26. </el-row>
  27. </el-form-item>
  28. </el-col>
  29. </el-row>
  30. <el-row :gutter="20">
  31. <el-col :span="4">
  32. <el-form-item label="印件编号" prop="id">
  33. <el-input v-model="formData.sczl_cl" :clearable="true" placeholder="2023.12.14" />
  34. </el-form-item>
  35. </el-col>
  36. <el-col :span="3">
  37. <el-form-item label="工序名称" prop="name">
  38. <el-input v-model="formData.sczl_PgCl" :clearable="true" placeholder="A班" />
  39. </el-form-item>
  40. </el-col>
  41. </el-row>
  42. <el-row :gutter="20">
  43. <el-col :span="4">
  44. <el-form-item label="班组成员" prop="id">
  45. </el-form-item>
  46. </el-col>
  47. </el-row>
  48. <el-row :gutter="1">
  49. <el-col :span="1">
  50. <el-input v-model="formData.address" :clearable="true" placeholder="2023.12.14" />
  51. </el-col>
  52. <el-col :span="1">
  53. <el-input v-model="formData.流程单号1" :clearable="true" placeholder="ZT01733" />
  54. </el-col>
  55. <el-col :span="1">
  56. <el-input v-model="formData.流程单号2" :clearable="true" placeholder="ZT01733" />
  57. </el-col>
  58. <el-col :span="1">
  59. <el-input v-model="formData.流程单号3" :clearable="true" placeholder="ZT01733" />
  60. </el-col>
  61. <el-col :span="1">
  62. <el-input v-model="formData.流程单号4" :clearable="true" placeholder="ZT01733" />
  63. </el-col>
  64. <el-col :span="1">
  65. <el-input v-model="formData.流程单号5" :clearable="true" placeholder="ZT01733" />
  66. </el-col>
  67. <el-col :span="1">
  68. <el-input v-model="formData.流程单号6" :clearable="true" placeholder="ZT01733" />
  69. </el-col>
  70. <el-col :span="1">
  71. <el-input v-model="formData.流程单号7" :clearable="true" placeholder="ZT01733" />
  72. </el-col>
  73. <el-col :span="1">
  74. <el-input v-model="formData.流程单号8" :clearable="true" placeholder="ZT01733" />
  75. </el-col>
  76. <el-col :span="1">
  77. <el-input v-model="formData.流程单号9" :clearable="true" placeholder="ZT01733" />
  78. </el-col>
  79. </el-row>
  80. <el-row :gutter="1">
  81. <el-col :span="1">
  82. <el-input v-model="formData.address" :clearable="true" placeholder="2023.12.14" />
  83. </el-col>
  84. <el-col :span="1">
  85. <el-input v-model="formData.流程单号1" :clearable="true" placeholder="ZT01733" />
  86. </el-col>
  87. <el-col :span="1">
  88. <el-input v-model="formData.流程单号2" :clearable="true" placeholder="ZT01733" />
  89. </el-col>
  90. <el-col :span="1">
  91. <el-input v-model="formData.流程单号3" :clearable="true" placeholder="ZT01733" />
  92. </el-col>
  93. <el-col :span="1">
  94. <el-input v-model="formData.流程单号4" :clearable="true" placeholder="ZT01733" />
  95. </el-col>
  96. <el-col :span="1">
  97. <el-input v-model="formData.流程单号5" :clearable="true" placeholder="ZT01733" />
  98. </el-col>
  99. <el-col :span="1">
  100. <el-input v-model="formData.流程单号6" :clearable="true" placeholder="ZT01733" />
  101. </el-col>
  102. <el-col :span="1">
  103. <el-input v-model="formData.流程单号7" :clearable="true" placeholder="ZT01733" />
  104. </el-col>
  105. <el-col :span="1">
  106. <el-input v-model="formData.流程单号8" :clearable="true" placeholder="ZT01733" />
  107. </el-col>
  108. <el-col :span="1">
  109. <el-input v-model="formData.流程单号9" :clearable="true" placeholder="ZT01733" />
  110. </el-col>
  111. </el-row>
  112. </el-col>
  113. <el-col >
  114. </el-col>
  115. </el-row>
  116. </div>
  117. <div class="gva-table-box">
  118. <div class="gva-btn-list">
  119. <el-button type="primary" icon="plus" @click="openDialog">新增</el-button>
  120. <el-popover v-model:visible="deleteVisible" :disabled="!multipleSelection.length" placement="top" width="160">
  121. <p>确定要删除吗?</p>
  122. <div style="text-align: right; margin-top: 8px;">
  123. <el-button type="primary" link @click="deleteVisible = false">取消</el-button>
  124. <el-button type="primary" @click="onDelete">确定</el-button>
  125. </div>
  126. <template #reference>
  127. <el-button icon="delete" style="margin-left: 10px;" :disabled="!multipleSelection.length" @click="deleteVisible = true">删除</el-button>
  128. </template>
  129. </el-popover>
  130. </div>
  131. <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
  132. <el-tab-pane label="设备作业清单" @click="showTable('印件资料')" name="first">
  133. <el-table ref="multipleTable"
  134. :show-overflow-tooltip="true"
  135. highlight-current-row="true"
  136. :row-style="{ height: '20px' }"
  137. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  138. :header-cell-style="{ padding: '0px' }"
  139. @row-dblclick="yjupdateCompanyFunc"
  140. style="width: 100%;height: 330px" border tooltip-effect="dark" :data="yjtableData" row-key="ID" @selection-change="handleSelectionChange">
  141. <!-- <el-table-column type="selection" width="55" />-->
  142. <el-table-column align="left" label="选择" prop="yj_yjno" width="80"/>
  143. <el-table-column align="left" label="工单编号|质量信息" prop="yj_yjdh" width="180" />
  144. <el-table-column align="left" label="印件资料" prop="yj_yjdh" width="240" />
  145. <el-table-column align="left" label="工序名称" prop="yj_yjmc" width="100" />
  146. <el-table-column align="left" label="计划产量/已完成" prop="yj_zzdh" width="180"/>
  147. <el-table-column align="left" label="装版时数" prop="yj_zzmc" width="100"/>
  148. <el-table-column align="left" label="工序产能" prop="yj_tlgg" width="100"/>
  149. <el-table-column align="left" label="计划工时" prop="yj_klgg" width="100"/>
  150. <el-table-column align="left" label="计划生产时段" prop="yj_ks" width="240" />
  151. <el-table-column align="left" label="排产备注" prop="yj_ls" width="100" />
  152. <el-table-column align="left" label="产品名称" prop="yj_desc" width="240" />
  153. </el-table>
  154. </el-tab-pane>
  155. <el-tab-pane label="班组人员及分配比例" @click="showTable('工艺资料')" name="second">
  156. <el-table ref="multipleTable"
  157. highlight-current-row="true"
  158. :show-overflow-tooltip="true"
  159. :row-style="{ height: '20px' }"
  160. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  161. :header-cell-style="{ padding: '0px' }"
  162. @row-dblclick="gyupdateCompanyFunc"
  163. :row-class-name="rowClassStyle"
  164. style="width: 100%;height: 400px" border tooltip-effect="dark" :data="gytableData" row-key="ID" @selection-change="handleSelectionChange"
  165. @row-click="clickybupdate">
  166. <!-- <el-table-column type="selection" width="55" />-->
  167. <el-table-column align="left" label="选择" prop="方案" width="70"/>
  168. <el-table-column align="left" label="班组号" prop="Gy0_yjno" width="80" />
  169. <el-table-column align="left" label="组员1" prop="Gy0_gxh" width="240" />
  170. <el-table-column align="left" label="组员2" prop="gy0_gxmc" width="240" />
  171. <el-table-column align="left" label="组员3" prop="add_gxmc" width="240" />
  172. <el-table-column align="left" label="组员4" prop="Gy0_Ks" width="240" />
  173. <el-table-column align="left" label="组员5" prop="Gy0_ls" width="100" />
  174. <el-table-column align="left" label="组员6" prop="备注" width="100" />
  175. <el-table-column align="left" label="组员7" prop="工价系数" width="100" />
  176. <el-table-column align="left" label="组员8" prop="损耗系数" width="100" />
  177. <el-table-column align="left" label="组员9" prop="Gy0_Ms" width="100" />
  178. <el-table-column align="left" label="组员10" prop="人工检_正品版" width="120" />
  179. </el-table>
  180. </el-tab-pane>
  181. <el-tab-pane label="当班产量明细" @click="showTable('印版资料')" name="third">
  182. <el-table ref="multipleTable"
  183. highlight-current-row="true"
  184. :show-overflow-tooltip="true"
  185. :row-style="{ height: '20px' }"
  186. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  187. :header-cell-style="{ padding: '0px' }"
  188. @row-dblclick="ybupdateCompanyFunc"
  189. style="width: 100%;height: 400px" border tooltip-effect="dark" :data="ybtableData" row-key="ID" @selection-change="handleSelectionChange"
  190. >
  191. <!-- <el-table-column type="selection" width="55" />-->
  192. <el-table-column align="left" label="生产时段" prop="YB_方案" width="180"/>
  193. <el-table-column align="left" label="工单编号" prop="YB_Yjno" width="120" />
  194. <el-table-column align="left" label="产品名称" prop="印版类别" width="240" />
  195. <el-table-column align="left" label="印件及工序" prop="存货编码" width="320"/>
  196. <el-table-column align="left" label="标牌号" prop="印版名称" width="80"/>
  197. <el-table-column align="left" label="产量" prop="考核印数" width="100"/>
  198. <el-table-column align="left" label="制程废品" prop="Sys_id" width="100" />
  199. <el-table-column align="left" label="制程次品" prop="建档日期" width="100" />
  200. <el-table-column align="left" label="前工序废" prop="更新日期" width="100" />
  201. <el-table-column align="left" label="来料异常" prop="YB_方案" width="100"/>
  202. <el-table-column align="left" label="装版工时" prop="YB_Yjno" width="100" />
  203. <el-table-column align="left" label="保养工时" prop="印版类别" width="100" />
  204. <el-table-column align="left" label="打样工时" prop="存货编码" width="100"/>
  205. <el-table-column align="left" label="异常停机工时" prop="印版名称" width="120"/>
  206. <el-table-column align="left" label="通电工时" prop="考核印数" width="100"/>
  207. <el-table-column align="left" label="码开始行" prop="Sys_id" width="100" />
  208. <el-table-column align="left" label="码结束行" prop="建档日期" width="100" />
  209. <el-table-column align="left" label="码包" prop="更新日期" width="100" />
  210. <el-table-column align="left" label="主电表" prop="YB_方案" width="100"/>
  211. <el-table-column align="left" label="辅电表" prop="YB_Yjno" width="100" />
  212. <el-table-column align="left" label="色度数" prop="印版类别" width="100" />
  213. </el-table>
  214. </el-tab-pane>
  215. <el-tab-pane label="检验记录" @click="showTable('技术资料附件')" name="fourth">
  216. <el-table ref="multipleTable"
  217. :row-style="{ height: '20px' }"
  218. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  219. :header-cell-style="{ padding: '0px' }"
  220. :show-overflow-tooltip="true"
  221. highlight-current-row="true"
  222. style="width: 100%;height: 400px" border tooltip-effect="dark" :data="jstableData" row-key="ID" @selection-change="handleSelectionChange">
  223. <!-- <el-table-column type="selection" width="55" />-->
  224. <el-table-column align="left" label="工单编号" prop="序号" width="120"/>
  225. <el-table-column align="left" label="印件号" prop="适用工序" width="120" />
  226. <el-table-column align="left" label="工序名称" prop="备注" width="330" />
  227. <el-table-column align="left" label="检验项目" prop="文件类型" width="120"/>
  228. <el-table-column align="left" label="12:39" prop="关联产品" width="100"/>
  229. <el-table-column align="left" label="13:08" prop="建档用户" width="100"/>
  230. <el-table-column align="left" label="13:25" prop="建档日期" width="100" />
  231. <el-table-column align="left" label="14:31" prop="更新日期" width="100" />
  232. </el-table>
  233. </el-tab-pane>
  234. </el-tabs>
  235. <!-- <div class="gva-pagination">
  236. <el-pagination
  237. layout="total, sizes, prev, pager, next, jumper"
  238. :current-page="page"
  239. :page-size="pageSize"
  240. :page-sizes="[10, 30, 50, 100]"
  241. :total="total"
  242. @current-change="handleCurrentChange"
  243. @size-change="handleSizeChange"
  244. />
  245. </div> -->
  246. </div>
  247. <el-dialog v-model="dialogFormVisible" :before-close="closeDialog" :title="type==='create'?'添加':'修改'" destroy-on-close>
  248. <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
  249. <el-tab-pane label="当日上报产量" @click="showTable('工艺资料')" name="first">
  250. <el-table ref="multipleTable"
  251. :show-overflow-tooltip="true"
  252. :row-style="{ height: '20px' }"
  253. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  254. :header-cell-style="{ padding: '0px' }"
  255. highlight-current-row="true"
  256. style="width: 100%;height: 400px" border tooltip-effect="dark" :data="gytableData" row-key="ID" @selection-change="handleSelectionChange">
  257. <el-table-column type="selection" width="55" />
  258. <el-table-column align="left" label="选择" prop="工单编号" width="100"/>
  259. <el-table-column align="left" label="产品名称" prop="重点工序" width="100"/>
  260. <el-table-column align="left" label="工序" prop="工序备注" width="240"/>
  261. <el-table-column align="left" label="备注" prop="机组" width="100"/>
  262. <el-table-column align="left" label="产量" prop="小时产能" width="100"/>
  263. <el-table-column align="left" label="千件工价" prop="生产工时" width="100"/>
  264. <el-table-column align="left" label="日定额" prop="辅助工时" width="100"/>
  265. <el-table-column align="left" label="补产标准" prop="印刷方式" width="100"/>
  266. <el-table-column align="left" label="难度系数" prop="版距" width="100"/>
  267. <el-table-column align="left" label="印刷方式" prop="创建用户" width="120"/>
  268. <el-table-column align="left" label="组员1" prop="Gy0_gxh" width="240" />
  269. <el-table-column align="left" label="组员2" prop="gy0_gxmc" width="240" />
  270. <el-table-column align="left" label="组员3" prop="add_gxmc" width="240" />
  271. <el-table-column align="left" label="组员4" prop="Gy0_Ks" width="240" />
  272. <el-table-column align="left" label="组员5" prop="Gy0_ls" width="100" />
  273. <el-table-column align="left" label="组员6" prop="备注" width="100" />
  274. <el-table-column align="left" label="组员7" prop="工价系数" width="100" />
  275. <el-table-column align="left" label="组员8" prop="损耗系数" width="100" />
  276. <el-table-column align="left" label="组员9" prop="Gy0_Ms" width="100" />
  277. <el-table-column align="left" label="组员10" prop="人工检_正品版" width="120" />
  278. <el-table-column align="left" label="制程废品" prop="Sys_id" width="100" />
  279. <el-table-column align="left" label="制程次品" prop="建档日期" width="100" />
  280. <el-table-column align="left" label="前工序废" prop="更新日期" width="100" />
  281. <el-table-column align="left" label="来料异常" prop="YB_方案" width="100"/>
  282. <el-table-column align="left" label="装版工时" prop="YB_Yjno" width="100" />
  283. <el-table-column align="left" label="保养工时" prop="印版类别" width="100" />
  284. <el-table-column align="left" label="打样工时" prop="存货编码" width="100"/>
  285. <el-table-column align="left" label="异常停机工时" prop="印版名称" width="120"/>
  286. <el-table-column align="left" label="通电工时" prop="考核印数" width="100"/>
  287. <el-table-column align="left" label="码开始行" prop="Sys_id" width="100" />
  288. <el-table-column align="left" label="码结束行" prop="建档日期" width="100" />
  289. <el-table-column align="left" label="码包" prop="更新日期" width="100" />
  290. <el-table-column align="left" label="主电表" prop="YB_方案" width="100"/>
  291. <el-table-column align="left" label="辅电表" prop="YB_Yjno" width="100" />
  292. <el-table-column align="left" label="色度数" prop="印版类别" width="100" />
  293. <el-table-column align="left" label="用户" prop="YB_Yjno" width="100" />
  294. <el-table-column align="left" label="更新时间" prop="印版类别" width="100" />
  295. </el-table>
  296. </el-tab-pane>
  297. <el-tab-pane label="当日制程检验记录" @click="showTable('印件资料')" name="second">
  298. <el-table ref="multipleTable"
  299. :row-style="{ height: '20px' }"
  300. :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
  301. :header-cell-style="{ padding: '0px' }"
  302. :show-overflow-tooltip="true"
  303. highlight-current-row="true"
  304. style="width: 100%;height: 400px" border tooltip-effect="dark" :data="yjtableData" row-key="ID" @selection-change="handleSelectionChange">
  305. <el-table-column type="selection" width="55" />
  306. <el-table-column align="left" label="工单编号" prop="序号" width="120"/>
  307. <el-table-column align="left" label="印件号" prop="适用工序" width="120" />
  308. <el-table-column align="left" label="工序名称" prop="备注" width="330" />
  309. <el-table-column align="left" label="检验项目" prop="文件类型" width="120"/>
  310. <el-table-column align="left" label="12:39" prop="关联产品" width="100"/>
  311. <el-table-column align="left" label="13:08" prop="建档用户" width="100"/>
  312. <el-table-column align="left" label="13:25" prop="建档日期" width="100" />
  313. <el-table-column align="left" label="14:31" prop="更新日期" width="100" />
  314. </el-table>
  315. </el-tab-pane>
  316. </el-tabs>
  317. </el-dialog>
  318. <el-dialog v-model="detailShow" style="width: 800px" lock-scroll :before-close="closeDetailShow" title="查看详情" destroy-on-close>
  319. <el-scrollbar height="550px">
  320. <el-descriptions column="1" border>
  321. <el-descriptions-item label="address字段">
  322. {{ formData.address }}
  323. </el-descriptions-item>
  324. <el-descriptions-item label="image字段">
  325. {{ formData.image }}
  326. </el-descriptions-item>
  327. <el-descriptions-item label="name字段">
  328. {{ formData.name }}
  329. </el-descriptions-item>
  330. </el-descriptions>
  331. </el-scrollbar>
  332. </el-dialog>
  333. </el-main>
  334. </el-container>
  335. </el-container>
  336. </div>
  337. </template>
  338. <script setup>
  339. import {
  340. createCompany,
  341. deleteCompany,
  342. deleteCompanyByIds,
  343. updateCompany,
  344. findCompany,
  345. getCompanyList
  346. } from '@/api/company'
  347. import {
  348. demoCustomer
  349. } from "@/api/demo";
  350. // 全量引入格式化工具 请按需保留
  351. import { getDictFunc, formatDate, formatBoolean, filterDict, ReturnArrImg, onDownloadFile } from '@/utils/format'
  352. import { ElMessage, ElMessageBox } from 'element-plus'
  353. import { ref, reactive } from 'vue'
  354. defineOptions({
  355. name: 'Company'
  356. })
  357. const treeData=ref([{
  358. label: '胶印车间',
  359. children: [{
  360. label: 'JY01# 【海德堡对开八色平板胶印机】',
  361. children: [{
  362. label: '2024.01.18',
  363. },{
  364. label:'2024.01.17'},{
  365. label:'2024.01.16'}],
  366. },{
  367. label: 'JY02# 【海德堡对开八色平板胶印机】',
  368. children: [{
  369. label: '2024.01.18',
  370. },{
  371. label:'2024.01.17'},{
  372. label:'2024.01.16'}]
  373. },{
  374. label: 'JY03# 【海德堡对开八色平板胶印机】',
  375. children: [{
  376. label: '2024.01.18',
  377. },{
  378. label:'2024.01.17'},{
  379. label:'2024.01.16'}]
  380. },{
  381. label: 'JY04# 【海德堡对开八色平板胶印机】',
  382. children: [{
  383. label: '2024.01.18',
  384. },{
  385. label:'2024.01.17'},{
  386. label:'2024.01.16'}]
  387. },],
  388. }, {
  389. label: '凹印车间',
  390. children: [{
  391. label: 'DW01# 【多功能凹版印刷机】',
  392. children: [{
  393. label: '2024.01.18',
  394. },{
  395. label:'2024.01.17'},{
  396. label:'2024.01.16'}],
  397. },{
  398. label: 'DW02# 【多功能凹版印刷机】',
  399. children: [{
  400. label: '2024.01.18',
  401. },{
  402. label:'2024.01.17'},{
  403. label:'2024.01.16'}]
  404. },{
  405. label: 'DW03# 【多功能凹版印刷机】',
  406. children: [{
  407. label: '2024.01.18',
  408. },{
  409. label:'2024.01.17'},{
  410. label:'2024.01.16'}]
  411. },{
  412. label: 'DW04# 【多功能凹版印刷机】',
  413. children: [{
  414. label: '2024.01.18',
  415. },{
  416. label:'2024.01.17'},{
  417. label:'2024.01.16'}]
  418. },],
  419. }, {
  420. label: '丝印车间',
  421. children: [{
  422. label: 'PM01# 【尚浩高速大单张】',
  423. children: [{
  424. label: '2024.01.18',
  425. },{
  426. label:'2024.01.17'},{
  427. label:'2024.01.16'}],
  428. },{
  429. label: 'PM02# 【尚浩高速大单张】',
  430. children: [{
  431. label: '2024.01.18',
  432. },{
  433. label:'2024.01.17'},{
  434. label:'2024.01.16'}]
  435. },{
  436. label: 'PM03# 【尚浩高速大单张】',
  437. children: [{
  438. label: '2024.01.18',
  439. },{
  440. label:'2024.01.17'},{
  441. label:'2024.01.16'}]
  442. },{
  443. label: 'PM04# 【尚浩高速大单张】',
  444. children: [{
  445. label: '2024.01.18',
  446. },{
  447. label:'2024.01.17'},{
  448. label:'2024.01.16'}]
  449. },],
  450. },{
  451. label: '烫膜车间',
  452. children: [{
  453. label: 'MQ01# 【众益自动模切】',
  454. children: [{
  455. label: '2024.01.18',
  456. },{
  457. label:'2024.01.17'},{
  458. label:'2024.01.16'}],
  459. },{
  460. label: 'MQ02# 【众益自动模切】',
  461. children: [{
  462. label: '2024.01.18',
  463. },{
  464. label:'2024.01.17'},{
  465. label:'2024.01.16'}]
  466. },{
  467. label: 'MQ03# 【众益自动模切】',
  468. children: [{
  469. label: '2024.01.18',
  470. },{
  471. label:'2024.01.17'},{
  472. label:'2024.01.16'}]
  473. },{
  474. label: 'MQ04# 【众益自动模切】',
  475. children: [{
  476. label: '2024.01.18',
  477. },{
  478. label:'2024.01.17'},{
  479. label:'2024.01.16'}]
  480. },],
  481. },{
  482. label: '检验车间',
  483. children: [{
  484. label: 'JP01# 【印品质量检测】',
  485. children: [{
  486. label: '2024.01.18',
  487. },{
  488. label:'2024.01.17'},{
  489. label:'2024.01.16'}],
  490. },{
  491. label: 'JP02# 【印品质量检测】',
  492. children: [{
  493. label: '2024.01.18',
  494. },{
  495. label:'2024.01.17'},{
  496. label:'2024.01.16'}]
  497. },{
  498. label: 'JP03# 【印品质量检测】',
  499. children: [{
  500. label: '2024.01.18',
  501. },{
  502. label:'2024.01.17'},{
  503. label:'2024.01.16'}]
  504. },{
  505. label: 'JP04# 【印品质量检测】',
  506. children: [{
  507. label: '2024.01.18',
  508. },{
  509. label:'2024.01.17'},{
  510. label:'2024.01.16'}]
  511. },],
  512. }])
  513. const handleNodeClick = (node,check) => {
  514. //存放当前节点的nodeId
  515. console.log(node,check);
  516. }
  517. // 自动化生成的字典(可能为空)以及字段
  518. const formData = ref({
  519. address: '',
  520. image: '',
  521. name: '',
  522. })
  523. // 验证规则
  524. const rule = reactive({
  525. })
  526. const searchRule = reactive({
  527. createdAt: [
  528. { validator: (rule, value, callback) => {
  529. if (searchInfo.value.startCreatedAt && !searchInfo.value.endCreatedAt) {
  530. callback(new Error('请填写结束日期'))
  531. } else if (!searchInfo.value.startCreatedAt && searchInfo.value.endCreatedAt) {
  532. callback(new Error('请填写开始日期'))
  533. } else if (searchInfo.value.startCreatedAt && searchInfo.value.endCreatedAt && (searchInfo.value.startCreatedAt.getTime() === searchInfo.value.endCreatedAt.getTime() || searchInfo.value.startCreatedAt.getTime() > searchInfo.value.endCreatedAt.getTime())) {
  534. callback(new Error('开始日期应当早于结束日期'))
  535. } else {
  536. callback()
  537. }
  538. }, trigger: 'change' }
  539. ],
  540. })
  541. const elFormRef = ref()
  542. const elSearchFormRef = ref()
  543. // =========== 表格控制部分 ===========
  544. const page = ref(1)
  545. const total = ref(0)
  546. const pageSize = ref(10)
  547. const tableData = ref([])
  548. const searchInfo = ref({})
  549. // 重置
  550. const onReset = () => {
  551. searchInfo.value = {}
  552. getTableData()
  553. }
  554. // 搜索
  555. const onSubmit = () => {
  556. elSearchFormRef.value?.validate(async(valid) => {
  557. if (!valid) return
  558. page.value = 1
  559. pageSize.value = 10
  560. getTableData()
  561. })
  562. }
  563. // 分页
  564. const handleSizeChange = (val) => {
  565. pageSize.value = val
  566. getTableData()
  567. }
  568. // 修改页面容量
  569. const handleCurrentChange = (val) => {
  570. page.value = val
  571. getTableData()
  572. }
  573. // 查询
  574. const getTableData = async() => {
  575. const table = await getCompanyList({ page: page.value, pageSize: pageSize.value, ...searchInfo.value })
  576. if (table.code === 0) {
  577. tableData.value = table.data.list
  578. total.value = table.data.total
  579. page.value = table.data.page
  580. pageSize.value = table.data.pageSize
  581. }
  582. }
  583. getTableData()
  584. // ============== 表格控制部分结束 ===============
  585. // 获取需要的字典 可能为空 按需保留
  586. const setOptions = async () =>{
  587. }
  588. // 获取需要的字典 可能为空 按需保留
  589. setOptions()
  590. // 多选数据
  591. const multipleSelection = ref([])
  592. // 多选
  593. const handleSelectionChange = (val) => {
  594. multipleSelection.value = val
  595. }
  596. // 删除行
  597. const deleteRow = (row) => {
  598. ElMessageBox.confirm('确定要删除吗?', '提示', {
  599. confirmButtonText: '确定',
  600. cancelButtonText: '取消',
  601. type: 'warning'
  602. }).then(() => {
  603. deleteCompanyFunc(row)
  604. })
  605. }
  606. // 批量删除控制标记
  607. const deleteVisible = ref(false)
  608. // 多选删除
  609. const onDelete = async() => {
  610. const ids = []
  611. if (multipleSelection.value.length === 0) {
  612. ElMessage({
  613. type: 'warning',
  614. message: '请选择要删除的数据'
  615. })
  616. return
  617. }
  618. multipleSelection.value &&
  619. multipleSelection.value.map(item => {
  620. ids.push(item.ID)
  621. })
  622. const res = await deleteCompanyByIds({ ids })
  623. if (res.code === 0) {
  624. ElMessage({
  625. type: 'success',
  626. message: '删除成功'
  627. })
  628. if (tableData.value.length === ids.length && page.value > 1) {
  629. page.value--
  630. }
  631. deleteVisible.value = false
  632. getTableData()
  633. }
  634. }
  635. // 行为控制标记(弹窗内部需要增还是改)
  636. const type = ref('')
  637. // 更新行
  638. const updateCompanyFunc = async(row) => {
  639. const res = await findCompany({ ID: row.ID })
  640. type.value = 'update'
  641. if (res.code === 0) {
  642. formData.value = res.data.recompany
  643. dialogFormVisible.value = true
  644. }
  645. }
  646. // 删除行
  647. const deleteCompanyFunc = async (row) => {
  648. const res = await deleteCompany({ ID: row.ID })
  649. if (res.code === 0) {
  650. ElMessage({
  651. type: 'success',
  652. message: '删除成功'
  653. })
  654. if (tableData.value.length === 1 && page.value > 1) {
  655. page.value--
  656. }
  657. getTableData()
  658. }
  659. }
  660. // 弹窗控制标记
  661. const dialogFormVisible = ref(false)
  662. // 查看详情控制标记
  663. const detailShow = ref(false)
  664. // 打开详情弹窗
  665. const openDetailShow = () => {
  666. detailShow.value = true
  667. }
  668. // 打开详情
  669. const getDetails = async (row) => {
  670. // 打开弹窗
  671. const res = await findCompany({ ID: row.ID })
  672. if (res.code === 0) {
  673. formData.value = res.data.recompany
  674. openDetailShow()
  675. }
  676. }
  677. // 关闭详情弹窗
  678. const closeDetailShow = () => {
  679. detailShow.value = false
  680. formData.value = {
  681. address: '',
  682. image: '',
  683. name: '',
  684. }
  685. }
  686. // 打开弹窗
  687. const openDialog = () => {
  688. type.value = 'create'
  689. dialogFormVisible.value = true
  690. }
  691. // 关闭弹窗
  692. const closeDialog = () => {
  693. dialogFormVisible.value = false
  694. formData.value = {
  695. address: '',
  696. image: '',
  697. name: '',
  698. }
  699. }
  700. // 弹窗确定
  701. const enterDialog = async () => {
  702. elFormRef.value?.validate( async (valid) => {
  703. if (!valid) return
  704. let res
  705. switch (type.value) {
  706. case 'create':
  707. res = await createCompany(formData.value)
  708. break
  709. case 'update':
  710. res = await updateCompany(formData.value)
  711. break
  712. default:
  713. res = await createCompany(formData.value)
  714. break
  715. }
  716. if (res.code === 0) {
  717. ElMessage({
  718. type: 'success',
  719. message: '创建/更改成功'
  720. })
  721. closeDialog()
  722. getTableData()
  723. }
  724. })
  725. }
  726. </script>
  727. <style>
  728. .JKWTree-container {
  729. display: flex;
  730. }
  731. .JKWTree-tree {
  732. width: 300px;
  733. background-color: #fff;
  734. padding: 10px;
  735. margin-right: 20px;
  736. }
  737. .JKWTree-tree h3 {
  738. font-size: 15px;
  739. font-weight: 700;
  740. margin: 10px 0;
  741. }
  742. .JKWTree-content {
  743. flex: 1;
  744. }
  745. </style>