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

752 lines
29 KiB

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
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
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
4 years ago
4 years ago
4 years ago
4 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
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
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
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
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
4 years ago
  1. <template>
  2. <div class="mod-config">
  3. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: -20px;">
  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)"><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. <download-excel
  69. :fields="exportDataStandard"
  70. :data="tableData"
  71. type="xlsx"
  72. :name="exportName"
  73. :header="exportHeader"
  74. :footer="exportFooter"
  75. :defaultValue="exportDefaultValue"
  76. :fetch="createExportData"
  77. :before-generate="startDownload"
  78. :before-finish="finishDownload"
  79. worksheet="导出信息"
  80. class="el-button el-button--primary el-button--medium">
  81. {{'导出'}}
  82. </download-excel>
  83. </el-form-item>
  84. </el-form>
  85. <el-table
  86. :height="height"
  87. :data="tableData"
  88. border
  89. style="width: 100%">
  90. <el-table-column
  91. prop=""
  92. header-align="center"
  93. align="center"
  94. min-width="100"
  95. label="操作">
  96. <template slot-scope="scope" class="foo_container">
  97. <a type="text" size="small" @click="initReportModal(scope.row)">报工</a>
  98. <a type="text" size="small" @click="SOPModal2(scope.row)">查看SOP</a>
  99. </template>
  100. </el-table-column>
  101. <el-table-column
  102. prop="seqNo"
  103. header-align="center"
  104. align="left"
  105. min-width="70"
  106. label="派工单号">
  107. </el-table-column>
  108. <el-table-column
  109. prop="orderNo"
  110. header-align="center"
  111. align="left"
  112. min-width="100"
  113. label="关联单号">
  114. </el-table-column>
  115. <el-table-column
  116. prop="scheduleType"
  117. header-align="center"
  118. align="left"
  119. min-width="100"
  120. label="关联单号类型">
  121. </el-table-column>
  122. <el-table-column
  123. prop="itemNo"
  124. header-align="center"
  125. align="left"
  126. min-width="70"
  127. label="工序号">
  128. </el-table-column>
  129. <el-table-column
  130. prop="itemDesc"
  131. header-align="center"
  132. align="left"
  133. min-width="160"
  134. label="工序名称">
  135. </el-table-column>
  136. <el-table-column
  137. prop="qtyRequired"
  138. header-align="center"
  139. align="right"
  140. min-width="80"
  141. label="派工数量">
  142. </el-table-column>
  143. <el-table-column
  144. prop="qtyReported"
  145. header-align="center"
  146. align="right"
  147. min-width="80"
  148. label="报工数量">
  149. </el-table-column>
  150. <el-table-column
  151. prop="qtyApprove"
  152. header-align="center"
  153. align="right"
  154. min-width="80"
  155. label="合格数量">
  156. </el-table-column>
  157. <el-table-column
  158. prop="timeRequired"
  159. header-align="center"
  160. align="right"
  161. min-width="80"
  162. label="需求时间">
  163. </el-table-column>
  164. <el-table-column
  165. prop="sScheduledDate"
  166. header-align="center"
  167. align="left"
  168. min-width="80"
  169. label="派工日期">
  170. </el-table-column>
  171. <el-table-column
  172. prop="operatorName"
  173. header-align="center"
  174. align="left"
  175. min-width="80"
  176. label="操作员姓名">
  177. </el-table-column>
  178. <el-table-column
  179. prop="partNo"
  180. header-align="center"
  181. align="left"
  182. min-width="80"
  183. label="产品编码">
  184. </el-table-column>
  185. <el-table-column
  186. prop="partDesc"
  187. header-align="center"
  188. align="left"
  189. min-width="200"
  190. label="产品名称">
  191. </el-table-column>
  192. <el-table-column
  193. prop="sResourceID"
  194. header-align="center"
  195. align="left"
  196. min-width="70"
  197. label="机台ID">
  198. </el-table-column>
  199. <el-table-column
  200. prop="sShiftNo"
  201. header-align="center"
  202. align="left"
  203. min-width="70"
  204. label="班次">
  205. </el-table-column>
  206. <el-table-column
  207. prop="sWorkCenterNo"
  208. header-align="center"
  209. align="left"
  210. min-width="100"
  211. label="加工中心编码">
  212. </el-table-column>
  213. </el-table>
  214. <el-dialog @close="closeDialog" :close-on-click-modal="false" :close-on-press-escape="false" v-drag title="报告信息" :visible.sync="setUp.reviewFlag" width="615px">
  215. <el-form :inline="true" label-position="top">
  216. <el-form-item label="派工单号">
  217. <el-input style="width: 130px;" :disabled="setUp.disabled" onkeyup="this.value = this.value.toUpperCase()" v-model="saveHeaderData.seqNo"></el-input>
  218. </el-form-item>
  219. <el-form-item label="产品编码">
  220. <el-input style="width: 130px;" :disabled="setUp.disabled" v-model="saveHeaderData.partNo"></el-input>
  221. </el-form-item>
  222. <el-form-item label="产品名称/规格型号">
  223. <el-input style="width: 275px;" :disabled="setUp.disabled" v-model="saveHeaderData.partDescription"></el-input>
  224. </el-form-item>
  225. </el-form>
  226. <el-form :inline="true" label-position="top">
  227. <el-form-item label="工序号">
  228. <el-input style="width: 130px;" :disabled="setUp.disabled" v-model="saveHeaderData.itemNo"></el-input>
  229. </el-form-item>
  230. <el-form-item label="工序名称">
  231. <el-input style="width: 130px;" :disabled="setUp.disabled" v-model="saveHeaderData.operationDesc"></el-input>
  232. </el-form-item>
  233. <el-form-item label="加工中心编码">
  234. <el-input style="width: 130px;" :disabled="setUp.disabled" v-model="saveHeaderData.workCenterNo"></el-input>
  235. </el-form-item>
  236. <el-form-item label="加工中心名称">
  237. <el-input style="width: 130px;" :disabled="setUp.disabled" v-model="saveHeaderData.workCenterDesc"></el-input>
  238. </el-form-item>
  239. </el-form>
  240. <el-form :inline="true" label-position="top">
  241. <el-form-item>
  242. <span slot="label" style="" @click="getBaseList(26 ,1)"><a herf="#">操作员</a></span>
  243. <el-input style="width: 130px;" v-model="saveHeaderData.operatorId"></el-input>
  244. </el-form-item>
  245. <el-form-item label="操作员姓名">
  246. <el-input style="width: 130px;" v-model="saveHeaderData.operatorName"></el-input>
  247. </el-form-item>
  248. <el-form-item label="生产日期">
  249. <el-date-picker
  250. style="width: 130px"
  251. v-model="saveHeaderData.planStartTime"
  252. type="date"
  253. value-format="yyyy-MM-dd"
  254. format = "yyyy-MM-dd"
  255. placeholder="选择日期">
  256. </el-date-picker>
  257. </el-form-item>
  258. <el-form-item label="报告日期">
  259. <el-date-picker
  260. style="width: 130px"
  261. v-model="saveHeaderData.planFinishTime"
  262. type="date"
  263. value-format="yyyy-MM-dd"
  264. format = "yyyy-MM-dd"
  265. placeholder="选择日期">
  266. </el-date-picker>
  267. </el-form-item>
  268. </el-form>
  269. <el-form :inline="true" label-position="top">
  270. <el-form-item label="本工序报工数">
  271. <el-input style="width: 130px;" :disabled="setUp.disabled" v-model="qty1"></el-input>
  272. </el-form-item>
  273. <el-form-item label="上工序报工数">
  274. <el-input style="width: 130px;" :disabled="setUp.disabled" v-model="qty2"></el-input>
  275. </el-form-item>
  276. </el-form>
  277. <el-form :inline="true" label-position="top">
  278. <el-form-item label="报告数量">
  279. <el-input type="number" oninput="value=value.replace(/[^\d]/g,'')" class="input_left" style="width: 178px;" v-model="saveHeaderData.qtyReported"></el-input>
  280. <!-- <el-input-number style="width: 178px;text-align: right;" v-model="saveHeaderData.qtyRework" size="medium" :min="0" :controls="false"></el-input-number>-->
  281. </el-form-item>
  282. <el-form-item label="合格数量">
  283. <el-input type="number" style="width: 178px;" oninput="value=value.replace(/[^\d]/g,'')" class="input_reight" v-model="saveHeaderData.qtyApprove"></el-input>
  284. <!-- <el-input-number style="width: 178px;text-align: right;" v-model="saveHeaderData.qtyRework" size="medium" :min="0" :controls="false"></el-input-number>-->
  285. </el-form-item>
  286. <el-form-item label="返工数量">
  287. <el-input type="number" style="width: 178px;" oninput="value=value.replace(/[^\d]/g,'')" v-model="saveHeaderData.qtyRework"></el-input>
  288. <!-- <el-input-number style="width: 178px;text-align: right;" v-model="saveHeaderData.qtyRework" size="medium" :min="0" :controls="false"></el-input-number>-->
  289. </el-form-item>
  290. </el-form>
  291. <fieldset class="customer-fieldset" style="width: 597px;margin-left: -10px;">
  292. <legend class="customer-legend">不良品分析</legend>
  293. <el-form :inline="true" label-position="top">
  294. <el-form-item>
  295. <span slot="label" style="" @click="getBaseList(26 ,2)"><a herf="#">操作员</a></span>
  296. <el-input style="width: 178px;" v-model="saveHeaderData.operatorId2"></el-input>
  297. </el-form-item>
  298. <el-form-item label="操作员姓名">
  299. <el-input style="width: 178px;" v-model="saveHeaderData.operatorIdName2"></el-input>
  300. </el-form-item>
  301. <el-form-item label="报废原因">
  302. <el-input style="width: 178px;" v-model="saveHeaderData.scrapReason"></el-input>
  303. </el-form-item>
  304. </el-form>
  305. </fieldset>
  306. <el-form :inline="true" label-position="top">
  307. <el-form-item label="准备时间">
  308. <el-input type="number" style="width: 178px;text-align: right;" v-model="saveHeaderData.preparationTime"></el-input> <!--oninput ="value=value.replace(/[^0-9.]/g,'')"-->
  309. <!-- <el-input-number style="width: 178px;text-align: right;" v-model="saveHeaderData.preparationTime" size="medium" :min="0" :controls="false"></el-input-number>-->
  310. </el-form-item>
  311. <el-form-item label="制造时间">
  312. <el-input type="number" style="width: 178px;" v-model="saveHeaderData.manufacturingTime"></el-input> <!--oninput ="value=value.replace(/[^0-9.]/g,'')"-->
  313. <!-- <el-input-number style="width: 178px;text-align: right;" v-model="saveHeaderData.manufacturingTime" size="medium" :min="0" :controls="false"></el-input-number>-->
  314. </el-form-item>
  315. <el-form-item label="清理时间" label-width="0px">
  316. <el-input type="number" style="width: 178px;" v-model="saveHeaderData.cleaningTime"></el-input> <!--oninput ="value=value.replace(/[^0-9.]/g,'')"-->
  317. <!-- :min="0" 最小值 :controls="false" 隐藏减价按钮 -->
  318. <!-- <el-input-number style="width: 178px;text-align: right;" v-model="saveHeaderData.cleaningTime" size="medium" :min="0" :controls="false"></el-input-number>-->
  319. </el-form-item>
  320. </el-form>
  321. <el-form :inline="true" label-position="top">
  322. <el-form-item label="停机原因">
  323. <el-input style="width: 560px;" v-model="saveHeaderData.shutdownReason"></el-input>
  324. </el-form-item>
  325. </el-form>
  326. <el-form :inline="true" label-position="top">
  327. <el-form-item label="备注">
  328. <el-input style="width: 560px;" v-model="saveHeaderData.remark"></el-input>
  329. </el-form-item>
  330. </el-form>
  331. <span slot="footer" class="dialog-footer">
  332. <el-button @click="SOPModal()" type="primary">查看SOP</el-button>
  333. <el-button @click="setUp.reviewFlag = false">取消</el-button>
  334. <el-button type="primary" :disabled="setUp.saveButton" @click="saveReport()">确定</el-button>
  335. </span>
  336. </el-dialog>
  337. <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" v-drag title="查看SOP" :visible.sync="sopFlag" width="80%">
  338. <el-row>
  339. <el-col :span="8">
  340. <div style="margin-top: 2%">
  341. <h5 style="margin-left: 0px;font-size: 20px">产品图片</h5>
  342. <el-form inline="true" style="margin-top: -5px;margin-left: 0px" label-position="top">
  343. <el-form-item :label="'工厂编号:'">
  344. <el-input v-model="sopData.site" readonly style="width: 120px"></el-input>
  345. </el-form-item>
  346. <el-form-item :label="'产品编码:'" style="margin-left: 20px">
  347. <el-input v-model="sopData.partNo" readonly style="width: 120px"></el-input>
  348. </el-form-item>
  349. </el-form>
  350. <el-form inline="true" style="margin-top: 20px;margin-left: 0px" label-position="top">
  351. <el-form-item :label="'产品名称/规格型号:'" style="font-size: 20px">
  352. <el-input v-model="partDescription" readonly style="width: 374px"></el-input>
  353. </el-form-item>
  354. </el-form>
  355. <el-form inline="true" style="margin-top: 20px;margin-left: 0px" label-position="top">
  356. <el-form-item :label="fileTitle">
  357. <el-input v-model="fileName" style="width: 374px" readonly></el-input>
  358. </el-form-item>
  359. </el-form>
  360. <el-form inline="true" style="margin-top: 20px;margin-left: 20px" label-position="top">
  361. <el-form-item :label="' '">
  362. <el-button @click="lastPicture()" type="primary">上一张</el-button>
  363. </el-form-item>
  364. <el-form-item :label="' '">
  365. <el-button @click="nextPicture()" type="primary">下一张</el-button>
  366. </el-form-item>
  367. <el-form-item :label="' '">
  368. <el-button @click="sopFlag=false" type="primary">关闭</el-button>
  369. </el-form-item>
  370. </el-form>
  371. </div>
  372. </el-col>
  373. <el-col :span="16">
  374. <div id="padPhoto" style="text-align: center;vertical-align:middle;" >
  375. <iframe :src="photoUrl" frameborder="0" width="100%" :height="height2"></iframe>
  376. </div>
  377. </el-col>
  378. </el-row>
  379. </el-dialog>
  380. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  381. </div>
  382. </template>
  383. <script>
  384. import {
  385. getSOScheduleRoutingData
  386. , saveGenerateReportForSchedule,
  387. searchReportedQty
  388. } from '@/api/production/generateReport.js'
  389. import Chooselist from '@/views/modules/common/Chooselist'
  390. import {
  391. getPhotoAddressData
  392. } from '@/api/pad.js'
  393. export default {
  394. name: 'generateReport',
  395. components: {
  396. Chooselist
  397. },
  398. data () {
  399. return {
  400. setUp: {
  401. reviewFlag: false,
  402. saveButton: false,
  403. readonlyFlag: false,
  404. disabled: false
  405. },
  406. saveHeaderData: {
  407. site: '',
  408. seqNo: '',
  409. itemNo: '',
  410. partNo: '',
  411. partDescription: '',
  412. operationDesc: '',
  413. workCenterNo: '',
  414. workCenterDesc: '',
  415. operatorId: '',
  416. operatorName: '',
  417. planStartTime: '',
  418. planFinishTime: '',
  419. qtyReported: 0,
  420. qtyApprove: 0,
  421. qtyRework: 0,
  422. operatorId2: '',
  423. operatorIdName2: '',
  424. scrapReason: '',
  425. preparationTime: 0,
  426. manufacturingTime: 0,
  427. cleaningTime: 0,
  428. shutdownReason: '',
  429. remark: '',
  430. orderRef1:'',
  431. scheduleType:'',
  432. userId:'',
  433. },
  434. qty1:'',
  435. qty2:'',
  436. sopFlag:false,
  437. site: this.$store.state.user.site,
  438. operatorType: 0,
  439. // 导出 start
  440. exportData: [],
  441. exportDataStandard: {
  442. '派工单号': 'seqNo',
  443. '关联单号': 'orderNo',
  444. '关联单号类型': 'scheduleType',
  445. '工序号': 'itemNo',
  446. '工序名称': 'itemDesc',
  447. '派工数量': 'qtyRequired',
  448. '报工数量': 'qtyReported',
  449. '合格数量': 'qtyApprove',
  450. '需求时间': 'timeRequired',
  451. '派工日期': 'sScheduledDate',
  452. '操作员姓名': 'operatorName',
  453. '产品编码': 'partNo',
  454. '产品名称': 'partDesc',
  455. '机台ID': 'sResourceID',
  456. '班次': 'sShiftNo',
  457. '加工中心': 'sWorkCenterNo',
  458. },
  459. exportName: '派工单列表' + this.getStrDate(),
  460. exportHeader: ['派工单列表'],
  461. exportFooter: [],
  462. exportDefaultValue: '这一行这一列没有数据',
  463. // 导出 end
  464. height: 200,
  465. tableData: [],
  466. date1: '',
  467. searchData: {
  468. orderNo: '',
  469. sWorkCenterNo: '',
  470. partNo: '',
  471. site: this.$store.state.user.site,
  472. itemNo:'',
  473. scheduleType:'',
  474. reportFlag:'QtyRequired>QtyReported',
  475. startDate:'',
  476. endDate:'',
  477. operatorName:'',
  478. sResourceID:'',
  479. sShiftNo:'',
  480. },
  481. photoUrl:'',
  482. sopData:{
  483. site:'',
  484. partNo:'',
  485. },
  486. partDescription:'',
  487. fileTitle:'',
  488. fileName:'',
  489. num:1,
  490. currentData:'',
  491. photoDatas:[],
  492. uploadImg:[],
  493. showviewer: false,
  494. url: '',
  495. height2:600,
  496. }
  497. },
  498. mounted () {
  499. this.$nextTick(() => {
  500. this.height = window.innerHeight - 210
  501. this.height2 = window.innerHeight -100
  502. })
  503. },
  504. methods: {
  505. saveReport () {
  506. if (this.saveHeaderData.qtyReported == null || this.saveHeaderData.qtyReported <= 0) {
  507. this.$alert('报告数量错误!', '错误信息', {
  508. confirmButtonText: '确定'
  509. })
  510. return
  511. }
  512. if (this.saveHeaderData.qtyApprove == null || this.saveHeaderData.qtyApprove < 0) {
  513. this.$alert('合格数量错误!', '错误信息', {
  514. confirmButtonText: '确定'
  515. })
  516. return
  517. }
  518. if (this.saveHeaderData.qtyRework == null || this.saveHeaderData.qtyRework <0) {
  519. this.$alert('返工数量错误!', '错误信息', {
  520. confirmButtonText: '确定'
  521. })
  522. return
  523. }
  524. if (this.saveHeaderData.preparationTime == null || this.saveHeaderData.preparationTime < 0) {
  525. this.$alert('准备时间错误!', '错误信息', {
  526. confirmButtonText: '确定'
  527. })
  528. return
  529. }
  530. if (this.saveHeaderData.manufacturingTime == null || this.saveHeaderData.manufacturingTime < 0) {
  531. this.$alert('制造时间错误!', '错误信息', {
  532. confirmButtonText: '确定'
  533. })
  534. return
  535. }
  536. if (this.saveHeaderData.cleaningTime == null || this.saveHeaderData.cleaningTime < 0) {
  537. this.$alert('清理时间错误!', '错误信息', {
  538. confirmButtonText: '确定'
  539. })
  540. return
  541. }
  542. if (parseFloat(this.saveHeaderData.qtyApprove) > parseFloat(this.saveHeaderData.qtyReported)) {
  543. this.$alert('合格数量大于报告数量!', '错误信息', {
  544. confirmButtonText: '确定'
  545. })
  546. return
  547. }
  548. if (this.saveHeaderData.planStartTime == null || this.saveHeaderData.planStartTime === '') {
  549. this.$alert('请选择生产日期!', '错误信息', {
  550. confirmButtonText: '确定'
  551. })
  552. return
  553. }
  554. if (this.saveHeaderData.planFinishTime == null || this.saveHeaderData.planFinishTime === '') {
  555. this.$alert('请选择报告日期!', '错误信息', {
  556. confirmButtonText: '确定'
  557. })
  558. return
  559. }
  560. saveGenerateReportForSchedule(this.saveHeaderData).then(({data}) => {
  561. if (data.code == 0) {
  562. this.$message.success(data.msg)
  563. this.setUp.reviewFlag = false
  564. this.search()
  565. } else {
  566. this.$alert(data.msg, '错误', {
  567. confirmButtonText: '确定'
  568. })
  569. }
  570. })
  571. },
  572. // 获取基础数据列表S
  573. getBaseList (val, type) {
  574. this.tagNo = val
  575. this.$nextTick(() => {
  576. let strVal = ''
  577. if (val === 24) {
  578. strVal = this.searchData.sWorkCenterNo
  579. }
  580. if (val === 5) {
  581. strVal = this.searchData.partNo
  582. }
  583. if (val === 26) {
  584. strVal = this.searchData.operatorName
  585. }
  586. if (val === 88) {
  587. strVal = this.searchData.sResourceID
  588. }
  589. this.$refs.baseList.init(val, strVal)
  590. })
  591. },
  592. /* 列表方法的回调 */
  593. getBaseData (val) {
  594. if (this.tagNo === 24) {
  595. this.searchData.sWorkCenterNo = val.WorkCenterNo
  596. } else if (this.tagNo === 5) {
  597. this.searchData.partNo = val.PartNo
  598. }
  599. if (this.tagNo === 26) {
  600. this.searchData.operatorName = val.OperatorName
  601. }
  602. if (this.tagNo === 88) {
  603. this.searchData.sResourceID = val.ResourceID
  604. }
  605. },
  606. initReportModal (row) {
  607. this.setUp.reviewFlag = true
  608. this.setUp.disabled = true
  609. let currentData = JSON.parse(JSON.stringify(row))
  610. this.saveHeaderData.site = currentData.site
  611. this.saveHeaderData.seqNo = currentData.seqNo
  612. this.saveHeaderData.itemNo = currentData.itemNo
  613. this.saveHeaderData.operationDesc = currentData.itemDesc
  614. this.saveHeaderData.partNo = currentData.partNo
  615. this.saveHeaderData.partDescription = currentData.partSpec
  616. this.saveHeaderData.workCenterNo = currentData.sWorkCenterNo
  617. this.saveHeaderData.workCenterDesc = currentData.workCenterDesc
  618. this.saveHeaderData.orderRef1=currentData.orderRef1
  619. this.saveHeaderData.scheduleType=currentData.scheduleType
  620. this.saveHeaderData.operatorId=currentData.operatorId
  621. this.saveHeaderData.operatorName=currentData.operatorName
  622. this.saveHeaderData.userId=this.$store.state.user.name
  623. this.saveHeaderData.planFinishTime = this.dayjs(new Date()).format('YYYY-MM-DD 00:00:00')
  624. this.saveHeaderData.planStartTime = this.dayjs(new Date()).format('YYYY-MM-DD 00:00:00')
  625. searchReportedQty(this.saveHeaderData).then(({data}) => {
  626. this.qty1 = data.row.qtyReported;
  627. this.qty2 =data.row.lastApproveQty;
  628. })
  629. },
  630. closeDialog () {
  631. Object.assign(this.$data.saveHeaderData, this.$options.data.call(this).saveHeaderData)
  632. },
  633. search () {
  634. getSOScheduleRoutingData(this.searchData).then(({data}) => {
  635. this.tableData = data.rows
  636. })
  637. },
  638. createExportData () {
  639. return this.tableData
  640. },
  641. startDownload () {
  642. // this.exportData = this.dataList
  643. },
  644. finishDownload () {
  645. },
  646. getStrDate () {
  647. let dd = new Date()
  648. let Y = dd.getFullYear()
  649. let M = (dd.getMonth() + 1) < 10 ? '0' + (dd.getMonth() + 1) : (dd.getMonth() + 1)// 获取当前月份的日期,不足10补0
  650. let D = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate()// 获取当前几号,不足10补0
  651. let H = dd.getHours() < 10 ? '0' + dd.getHours() : dd.getHours()
  652. let MM = dd.getMinutes() < 10 ? '0' + dd.getMinutes() : dd.getMinutes()
  653. let S = dd.getSeconds() < 10 ? '0' + dd.getSeconds() : dd.getSeconds()
  654. return Y + M + D + H + MM + S
  655. },
  656. SOPModal(){
  657. this.sopData.partNo = this.saveHeaderData.partNo;
  658. this.sopData.site= this.saveHeaderData.site;
  659. this.partDescription= this.saveHeaderData.partDescription;
  660. // var div1=document.getElementById("padPhoto");
  661. // div1.style.cssText= "height:"+this.height2+"px;";
  662. this.getPhoto();
  663. this.sopFlag=true;
  664. },
  665. SOPModal2(row){
  666. this.sopData.partNo = row.partNo;
  667. this.sopData.site= row.site;
  668. this.partDescription= row.partDesc;
  669. // var div1=document.getElementById("padPhoto");
  670. // div1.style.cssText= "height:"+this.height2+"px;";
  671. this.getPhoto();
  672. this.sopFlag=true;
  673. },
  674. getPhoto(){
  675. getPhotoAddressData(this.sopData).then(({data}) => {
  676. this.photoDatas = data.rows;
  677. if(this.photoDatas.length==0){
  678. this.fileTitle="文件名 ("+0+"/"+0+")";
  679. this.$alert('该物料没有上传图片!', '错误', {
  680. confirmButtonText: '确定'
  681. })
  682. return false;
  683. }
  684. this.fileName=this.photoDatas[this.num-1].attaFileNameDb;
  685. this.fileTitle="文件名 ("+this.num+"/"+this.photoDatas.length+")";
  686. // this.photoUrl='http://192.168.2.172/upload/'+this.photoDatas[this.num-1].attaFileNameDb;
  687. this.photoUrl='http://192.168.1.83/upload/'+this.photoDatas[this.num-1].attaFileNameDb;
  688. })
  689. },
  690. nextPicture(){
  691. if(this.photoDatas.length==0){
  692. this.fileTitle="文件名 ("+0+"/"+0+")";
  693. this.$alert('该物料没有上传图片!', '错误', {
  694. confirmButtonText: '确定'
  695. })
  696. return false;
  697. }
  698. if(this.num==this.photoDatas.length){
  699. this.num=1;
  700. }else{
  701. this.num=this.num+1;
  702. }
  703. this.fileName=this.photoDatas[this.num-1].attaFileNameDb;
  704. this.fileTitle="文件名 ("+this.num+"/"+this.photoDatas.length+")";
  705. // this.photoUrl='http://192.168.2.172/upload/'+this.photoDatas[this.num-1].attaFileNameDb;
  706. this.photoUrl='http://192.168.1.83/upload/'+this.photoDatas[this.num-1].attaFileNameDb;
  707. },
  708. lastPicture(){
  709. if(this.photoDatas.length==0){
  710. this.fileTitle="文件名 ("+0+"/"+0+")";
  711. this.$alert('该物料没有上传图片!', '错误', {
  712. confirmButtonText: '确定'
  713. })
  714. return false;
  715. }
  716. if(this.num==1){
  717. this.num=this.photoDatas.length;
  718. }else{
  719. this.num=this.num-1;
  720. }
  721. this.fileName=this.photoDatas[this.num-1].attaFileNameDb;
  722. this.fileTitle="文件名 ("+this.num+"/"+this.photoDatas.length+")";
  723. // this.photoUrl='http://192.168.2.172/upload/'+this.photoDatas[this.num-1].attaFileNameDb;
  724. this.photoUrl='http://192.168.1.83/upload/'+this.photoDatas[this.num-1].attaFileNameDb;
  725. },
  726. },
  727. created () {
  728. }
  729. }
  730. </script>
  731. <style scoped>
  732. .input_left{
  733. text-align: left;
  734. }
  735. .input_reight{
  736. text-align: right;
  737. }
  738. /deep/ input::-webkit-inner-spin-button {
  739. -webkit-appearance: none !important;
  740. }
  741. input[type='number'] {
  742. -moz-appearance: textfield !important;
  743. }
  744. </style>