赫艾前端
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.

1010 lines
39 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 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
4 years ago
3 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
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
3 years ago
4 years ago
4 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
3 years ago
3 years ago
3 years ago
4 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 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
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
3 years ago
3 years ago
3 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
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
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
4 years ago
3 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
3 years 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
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
3 years ago
4 years ago
3 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
  1. <template>
  2. <div class="mod-config">
  3. <el-form :inline="true" label-position="top" label-width="100px" >
  4. <el-form-item :label="'生产订单号'">
  5. <el-input v-model="searchData.orderNo" style="width: 130px"></el-input>
  6. </el-form-item>
  7. <el-form-item >
  8. <span slot="label" style="" @click="getBaseList(24)"><a herf="#">加工中心编码</a></span>
  9. <el-input v-model="searchData.sWorkCenterNo" style="width: 130px"></el-input>
  10. </el-form-item>
  11. <el-form-item >
  12. <span slot="label" style="" @click="getBaseList(5)"><a herf="#">产品编码</a></span>
  13. <el-input v-model="searchData.partNo" style="width: 120px"></el-input>
  14. </el-form-item>
  15. <el-form-item :label="'工序编号'">
  16. <el-input v-model="searchData.itemNo" style="width: 120px"></el-input>
  17. </el-form-item>
  18. <el-form-item :label="'派工单类型'">
  19. <el-select v-model="searchData.scheduleType" style="width: 120px">
  20. <el-option label="全部" value=""></el-option>
  21. <el-option label="生产订单派工单" value="生产订单派工单"></el-option>
  22. <el-option label="日计划派工单" value="日计划派工单"></el-option>
  23. </el-select>
  24. </el-form-item>
  25. <el-form-item :label="'是否报工完成'">
  26. <el-select v-model="searchData.reportFlag" style="width: 120px">
  27. <el-option label="全部" value=""></el-option>
  28. <el-option label="是" value="QtyReported>=QtyRequired"></el-option>
  29. <el-option label="否" value="QtyRequired>QtyReported"></el-option>
  30. </el-select>
  31. </el-form-item>
  32. </el-form>
  33. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
  34. <el-form-item :label="'派工日期:'">
  35. <el-date-picker
  36. style="width: 130px"
  37. v-model="searchData.startDate"
  38. value-format="yyyy-MM-dd"
  39. placeholder="选择日期">
  40. </el-date-picker>
  41. </el-form-item>
  42. <el-form-item :label="'至: '">
  43. <el-date-picker
  44. style="width: 130px"
  45. v-model="searchData.endDate"
  46. type="date"
  47. value-format="yyyy-MM-dd"
  48. placeholder="选择日期">
  49. </el-date-picker>
  50. </el-form-item>
  51. <el-form-item >
  52. <span slot="label" style="" @click="getBaseList(26,3)"><a herf="#">操作员姓名</a></span>
  53. <el-input v-model="searchData.operatorName" style="width: 120px"></el-input>
  54. </el-form-item>
  55. <el-form-item >
  56. <span slot="label" style="" @click="getBaseList(88)"><a herf="#">机台ID</a></span>
  57. <el-input v-model="searchData.sResourceID" style="width: 120px"></el-input>
  58. </el-form-item>
  59. <el-form-item :label="'班次'">
  60. <el-select v-model="searchData.sShiftNo" style="width: 120px">
  61. <el-option label="全部" value=""></el-option>
  62. <el-option label="白班" value="白班"></el-option>
  63. <el-option label="晚班" value="晚班"></el-option>
  64. </el-select>
  65. </el-form-item>
  66. <el-form-item :label="' '">
  67. <el-button @click="search()" style="margin-left: 0px;margin-top:0px" type="primary">查询</el-button>
  68. <el-button @click="openStart()" style="margin-left: 0px;margin-top:0px" type="primary">派工单开始</el-button>
  69. <el-button @click="openScan()" style="margin-left: 0px;margin-top:0px" type="primary">派工单报工</el-button>
  70. <download-excel
  71. :fields="exportDataStandard"
  72. :data="tableData"
  73. type="xlsx"
  74. :name="exportName"
  75. :header="exportHeader"
  76. :footer="exportFooter"
  77. :defaultValue="exportDefaultValue"
  78. :fetch="createExportData"
  79. :before-generate="startDownload"
  80. :before-finish="finishDownload"
  81. worksheet="导出信息"
  82. class="el-button el-button--primary el-button--medium">
  83. {{'导出'}}
  84. </download-excel>
  85. </el-form-item>
  86. </el-form>
  87. <el-table
  88. :height="height"
  89. :data="tableData"
  90. border
  91. style="width: 100%">
  92. <el-table-column
  93. prop=""
  94. header-align="center"
  95. align="center"
  96. min-width="100"
  97. label="操作">
  98. <template slot-scope="scope" class="foo_container">
  99. <a type="text" size="small" @click="initReportModal(scope.row)">报工</a>
  100. <a type="text" size="small" @click="SOPModal2(scope.row)">查看SOP</a>
  101. </template>
  102. </el-table-column>
  103. <el-table-column
  104. prop="seqNo"
  105. header-align="center"
  106. align="left"
  107. min-width="70"
  108. label="派工单号">
  109. </el-table-column>
  110. <el-table-column
  111. prop="orderNo"
  112. header-align="center"
  113. align="left"
  114. min-width="100"
  115. label="关联单号">
  116. </el-table-column>
  117. <el-table-column
  118. prop="scheduleType"
  119. header-align="center"
  120. align="left"
  121. min-width="100"
  122. label="关联单号类型">
  123. </el-table-column>
  124. <el-table-column
  125. prop="itemNo"
  126. header-align="center"
  127. align="left"
  128. min-width="70"
  129. label="工序号">
  130. </el-table-column>
  131. <el-table-column
  132. prop="itemDesc"
  133. header-align="center"
  134. align="left"
  135. min-width="160"
  136. label="工序名称">
  137. </el-table-column>
  138. <el-table-column
  139. prop="qtyRequired"
  140. header-align="center"
  141. align="right"
  142. min-width="80"
  143. label="派工数量">
  144. </el-table-column>
  145. <el-table-column
  146. prop="qtyReported"
  147. header-align="center"
  148. align="right"
  149. min-width="80"
  150. label="报工数量">
  151. </el-table-column>
  152. <el-table-column
  153. prop="qtyApprove"
  154. header-align="center"
  155. align="right"
  156. min-width="80"
  157. label="合格数量">
  158. </el-table-column>
  159. <el-table-column
  160. prop="timeRequired"
  161. header-align="center"
  162. align="right"
  163. min-width="80"
  164. label="需求时间">
  165. </el-table-column>
  166. <el-table-column
  167. prop="sScheduledDate"
  168. header-align="center"
  169. align="left"
  170. min-width="80"
  171. label="派工日期">
  172. </el-table-column>
  173. <el-table-column
  174. prop="operatorName"
  175. header-align="center"
  176. align="left"
  177. min-width="80"
  178. label="操作员姓名">
  179. </el-table-column>
  180. <el-table-column
  181. prop="partNo"
  182. header-align="center"
  183. align="left"
  184. min-width="80"
  185. label="产品编码">
  186. </el-table-column>
  187. <el-table-column
  188. prop="partDesc"
  189. header-align="center"
  190. align="left"
  191. min-width="200"
  192. label="产品名称">
  193. </el-table-column>
  194. <el-table-column
  195. prop="sResourceID"
  196. header-align="center"
  197. align="left"
  198. min-width="70"
  199. label="机台ID">
  200. </el-table-column>
  201. <el-table-column
  202. prop="sShiftNo"
  203. header-align="center"
  204. align="left"
  205. min-width="70"
  206. label="班次">
  207. </el-table-column>
  208. <el-table-column
  209. prop="sWorkCenterNo"
  210. header-align="center"
  211. align="left"
  212. min-width="100"
  213. label="加工中心编码">
  214. </el-table-column>
  215. </el-table>
  216. <el-dialog title="扫描派工单" :close-on-click-modal="false" v-drag :visible.sync="scanModalFlag" width="215px">
  217. <el-form :inline="true" label-position="top" style="margin-left: 22px;margin-top: -5px;">
  218. <el-form-item :label="'派工单号:'">
  219. <el-input v-model="scanSeqNo" ref="input" type="number" style="width: 130px;" @keyup.enter.native="searchSeqNo()"></el-input>
  220. </el-form-item>
  221. </el-form>
  222. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  223. <el-button type="primary" @click="searchSeqNo()">搜索</el-button>
  224. <el-button type="primary" @click="scanModalFlag = false">关闭</el-button>
  225. </el-footer>
  226. </el-dialog>
  227. <el-dialog title="开始派工单" :close-on-click-modal="false" v-drag :visible.sync="startModalFlag" width="215px">
  228. <el-form :inline="true" label-position="top" style="margin-left: 22px;margin-top: -5px;">
  229. <el-form-item :label="'派工单号:'">
  230. <el-input v-model="scanSeqNo" ref="start" type="number" style="width: 130px;" @keyup.enter.native="startSeqNo()"></el-input>
  231. </el-form-item>
  232. </el-form>
  233. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  234. <el-button type="primary" @click="startSeqNo()">开始</el-button>
  235. <el-button type="primary" @click="startModalFlag = false">关闭</el-button>
  236. </el-footer>
  237. </el-dialog>
  238. <el-dialog @close="closeDialog" :close-on-click-modal="false" :close-on-press-escape="false" v-drag title="报告信息" :visible.sync="setUp.reviewFlag" width="615px">
  239. <el-form :inline="true" label-position="top">
  240. <el-form-item label="派工单号">
  241. <el-input style="width: 130px;" :disabled="setUp.disabled" onkeyup="this.value = this.value.toUpperCase()" v-model="saveHeaderData.seqNo"></el-input>
  242. </el-form-item>
  243. <el-form-item label="产品编码">
  244. <el-input style="width: 130px;" :disabled="setUp.disabled" v-model="saveHeaderData.partNo"></el-input>
  245. </el-form-item>
  246. <el-form-item label="产品名称/规格型号">
  247. <el-input style="width: 275px;" :disabled="setUp.disabled" v-model="saveHeaderData.partDescription"></el-input>
  248. </el-form-item>
  249. </el-form>
  250. <el-form :inline="true" label-position="top">
  251. <el-form-item label="工序号">
  252. <el-input style="width: 130px;" :disabled="setUp.disabled" v-model="saveHeaderData.itemNo"></el-input>
  253. </el-form-item>
  254. <el-form-item label="工序名称">
  255. <el-input style="width: 130px;" :disabled="setUp.disabled" v-model="saveHeaderData.operationDesc"></el-input>
  256. </el-form-item>
  257. <el-form-item label="加工中心编码">
  258. <el-input style="width: 130px;" :disabled="setUp.disabled" v-model="saveHeaderData.workCenterNo"></el-input>
  259. </el-form-item>
  260. <el-form-item label="加工中心名称">
  261. <el-input style="width: 130px;" :disabled="setUp.disabled" v-model="saveHeaderData.workCenterDesc"></el-input>
  262. </el-form-item>
  263. </el-form>
  264. <el-form :inline="true" label-position="top">
  265. <el-form-item>
  266. <span slot="label" style="" @click="getBaseList(26 ,1)"><a herf="#">操作员</a></span>
  267. <el-input style="width: 130px;" v-model="saveHeaderData.operatorId"></el-input>
  268. </el-form-item>
  269. <el-form-item label="操作员姓名">
  270. <el-input style="width: 130px;" v-model="saveHeaderData.operatorName"></el-input>
  271. </el-form-item>
  272. <el-form-item label="生产日期">
  273. <el-date-picker
  274. style="width: 130px"
  275. v-model="saveHeaderData.planStartTime"
  276. type="date"
  277. value-format="yyyy-MM-dd"
  278. format = "yyyy-MM-dd"
  279. placeholder="选择日期">
  280. </el-date-picker>
  281. </el-form-item>
  282. <el-form-item label="报告日期">
  283. <el-date-picker
  284. style="width: 130px"
  285. v-model="saveHeaderData.planFinishTime"
  286. type="date"
  287. value-format="yyyy-MM-dd"
  288. format = "yyyy-MM-dd"
  289. placeholder="选择日期">
  290. </el-date-picker>
  291. </el-form-item>
  292. </el-form>
  293. <el-form :inline="true" label-position="top">
  294. <el-form-item label="本工序报工数">
  295. <el-input style="width: 130px;" :disabled="setUp.disabled" v-model="qty1"></el-input>
  296. </el-form-item>
  297. <el-form-item label="上工序报工数">
  298. <el-input style="width: 130px;" :disabled="setUp.disabled" v-model="qty2"></el-input>
  299. </el-form-item>
  300. <el-form-item label="单位重量">
  301. <el-input style="width: 130px;" disabled v-model="qty3"></el-input>
  302. </el-form-item>
  303. </el-form>
  304. <el-form :inline="true" label-position="top">
  305. <el-form-item label="报告数量">
  306. <el-input type="number" class="input_left" style="width: 178px;" v-model="saveHeaderData.qtyReported" @blur="qtyReportedBlur()"></el-input>
  307. </el-form-item>
  308. <el-form-item label="合格数量">
  309. <el-input type="number" style="width: 178px;" class="input_reight" v-model="saveHeaderData.qtyApprove" @blur="qtyApproveBlur()"></el-input>
  310. </el-form-item>
  311. <el-form-item label="返工数量">
  312. <el-input type="number" style="width: 178px;" v-model="saveHeaderData.qtyRework" @blur="qtyReworkBlur()"></el-input>
  313. </el-form-item>
  314. </el-form>
  315. <el-form :inline="true" label-position="top">
  316. <el-form-item label="报告重量(KG)">
  317. <el-input type="number" class="input_left" style="width: 178px;" :disabled="factorFlag" v-model="KGReported" @blur="KGReportedBlur()"></el-input>
  318. </el-form-item>
  319. <el-form-item label="合格重量(KG)">
  320. <el-input type="number" style="width: 178px;" class="input_reight" :disabled="factorFlag" v-model="KGApprove" @blur="KGApproveBlur()"></el-input>
  321. </el-form-item>
  322. <el-form-item label="返工重量(KG)">
  323. <el-input type="number" style="width: 178px;" v-model="KGRework" :disabled="factorFlag" @blur="KGReworkBlur()"></el-input>
  324. </el-form-item>
  325. </el-form>
  326. <fieldset class="customer-fieldset" style="width: 597px;margin-left: -10px;">
  327. <legend class="customer-legend">不良品分析</legend>
  328. <el-form :inline="true" label-position="top">
  329. <el-form-item>
  330. <span slot="label" style="" @click="getBaseList(26 ,2)"><a herf="#">操作员</a></span>
  331. <el-input style="width: 178px;" v-model="saveHeaderData.operatorId2"></el-input>
  332. </el-form-item>
  333. <el-form-item label="操作员姓名">
  334. <el-input style="width: 178px;" v-model="saveHeaderData.operatorIdName2"></el-input>
  335. </el-form-item>
  336. <el-form-item label="报废原因">
  337. <el-input style="width: 178px;" v-model="saveHeaderData.scrapReason"></el-input>
  338. </el-form-item>
  339. </el-form>
  340. </fieldset>
  341. <el-form :inline="true" label-position="top">
  342. <el-form-item label="准备时间">
  343. <el-input type="number" style="width: 178px;text-align: right;" v-model="saveHeaderData.preparationTime" ></el-input> <!--oninput ="value=value.replace(/[^0-9.]/g,'')"-->
  344. <!-- <el-input-number style="width: 178px;text-align: right;" v-model="saveHeaderData.preparationTime" size="medium" :min="0" :controls="false"></el-input-number>-->
  345. </el-form-item>
  346. <el-form-item label="制造时间">
  347. <el-input type="number" style="width: 178px;" v-model="saveHeaderData.manufacturingTime"></el-input> <!--oninput ="value=value.replace(/[^0-9.]/g,'')"-->
  348. <!-- <el-input-number style="width: 178px;text-align: right;" v-model="saveHeaderData.manufacturingTime" size="medium" :min="0" :controls="false"></el-input-number>-->
  349. </el-form-item>
  350. <el-form-item label="清理时间" label-width="0px">
  351. <el-input type="number" style="width: 178px;" v-model="saveHeaderData.cleaningTime"></el-input> <!--oninput ="value=value.replace(/[^0-9.]/g,'')"-->
  352. <!-- :min="0" 最小值 :controls="false" 隐藏减价按钮 -->
  353. <!-- <el-input-number style="width: 178px;text-align: right;" v-model="saveHeaderData.cleaningTime" size="medium" :min="0" :controls="false"></el-input-number>-->
  354. </el-form-item>
  355. </el-form>
  356. <el-form :inline="true" label-position="top">
  357. <el-form-item label="停机原因">
  358. <el-input style="width: 560px;" v-model="saveHeaderData.shutdownReason"></el-input>
  359. </el-form-item>
  360. </el-form>
  361. <el-form :inline="true" label-position="top">
  362. <el-form-item label="备注">
  363. <el-input style="width: 560px;" v-model="saveHeaderData.remark"></el-input>
  364. </el-form-item>
  365. </el-form>
  366. <span slot="footer" class="dialog-footer">
  367. <el-button @click="SOPModal()" type="primary">查看SOP</el-button>
  368. <el-button @click="setUp.reviewFlag = false">取消</el-button>
  369. <el-button type="primary" :disabled="setUp.saveButton" @click="saveReport()">确定</el-button>
  370. </span>
  371. </el-dialog>
  372. <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" v-drag title="查看SOP" :visible.sync="sopFlag" width="80%">
  373. <el-row>
  374. <el-col :span="8">
  375. <div style="margin-top: 2%">
  376. <h5 style="margin-left: 0px;font-size: 20px">产品图片</h5>
  377. <el-form inline="true" style="margin-top: -5px;margin-left: 0px" label-position="top">
  378. <el-form-item :label="'工厂编号:'">
  379. <el-input v-model="sopData.site" readonly style="width: 120px"></el-input>
  380. </el-form-item>
  381. <el-form-item :label="'产品编码:'" style="margin-left: 20px">
  382. <el-input v-model="sopData.partNo" readonly style="width: 120px"></el-input>
  383. </el-form-item>
  384. </el-form>
  385. <el-form inline="true" style="margin-top: 20px;margin-left: 0px" label-position="top">
  386. <el-form-item :label="'产品名称/规格型号:'" style="font-size: 20px">
  387. <el-input v-model="partDescription" readonly style="width: 374px"></el-input>
  388. </el-form-item>
  389. </el-form>
  390. <el-form inline="true" style="margin-top: 20px;margin-left: 0px" label-position="top">
  391. <el-form-item :label="fileTitle">
  392. <el-input v-model="fileName" style="width: 374px" readonly></el-input>
  393. </el-form-item>
  394. </el-form>
  395. <el-form inline="true" style="margin-top: 20px;margin-left: 20px" label-position="top">
  396. <el-form-item :label="' '">
  397. <el-button @click="lastPicture()" type="primary">上一张</el-button>
  398. </el-form-item>
  399. <el-form-item :label="' '">
  400. <el-button @click="nextPicture()" type="primary">下一张</el-button>
  401. </el-form-item>
  402. <el-form-item :label="' '">
  403. <el-button @click="sopFlag=false" type="primary">关闭</el-button>
  404. </el-form-item>
  405. </el-form>
  406. </div>
  407. </el-col>
  408. <el-col :span="16">
  409. <div id="padPhoto" style="text-align: center;vertical-align:middle;" >
  410. <iframe :src="photoUrl" frameborder="0" width="100%" :height="height2"></iframe>
  411. </div>
  412. </el-col>
  413. </el-row>
  414. </el-dialog>
  415. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  416. </div>
  417. </template>
  418. <script>
  419. import {
  420. printTransNoLabel,
  421. } from "@/views/modules/production/print_transNo_label.js"
  422. import {
  423. getSOScheduleRoutingData
  424. , saveGenerateReportForSchedule,
  425. searchReportedQty,
  426. searchSeqNo,
  427. startSeqNo,
  428. } from '@/api/production/generateReport.js'
  429. import Chooselist from '@/views/modules/common/Chooselist'
  430. import {
  431. getPhotoAddressData
  432. } from '@/api/pad.js'
  433. export default {
  434. name: 'generateReport',
  435. components: {
  436. Chooselist
  437. },
  438. data () {
  439. return {
  440. setUp: {
  441. reviewFlag: false,
  442. saveButton: false,
  443. readonlyFlag: false,
  444. disabled: false
  445. },
  446. factorFlag:false,
  447. KGReported:'',
  448. KGApprove:'',
  449. KGRework:'',
  450. saveHeaderData: {
  451. site: '',
  452. seqNo: '',
  453. itemNo: '',
  454. partNo: '',
  455. partDescription: '',
  456. operationDesc: '',
  457. workCenterNo: '',
  458. workCenterDesc: '',
  459. operatorId: '',
  460. operatorName: '',
  461. planStartTime: '',
  462. planFinishTime: '',
  463. qtyReported: 0,
  464. qtyApprove: 0,
  465. qtyRework: 0,
  466. operatorId2: '',
  467. operatorIdName2: '',
  468. scrapReason: '',
  469. preparationTime: 0,
  470. manufacturingTime: 0,
  471. cleaningTime: 0,
  472. shutdownReason: '',
  473. remark: '',
  474. orderRef1:'',
  475. scheduleType:'',
  476. userId:'',
  477. },
  478. scanSeqNo:'',
  479. qty1:'',
  480. qty2:'',
  481. qty3:'',
  482. sopFlag:false,
  483. site: this.$store.state.user.site,
  484. operatorType: 0,
  485. // 导出 start
  486. exportData: [],
  487. exportDataStandard: {
  488. '派工单号': 'seqNo',
  489. '关联单号': 'orderNo',
  490. '关联单号类型': 'scheduleType',
  491. '工序号': 'itemNo',
  492. '工序名称': 'itemDesc',
  493. '派工数量': 'qtyRequired',
  494. '报工数量': 'qtyReported',
  495. '合格数量': 'qtyApprove',
  496. '需求时间': 'timeRequired',
  497. '派工日期': 'sScheduledDate',
  498. '操作员姓名': 'operatorName',
  499. '产品编码': 'partNo',
  500. '产品名称': 'partDesc',
  501. '机台ID': 'sResourceID',
  502. '班次': 'sShiftNo',
  503. '加工中心': 'sWorkCenterNo',
  504. },
  505. exportName: '派工单列表' + this.getStrDate(),
  506. exportHeader: ['派工单列表'],
  507. exportFooter: [],
  508. exportDefaultValue: '这一行这一列没有数据',
  509. // 导出 end
  510. height: 200,
  511. tableData: [],
  512. date1: '',
  513. searchData: {
  514. orderNo: '',
  515. sWorkCenterNo: '',
  516. partNo: '',
  517. site: this.$store.state.user.site,
  518. itemNo:'',
  519. scheduleType:'',
  520. reportFlag:'QtyRequired>QtyReported',
  521. startDate:'',
  522. endDate:'',
  523. operatorName:'',
  524. sResourceID:'',
  525. sShiftNo:'',
  526. },
  527. photoUrl:'',
  528. sopData:{
  529. site:'',
  530. partNo:'',
  531. },
  532. scanModalFlag:false,
  533. partDescription:'',
  534. fileTitle:'',
  535. fileName:'',
  536. num:1,
  537. currentData:'',
  538. photoDatas:[],
  539. uploadImg:[],
  540. showviewer: false,
  541. url: '',
  542. height2:600,
  543. tagNo2:'',
  544. startModalFlag:false,
  545. }
  546. },
  547. mounted () {
  548. this.$nextTick(() => {
  549. this.height = window.innerHeight - 210
  550. this.height2 = window.innerHeight -100
  551. })
  552. },
  553. methods: {
  554. saveReport () {
  555. if (this.saveHeaderData.qtyReported == null || this.saveHeaderData.qtyReported <= 0) {
  556. this.$alert('报告数量错误!', '错误信息', {
  557. confirmButtonText: '确定'
  558. })
  559. return
  560. }
  561. if (this.saveHeaderData.qtyApprove == null || this.saveHeaderData.qtyApprove < 0) {
  562. this.$alert('合格数量错误!', '错误信息', {
  563. confirmButtonText: '确定'
  564. })
  565. return
  566. }
  567. if (this.saveHeaderData.qtyRework == null || this.saveHeaderData.qtyRework <0) {
  568. this.$alert('返工数量错误!', '错误信息', {
  569. confirmButtonText: '确定'
  570. })
  571. return
  572. }
  573. if (this.saveHeaderData.preparationTime == null || this.saveHeaderData.preparationTime < 0) {
  574. this.$alert('准备时间错误!', '错误信息', {
  575. confirmButtonText: '确定'
  576. })
  577. return
  578. }
  579. if (this.saveHeaderData.manufacturingTime == null || this.saveHeaderData.manufacturingTime < 0) {
  580. this.$alert('制造时间错误!', '错误信息', {
  581. confirmButtonText: '确定'
  582. })
  583. return
  584. }
  585. if (this.saveHeaderData.cleaningTime == null || this.saveHeaderData.cleaningTime < 0) {
  586. this.$alert('清理时间错误!', '错误信息', {
  587. confirmButtonText: '确定'
  588. })
  589. return
  590. }
  591. if (parseFloat(this.saveHeaderData.qtyApprove) > parseFloat(this.saveHeaderData.qtyReported)) {
  592. this.$alert('合格数量大于报告数量!', '错误信息', {
  593. confirmButtonText: '确定'
  594. })
  595. return
  596. }
  597. if (this.saveHeaderData.planStartTime == null || this.saveHeaderData.planStartTime === '') {
  598. this.$alert('请选择生产日期!', '错误信息', {
  599. confirmButtonText: '确定'
  600. })
  601. return
  602. }
  603. if (this.saveHeaderData.planFinishTime == null || this.saveHeaderData.planFinishTime === '') {
  604. this.$alert('请选择报告日期!', '错误信息', {
  605. confirmButtonText: '确定'
  606. })
  607. return
  608. }
  609. saveGenerateReportForSchedule(this.saveHeaderData).then(({data}) => {
  610. if (data.code == 0) {
  611. this.$message.success(data.msg)
  612. this.setUp.reviewFlag = false
  613. this.search()
  614. if(data.transNo!=null&&data.transNo!=""){
  615. let indata={
  616. transNo:data.transNo,
  617. }
  618. let inList=[];
  619. inList.push(indata)
  620. printTransNoLabel(inList);
  621. }
  622. } else {
  623. this.$alert(data.msg, '错误', {
  624. confirmButtonText: '确定'
  625. })
  626. }
  627. })
  628. },
  629. // 获取基础数据列表S
  630. getBaseList (val, type) {
  631. this.tagNo = val
  632. this.tagNo2 = type
  633. this.$nextTick(() => {
  634. let strVal = ''
  635. if (val === 24) {
  636. strVal = this.searchData.sWorkCenterNo
  637. }
  638. if (val === 5) {
  639. strVal = this.searchData.partNo
  640. }
  641. if (val === 26) {
  642. if(type==1) {
  643. strVal = this.saveHeaderData.operatorId
  644. }else if(type==2){
  645. strVal = this.saveHeaderData.operatorId2
  646. }else {
  647. strVal = this.searchData.operatorName
  648. }
  649. }
  650. if (val === 88) {
  651. strVal = this.searchData.sResourceID
  652. }
  653. this.$refs.baseList.init(val, strVal)
  654. })
  655. },
  656. /* 列表方法的回调 */
  657. getBaseData (val) {
  658. if (this.tagNo === 24) {
  659. this.searchData.sWorkCenterNo = val.WorkCenterNo
  660. } else if (this.tagNo === 5) {
  661. this.searchData.partNo = val.PartNo
  662. }
  663. if (this.tagNo === 26) {
  664. if(this.tagNo2==1) {
  665. this.saveHeaderData.operatorId = val.OperatorID
  666. this.saveHeaderData.operatorName = val.OperatorName
  667. }else if(this.tagNo2==2){
  668. this.saveHeaderData.operatorId2 = val.OperatorID
  669. this.saveHeaderData.operatorIdName2 = val.OperatorName
  670. }else {
  671. this.searchData.operatorName = val.OperatorName
  672. }
  673. }
  674. if (this.tagNo === 88) {
  675. this.searchData.sResourceID = val.ResourceID
  676. }
  677. },
  678. initReportModal (row) {
  679. this.scanSeqNo=row.seqNo
  680. this.searchSeqNo()
  681. // this.setUp.reviewFlag = true;
  682. // this.setUp.disabled = true;
  683. // let currentData = JSON.parse(JSON.stringify(row));
  684. // this.KGReported=0
  685. // this.KGApprove=0
  686. // this.KGRework=0
  687. // this.saveHeaderData.qtyApprove=0
  688. // this.saveHeaderData.qtyReported=0
  689. // this.saveHeaderData.qtyRework=0
  690. // this.saveHeaderData.site = currentData.site;
  691. // this.saveHeaderData.seqNo = currentData.seqNo;
  692. // this.saveHeaderData.itemNo = currentData.itemNo;
  693. // this.saveHeaderData.operationDesc = currentData.itemDesc;
  694. // this.saveHeaderData.partNo = currentData.partNo;
  695. // this.saveHeaderData.partDescription = currentData.partSpec;
  696. // this.saveHeaderData.workCenterNo = currentData.sWorkCenterNo;
  697. // this.saveHeaderData.workCenterDesc = currentData.workCenterDesc;
  698. // this.saveHeaderData.orderRef1=currentData.orderRef1;
  699. // this.saveHeaderData.orderNo=currentData.orderNo;
  700. // this.saveHeaderData.scheduleType=currentData.scheduleType;
  701. // this.saveHeaderData.operatorId=currentData.operatorId;
  702. // this.saveHeaderData.operatorName=currentData.operatorName;
  703. // this.saveHeaderData.userId=this.$store.state.user.name;
  704. // this.qty1='';
  705. // this.qty2 ='';
  706. // this.saveHeaderData.planStartTime = this.dayjs(new Date()).format('YYYY-MM-DD 00:00:00')
  707. // searchReportedQty(this.saveHeaderData).then(({data}) => {
  708. // this.qty1 = data.row.qtyReported;
  709. // this.qty2 =data.row.lastApproveQty;
  710. // this.saveHeaderData.manufacturingTime=data.row.timeReported;
  711. // if(data.row.weightFactor==-1){
  712. // this.qty3 ="erp未维护数据"
  713. // this.KGReported=''
  714. // this.KGApprove=''
  715. // this.KGRework=''
  716. // this.factorFlag=true;
  717. // }else {
  718. // this.qty3 =data.row.weightFactor
  719. // this.factorFlag=false;
  720. // }
  721. // })
  722. },
  723. closeDialog () {
  724. Object.assign(this.$data.saveHeaderData, this.$options.data.call(this).saveHeaderData)
  725. },
  726. search () {
  727. getSOScheduleRoutingData(this.searchData).then(({data}) => {
  728. this.tableData = data.rows
  729. })
  730. },
  731. createExportData () {
  732. return this.tableData
  733. },
  734. startDownload () {
  735. // this.exportData = this.dataList
  736. },
  737. finishDownload () {
  738. },
  739. getStrDate () {
  740. let dd = new Date()
  741. let Y = dd.getFullYear()
  742. let M = (dd.getMonth() + 1) < 10 ? '0' + (dd.getMonth() + 1) : (dd.getMonth() + 1)// 获取当前月份的日期,不足10补0
  743. let D = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate()// 获取当前几号,不足10补0
  744. let H = dd.getHours() < 10 ? '0' + dd.getHours() : dd.getHours()
  745. let MM = dd.getMinutes() < 10 ? '0' + dd.getMinutes() : dd.getMinutes()
  746. let S = dd.getSeconds() < 10 ? '0' + dd.getSeconds() : dd.getSeconds()
  747. return Y + M + D + H + MM + S
  748. },
  749. SOPModal(){
  750. this.sopData.partNo = this.saveHeaderData.partNo;
  751. this.sopData.site= this.saveHeaderData.site;
  752. this.partDescription= this.saveHeaderData.partDescription;
  753. // var div1=document.getElementById("padPhoto");
  754. // div1.style.cssText= "height:"+this.height2+"px;";
  755. this.getPhoto();
  756. this.sopFlag=true;
  757. },
  758. SOPModal2(row){
  759. this.sopData.partNo = row.partNo;
  760. this.sopData.site= row.site;
  761. this.partDescription= row.partDesc;
  762. // var div1=document.getElementById("padPhoto");
  763. // div1.style.cssText= "height:"+this.height2+"px;";
  764. this.getPhoto();
  765. this.sopFlag=true;
  766. },
  767. getPhoto(){
  768. getPhotoAddressData(this.sopData).then(({data}) => {
  769. this.photoDatas = data.rows;
  770. if(this.photoDatas.length==0){
  771. this.fileTitle="文件名 ("+0+"/"+0+")";
  772. this.$alert('该物料没有上传图片!', '错误', {
  773. confirmButtonText: '确定'
  774. })
  775. return false;
  776. }
  777. this.fileName=this.photoDatas[this.num-1].attaFileNameDb;
  778. this.fileTitle="文件名 ("+this.num+"/"+this.photoDatas.length+")";
  779. this.photoUrl='http://192.168.2.172/upload/'+this.photoDatas[this.num-1].attaFileNameDb;
  780. // this.photoUrl='http://192.168.1.83/upload/'+this.photoDatas[this.num-1].attaFileNameDb;
  781. })
  782. },
  783. nextPicture(){
  784. if(this.photoDatas.length==0){
  785. this.fileTitle="文件名 ("+0+"/"+0+")";
  786. this.$alert('该物料没有上传图片!', '错误', {
  787. confirmButtonText: '确定'
  788. })
  789. return false;
  790. }
  791. if(this.num==this.photoDatas.length){
  792. this.num=1;
  793. }else{
  794. this.num=this.num+1;
  795. }
  796. this.fileName=this.photoDatas[this.num-1].attaFileNameDb;
  797. this.fileTitle="文件名 ("+this.num+"/"+this.photoDatas.length+")";
  798. this.photoUrl='http://192.168.2.172/upload/'+this.photoDatas[this.num-1].attaFileNameDb;
  799. // this.photoUrl='http://192.168.1.83/upload/'+this.photoDatas[this.num-1].attaFileNameDb;
  800. },
  801. lastPicture(){
  802. if(this.photoDatas.length==0){
  803. this.fileTitle="文件名 ("+0+"/"+0+")";
  804. this.fileName='';
  805. this.photoUrl='';
  806. this.$alert('该物料没有上传图片!', '错误', {
  807. confirmButtonText: '确定'
  808. })
  809. return false;
  810. }
  811. if(this.num==1){
  812. this.num=this.photoDatas.length;
  813. }else{
  814. this.num=this.num-1;
  815. }
  816. this.fileName=this.photoDatas[this.num-1].attaFileNameDb;
  817. this.fileTitle="文件名 ("+this.num+"/"+this.photoDatas.length+")";
  818. this.photoUrl='http://192.168.2.172/upload/'+this.photoDatas[this.num-1].attaFileNameDb;
  819. // this.photoUrl='http://192.168.1.83/upload/'+this.photoDatas[this.num-1].attaFileNameDb;
  820. },
  821. openScan(){
  822. this.scanSeqNo='';
  823. this.scanModalFlag=true;
  824. this.$nextTick(() => { this.$refs.input.focus();})
  825. },
  826. openStart(){
  827. this.scanSeqNo='';
  828. this.startModalFlag=true;
  829. this.$nextTick(() => { this.$refs.start.focus();})
  830. },
  831. searchSeqNo(){
  832. if(this.scanSeqNo==''){
  833. this.$alert("请扫描派工单!",'错误', {
  834. confirmButtonText: '确定'
  835. })
  836. return false;
  837. }
  838. let inData={
  839. site:this.$store.state.user.site,
  840. seqNo:this.scanSeqNo
  841. }
  842. searchSeqNo(inData).then(({data}) => {
  843. if (data.code == 0) {
  844. if(data.row==null){
  845. this.$alert("派工单不存在!",'错误', {
  846. confirmButtonText: '确定'
  847. })
  848. return false;
  849. }
  850. let currentData = data.row;
  851. if(currentData.closedFlag=='Y'){
  852. this.$alert("该派工单已关闭!",'错误', {
  853. confirmButtonText: '确定'
  854. })
  855. return false;
  856. }
  857. this.KGReported=0
  858. this.KGApprove=0
  859. this.KGRework=0
  860. this.saveHeaderData.qtyApprove=0
  861. this.saveHeaderData.qtyReported=0
  862. this.saveHeaderData.qtyRework=0
  863. this.saveHeaderData.site = currentData.site;
  864. this.saveHeaderData.seqNo = currentData.seqNo;
  865. this.saveHeaderData.itemNo = currentData.itemNo;
  866. this.saveHeaderData.operationDesc = currentData.itemDesc;
  867. this.saveHeaderData.partNo = currentData.partNo;
  868. this.saveHeaderData.partDescription = currentData.partSpec;
  869. this.saveHeaderData.workCenterNo = currentData.sWorkCenterNo;
  870. this.saveHeaderData.workCenterDesc = currentData.workCenterDesc;
  871. this.saveHeaderData.orderRef1=currentData.orderRef1;
  872. this.saveHeaderData.orderNo=currentData.orderNo;
  873. this.saveHeaderData.scheduleType=currentData.scheduleType;
  874. this.saveHeaderData.operatorId=currentData.operatorId;
  875. this.saveHeaderData.operatorName=currentData.operatorName;
  876. this.saveHeaderData.userId=this.$store.state.user.name;
  877. this.qty1='';
  878. this.qty2 ='';
  879. this.saveHeaderData.planStartTime = this.dayjs(new Date()).format('YYYY-MM-DD 00:00:00')
  880. searchReportedQty(this.saveHeaderData).then(({data}) => {
  881. if(data.code===0) {
  882. this.qty1 = data.row.qtyReported;
  883. this.qty2 = data.row.lastApproveQty;
  884. this.saveHeaderData.manufacturingTime = data.row.timeReported;
  885. if (data.row.weightFactor == -1) {
  886. this.qty3 = "erp未维护数据"
  887. this.KGReported = ''
  888. this.KGApprove = ''
  889. this.KGRework = ''
  890. this.factorFlag = true;
  891. } else {
  892. this.qty3 = data.row.weightFactor
  893. this.factorFlag = false;
  894. }
  895. }else {
  896. this.$alert(data.msg, '错误', {
  897. confirmButtonText: '确定'
  898. })
  899. return false;
  900. }
  901. })
  902. this.scanModalFlag=false;
  903. this.setUp.reviewFlag = true;
  904. this.setUp.disabled = true;
  905. } else {
  906. this.$alert(data.msg, '错误', {
  907. confirmButtonText: '确定'
  908. })
  909. }
  910. })
  911. },
  912. qtyReportedBlur(){
  913. if(this.qty3&&this.qty3!=0&&this.qty3!='erp未维护数据'&&this.saveHeaderData.qtyReported!=''){
  914. this.KGReported=(this.saveHeaderData.qtyReported*this.qty3).toFixed(1)
  915. }
  916. if(this.saveHeaderData.qtyReported==''){
  917. this.KGReported=''
  918. }
  919. },
  920. qtyApproveBlur(){
  921. if(this.qty3&&this.qty3!=0&&this.qty3!='erp未维护数据'&&this.saveHeaderData.qtyApprove!=''){
  922. this.KGApprove=(this.saveHeaderData.qtyApprove*this.qty3).toFixed(1)
  923. }
  924. if(this.saveHeaderData.qtyApprove==''){
  925. this.KGApprove=''
  926. }
  927. },
  928. qtyReworkBlur(){
  929. if(this.qty3&&this.qty3!=0&&this.qty3!='erp未维护数据'&&this.saveHeaderData.qtyRework!=''){
  930. this.KGRework=(this.saveHeaderData.qtyRework*this.qty3).toFixed(1)
  931. }
  932. if(this.saveHeaderData.qtyRework==''){
  933. this.KGRework=''
  934. }
  935. },
  936. KGReportedBlur(){
  937. if(this.qty3&&this.qty3!=0&&this.qty3!='erp未维护数据'&&this.KGReported!=''){
  938. this.saveHeaderData.qtyReported=(this.KGReported/this.qty3).toFixed(1)
  939. }
  940. if(this.KGReported==''){
  941. this.saveHeaderData.qtyReported=''
  942. }
  943. },
  944. KGApproveBlur(){
  945. if(this.qty3&&this.qty3!=0&&this.qty3!='erp未维护数据'&&this.KGApprove!=''){
  946. this.saveHeaderData.qtyApprove=(this.KGApprove/this.qty3).toFixed(1)
  947. }
  948. if(this.KGApprove==''){
  949. this.saveHeaderData.qtyApprove=''
  950. }
  951. },
  952. KGReworkBlur(){
  953. if(this.qty3&&this.qty3!=0&&this.qty3!='erp未维护数据'&&this.KGRework!=''){
  954. this.saveHeaderData.qtyRework=(this.KGRework/this.qty3).toFixed(1)
  955. }
  956. if(this.KGRework==''){
  957. this.saveHeaderData.qtyRework=''
  958. }
  959. },
  960. startSeqNo(){
  961. let inData={
  962. site:this.$store.state.user.site,
  963. username:this.$store.state.user.name,
  964. seqNo:this.scanSeqNo
  965. }
  966. startSeqNo(inData).then(({data}) => {
  967. if (data && data.code === 0) {
  968. this.scanSeqNo='';
  969. this.$message({
  970. message: '操作成功',
  971. type: 'success',
  972. duration: 1500,
  973. onClose: () => {
  974. }
  975. })
  976. } else {
  977. this.$alert(data.msg, '错误', {
  978. confirmButtonText: '确定'
  979. })
  980. }
  981. })
  982. },
  983. },
  984. created () {
  985. }
  986. }
  987. </script>
  988. <style scoped>
  989. .input_left{
  990. text-align: left;
  991. }
  992. .input_reight{
  993. text-align: right;
  994. }
  995. /deep/ input::-webkit-inner-spin-button {
  996. -webkit-appearance: none !important;
  997. }
  998. input[type='number'] {
  999. -moz-appearance: textfield !important;
  1000. }
  1001. </style>