赫艾前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1013 lines
35 KiB

4 years ago
4 years ago
3 years ago
4 years ago
2 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
4 years ago
4 years ago
3 years ago
4 years ago
3 years ago
3 years ago
4 years ago
3 years ago
4 years ago
1 year ago
4 years ago
1 year ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
1 year ago
1 year ago
1 year ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
2 years ago
4 years ago
3 years ago
4 years ago
1 year ago
2 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
3 years ago
1 year ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
2 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
3 years ago
4 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
3 years ago
4 years ago
4 years ago
4 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
2 years ago
4 years ago
2 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
3 years ago
4 years ago
1 year ago
3 years ago
4 years ago
4 years ago
3 years ago
1 year ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
1 year ago
4 years ago
3 years ago
4 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
3 years ago
4 years ago
4 years ago
3 years ago
3 years ago
4 years ago
1 year ago
4 years ago
1 year ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
3 years ago
1 year ago
4 years ago
3 years ago
3 years ago
3 years ago
4 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
1 year ago
4 years ago
3 years ago
3 years ago
4 years ago
  1. <template>
  2. <div class="mod-config">
  3. <el-form :inline="true" v-model="searchData">
  4. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 5px;" >
  5. <el-form-item :label="'工厂编号:'">
  6. <el-input v-model="searchData.site" style="width: 120px"></el-input>
  7. </el-form-item>
  8. <el-form-item :label="'日计划号:'">
  9. <el-input v-model="searchData.orderNo" style="width: 120px"></el-input>
  10. </el-form-item>
  11. <el-form-item :label="'生产订单号:'">
  12. <el-input v-model="searchData.orderRef1" style="width: 120px"></el-input>
  13. </el-form-item>
  14. <el-form-item :label="'规格型号:'">
  15. <el-input v-model="searchData.partDescription" style="width: 120px"></el-input>
  16. </el-form-item>
  17. <el-form-item :label="'计划日期:'">
  18. <el-date-picker
  19. style="width: 130px"
  20. v-model="searchData.startDate1"
  21. type="date"
  22. value-format="yyyy-MM-dd"
  23. placeholder="选择日期">
  24. </el-date-picker>
  25. </el-form-item>
  26. <el-form-item style="margin-top: 23px;">
  27. <laber style="margin-left: -9px;font-size: 19px">&#10142</laber>
  28. </el-form-item>
  29. <el-form-item :label="' '">
  30. <el-date-picker
  31. style="width: 130px"
  32. v-model="searchData.endDate1"
  33. type="date"
  34. value-format="yyyy-MM-dd"
  35. placeholder="选择日期">
  36. </el-date-picker>
  37. </el-form-item>
  38. <el-form-item :label="'计划发货日期:'">
  39. <el-date-picker
  40. style="width: 130px"
  41. v-model="searchData.startDate4"
  42. type="date"
  43. value-format="yyyy-MM-dd"
  44. placeholder="选择日期">
  45. </el-date-picker>
  46. </el-form-item>
  47. <el-form-item style="margin-top: 23px;">
  48. <laber style="margin-left: -9px;font-size: 19px">&#10142</laber>
  49. </el-form-item>
  50. <el-form-item :label="' '">
  51. <el-date-picker
  52. style="width: 130px"
  53. v-model="searchData.endDate4"
  54. type="date"
  55. value-format="yyyy-MM-dd"
  56. placeholder="选择日期">
  57. </el-date-picker>
  58. </el-form-item>
  59. </el-form>
  60. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 5px;">
  61. <el-form-item :label="'状态:'">
  62. <el-select filterable v-model="searchData.status" style="width: 120px">
  63. <el-option label="全部" value=""></el-option>
  64. <el-option label="已计划" value="('已计划')"></el-option>
  65. <el-option label="已取消" value="('已取消')"></el-option>
  66. </el-select>
  67. </el-form-item>
  68. <el-form-item >
  69. <span slot="label" style="" @click="getBaseList(5)"><a herf="#">物料编码</a></span>
  70. <el-input v-model="searchData.partNo" style="width: 120px"></el-input>
  71. </el-form-item>
  72. <el-form-item :label="'派工情况:'">
  73. <el-select filterable v-model="searchData.planStatus" style="width: 120px">
  74. <el-option label="全部" value=""></el-option>
  75. <el-option label="未派工完" value="a.OrderQty>isnull(SL.scheduledQty,0)"></el-option>
  76. <el-option label="已派工完" value="isnull(SL.scheduledQty,0)>= a.OrderQty"></el-option>
  77. </el-select>
  78. </el-form-item>
  79. <el-form-item :label="'是否打料完成:'">
  80. <el-select filterable v-model="searchData.finishFlag" style="width: 120px">
  81. <el-option label="全部" value=""></el-option>
  82. <el-option label="是" value="Y"></el-option>
  83. <el-option label="否" value="N"></el-option>
  84. </el-select>
  85. </el-form-item>
  86. <el-form-item :label="'要求完工日期:'">
  87. <el-date-picker
  88. style="width: 130px"
  89. v-model="searchData.startDate3"
  90. type="date"
  91. value-format="yyyy-MM-dd"
  92. placeholder="选择日期">
  93. </el-date-picker>
  94. </el-form-item>
  95. <el-form-item style="margin-top: 23px;">
  96. <laber style="margin-left: -9px;font-size: 19px">&#10142</laber>
  97. </el-form-item>
  98. <el-form-item :label="' '">
  99. <el-date-picker
  100. style="width: 130px"
  101. v-model="searchData.endDate3"
  102. type="date"
  103. value-format="yyyy-MM-dd"
  104. placeholder="选择日期">
  105. </el-date-picker>
  106. </el-form-item>
  107. <el-form-item :label="' '">
  108. <el-button @click="search()" style="margin-left: 24px" type="primary">查询</el-button>
  109. <download-excel
  110. :fields="exportDataStandard"
  111. :data="tableData"
  112. type="xlsx"
  113. :name="exportName"
  114. :header="exportHeader"
  115. :footer="exportFooter"
  116. :defaultValue="exportDefaultValue"
  117. :fetch="createExportData"
  118. :before-generate="startDownload"
  119. :before-finish="finishDownload"
  120. worksheet="导出信息"
  121. class="el-button el-button--primary el-button--medium">
  122. {{'导出'}}
  123. </download-excel>
  124. </el-form-item>
  125. </el-form>
  126. </el-form>
  127. <el-table
  128. :height="height"
  129. :data="tableData"
  130. :row-class-name="tableRowClassName"
  131. border
  132. style="width: 100%">
  133. <el-table-column
  134. prop=""
  135. fixed="left"
  136. header-align="center"
  137. align="center"
  138. width="120"
  139. label="操作">
  140. <template slot-scope="scope">
  141. <a type="text" size="small" @click="openScheduleModel(scope.row)">派工</a>
  142. <a type="text" v-if="scope.row.vpFinishFlag !== '' && scope.row.vpFinishFlag !=null " size="small" @click="vpPartModel(scope.row)">组合件清单</a>
  143. </template>
  144. </el-table-column>
  145. <el-table-column
  146. prop="site"
  147. header-align="center"
  148. align="left"
  149. min-width="120"
  150. label="工厂编号">
  151. </el-table-column>
  152. <el-table-column
  153. prop="orderNo"
  154. header-align="center"
  155. align="left"
  156. min-width="120"
  157. label="日计划号">
  158. </el-table-column>
  159. <el-table-column
  160. prop="finishFlag"
  161. header-align="center"
  162. align="left"
  163. min-width="90"
  164. label="是否打料完成">
  165. </el-table-column>
  166. <el-table-column
  167. prop="vpFinishFlag"
  168. header-align="center"
  169. align="left"
  170. min-width="90"
  171. label="VP是否入库">
  172. </el-table-column>
  173. <el-table-column
  174. prop="itemNo"
  175. header-align="center"
  176. align="left"
  177. min-width="60"
  178. label="工序号">
  179. </el-table-column>
  180. <el-table-column
  181. prop="operationDesc"
  182. header-align="center"
  183. align="left"
  184. min-width="160"
  185. label="工序名称">
  186. </el-table-column>
  187. <el-table-column
  188. prop="partNo"
  189. header-align="center"
  190. align="left"
  191. min-width="120"
  192. label="物料编码">
  193. </el-table-column>
  194. <el-table-column
  195. prop="partDescription"
  196. header-align="center"
  197. align="left"
  198. min-width="200"
  199. label="物料名称">
  200. </el-table-column>
  201. <el-table-column
  202. prop="yangHuaJiType"
  203. header-align="center"
  204. align="left"
  205. min-width="80"
  206. label="氧化剂类型">
  207. </el-table-column>
  208. <el-table-column
  209. prop="liuHuaShiJian"
  210. header-align="center"
  211. align="right"
  212. min-width="70"
  213. label="硫化时间">
  214. </el-table-column>
  215. <el-table-column
  216. prop="workCenterNo"
  217. header-align="center"
  218. align="left"
  219. min-width="100"
  220. label="加工中心">
  221. </el-table-column>
  222. <el-table-column
  223. prop="cuiHuaJi"
  224. header-align="center"
  225. align="left"
  226. width="100"
  227. label="催化剂">
  228. </el-table-column>
  229. <el-table-column
  230. prop="equipment"
  231. header-align="center"
  232. align="left"
  233. min-width="80"
  234. label="设备类型">
  235. </el-table-column>
  236. <el-table-column
  237. prop="status"
  238. header-align="center"
  239. align="left"
  240. min-width="60"
  241. label="状态">
  242. </el-table-column>
  243. <el-table-column
  244. prop="orderDate"
  245. header-align="center"
  246. align="left"
  247. min-width="130"
  248. label="计划日期">
  249. </el-table-column>
  250. <el-table-column
  251. prop="needDate"
  252. header-align="center"
  253. align="left"
  254. sortable
  255. width="130"
  256. label="要求完工日期">
  257. </el-table-column>
  258. <el-table-column
  259. prop="planShipDate"
  260. header-align="center"
  261. align="left"
  262. sortable
  263. width="130"
  264. label="计划发货日期">
  265. </el-table-column>
  266. <el-table-column
  267. prop="orderRef1"
  268. header-align="center"
  269. align="left"
  270. min-width="130"
  271. label="生产订单号">
  272. </el-table-column>
  273. <el-table-column
  274. prop="lotSize"
  275. header-align="center"
  276. align="right"
  277. min-width="80"
  278. label="订单数量">
  279. </el-table-column>
  280. <el-table-column
  281. prop="weight"
  282. header-align="center"
  283. align="right"
  284. width="80"
  285. label="参考重量">
  286. </el-table-column>
  287. <el-table-column
  288. prop="qtyfinished"
  289. header-align="center"
  290. align="right"
  291. min-width="90"
  292. label="打料完成数量">
  293. </el-table-column>
  294. <el-table-column
  295. prop="banQty"
  296. header-align="center"
  297. align="right"
  298. width="80"
  299. label="剩余班次">
  300. </el-table-column>
  301. <el-table-column
  302. prop="scheduledQty"
  303. header-align="center"
  304. align="right"
  305. min-width="80"
  306. label="已派工数量">
  307. </el-table-column>
  308. <!-- <el-table-column-->
  309. <!-- prop="qtyApprove"-->
  310. <!-- header-align="center"-->
  311. <!-- align="right"-->
  312. <!-- width="80"-->
  313. <!-- label="合格数量">-->
  314. <!-- </el-table-column>-->
  315. <el-table-column
  316. prop="machSetupTime"
  317. header-align="center"
  318. align="right"
  319. min-width="80"
  320. label="调机时间">
  321. </el-table-column>
  322. <el-table-column
  323. prop="machRunFactor"
  324. header-align="center"
  325. align="right"
  326. min-width="80"
  327. label="单位产出量">
  328. </el-table-column>
  329. <el-table-column
  330. prop="factorUnit"
  331. header-align="center"
  332. align="left"
  333. min-width="80"
  334. label="产出单位">
  335. </el-table-column>
  336. </el-table>
  337. <el-dialog title="派工" :close-on-click-modal="false" v-drag :visible.sync="scheduledModalFlag" width="730px">
  338. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  339. <el-form-item label="日计划号:">
  340. <el-input v-model="schedulingModalData.orderNo" disabled style="width: 120px"></el-input>
  341. </el-form-item>
  342. <el-form-item label="工厂编号:">
  343. <el-input v-model="schedulingModalData.site" disabled style="width: 120px"></el-input>
  344. </el-form-item>
  345. <el-form-item label="计划日期:">
  346. <el-input v-model="schedulingModalData.orderDate" disabled style="width: 120px"></el-input>
  347. </el-form-item>
  348. <el-form-item label="订单数量:">
  349. <el-input v-model="schedulingModalData.lotSize" disabled style="width: 120px"></el-input>
  350. </el-form-item>
  351. <el-form-item label="待派工数:">
  352. <el-input v-model="schedulingModalData.qtyToSchedule" disabled style="width: 120px"></el-input>
  353. </el-form-item>
  354. </el-form>
  355. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  356. <el-form-item label="产品编码:">
  357. <el-input v-model="schedulingModalData.partNo" disabled style="width: 120px"></el-input>
  358. </el-form-item>
  359. <el-form-item label="产品名称:">
  360. <el-input v-model="schedulingModalData.partDescription" disabled style="width: 120px"></el-input>
  361. </el-form-item>
  362. <el-form-item label="工序号:">
  363. <el-input v-model="schedulingModalData.itemNo" disabled style="width: 120px"></el-input>
  364. </el-form-item>
  365. <el-form-item label="工序名称:">
  366. <el-input v-model="schedulingModalData.operationDesc" disabled style="width: 120px"></el-input>
  367. </el-form-item>
  368. <el-form-item label="加工中心:">
  369. <el-input v-model="schedulingModalData.workCenterNo" disabled style="width: 120px"></el-input>
  370. </el-form-item>
  371. </el-form>
  372. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  373. <el-form-item label="派工机台:">
  374. <el-select v-model="schedulingModalData.resourceId" style="width: 120px"
  375. placeholder="请选择">
  376. <el-option v-for="item in availableResourceList " :key="item.ResourceID" :label="item.ResourceID+'-'+item.ResouceDesc"
  377. :value="item.ResourceID">
  378. </el-option>
  379. </el-select>
  380. </el-form-item>
  381. <el-form-item label="派工班次:">
  382. <el-select v-model="schedulingModalData.shiftNo" style="width: 120px"
  383. placeholder="请选择">
  384. <el-option label="白班" value="白班"></el-option>
  385. <el-option label="晚班" value="晚班"></el-option>
  386. <el-option label="加班" value="加班"></el-option>
  387. </el-select>
  388. </el-form-item>
  389. <el-form-item label="派工人员:">
  390. <el-select v-model="schedulingModalData.operatorId" style="width: 120px"
  391. placeholder="请选择">
  392. <el-option v-for="item in operatorIdList " :key="index" :label="item.operatorName"
  393. :value="item.operatorID">
  394. </el-option>
  395. </el-select>
  396. </el-form-item>
  397. <el-form-item label="本次累计派工数量:">
  398. <el-input v-model="schedulingModalData.sumQty" type="number" disabled style="width: 120px"></el-input>
  399. </el-form-item>
  400. <el-form-item label="重量系数:">
  401. <el-input v-model="schedulingModalData.weightFactor" disabled style="width: 120px"></el-input>
  402. </el-form-item>
  403. </el-form>
  404. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  405. <el-form-item label="派工备注:">
  406. <el-input v-model="schedulingModalData.remark" style="width: 656px"></el-input>
  407. </el-form-item>
  408. </el-form>
  409. <el-button type="primary" @click="addPlans()" style="margin-left: 10px;">添加</el-button>
  410. <el-button type="primary" @click="saveSchedule()">保存</el-button>
  411. <div class="rq ">
  412. <el-table
  413. height="200"
  414. :data="schedulingModalTableData"
  415. border
  416. style="width: 100%">
  417. <el-table-column
  418. prop="scheduleDate"
  419. header-align="center"
  420. align="left"
  421. min-width="100"
  422. label="派工日期">
  423. <template slot-scope="scope">
  424. <el-date-picker
  425. style="width: 95%"
  426. class="sl-input"
  427. v-model="scope.row.scheduleDate"
  428. type="date"
  429. value-format="yyyy-MM-dd"
  430. placeholder="选择日期">
  431. </el-date-picker>
  432. </template>
  433. </el-table-column>
  434. <el-table-column
  435. prop="scheduleQty"
  436. header-align="center"
  437. align="right"
  438. min-width="80"
  439. label="派工数量">
  440. <template slot-scope="scope">
  441. <el-input v-model="scope.row.scheduleQty" type="number" @change="changeSum" @blur="scheduleQtyBlur(scope.row)" placeholder="请输入数量"
  442. style="width:98%"></el-input>
  443. </template>
  444. </el-table-column>
  445. <el-table-column
  446. prop="weight"
  447. header-align="center"
  448. align="right"
  449. min-width="80"
  450. label="转化重量">
  451. <template slot-scope="scope">
  452. <el-input v-model="scope.row.weight" type="number" :disabled="weightFactorFlag" @change="changeSum" @blur="weightBlur(scope.row)" placeholder="请输入重量"
  453. style="width:98%"></el-input>
  454. </template>
  455. </el-table-column>
  456. <el-table-column
  457. prop="resourceId"
  458. header-align="center"
  459. align="left"
  460. min-width="80"
  461. label="派工机台">
  462. <template slot-scope="scope">
  463. <el-select v-model="scope.row.resourceId" placeholder="请选择" style="height: 12px;padding: 0px " filterable
  464. allow-create>
  465. <el-option v-for="item in availableResourceList " :key="index" :label="item.ResourceID+'-'+item.ResouceDesc"
  466. :value="item.ResourceID">
  467. </el-option>
  468. </el-select>
  469. </template>
  470. </el-table-column>
  471. <el-table-column
  472. prop="shiftNo"
  473. header-align="center"
  474. align="left"
  475. min-width="80"
  476. label="派工班次">
  477. <template slot-scope="scope">
  478. <el-select v-model="scope.row.shiftNo" placeholder="请选择" style="height: 12px;padding: 0px " filterable
  479. allow-create>
  480. <el-option label="白班" value="白班"></el-option>
  481. <el-option label="晚班" value="晚班"></el-option>
  482. <el-option label="加班" value="加班"></el-option>
  483. </el-select>
  484. </template>
  485. </el-table-column>
  486. <el-table-column
  487. prop="shiftNo"
  488. header-align="center"
  489. align="left"
  490. min-width="80"
  491. label="派工类型">
  492. <template slot-scope="scope">
  493. <el-select v-model="scope.row.jobType" placeholder="请选择" style="height: 12px;padding: 0px " filterable
  494. allow-create>
  495. <el-option label="计件" value="计件"></el-option>
  496. <el-option label="计时" value="计时"></el-option>
  497. <el-option label="外协" value="外协"></el-option>
  498. </el-select>
  499. </template>
  500. </el-table-column>
  501. <el-table-column
  502. prop="operatorId"
  503. header-align="center"
  504. align="right"
  505. min-width="80"
  506. label="派工人员">
  507. <template slot-scope="scope">
  508. <el-select v-model="scope.row.operatorId" placeholder="请选择" style="height: 12px;padding: 0px " filterable
  509. allow-create>
  510. <el-option v-for="item in operatorIdList " :key="index" :label="item.operatorName"
  511. :value="item.operatorID">
  512. </el-option>
  513. </el-select>
  514. </template>
  515. </el-table-column>
  516. <el-table-column
  517. prop=""
  518. header-align="center"
  519. align="center"
  520. width="60"
  521. label="操作">
  522. <template slot-scope="scope" class="foo_container">
  523. <a type="text" size="small" @click="splitScheduleTable(scope.$index)">删除</a>
  524. </template>
  525. </el-table-column>
  526. </el-table>
  527. </div>
  528. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  529. <el-button type="primary" @click="scheduledModalFlag = false">取消</el-button>
  530. <!-- <el-button type="primary" :disabled="bannersBut" @click="saveBanners()">确定</el-button>-->
  531. </el-footer>
  532. </el-dialog>
  533. <el-dialog title="组合件清单" :close-on-click-modal="false" v-drag :visible.sync="vpModalFlag" width="600px">
  534. <div class="rq ">
  535. <el-table
  536. height="200"
  537. :data="vpModalTableData"
  538. border
  539. style="width: 100%">
  540. <el-table-column
  541. prop="partNo"
  542. header-align="center"
  543. align="left"
  544. min-width="100"
  545. label="组件编码">
  546. </el-table-column>
  547. <el-table-column
  548. prop="partDesc"
  549. header-align="center"
  550. align="left"
  551. min-width="150"
  552. label="规格型号">
  553. </el-table-column>
  554. <el-table-column
  555. prop="qtyRequire"
  556. header-align="center"
  557. align="left"
  558. min-width="100"
  559. label="需求数量">
  560. </el-table-column>
  561. <el-table-column
  562. prop="qty"
  563. header-align="center"
  564. align="left"
  565. min-width="100"
  566. label="入库数量">
  567. </el-table-column>
  568. <el-table-column
  569. prop="umid"
  570. header-align="center"
  571. align="left"
  572. min-width="100"
  573. label="计量单位">
  574. </el-table-column>
  575. </el-table>
  576. </div>
  577. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  578. <el-button type="primary" @click="vpModalFlag = false">关闭</el-button>
  579. </el-footer>
  580. </el-dialog>
  581. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  582. </div>
  583. </template>
  584. <script>
  585. import {
  586. getSOTastRoutingData,
  587. getWorkCenterOperatorList,
  588. getAvailableResourceList,
  589. scheduleForSOTask,
  590. getVpPartModel,
  591. } from "@/api/production.js"
  592. import Chooselist from '@/views/modules/common/Chooselist'
  593. export default {
  594. name: 'scheduleForSOTask',
  595. components: {
  596. Chooselist
  597. },
  598. data () {
  599. return {
  600. // 导出 start
  601. exportData: [],
  602. exportDataStandard: {
  603. "日计划号": "orderNo",
  604. "工序号": "itemNo",
  605. "工序名称": "operationDesc",
  606. "物料编码": "partNo",
  607. "物料名称": "partDescription",
  608. "加工中心": "workCenterNo",
  609. "状态": "status",
  610. "计划日期": "orderDate",
  611. "日计划数量": "lotSize",
  612. "已派工数量": "scheduledQty",
  613. "生产订单号": "orderRef1",
  614. "调机时间": "machSetupTime",
  615. "单位产出量": "machRunFactor",
  616. "产出单位": "factorUnit",
  617. },
  618. exportName: "日计划工序列表"+this.getStrDate(),
  619. exportHeader: ["日计划工序列表"],
  620. exportFooter: [],
  621. exportDefaultValue: "",
  622. // 导出 end
  623. height:200,
  624. tableData:[],
  625. date1:'',
  626. searchData: {
  627. orderNo: '',
  628. startDate1: new Date(),
  629. endDate1: '',
  630. startDate3: '',
  631. endDate3: '',
  632. startDate4: '',
  633. endDate4: '',
  634. status: '(\'已计划\')',
  635. partNo: '',
  636. orderRef1:'',
  637. site: '',
  638. planStatus: 'a.OrderQty>isnull(SL.scheduledQty,0)',
  639. partDescription:'',
  640. finishFlag:'',
  641. userId:this.$store.state.user.name,
  642. },
  643. weightFactorFlag:false,
  644. schedulingModalData: {
  645. remark:'',
  646. weightFactor:'',
  647. orderNo: '',
  648. site: '',
  649. orderRef1: '',
  650. lotSize: '',
  651. qtyToSchedule: '',
  652. partNo: '',
  653. partDescription: '',
  654. itemNo: '',
  655. operationDesc: '',
  656. workCenterNo: '',
  657. scheduleDate: '',
  658. scheduleQty: '',
  659. resourceId: '',
  660. shiftNo: '',
  661. sumQty: '',
  662. orderDate:'',
  663. operatorId:'',
  664. efficiency:'',
  665. partPlanQty:'',
  666. },
  667. scheduledModalFlag: false,
  668. vpModalFlag: false,
  669. availableResourceList: [],
  670. schedulingModalTableData: [],
  671. vpModalTableData: [],
  672. operatorIdList:[],
  673. tagNo:'',
  674. }
  675. },
  676. mounted() {
  677. this.$nextTick(()=>{
  678. this.height = window.innerHeight - 220;
  679. })
  680. },
  681. methods: {
  682. // 获取基础数据列表S
  683. getBaseList (val,type) {
  684. this.tagNo = val
  685. this.$nextTick(() => {
  686. let strVal = ''
  687. if (val === 5) {
  688. strVal = this.searchData.partNo
  689. }
  690. this.$refs.baseList.init(val, strVal)
  691. })
  692. },
  693. /* 列表方法的回调 */
  694. getBaseData (val) {
  695. if (this.tagNo === 5) {
  696. this.searchData.partNo = val.PartNo
  697. }
  698. },
  699. search(){
  700. getSOTastRoutingData(this.searchData).then(({data}) => {
  701. this.tableData = data.rows;
  702. })
  703. },
  704. createExportData() {
  705. return this.tableData;
  706. },
  707. startDownload() {
  708. // this.exportData = this.dataList
  709. },
  710. finishDownload() {
  711. },
  712. getStrDate() {
  713. let dd = new Date();
  714. let Y = dd.getFullYear();
  715. let M = (dd.getMonth() + 1) < 10 ? "0" + (dd.getMonth() + 1) : (dd.getMonth() + 1);//获取当前月份的日期,不足10补0
  716. let D = dd.getDate() < 10 ? "0" + dd.getDate() : dd.getDate();//获取当前几号,不足10补0
  717. let H = dd.getHours() < 10 ? "0" + dd.getHours() : dd.getHours();
  718. let MM = dd.getMinutes() < 10 ? "0" + dd.getMinutes() : dd.getMinutes();
  719. let S = dd.getSeconds() < 10 ? "0" + dd.getSeconds() : dd.getSeconds();
  720. return Y + M + D + H + MM + S;
  721. },
  722. openScheduleModel(row){
  723. // if (row.lotSize-row.scheduledQty == 0) {
  724. // this.$alert('该订单已派工完毕!', '错误', {
  725. // confirmButtonText: '确定'
  726. // })
  727. // return false
  728. // }
  729. if (row.qtyfinished == 0) {
  730. this.$alert('该日计划尚未打料完成!', '错误', {
  731. confirmButtonText: '确定'
  732. })
  733. return false
  734. }
  735. if (row.vpFinishFlag === 'N') {
  736. this.$alert('该日计划尚未完成组件!', '错误', {
  737. confirmButtonText: '确定'
  738. })
  739. return false
  740. }
  741. this.schedulingModalData = {
  742. remark:'',
  743. weightFactor: row.weightFactor,
  744. partPlanQty: row.partPlanQty,
  745. orderNo: row.orderNo,
  746. site: row.site,
  747. orderRef1: row.orderRef1,
  748. lotSize: row.lotSize,
  749. qtyToSchedule: row.lotSize-row.scheduledQty,
  750. partNo: row.partNo,
  751. partDescription: row.partDescription,
  752. itemNo: row.itemNo,
  753. operationDesc: row.operationDesc,
  754. workCenterNo: row.workCenterNo,
  755. efficiency:row.efficiency,
  756. orderDate: row.orderDate,
  757. scheduleDate: '',
  758. scheduleQty: '',
  759. resourceId: '',
  760. shiftNo: '',
  761. sumQty: 0,
  762. operatorId: '',
  763. repairSOFlag:row.repairSOFlag,
  764. }
  765. if(this.schedulingModalData.weightFactor==null||this.schedulingModalData.weightFactor==''||this.schedulingModalData.weightFactor=='0'){
  766. this.weightFactorFlag=true;
  767. this.schedulingModalData.weightFactor='ERP未维护数据'
  768. }else {
  769. this.weightFactorFlag=false;
  770. }
  771. this.schedulingModalTableData = []
  772. this.getAvailableResourceList(row);
  773. this.getWorkCenterOperatorList(row);
  774. this.scheduledModalFlag = true
  775. },
  776. addPlans () {
  777. // if (this.schedulingModalData.resourceId == '') {
  778. // this.$alert('请选择机台!', '错误', {
  779. // confirmButtonText: '确定'
  780. // })
  781. // return false
  782. // }
  783. // if (this.schedulingModalData.shiftNo == '') {
  784. // this.$alert('请选择派工班次!', '错误', {
  785. // confirmButtonText: '确定'
  786. // })
  787. // return false
  788. // }
  789. let data={
  790. scheduleQty: '',
  791. weight:'',
  792. resourceId: this.schedulingModalData.resourceId,
  793. shiftNo: this.schedulingModalData.shiftNo,
  794. scheduleDate: null,
  795. operatorId:this.schedulingModalData.operatorId,
  796. createBy:this.$store.state.user.name,
  797. jobType:'',
  798. }
  799. if(this.schedulingModalData.partPlanQty!=null&&this.schedulingModalData.partPlanQty!=''&&this.schedulingModalData.partPlanQty!=0){
  800. data.scheduleQty=this.schedulingModalData.partPlanQty;
  801. if(this.schedulingModalData.weightFactor==null||this.schedulingModalData.weightFactor==''||this.schedulingModalData.weightFactor=='0'){
  802. }else {
  803. data.weight=Math.round( data.scheduleQty*this.schedulingModalData.weightFactor)
  804. }
  805. }
  806. this.schedulingModalTableData.push(data)
  807. this.changeSum ();
  808. },
  809. changeSum () {
  810. let sum = 0
  811. if (this.schedulingModalTableData.length > 0) {
  812. for (let i = 0; i < this.schedulingModalTableData.length; i++) {
  813. if (this.schedulingModalTableData[i].scheduleQty != '' && this.schedulingModalTableData[i].scheduleQty != null) {
  814. sum += Number(this.schedulingModalTableData[i].scheduleQty)
  815. }
  816. }
  817. }
  818. this.schedulingModalData.sumQty = sum
  819. },
  820. splitScheduleTable (index) {
  821. this.schedulingModalTableData.splice(index, 1)
  822. this.changeSum()
  823. },
  824. getWorkCenterOperatorList(row){
  825. let inData={
  826. site:row.site,
  827. workCenterNo:row.workCenterNo,
  828. }
  829. getWorkCenterOperatorList(inData).then(({data}) => {
  830. this.operatorIdList = data.rows;
  831. })
  832. },
  833. getAvailableResourceList(row){
  834. let inData={
  835. site:row.site,
  836. orderNo:row.orderRef1,
  837. itemNo:row.itemNo,
  838. }
  839. getAvailableResourceList(inData).then(({data}) => {
  840. this.availableResourceList = data.rows;
  841. })
  842. },
  843. saveSchedule(){
  844. if(this.schedulingModalTableData.length==0){
  845. this.$alert('请添加派工记录!', '错误', {
  846. confirmButtonText: '确定'
  847. })
  848. return false
  849. }
  850. // if(this.schedulingModalData.qtyToSchedule<this.schedulingModalData.sumQty){
  851. // this.$alert('实际派工数量大于可派工数量!', '错误', {
  852. // confirmButtonText: '确定'
  853. // })
  854. // return false
  855. // }
  856. let flag=false;
  857. for (let i = 0; i <this.schedulingModalTableData.length; i++) {
  858. if(''==this.schedulingModalTableData[i].scheduleQty||this.schedulingModalTableData[i].scheduleQty==null){
  859. this.$alert('存在派工记录没有填写派工数量!', '错误', {
  860. confirmButtonText: '确定'
  861. })
  862. return false
  863. }
  864. if(this.schedulingModalTableData[i].scheduleQty<=0){
  865. this.$alert('派工数量必须大于0!', '错误', {
  866. confirmButtonText: '确定'
  867. })
  868. return false
  869. }
  870. if(''==this.schedulingModalTableData[i].resourceId||this.schedulingModalTableData[i].resourceId==null){
  871. this.$alert('存在派工记录没有选择机台!', '错误', {
  872. confirmButtonText: '确定'
  873. })
  874. return false
  875. }
  876. if(''==this.schedulingModalTableData[i].shiftNo||this.schedulingModalTableData[i].shiftNo==null){
  877. this.$alert('存在派工记录没有选择班次!', '错误', {
  878. confirmButtonText: '确定'
  879. })
  880. return false
  881. }
  882. if(this.schedulingModalTableData[i].jobType==''||this.schedulingModalTableData[i].jobType==null){
  883. this.$alert('请选择派工类型!', '错误', {
  884. confirmButtonText: '确定'
  885. })
  886. return false
  887. }
  888. if(''==this.schedulingModalTableData[i].scheduleDate||this.schedulingModalTableData[i].scheduleDate==null){
  889. this.$alert('存在派工记录没有填写日期!', '错误', {
  890. confirmButtonText: '确定'
  891. })
  892. return false
  893. }
  894. if(''==this.schedulingModalTableData[i].operatorId||this.schedulingModalTableData[i].operatorId==null){
  895. this.$alert('存在派工记录没有选择操作员!', '错误', {
  896. confirmButtonText: '确定'
  897. })
  898. return false
  899. }
  900. if(this.schedulingModalTableData[i].scheduleDate!=this.schedulingModalData.orderDate){
  901. flag=true;
  902. }
  903. }
  904. if(flag){
  905. this.$confirm(`派工日期不是排产日期,是否继续`, '提示', {
  906. confirmButtonText: '确定',
  907. cancelButtonText: '取消',
  908. type: 'warning'
  909. }).then(() => {
  910. this.doSchedule();
  911. })
  912. }else {
  913. this.doSchedule();
  914. }
  915. },
  916. doSchedule(){
  917. let indata={
  918. orderNo: this.schedulingModalData.orderNo,
  919. site: this.schedulingModalData.site,
  920. orderDate: this.schedulingModalData.orderDate,
  921. partNo: this.schedulingModalData.partNo,
  922. itemNo: this.schedulingModalData.itemNo,
  923. workCenterNo: this.schedulingModalData.workCenterNo,
  924. sumQty: this.schedulingModalData.sumQty,
  925. scheduleDetail:this.schedulingModalTableData,
  926. efficiency:this.schedulingModalData.efficiency,
  927. orderRef1:this.schedulingModalData.orderRef1,
  928. remark:this.schedulingModalData.remark,
  929. repairSOFlag:this.schedulingModalData.repairSOFlag
  930. }
  931. scheduleForSOTask(indata).then(({data}) => {
  932. if (data && data.code === 0) {
  933. this.scheduledModalFlag = false
  934. for (let i = 0; i <this.tableData.length ; i++) {
  935. if(this.tableData[i].orderNo==indata.orderNo &&this.tableData[i].itemNo==indata.itemNo){
  936. this.tableData[i].scheduledQty=data.qty;
  937. }
  938. }
  939. this.$message({
  940. message: '操作成功',
  941. type: 'success',
  942. duration: 1500,
  943. onClose: () => {
  944. }
  945. })
  946. } else {
  947. this.$alert(data.msg, '错误', {
  948. confirmButtonText: '确定'
  949. })
  950. }
  951. })
  952. },
  953. scheduleQtyBlur(row){
  954. if(this.schedulingModalData.weightFactor&&this.schedulingModalData.weightFactor!=0&&this.weightFactorFlag==false&&row.scheduleQty!=''){
  955. row.weight=(row.scheduleQty*this.schedulingModalData.weightFactor).toFixed(1)
  956. }
  957. if(row.scheduleQty==''){
  958. row.weight=''
  959. }
  960. },
  961. weightBlur(row){
  962. if(this.schedulingModalData.weightFactor&&this.schedulingModalData.weightFactor!=0&&this.weightFactorFlag==false&&row.weight!=''){
  963. row.scheduleQty=(row.weight/this.schedulingModalData.weightFactor).toFixed(1)
  964. }
  965. if(row.weight==''){
  966. row.scheduleQty=''
  967. }
  968. },
  969. tableRowClassName ({row, rowIndex}) {
  970. if (row.lastStartDate == this.dayjs().format('YYYY-MM-DD')) {
  971. return 'success-row'
  972. }
  973. return ''
  974. },
  975. vpPartModel(row){
  976. getVpPartModel(row).then(({data}) => {
  977. this.vpModalTableData = data.rows;
  978. })
  979. this.vpModalFlag=true
  980. },
  981. },
  982. created() {
  983. }
  984. }
  985. </script>
  986. <style >
  987. .rq .el-table .cell {
  988. line-height: 20px;
  989. font-size: 12px;
  990. height: 20px;
  991. }
  992. .el-table .success-row {
  993. background: #1bb61b;
  994. }
  995. </style>