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.

2791 lines
95 KiB

2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
  1. <template>
  2. <div class="mod-config">
  3. <!-- 条件查询 -->
  4. <el-form :inline="true" label-position="top" :model="searchData">
  5. <el-form-item :label="'单据号'">
  6. <el-input v-model="searchData.notifyNo" clearable style="width: 120px"></el-input>
  7. </el-form-item>
  8. <el-form-item :label="'单据状态'">
  9. <el-select multiple collapse-tags v-model="searchData.orderStatusList" clearable style="width: 160px">
  10. <el-option label="ISSUE" value="ISSUE"></el-option>
  11. <el-option label="CLOSED" value="CLOSED"></el-option>
  12. </el-select>
  13. </el-form-item>
  14. <el-form-item :label="'申请单日期'">
  15. <el-date-picker style="width: 120px" v-model="searchData.startDate" type="date" value-format="yyyy-MM-dd"
  16. placeholder="选择日期">
  17. </el-date-picker>
  18. </el-form-item>
  19. <el-form-item style="margin-top: 23px;">
  20. <!-- <laber style="margin-left: -9px;font-size: 19px"></laber> -->
  21. ~
  22. </el-form-item>
  23. <el-form-item :label="' '">
  24. <el-date-picker style="width: 120px" v-model="searchData.endDate" type="date" value-format="yyyy-MM-dd"
  25. placeholder="选择日期">
  26. </el-date-picker>
  27. </el-form-item>
  28. <el-form-item :label="' '">
  29. <el-button type="primary" :loading="searchLoading" @click="getDataList()">查询</el-button>
  30. </el-form-item>
  31. </el-form>
  32. <!-- 展示列表 -->
  33. <el-table :height="height" :data="dataList" border v-loading="searchLoading" ref="inboundTable"
  34. :row-style="rowStyle" @row-click="inboundClickRow" @current-change="changeCurrentRow" style="width: 100%;">
  35. <el-table-column type="selection" header-align="center" align="center" width="50">
  36. </el-table-column>
  37. <el-table-column v-for="(item,index) in columnList" :key="index" :sortable="item.columnSortable"
  38. :prop="item.columnProp" :header-align="item.headerAlign" :show-overflow-tooltip="item.showOverflowTooltip"
  39. :align="item.align" :fixed="item.fixed==''?false:item.fixed" :min-width="item.columnWidth"
  40. :label="item.columnLabel">
  41. <template slot-scope="scope">
  42. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  43. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  44. style="width: 100px; height: 80px" /></span>
  45. </template>
  46. </el-table-column>
  47. <el-table-column fixed="right" header-align="center" align="center" width="250" label="操作">
  48. <template slot-scope="scope">
  49. <!-- <template v-if="!authUpdate">
  50. <el-link
  51. v-if="scope.row.orderStatus === '草稿' || scope.row.orderStatus === '待检验' || scope.row.orderStatus === '编辑中'"
  52. style="cursor: pointer" @click="updateModal(scope.row)">编辑</el-link>
  53. </template> -->
  54. <template v-if="!authClose">
  55. <el-link style="cursor: pointer" @click="closeModal(scope.row)">关闭</el-link>
  56. </template>
  57. <!-- rqrq - 添加推送WCS按钮 -->
  58. <a type="text" size="small" v-if="scope.row.pushWcsFlag!=='推送完成'&&scope.row.status==='ISSUE'" @click="previewInventory(scope.row)" style="margin-left: 10px;">推送WCS</a>
  59. </template>
  60. </el-table-column>
  61. </el-table>
  62. <!-- 分页栏 -->
  63. <el-pagination style="margin-top: 0px" @size-change="sizeChangeHandle" @current-change="currentChangeHandle"
  64. :current-page="pageIndex" :page-sizes="[20, 50, 100, 200, 500]" :page-size="pageSize" :total="totalPage"
  65. layout="total, sizes, prev, pager, next, jumper">
  66. </el-pagination>
  67. <!-- 收货入库通知新增/修改 -->
  68. <el-dialog title="收货入库通知" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="525px">
  69. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules"
  70. style="margin-left: 7px;margin-top: -5px;">
  71. <el-form-item label="单据类型" prop="orderType">
  72. <el-select v-model="modalData.orderType" :disabled="modalDisableFlag" style="width: 100px">
  73. <el-option label="生产退料" value="生产退料"></el-option>
  74. <el-option label="生产入库" value="生产入库"></el-option>
  75. <el-option label="其他入库" value="其他入库"></el-option>
  76. </el-select>
  77. </el-form-item>
  78. <el-form-item label="要求入库日期" prop="requiredInboundDate">
  79. <el-date-picker style="width: 120px" v-model="modalData.requiredInboundDate" type="date"
  80. value-format="yyyy-MM-dd">
  81. </el-date-picker>
  82. </el-form-item>
  83. </el-form>
  84. <el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px">
  85. <el-form-item>
  86. <!-- <span v-if="modalDisableFlag" slot="label">供应商</span>-->
  87. <span style="cursor: pointer" slot="label" @click="getBaseList(506)"><a href="#">供应商</a></span>
  88. <el-input v-model="modalData.supplierId" @change="supplierBlur(506)" style="width: 100px"></el-input>
  89. <el-input v-model="modalData.supplierName" disabled style="width: 380px"></el-input>
  90. </el-form-item>
  91. </el-form>
  92. <el-form :inline="true" label-position="top" style="margin-left: 7px">
  93. <el-form-item :label="'备注'">
  94. <el-input type="textarea" v-model="modalData.remarks" :rows="3" resize='none' show-word-limit
  95. style="width: 485px;height: 20px"></el-input>
  96. </el-form-item>
  97. </el-form>
  98. <el-footer style="height:35px;margin-top: 55px;text-align:center">
  99. <el-button type="primary" :loading="saveLoading" @click="saveData()">保存</el-button>
  100. <el-button type="primary" @click="modalFlag = false">关闭</el-button>
  101. </el-footer>
  102. </el-dialog>
  103. <!-- 页签 -->
  104. <el-tabs v-model="activeTable" style="width: 100%" :style="{height: secondHeight + 'px'}" type="border-card"
  105. @tab-click="tabClick" class="customer-tab">
  106. <el-tab-pane label="已申请物料" name="inboundDetail">
  107. <!-- <el-form label-position="top" style="margin-left: 2px;">
  108. <el-button type="primary" @click="deleteInboundDetail()" icon="el-icon-delete">删除</el-button>
  109. </el-form> -->
  110. <el-table :data="detailList" :height="secondHeight - 68" border @selection-change="selectionInboundDetail"
  111. v-loading="searchLoading" style="width: 100%;">
  112. <!-- <el-table-column type="selection" header-align="center" align="center" width="50">
  113. </el-table-column> -->
  114. <el-table-column v-for="(item,index) in columnDetailList" :key="index" :sortable="item.columnSortable"
  115. :prop="item.columnProp" :header-align="item.headerAlign" :show-overflow-tooltip="item.showOverflowTooltip"
  116. :align="item.align" :fixed="item.fixed==''?false:item.fixed" :min-width="item.columnWidth"
  117. :label="item.columnLabel">
  118. <template slot-scope="scope">
  119. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  120. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  121. style="width: 100px; height: 80px" /></span>
  122. </template>
  123. </el-table-column>
  124. <!-- <el-table-column prop="requiredQty" header-align="center" align="right" min-width="100" label="要求入库数量">
  125. <template slot-scope="scope">
  126. <span v-if="editBatchVisible">
  127. <el-input :controls="false" v-model="scope.row.requiredQty"
  128. @input="value => scope.row.requiredQty = value.match(/^(\d+\.?\d*|\.\d+)$/) ? value : ''"
  129. style="height: 11px; width: 98%;">
  130. </el-input>
  131. </span>
  132. <span v-else>
  133. <span>{{scope.row[scope.column.property]}}</span>
  134. </span>
  135. </template>
  136. </el-table-column>
  137. <el-table-column prop="inWarehouseName" header-align="center" align="center" min-width="180" label="入库仓库">
  138. <template slot-scope="scope">
  139. <span v-if="editBatchVisible">
  140. <el-button type="text" @click="chooseWareHouse(scope.row)"
  141. style="width:18%;padding: 3px 7px">选择</el-button>
  142. <el-input v-model="scope.row.inWarehouseName" readonly style="width:77%"></el-input>
  143. </span>
  144. <span v-else>
  145. <span>{{scope.row[scope.column.property]}}</span>
  146. </span>
  147. </template>
  148. </el-table-column>
  149. <el-table-column prop="actualStockInQty" header-align="center" align="right" min-width="100" label="实际入库数量">
  150. </el-table-column> -->
  151. <el-table-column fixed="right" header-align="center" align="center" width="100" label="操作">
  152. <template slot-scope="scope">
  153. <a type="text" size="small" @click="enterSOSDetail(scope.row)">物料</a>
  154. <a type="text" size="small" @click="deleteNotifySOS(scope.row)">删除</a>
  155. </template>
  156. </el-table-column>
  157. </el-table>
  158. </el-tab-pane>
  159. </el-tabs>
  160. <!-- rqrq - 推送WCS预览弹窗 -->
  161. <el-dialog
  162. title="库存匹配情况预览"
  163. :visible.sync="previewDialogVisible"
  164. :close-on-click-modal="false"
  165. v-drag
  166. width="95%">
  167. <el-table
  168. :data="previewData"
  169. border
  170. v-loading="previewLoading"
  171. style="width: 100%;"
  172. height="300"
  173. :row-class-name="getRowClassName">
  174. <el-table-column
  175. prop="rowNo"
  176. label="行号"
  177. width="80"
  178. align="center">
  179. </el-table-column>
  180. <el-table-column
  181. prop="productionOrderNo"
  182. label="生产订单号"
  183. width="100"
  184. sortable
  185. align="center">
  186. </el-table-column>
  187. <el-table-column
  188. prop="bomLineNo"
  189. label="BOM行号"
  190. width="100"
  191. sortable
  192. align="center">
  193. </el-table-column>
  194. <el-table-column
  195. prop="partNo"
  196. label="物料编码"
  197. width="100"
  198. sortable
  199. align="center">
  200. </el-table-column>
  201. <el-table-column
  202. prop="requiredQty"
  203. label="需求数量"
  204. width="80"
  205. align="center">
  206. </el-table-column>
  207. <el-table-column
  208. prop="isWarehouseSatisfied"
  209. label="立库是否满足"
  210. width="100"
  211. align="center">
  212. <template slot-scope="scope">
  213. <span :style="{color: scope.row.isWarehouseSatisfied === 'Y' ? '#67C23A' : '#F56C6C'}">
  214. {{ scope.row.isWarehouseSatisfied === 'Y' ? '是' : '否' }}
  215. </span>
  216. </template>
  217. </el-table-column>
  218. <el-table-column
  219. prop="isOtherWarehouseSatisfied"
  220. label="分切仓库是否满足"
  221. width="120"
  222. align="center">
  223. <template slot-scope="scope">
  224. <span v-if="scope.row.isOtherWarehouseSatisfied" :style="{color: scope.row.isOtherWarehouseSatisfied === 'Y' ? '#67C23A' : '#F56C6C'}">
  225. {{ scope.row.isOtherWarehouseSatisfied === 'Y' ? '是' : '否' }}
  226. </span>
  227. </template>
  228. </el-table-column>
  229. <el-table-column
  230. prop="matchedBarcodes"
  231. label="匹配条码"
  232. min-width="300"
  233. align="left"
  234. class-name="wrap-text-column">
  235. <template slot-scope="scope">
  236. <div style="white-space: normal; word-break: break-all; line-height: 1.5;">
  237. {{ scope.row.matchedBarcodes }}
  238. </div>
  239. </template>
  240. </el-table-column>
  241. </el-table>
  242. <span slot="footer" class="dialog-footer">
  243. <el-button type="primary" class="yzzButtonAn" @click="pushToWCS" :disabled="previewLoading">
  244. {{ previewLoading ? '推送中...' : '推送至WCS' }}
  245. </el-button>
  246. <el-button @click="previewDialogVisible = false" :disabled="previewLoading">关闭</el-button>
  247. </span>
  248. </el-dialog>
  249. <!-- 收获入库单明细新增 -->
  250. <el-dialog title="收货入库单明细" :close-on-click-modal="false" v-drag :visible.sync="detailModal" width="900px">
  251. <div style="font-size: 12px">
  252. <el-form :inline="true" label-position="top" :model="detailSearchData">
  253. <el-form-item :label="'物料编码'">
  254. <el-input v-model="detailSearchData.partNo" clearable style="width: 120px"></el-input>
  255. </el-form-item>
  256. <el-form-item :label="'物料名称'">
  257. <el-input v-model="detailSearchData.partDesc" clearable style="width: 120px"></el-input>
  258. </el-form-item>
  259. <template v-if="detailSearchData.orderType === '生产入库'">
  260. <el-form-item :label="'生产订单'">
  261. <el-input v-model="detailSearchData.relatedOrderNo" clearable style="width: 120px"></el-input>
  262. </el-form-item>
  263. <el-form-item :label="'订单状态'">
  264. <el-select v-model="detailSearchData.status" clearable style="width: 100px">
  265. <el-option label="已计划" value="已计划"></el-option>
  266. <el-option label="已下达" value="已下达"></el-option>
  267. <el-option label="已排产" value="已排产"></el-option>
  268. <el-option label="已开工" value="已开工"></el-option>
  269. <el-option label="已取消" value="已取消"></el-option>
  270. <el-option label="已停工" value="已停工"></el-option>
  271. <el-option label="已关闭" value="已关闭"></el-option>
  272. </el-select>
  273. </el-form-item>
  274. </template>
  275. <el-form-item label=" ">
  276. <el-button type="primary" @click="searchTypeChange">查询</el-button>
  277. </el-form-item>
  278. </el-form>
  279. </div>
  280. <el-container v-if="detailSearchData.orderType === '其他入库'">
  281. <el-header style="width: 880px;height: 200px;padding: 0 0 0 0">
  282. <span style="font-size: 12px">可选物料</span>
  283. <el-table height="200px" :data="partList1" border ref="partTable1" @selection-change="selectionPart1"
  284. highlight-current-row style="width: 100%">
  285. <el-table-column type="selection" header-align="center" align="center" width="50">
  286. </el-table-column>
  287. <el-table-column prop="partNo" header-align="center" align="center" min-width="80" label="物料编码">
  288. </el-table-column>
  289. <el-table-column prop="partDesc" header-align="center" align="left" min-width="120" label="物料名称">
  290. </el-table-column>
  291. <el-table-column prop="unit" header-align="center" align="left" min-width="120" label="物料单位">
  292. </el-table-column>
  293. </el-table>
  294. <!-- 分页-->
  295. <el-pagination style="margin-top: 5px" @size-change="sizeChangeHandle2" @current-change="currentChangeHandle2"
  296. :current-page="pageIndex2" :page-sizes="[20, 50, 100, 200, 500]" :page-size="pageSize2" :total="totalPage2"
  297. layout="total, sizes, prev, pager, next, jumper">
  298. </el-pagination>
  299. </el-header>
  300. <el-main style="width: 880px;height: 27px;margin-top: 70px;padding: 0 0 0 0;text-align:center">
  301. <div>
  302. <el-button type="primary" @click="addPart">添加>></el-button>
  303. <el-button type="primary" @click="deletePart">删除&lt;&lt;</el-button>
  304. </div>
  305. </el-main>
  306. <el-footer style="width: 880px;height: 200px;padding: 0 0 0 0;">
  307. <span style="font-size: 12px">已选物料</span>
  308. <div class="rq">
  309. <el-table height="200px" :data="partList2" border ref="partTable2" @selection-change="selectionPart2"
  310. highlight-current-row style="width: 100%">
  311. <el-table-column type="selection" header-align="center" align="center" width="50">
  312. </el-table-column>
  313. <el-table-column prop="partNo" header-align="center" align="center" min-width="80" label="物料编码">
  314. </el-table-column>
  315. <el-table-column prop="partDesc" header-align="center" align="left" min-width="120" label="物料名称">
  316. </el-table-column>
  317. <el-table-column prop="" header-align="center" align="center" min-width="100" label="要求入库数量">
  318. <template slot-scope="scope">
  319. <el-input :controls="false" v-model="scope.row.requiredQty"
  320. @input="value => scope.row.requiredQty = value.match(/^(\d+\.?\d*|\.\d+)$/) ? value : ''"
  321. style="height: 11px; width: 98%;">
  322. </el-input>
  323. </template>
  324. </el-table-column>
  325. </el-table>
  326. </div>
  327. </el-footer>
  328. </el-container>
  329. <el-container v-else-if="detailSearchData.orderType === '生产入库'">
  330. <el-header style="width: 880px;height: 200px;padding: 0 0 0 0">
  331. <span style="font-size: 12px">可选物料</span>
  332. <el-table height="200px" :data="partList1" border ref="partTable1" @selection-change="selectionPart1"
  333. highlight-current-row style="width: 100%">
  334. <el-table-column type="selection" header-align="center" align="center" width="50">
  335. </el-table-column>
  336. <el-table-column prop="relatedOrderNo" header-align="center" align="left" min-width="100" label="生产订单">
  337. </el-table-column>
  338. <el-table-column prop="partNo" header-align="center" align="left" min-width="100" label="物料编码">
  339. </el-table-column>
  340. <el-table-column prop="partDesc" header-align="center" align="left" min-width="200" label="物料名称">
  341. </el-table-column>
  342. <el-table-column prop="unit" header-align="center" align="left" min-width="80" label="物料单位">
  343. </el-table-column>
  344. <el-table-column prop="orderQty" header-align="center" align="right" min-width="80" label="订单数量">
  345. </el-table-column>
  346. <el-table-column prop="requiredQty" header-align="center" align="right" min-width="80" label="可入库数">
  347. </el-table-column>
  348. <el-table-column prop="countRollNo" header-align="center" align="right" min-width="80" label="可入库卷数">
  349. </el-table-column>
  350. </el-table>
  351. <!-- 分页-->
  352. <el-pagination style="margin-top: 5px" @size-change="sizeChangeHandle2" @current-change="currentChangeHandle2"
  353. :current-page="pageIndex2" :page-sizes="[20, 50, 100, 200, 500]" :page-size="pageSize2" :total="totalPage2"
  354. layout="total, sizes, prev, pager, next, jumper">
  355. </el-pagination>
  356. </el-header>
  357. <el-main style="width: 880px;height: 27px;margin-top: 70px;padding: 0 0 0 0;text-align:center">
  358. <div>
  359. <el-button type="primary" @click="addPart">添加>></el-button>
  360. <el-button type="primary" @click="deletePart">删除&lt;&lt;</el-button>
  361. </div>
  362. </el-main>
  363. <el-footer style="width: 880px;height: 200px;padding: 0 0 0 0;">
  364. <span style="font-size: 12px">已选物料</span>
  365. <div class="rq">
  366. <el-table height="200px" :data="partList2" border ref="partTable2" @selection-change="selectionPart2"
  367. highlight-current-row style="width: 100%">
  368. <el-table-column type="selection" header-align="center" align="center" width="50">
  369. </el-table-column>
  370. <el-table-column prop="relatedOrderNo" header-align="center" align="center" min-width="80" label="生产订单">
  371. </el-table-column>
  372. <el-table-column prop="partNo" header-align="center" align="center" min-width="80" label="物料编码">
  373. </el-table-column>
  374. <el-table-column prop="partDesc" header-align="center" align="left" min-width="150" label="物料名称">
  375. </el-table-column>
  376. <el-table-column prop="" header-align="center" align="center" min-width="100" label="要求入库数量">
  377. <template slot-scope="scope">
  378. <el-input :controls="false" v-model="scope.row.requiredQty"
  379. @input="value => scope.row.requiredQty = value.match(/^(\d+\.?\d*|\.\d+)$/) ? value : ''"
  380. style="height: 11px; width: 98%;">
  381. </el-input>
  382. </template>
  383. </el-table-column>
  384. </el-table>
  385. </div>
  386. </el-footer>
  387. </el-container>
  388. <el-footer style="height:30px;margin-top: 35px;text-align:center">
  389. <el-button type="primary" :loading="saveLoading" @click="saveInboundDetail">保存</el-button>
  390. <el-button type="primary" @click="detailModal = false">关闭</el-button>
  391. </el-footer>
  392. </el-dialog>
  393. <el-dialog title="选择工单" :close-on-click-modal="false" v-drag :visible.sync="seqNoModalFlag" width="1000px">
  394. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  395. <el-row :gutter="20">
  396. <el-col :span="4">
  397. <el-form-item :label="'生产订单'">
  398. <el-input v-model="seqNoData.orderno"></el-input>
  399. </el-form-item>
  400. </el-col>
  401. <el-col :span="4">
  402. <el-form-item>
  403. <span slot="label" style="" @click="getBaseList(515)"><a herf="#">机台</a></span>
  404. <el-input v-model="seqNoData.sResourceid"></el-input>
  405. </el-form-item>
  406. </el-col>
  407. <el-col :span="4">
  408. <el-form-item>
  409. <span slot="label" style="" @click="getBaseList(216)"><a herf="#">加工中心</a></span>
  410. <el-input v-model="seqNoData.sWorkcenterno"></el-input>
  411. </el-form-item>
  412. </el-col>
  413. <el-col :span="4">
  414. <el-form-item :label="'派工日期'">
  415. <el-date-picker style="width: 100%" v-model="seqNoData.startDate" type="date" value-format="yyyy-MM-dd"
  416. placeholder="选择日期">
  417. </el-date-picker>
  418. </el-form-item>
  419. </el-col>
  420. <el-col :span="4">
  421. <el-form-item :label="'到'">
  422. <el-date-picker style="width: 100%" v-model="seqNoData.endDate" type="date" value-format="yyyy-MM-dd"
  423. placeholder="选择日期">
  424. </el-date-picker>
  425. </el-form-item>
  426. </el-col>
  427. </el-row>
  428. <el-row :gutter="20">
  429. <el-col :span="6">
  430. <el-form-item>
  431. <el-button type="primary" @click="searchSOSRouting()" style="margin-top: 5px" class="">查询</el-button>
  432. </el-form-item>
  433. </el-col>
  434. </el-row>
  435. </el-form>
  436. <el-table :height="400" :data="seqNoList" border style="width: 100%;">
  437. <el-table-column v-for="(item,index) in columnList2" :key="index" :sortable="item.columnSortable"
  438. :prop="item.columnProp" :header-align="item.headerAlign" :show-overflow-tooltip="item.showOverflowTooltip"
  439. :align="item.align" :fixed="item.fixed==''?false:item.fixed" :min-width="item.columnWidth"
  440. :label="item.columnLabel">
  441. <template slot-scope="scope">
  442. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  443. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  444. style="width: 100px; height: 80px" /></span>
  445. </template>
  446. </el-table-column>
  447. <el-table-column fixed="left" header-align="center" align="center" width="60" label="操作">
  448. <template slot-scope="scope">
  449. <a type="text" size="small" @click="chooseSOS(scope.row)">选择</a>
  450. </template>
  451. </el-table-column>
  452. </el-table>
  453. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  454. <el-button type="primary" @click="seqNoModalFlag = false">关闭</el-button>
  455. </el-footer>
  456. </el-dialog>
  457. <el-dialog title="保存工单" :close-on-click-modal="false" v-drag :visible.sync="saveSeqNoModalFlag" width="750px">
  458. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  459. <el-row :gutter="20">
  460. <el-col :span="6">
  461. <el-form-item :label="'生产订单'">
  462. <el-input v-model="notifyOrderData.orderNo" disabled></el-input>
  463. </el-form-item>
  464. </el-col>
  465. <el-col :span="6">
  466. <el-form-item :label="'机台'">
  467. <el-input v-model="notifyOrderData.sResourceID" disabled></el-input>
  468. </el-form-item>
  469. </el-col>
  470. <el-col :span="6">
  471. <el-form-item :label="'工单数量'">
  472. <el-input v-model="notifyOrderData.qtyRequired" disabled></el-input>
  473. </el-form-item>
  474. </el-col>
  475. </el-row>
  476. <el-row :gutter="20">
  477. <el-col :span="6">
  478. <el-form-item :label="'物料'">
  479. <el-input v-model="notifyOrderData.partNo" disabled></el-input>
  480. </el-form-item>
  481. </el-col>
  482. <el-col :span="12">
  483. <el-form-item :label="'物料名称'">
  484. <el-input v-model="notifyOrderData.partDesc" disabled style="width: 204%"></el-input>
  485. </el-form-item>
  486. </el-col>
  487. </el-row>
  488. <el-row :gutter="20">
  489. <el-col :span="6">
  490. <el-form-item :label="'要求发料时间'">
  491. <el-date-picker style="width: 100%" v-model="notifyOrderData.needDate" type="datetime"
  492. value-format="yyyy-MM-dd HH:mm" placeholder="选择日期">
  493. </el-date-picker>
  494. </el-form-item>
  495. </el-col>
  496. <el-col :span="6">
  497. <el-form-item label="机台">
  498. <el-input v-model="notifyOrderData.locationNo" disabled></el-input>
  499. </el-form-item>
  500. </el-col>
  501. <el-col :span="6">
  502. <el-form-item :label="'此次领料数量'">
  503. <el-input-number v-model="notifyOrderData.issureQty" style="padding: 0px;width: 100%" :controls="false"
  504. :step="0" :min="0" class="text-right"></el-input-number>
  505. </el-form-item>
  506. </el-col>
  507. <el-col :span="6">
  508. <el-form-item :label="' '">
  509. <el-button type="primary" @click="qtyAllForSeqNo()" style="margin-top: 4%;">全数领料</el-button>
  510. </el-form-item>
  511. </el-col>
  512. </el-row>
  513. </el-form>
  514. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  515. <el-button type="primary" @click="saveSOS()">保存</el-button>
  516. <el-button type="primary" @click="saveSeqNoModalFlag=false">关闭</el-button>
  517. </el-footer>
  518. </el-dialog>
  519. <!-- 入库明细 -->
  520. <el-dialog title="入库明细" :close-on-click-modal="false" v-drag :visible.sync="detailModal2" width="900px">
  521. <el-table height="400px" :data="detailList2" border style="width: 100%;">
  522. <el-table-column v-for="(item,index) in columnDetailList2" :key="index" :sortable="item.columnSortable"
  523. :prop="item.columnProp" :header-align="item.headerAlign" :show-overflow-tooltip="item.showOverflowTooltip"
  524. :align="item.align" :fixed="item.fixed===''?false:item.fixed" :min-width="item.columnWidth"
  525. :label="item.columnLabel">
  526. </el-table-column>
  527. </el-table>
  528. <el-footer style="height:35px;margin-top: 15px;text-align:center">
  529. <el-button type="primary" @click="detailModal2 = false">关闭</el-button>
  530. </el-footer>
  531. </el-dialog>
  532. <el-dialog title="申请明细" :close-on-click-modal="false" v-drag :visible.sync="materialModalFlag" width="900px">
  533. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  534. <el-row :gutter="20">
  535. <el-col :span="6">
  536. <el-form-item :label="'生产订单号'">
  537. <el-input v-model="sobomData.orderNo" disabled></el-input>
  538. </el-form-item>
  539. </el-col>
  540. <el-col :span="6">
  541. <el-form-item label=" ">
  542. <el-button type="primary" @click="openSelectMaterialModalForDetail()"
  543. class="">添加</el-button>
  544. </el-form-item>
  545. </el-col>
  546. </el-row>
  547. </el-form>
  548. <div class="yzzTable">
  549. <el-table :height="400" :data="sobomList" border v-loading="bomLoadFlag" style="width: 100%;">
  550. <el-table-column v-for="(item,index) in columnList3" :key="index" :sortable="item.columnSortable"
  551. :prop="item.columnProp" :header-align="item.headerAlign" :show-overflow-tooltip="item.showOverflowTooltip"
  552. :align="item.align" :fixed="item.fixed==''?false:item.fixed" :min-width="item.columnWidth"
  553. :label="item.columnLabel">
  554. <template slot-scope="scope">
  555. <div v-if="item.columnProp === 'qtyToIssue'">
  556. <el-input v-model="scope.row.qtyToIssue" type="number" style="height: 11px; width: 98%;" :step="0"
  557. :min="0"></el-input>
  558. </div>
  559. <div v-else-if="item.columnProp === 'remark'">
  560. <el-input v-model="scope.row.remark" style="padding: 0;width: 100%"></el-input>
  561. </div>
  562. <div v-else>
  563. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  564. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  565. style="width: 100px; height: 80px" /></span>
  566. </div>
  567. </template>
  568. </el-table-column>
  569. <!-- <el-table-column prop="" header-align="center" align="center" min-width="50" label="操作">
  570. <template slot-scope="scope">
  571. <el-button type="primary" @click="qtyAllForBom(scope.row)" style="width: 100%">全数领料</el-button>
  572. </template>
  573. </el-table-column> -->
  574. </el-table>
  575. </div>
  576. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  577. <el-button type="primary" @click="saveNoOrderMaterialDetail()">保存</el-button>
  578. <el-button type="primary" @click="materialModalFlag=false">关闭</el-button>
  579. </el-footer>
  580. </el-dialog>
  581. <!-- 选择物料弹框 -->
  582. <el-dialog title="新增物料" :close-on-click-modal="false" v-drag :visible.sync="selectMaterialModalFlag" width="1080px">
  583. <el-form :inline="true" label-position="top">
  584. <el-form-item label="物料编号">
  585. <el-input v-model="componentPartNo" style="width: 120px"></el-input>
  586. </el-form-item>
  587. <el-form-item label=" ">
  588. <el-button type="primary" @click="loadAvailableMaterialList()" class="">查询</el-button>
  589. </el-form-item>
  590. </el-form>
  591. <el-container style="margin-top: 0px;">
  592. <!-- 左侧可选物料 -->
  593. <el-main style="width: 470px;padding: 1px">
  594. <span style="font-size: 12px">可选物料</span>
  595. <el-table height="350px" :data="availableMaterialList" border ref="itemTable1" @row-click="itemClickRow1"
  596. @selection-change="handleAvailableSelectionChange" highlight-current-row style="width: 100%"
  597. v-loading="selectMaterialLoading">
  598. <el-table-column type="selection" header-align="center" align="center" :selectable="selectFlag" width="50">
  599. </el-table-column>
  600. <el-table-column prop="partNo" header-align="center" align="center" min-width="170" label="物料号">
  601. </el-table-column>
  602. <el-table-column prop="height" header-align="center" align="center" min-width="80" label="高度">
  603. </el-table-column>
  604. <el-table-column prop="isInWh" header-align="center" align="center" min-width="80" label="是否在立库">
  605. </el-table-column>
  606. </el-table>
  607. <el-pagination @size-change="handleAvailableSizeChange" @current-change="handleAvailableCurrentChange"
  608. :current-page="availableMaterialPage" :page-sizes="[50, 100]" :page-size="availableMaterialLimit"
  609. small layout="total, prev, pager, next" :total="availableMaterialTotal"
  610. style="margin-top: 10px; text-align: right;">
  611. </el-pagination>
  612. </el-main>
  613. <!-- 中间操作按钮 -->
  614. <el-main style="width: 100px;padding: 1px">
  615. <div style="margin-top: 180px;margin-left: 18px">
  616. <el-button type="primary" @click="addToSelected">添加>></el-button>
  617. </div>
  618. <div style="margin-top: 15px;margin-left: 18px">
  619. <el-button type="primary" @click="removeFromSelected">删除&lt;&lt; </el-button>
  620. </div>
  621. </el-main>
  622. <!-- 右侧已选物料 -->
  623. <el-main style="width: 470px;padding: 1px">
  624. <span style="font-size: 12px">已有物料</span>
  625. <el-table height="400px" :data="selectedMaterialList" border ref="itemTable2" @row-click="itemClickRow2"
  626. @selection-change="handleSelectedSelectionChange" highlight-current-row style="width: 100%">
  627. <el-table-column type="selection" header-align="center" align="center" :selectable="selectFlag" width="50">
  628. </el-table-column>
  629. <el-table-column prop="partNo" header-align="center" align="center" min-width="170" label="物料号">
  630. </el-table-column>
  631. <el-table-column prop="height" header-align="center" align="center" min-width="80" label="高度">
  632. </el-table-column>
  633. <el-table-column prop="isInWh" header-align="center" align="center" min-width="80" label="是否在立库">
  634. </el-table-column>
  635. </el-table>
  636. </el-main>
  637. </el-container>
  638. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  639. <el-button type="primary" @click="confirmSelectMaterial()">保存</el-button>
  640. <el-button @click="selectMaterialModalFlag = false">关闭</el-button>
  641. </el-footer>
  642. </el-dialog>
  643. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  644. </div>
  645. </template>
  646. <script>
  647. import {
  648. searchNoOrderNotifyHeader,
  649. getNotifyNoOrderDetailByType,
  650. noOrderList,
  651. saveNoOrderMaterialDetail,
  652. getNoOrderMaterialList
  653. } from '@/api/orderIssure/noOrderIssueNotify.js'
  654. // rqrq - 导入推送WCS相关API(使用领料申请的通用API)
  655. import {
  656. checkIssueNotifyInventory,
  657. pushInventoryToWcs
  658. } from '@/api/orderIssure/soIssueNotify.js'
  659. import {
  660. getSiteAndBuByUserName,
  661. createNotify,
  662. closeInboundNotification,
  663. checkUserHasUnissueShipment,
  664. cancelIssueShipment,
  665. deleteNotifyUnissue,
  666. } from '@/api/shipment/shipmentIssue.js'
  667. import Chooselist from '@/views/modules/common/Chooselist_eam'
  668. import { getChooselist } from '@/api/chooselist/chooselist.js'
  669. import {
  670. getTableDefaultListLanguage,
  671. getTableUserListLanguage,
  672. } from '@/api/table.js'
  673. export default {
  674. components: {
  675. Chooselist,
  676. },
  677. data() {
  678. return {
  679. columnsProp: ['createBy', 'updateBy'],
  680. // 导出 start
  681. exportData: [],
  682. exportName: '收货入库' + this.dayjs().format('YYYYMMDDHHmmss'),
  683. exportHeader: ['收货入库'],
  684. exportFooter: [],
  685. exportList: [],
  686. // 导出 end
  687. tagNo: '',
  688. tagType: '',
  689. searchData: {
  690. site: '',
  691. userName: this.$store.state.user.name,
  692. orderNo: '',
  693. orderType: '',
  694. orderStatus: '',
  695. orderStatusList: [],
  696. startDate: '',
  697. endDate: '',
  698. page: 1,
  699. limit: 10,
  700. },
  701. detailSearchData: {
  702. site: '',
  703. buNo: '',
  704. orderNo: '',
  705. partNo: '',
  706. partDesc: '',
  707. partNos: '',
  708. orderType: '',
  709. relatedOrderNo: '',
  710. status: '',
  711. page: 1,
  712. limit: 10,
  713. },
  714. height: 200,
  715. secondHeight: 200,
  716. pageIndex: 1,
  717. pageSize: 20,
  718. totalPage: 0,
  719. pageIndex2: 1,
  720. pageSize2: 20,
  721. totalPage2: 0,
  722. modalFlag: false,
  723. modalDisableFlag: false,
  724. notifyOrderData: {
  725. partNo: '',
  726. orderno: '',
  727. itemno: '',
  728. seqno: '',
  729. partDesc: '',
  730. qtyrequired: '',
  731. sResourceid: '',
  732. issureQty: '',
  733. locationNo: '',
  734. needDate: '',
  735. },
  736. modalData: {
  737. site: '',
  738. bu: '',
  739. buNo: '',
  740. flag: '',
  741. orderNo: '',
  742. orderType: '',
  743. orderStatus: '',
  744. requiredInboundDate: '',
  745. supplierId: '',
  746. supplierName: '',
  747. remarks: '',
  748. createdBy: '',
  749. updatedBy: '',
  750. },
  751. seqNoData: {
  752. site: localStorage.getItem('site'),
  753. bu: '',
  754. orderno: '',
  755. seqno: '',
  756. sResourceid: '',
  757. sWorkcenterno: '',
  758. operatorId: '',
  759. sShiftno: '',
  760. startDate: '',
  761. endDate: '',
  762. },
  763. dataList: [],
  764. detailList: [],
  765. userBuList: [],
  766. inboundSelection: [],
  767. inboundDetailSelection: [],
  768. partSelections1: [],
  769. partSelections2: [],
  770. partList1: [],
  771. partList2: [],
  772. dataListLoading: false,
  773. // 展示列集
  774. columnList: [
  775. {
  776. userId: this.$store.state.user.name,
  777. functionId: 610,
  778. serialNumber: '610Table1OrderNo',
  779. tableId: '610Table1',
  780. tableName: '收货入库任务表',
  781. columnProp: 'notifyNo',
  782. headerAlign: 'center',
  783. align: 'center',
  784. columnLabel: '单据号',
  785. columnHidden: false,
  786. columnImage: false,
  787. columnSortable: false,
  788. sortLv: 0,
  789. status: true,
  790. fixed: '',
  791. columnWidth: 120,
  792. },
  793. /* {
  794. userId: this.$store.state.user.name,
  795. functionId: 610,
  796. serialNumber: '610Table1OrderType',
  797. tableId: '610Table1',
  798. tableName: '收货入库任务表',
  799. columnProp: 'orderType',
  800. headerAlign: 'center',
  801. align: 'center',
  802. columnLabel: '单据类型',
  803. columnHidden: false,
  804. columnImage: false,
  805. columnSortable: false,
  806. sortLv: 0,
  807. status: true,
  808. fixed: '',
  809. columnWidth: 100,
  810. }, */
  811. {
  812. userId: this.$store.state.user.name,
  813. functionId: 610,
  814. serialNumber: '610Table1OrderStatus',
  815. tableId: '610Table1',
  816. tableName: '收货入库任务表',
  817. columnProp: 'status',
  818. headerAlign: 'center',
  819. align: 'left',
  820. columnLabel: '单据状态',
  821. columnHidden: false,
  822. columnImage: false,
  823. columnSortable: false,
  824. sortLv: 0,
  825. status: true,
  826. fixed: '',
  827. columnWidth: 100,
  828. },
  829. /* {
  830. userId: this.$store.state.user.name,
  831. functionId: 610,
  832. serialNumber: '610Table1SupplierId',
  833. tableId: '610Table1',
  834. tableName: '收货入库任务表',
  835. columnProp: 'supplierId',
  836. headerAlign: 'center',
  837. align: 'left',
  838. columnLabel: '供应商编码',
  839. columnHidden: false,
  840. columnImage: false,
  841. columnSortable: false,
  842. sortLv: 0,
  843. status: true,
  844. fixed: '',
  845. columnWidth: 120,
  846. },
  847. {
  848. userId: this.$store.state.user.name,
  849. functionId: 610,
  850. serialNumber: '610Table1SupplierName',
  851. tableId: '610Table1',
  852. tableName: '收货入库任务表',
  853. columnProp: 'supplierName',
  854. headerAlign: 'center',
  855. align: 'left',
  856. columnLabel: '供应商名称',
  857. columnHidden: false,
  858. columnImage: false,
  859. columnSortable: false,
  860. sortLv: 0,
  861. status: true,
  862. fixed: '',
  863. columnWidth: 200,
  864. }, */
  865. {
  866. userId: this.$store.state.user.name,
  867. functionId: 610,
  868. serialNumber: '610Table1RequiredInboundDate',
  869. tableId: '610Table1',
  870. tableName: '收货入库任务表',
  871. columnProp: 'notifyDate',
  872. headerAlign: 'center',
  873. align: 'center',
  874. columnLabel: '申请单日期',
  875. columnHidden: false,
  876. columnImage: false,
  877. columnSortable: false,
  878. sortLv: 0,
  879. status: true,
  880. fixed: '',
  881. columnWidth: 150,
  882. },
  883. {
  884. userId: this.$store.state.user.name,
  885. functionId: 610,
  886. serialNumber: '610Table1CreatedDate',
  887. tableId: '610Table1',
  888. tableName: '收货入库任务表',
  889. columnProp: 'enteredDate',
  890. headerAlign: 'center',
  891. align: 'center',
  892. columnLabel: '创建时间',
  893. columnHidden: false,
  894. columnImage: false,
  895. columnSortable: false,
  896. sortLv: 0,
  897. status: true,
  898. fixed: '',
  899. columnWidth: 170,
  900. },
  901. {
  902. userId: this.$store.state.user.name,
  903. functionId: 610,
  904. serialNumber: '610Table1CreatedBy',
  905. tableId: '610Table1',
  906. tableName: '收货入库任务表',
  907. columnProp: 'username',
  908. headerAlign: 'center',
  909. align: 'center',
  910. columnLabel: '创建人',
  911. columnHidden: false,
  912. columnImage: false,
  913. columnSortable: false,
  914. sortLv: 0,
  915. status: true,
  916. fixed: '',
  917. columnWidth: 100,
  918. },
  919. // rqrq - 添加推送WCS字段
  920. {
  921. userId: this.$store.state.user.name,
  922. functionId: 610,
  923. serialNumber: '610Table1PushWcsFlag',
  924. tableId: '610Table1',
  925. tableName: '收货入库任务表',
  926. columnProp: 'pushWcsFlag',
  927. headerAlign: 'center',
  928. align: 'center',
  929. columnLabel: '推送WCS',
  930. columnHidden: false,
  931. columnImage: false,
  932. columnSortable: false,
  933. sortLv: 0,
  934. status: true,
  935. fixed: '',
  936. columnWidth: 100,
  937. },
  938. /* {
  939. userId: this.$store.state.user.name,
  940. functionId: 610,
  941. serialNumber: '610Table1UpdatedDate',
  942. tableId: '610Table1',
  943. tableName: '收货入库任务表',
  944. columnProp: 'updatedDate',
  945. headerAlign: 'center',
  946. align: 'center',
  947. columnLabel: '更新时间',
  948. columnHidden: false,
  949. columnImage: false,
  950. columnSortable: false,
  951. sortLv: 0,
  952. status: true,
  953. fixed: '',
  954. columnWidth: 170,
  955. },
  956. {
  957. userId: this.$store.state.user.name,
  958. functionId: 610,
  959. serialNumber: '610Table1UpdatedBy',
  960. tableId: '610Table1',
  961. tableName: '收货入库任务表',
  962. columnProp: 'updatedBy',
  963. headerAlign: 'center',
  964. align: 'center',
  965. columnLabel: '更新人',
  966. columnHidden: false,
  967. columnImage: false,
  968. columnSortable: false,
  969. sortLv: 0,
  970. status: true,
  971. fixed: '',
  972. columnWidth: 100,
  973. }, */
  974. ],
  975. columnList2: [
  976. {
  977. userId: this.$store.state.user.name,
  978. functionId: 701001,
  979. serialNumber: '701001Table2Orderno',
  980. tableId: '701001Table2',
  981. tableName: '查询派工单',
  982. columnProp: 'orderNo',
  983. headerAlign: 'center',
  984. align: 'center',
  985. columnLabel: 'SHIPMENTID',
  986. columnHidden: false,
  987. columnImage: false,
  988. columnSortable: false,
  989. sortLv: 0,
  990. status: true,
  991. fixed: '',
  992. columnWidth: 120,
  993. },
  994. {
  995. userId: this.$store.state.user.name,
  996. functionId: 701001,
  997. serialNumber: '701001Table2Itemno',
  998. tableId: '701001Table2',
  999. tableName: '查询派工单',
  1000. columnProp: 'itemNo',
  1001. headerAlign: 'center',
  1002. align: 'right',
  1003. columnLabel: '工序',
  1004. columnHidden: false,
  1005. columnImage: false,
  1006. columnSortable: false,
  1007. sortLv: 0,
  1008. status: true,
  1009. fixed: '',
  1010. columnWidth: 50,
  1011. },
  1012. {
  1013. userId: this.$store.state.user.name,
  1014. functionId: 701001,
  1015. serialNumber: '701001Table2ItemDesc',
  1016. tableId: '701001Table2',
  1017. tableName: '查询派工单',
  1018. columnProp: 'itemDesc',
  1019. headerAlign: 'center',
  1020. align: 'left',
  1021. columnLabel: '工序名称',
  1022. columnHidden: false,
  1023. columnImage: false,
  1024. columnSortable: false,
  1025. sortLv: 0,
  1026. status: true,
  1027. fixed: '',
  1028. columnWidth: 100,
  1029. },
  1030. {
  1031. userId: this.$store.state.user.name,
  1032. functionId: 701001,
  1033. serialNumber: '701001Table2PartNo',
  1034. tableId: '701001Table2',
  1035. tableName: '查询派工单',
  1036. columnProp: 'partNo',
  1037. headerAlign: 'center',
  1038. align: 'left',
  1039. columnLabel: '物料编码',
  1040. columnHidden: false,
  1041. columnImage: false,
  1042. columnSortable: false,
  1043. sortLv: 0,
  1044. status: true,
  1045. fixed: '',
  1046. columnWidth: 80,
  1047. },
  1048. {
  1049. userId: this.$store.state.user.name,
  1050. functionId: 701001,
  1051. serialNumber: '701001Table2Qtyrequired',
  1052. tableId: '701001Table2',
  1053. tableName: '查询派工单',
  1054. columnProp: 'qtyRequired',
  1055. headerAlign: 'center',
  1056. align: 'right',
  1057. columnLabel: '工单数量',
  1058. columnHidden: false,
  1059. columnImage: false,
  1060. columnSortable: false,
  1061. sortLv: 0,
  1062. status: true,
  1063. fixed: '',
  1064. columnWidth: 80,
  1065. },
  1066. {
  1067. userId: this.$store.state.user.name,
  1068. functionId: 701001,
  1069. serialNumber: '701001Table2Qtyreported',
  1070. tableId: '701001Table2',
  1071. tableName: '查询派工单',
  1072. columnProp: 'qtyReported',
  1073. headerAlign: 'center',
  1074. align: 'right',
  1075. columnLabel: '报工数量',
  1076. columnHidden: false,
  1077. columnImage: false,
  1078. columnSortable: false,
  1079. sortLv: 0,
  1080. status: true,
  1081. fixed: '',
  1082. columnWidth: 100,
  1083. },
  1084. {
  1085. userId: this.$store.state.user.name,
  1086. functionId: 701001,
  1087. serialNumber: '701001Table2SScheduleddate',
  1088. tableId: '701001Table2',
  1089. tableName: '查询工单',
  1090. columnProp: 'sScheduledDate',
  1091. headerAlign: 'center',
  1092. align: 'left',
  1093. columnLabel: '工单日期',
  1094. columnHidden: false,
  1095. columnImage: false,
  1096. columnSortable: false,
  1097. sortLv: 0,
  1098. status: true,
  1099. fixed: '',
  1100. columnWidth: 100,
  1101. },
  1102. {
  1103. userId: this.$store.state.user.name,
  1104. functionId: 701001,
  1105. serialNumber: '701001Table2SWorkcenterno',
  1106. tableId: '701001Table2',
  1107. tableName: '查询派工单',
  1108. columnProp: 'sWorkCenterNo',
  1109. headerAlign: 'center',
  1110. align: 'left',
  1111. columnLabel: '加工中心编码',
  1112. columnHidden: false,
  1113. columnImage: false,
  1114. columnSortable: false,
  1115. sortLv: 0,
  1116. status: true,
  1117. fixed: '',
  1118. columnWidth: 80,
  1119. },
  1120. {
  1121. userId: this.$store.state.user.name,
  1122. functionId: 701001,
  1123. serialNumber: '701001Table2WorkCenterDesc',
  1124. tableId: '701001Table2',
  1125. tableName: '查询工单',
  1126. columnProp: 'workCenterDesc',
  1127. headerAlign: 'center',
  1128. align: 'left',
  1129. columnLabel: '加工中心名称',
  1130. columnHidden: false,
  1131. columnImage: false,
  1132. columnSortable: false,
  1133. sortLv: 0,
  1134. status: true,
  1135. fixed: '',
  1136. columnWidth: 100,
  1137. },
  1138. {
  1139. userId: this.$store.state.user.name,
  1140. functionId: 701001,
  1141. serialNumber: '701001Table2SResourceid',
  1142. tableId: '701001Table2',
  1143. tableName: '查询派工单',
  1144. columnProp: 'sResourceID',
  1145. headerAlign: 'center',
  1146. align: 'left',
  1147. columnLabel: '机台编码',
  1148. columnHidden: false,
  1149. columnImage: false,
  1150. columnSortable: false,
  1151. sortLv: 0,
  1152. status: true,
  1153. fixed: '',
  1154. columnWidth: 60,
  1155. },
  1156. {
  1157. userId: this.$store.state.user.name,
  1158. functionId: 701001,
  1159. serialNumber: '701001Table2ResourceDesc',
  1160. tableId: '701001Table2',
  1161. tableName: '查询派工单',
  1162. columnProp: 'resourceDesc',
  1163. headerAlign: 'center',
  1164. align: 'left',
  1165. columnLabel: '机台名称',
  1166. columnHidden: false,
  1167. columnImage: false,
  1168. columnSortable: false,
  1169. sortLv: 0,
  1170. status: true,
  1171. fixed: '',
  1172. columnWidth: 100,
  1173. },
  1174. {
  1175. userId: this.$store.state.user.name,
  1176. functionId: 701001,
  1177. serialNumber: '701001Table2OperatorDesc',
  1178. tableId: '701001Table2',
  1179. tableName: '查询派工单',
  1180. columnProp: 'operatorDesc',
  1181. headerAlign: 'center',
  1182. align: 'left',
  1183. columnLabel: '操作员',
  1184. columnHidden: false,
  1185. columnImage: false,
  1186. columnSortable: false,
  1187. sortLv: 0,
  1188. status: true,
  1189. fixed: '',
  1190. columnWidth: 100,
  1191. },
  1192. ],
  1193. columnList3: [
  1194. {
  1195. userId: this.$store.state.user.name,
  1196. functionId: 555001,
  1197. serialNumber: '555001Table3ComponentPartNo',
  1198. tableId: '555001Table3',
  1199. tableName: '领料申请BOM子表',
  1200. columnProp: 'componentPartNo',
  1201. headerAlign: 'center',
  1202. align: 'left',
  1203. columnLabel: '物料编码',
  1204. columnHidden: false,
  1205. columnImage: false,
  1206. columnSortable: true,
  1207. sortLv: 0,
  1208. status: true,
  1209. fixed: false,
  1210. columnWidth: 80,
  1211. },
  1212. {
  1213. userId: this.$store.state.user.name,
  1214. functionId: 555001,
  1215. serialNumber: '555001Table3QtyRequired',
  1216. tableId: '555001Table3',
  1217. tableName: '领料申请BOM子表',
  1218. columnProp: 'isInWh',
  1219. headerAlign: 'center',
  1220. align: 'center',
  1221. columnLabel: '是否在立库',
  1222. columnHidden: false,
  1223. columnImage: false,
  1224. columnSortable: false,
  1225. sortLv: 0,
  1226. status: true,
  1227. fixed: false,
  1228. columnWidth: 50,
  1229. },
  1230. {
  1231. userId: this.$store.state.user.name,
  1232. functionId: 555001,
  1233. serialNumber: '555001Table3QtyToIssue',
  1234. tableId: '555001Table3',
  1235. tableName: '领料申请BOM子表',
  1236. columnProp: 'qtyToIssue',
  1237. headerAlign: 'center',
  1238. align: 'right',
  1239. columnLabel: '本次申请数量',
  1240. columnHidden: false,
  1241. columnImage: false,
  1242. columnSortable: false,
  1243. sortLv: 0,
  1244. status: true,
  1245. fixed: false,
  1246. columnWidth: 60,
  1247. },
  1248. {
  1249. userId: this.$store.state.user.name,
  1250. functionId: 555001,
  1251. serialNumber: '555001Table3Remark',
  1252. tableId: '555001Table3',
  1253. tableName: '领料申请BOM子表',
  1254. columnProp: 'remark',
  1255. headerAlign: 'center',
  1256. align: 'left',
  1257. columnLabel: '备注',
  1258. columnHidden: false,
  1259. columnImage: false,
  1260. columnSortable: false,
  1261. sortLv: 0,
  1262. status: true,
  1263. fixed: false,
  1264. columnWidth: 150,
  1265. },
  1266. ],
  1267. columnDetailList: [
  1268. {
  1269. userId: this.$store.state.user.name,
  1270. functionId: 444002,
  1271. serialNumber: '555001Table1ItemNo',
  1272. tableId: '555001Table1',
  1273. tableName: '领料申请工单子表',
  1274. columnProp: 'itemNo',
  1275. headerAlign: 'center',
  1276. align: 'right',
  1277. columnLabel: '序号',
  1278. columnHidden: false,
  1279. columnImage: false,
  1280. columnSortable: false,
  1281. sortLv: 0,
  1282. status: true,
  1283. fixed: false,
  1284. columnWidth: 50,
  1285. },
  1286. /* {
  1287. userId: this.$store.state.user.name,
  1288. functionId: 444002,
  1289. serialNumber: '555001Table1SeqNo',
  1290. tableId: '555001Table1',
  1291. tableName: '领料申请派工单子表',
  1292. columnProp: 'seqNo',
  1293. headerAlign: 'center',
  1294. align: 'center',
  1295. columnLabel: '派工单号',
  1296. columnHidden: false,
  1297. columnImage: false,
  1298. columnSortable: false,
  1299. sortLv: 0,
  1300. status: true,
  1301. fixed: false,
  1302. columnWidth: 150,
  1303. }, */
  1304. {
  1305. userId: this.$store.state.user.name,
  1306. functionId: 444002,
  1307. serialNumber: '555001Table1SOOrderNo',
  1308. tableId: '555001Table1',
  1309. tableName: '领料申请工单子表',
  1310. columnProp: 'soorderNo',
  1311. headerAlign: 'center',
  1312. align: 'center',
  1313. columnLabel: '生产订单号',
  1314. columnHidden: false,
  1315. columnImage: false,
  1316. columnSortable: false,
  1317. sortLv: 0,
  1318. status: true,
  1319. fixed: false,
  1320. columnWidth: 120,
  1321. },
  1322. {
  1323. userId: this.$store.state.user.name,
  1324. functionId: 444002,
  1325. serialNumber: '555001Table1ReleaseNo',
  1326. tableId: '555001Table1',
  1327. tableName: '领料申请工单子表',
  1328. columnProp: 'releaseNo',
  1329. headerAlign: 'center',
  1330. align: 'center',
  1331. columnLabel: 'ReleaseNo',
  1332. columnHidden: false,
  1333. columnImage: false,
  1334. columnSortable: false,
  1335. sortLv: 0,
  1336. status: true,
  1337. fixed: false,
  1338. columnWidth: 80,
  1339. },
  1340. {
  1341. userId: this.$store.state.user.name,
  1342. functionId: 444002,
  1343. serialNumber: '555001Table1SequenceNo',
  1344. tableId: '555001Table1',
  1345. tableName: '领料申请工单子表',
  1346. columnProp: 'sequenceNo',
  1347. headerAlign: 'center',
  1348. align: 'center',
  1349. columnLabel: 'SequenceNo',
  1350. columnHidden: false,
  1351. columnImage: false,
  1352. columnSortable: false,
  1353. sortLv: 0,
  1354. status: true,
  1355. fixed: false,
  1356. columnWidth: 80,
  1357. },
  1358. {
  1359. userId: this.$store.state.user.name,
  1360. functionId: 444002,
  1361. serialNumber: '555001Table1NeedDate',
  1362. tableId: '555001Table1',
  1363. tableName: '领料申请派工单子表',
  1364. columnProp: 'needDate',
  1365. headerAlign: 'center',
  1366. align: 'left',
  1367. columnLabel: '要求发料时间',
  1368. columnHidden: false,
  1369. columnImage: false,
  1370. columnSortable: false,
  1371. sortLv: 0,
  1372. status: true,
  1373. fixed: false,
  1374. columnWidth: 80,
  1375. },
  1376. ],
  1377. rules: {
  1378. bu: [
  1379. {
  1380. required: true,
  1381. message: ' ',
  1382. trigger: ['blur', 'change'],
  1383. },
  1384. ],
  1385. orderType: [
  1386. {
  1387. required: true,
  1388. message: ' ',
  1389. trigger: ['blur', 'change'],
  1390. },
  1391. ],
  1392. requiredInboundDate: [
  1393. {
  1394. required: true,
  1395. message: ' ',
  1396. trigger: ['blur', 'change'],
  1397. },
  1398. ],
  1399. },
  1400. searchLoading: false,
  1401. saveLoading: false,
  1402. activeTable: 'inboundDetail',
  1403. detailModal: false,
  1404. authSearch: false,
  1405. authSave: false,
  1406. authUpdate: false,
  1407. authDelete: false,
  1408. authArchive: false,
  1409. authClose: false,
  1410. authIssue: false,
  1411. editBatchVisible: false,
  1412. menuId: this.$route.meta.menuId,
  1413. tempWareHouseRow: {},
  1414. detailList2: [],
  1415. detailModal2: false,
  1416. currentRow: {},
  1417. seqNoList: [],
  1418. seqNoModalFlag: false,
  1419. saveSeqNoModalFlag: false,
  1420. bomLoadFlag: false,
  1421. sobomList: [],
  1422. itemNo: '',
  1423. materialModalFlag: false,
  1424. sobomData: {},
  1425. notifyNo: '',
  1426. // 选择物料弹框相关
  1427. selectMaterialModalFlag: false,
  1428. availableMaterialList: [], // 左侧可选物料列表
  1429. selectedMaterialList: [], // 右侧已选物料列表
  1430. availableMaterialSelections: [], // 左侧选中的行
  1431. selectedMaterialSelections: [], // 右侧选中的行
  1432. selectMaterialLoading: false,
  1433. modelCode: '', // 模板编号
  1434. modelName: '', // 模板名称
  1435. // 左侧表格分页相关
  1436. availableMaterialPage: 1, // 当前页码
  1437. availableMaterialLimit: 100, // 每页条数
  1438. availableMaterialTotal: 0, // 总条数
  1439. componentPartNo: '', // 物料编码搜索
  1440. // 申请明细弹框相关
  1441. isMaterialDetailModal: false, // 标识是否从申请明细弹框打开选择物料弹框
  1442. clickrow: {},
  1443. // rqrq - 推送WCS预览相关数据
  1444. previewDialogVisible: false,
  1445. previewLoading: false,
  1446. previewData: [],
  1447. currentNotifyRow: null, // 当前要推送WCS的通知单行数据 - rqrq
  1448. }
  1449. },
  1450. mounted() {
  1451. this.$nextTick(() => {
  1452. this.height = window.innerHeight / 2 - 100
  1453. /*第二个表格高度的动态调整*/
  1454. this.secondHeight = window.innerHeight - this.height - 170
  1455. })
  1456. },
  1457. created() {
  1458. // 按钮控制
  1459. this.getButtonAuthData()
  1460. // 获取用户的 site 和 bu
  1461. //this.getSiteAndBuByUserName()
  1462. // 动态列
  1463. //this.getTableUserColumn(this.$route.meta.menuId + 'table1', 1)
  1464. //this.getTableUserColumn(this.$route.meta.menuId + 'table2', 2)
  1465. if (!this.authSearch) {
  1466. // 获取数据列表
  1467. this.getDataList()
  1468. }
  1469. },
  1470. methods: {
  1471. // 获取用户的bu
  1472. getSiteAndBuByUserName() {
  1473. let tempData = {
  1474. username: this.$store.state.user.name,
  1475. }
  1476. getSiteAndBuByUserName(tempData).then(({ data }) => {
  1477. if (data.code === 0) {
  1478. this.userBuList = data.rows
  1479. }
  1480. })
  1481. },
  1482. // 获取数据列表
  1483. getDataList() {
  1484. this.searchData.limit = this.pageSize
  1485. this.searchData.page = this.pageIndex
  1486. this.searchData.orderStatus = this.searchData.orderStatusList.join(',')
  1487. console.log('this.', this.searchData)
  1488. this.searchLoading = true
  1489. searchNoOrderNotifyHeader(this.searchData)
  1490. .then(({ data }) => {
  1491. if (data.code === 0) {
  1492. this.dataList = data.page.list
  1493. this.pageIndex = data.page.currPage
  1494. this.pageSize = data.page.pageSize
  1495. this.totalPage = data.page.totalCount
  1496. console.log('this.dataList', this.dataList)
  1497. // 判断是否全部存在数据
  1498. if (this.dataList.length > 0) {
  1499. // 设置选中行并高亮第一行
  1500. this.$nextTick(() => {
  1501. this.$refs.inboundTable.setCurrentRow(this.dataList[0])
  1502. this.currentRow = JSON.parse(JSON.stringify(this.dataList[0]))
  1503. // 调用getNotifyNoDetail方法获取入库明细
  1504. this.getNotifyNoOrderDetailByType()
  1505. })
  1506. } else {
  1507. this.currentRow = {}
  1508. this.detailList = []
  1509. }
  1510. }
  1511. })
  1512. .finally(() => {
  1513. this.searchLoading = false
  1514. })
  1515. },
  1516. // 每页数
  1517. sizeChangeHandle(val) {
  1518. this.pageSize = val
  1519. this.pageIndex = 1
  1520. this.getDataList()
  1521. },
  1522. // 当前页
  1523. currentChangeHandle(val) {
  1524. this.pageIndex = val
  1525. this.getDataList()
  1526. },
  1527. // 子明细每页数
  1528. sizeChangeHandle2(val) {
  1529. this.pageSize2 = val
  1530. this.pageIndex2 = 1
  1531. this.searchTypeChange()
  1532. },
  1533. // 子明细当前页
  1534. currentChangeHandle2(val) {
  1535. this.pageIndex2 = val
  1536. this.searchTypeChange()
  1537. },
  1538. saveModal() {
  1539. this.modalData = {
  1540. flag: '1',
  1541. site: '',
  1542. orderNo: '',
  1543. orderType: '',
  1544. orderStatus: '',
  1545. requiredInboundDate: '',
  1546. supplierId: '',
  1547. supplierName: '',
  1548. remarks: '',
  1549. createdBy: this.$store.state.user.name,
  1550. }
  1551. this.modalDisableFlag = false
  1552. this.modalFlag = true
  1553. },
  1554. updateModal(row) {
  1555. if (this.currentRow.orderType === '采购入库') {
  1556. this.$message.warning('采购入库单据不能编辑!')
  1557. return
  1558. }
  1559. this.modalData = {
  1560. flag: '2',
  1561. site: row.site,
  1562. bu: row.site + '_' + row.buNo,
  1563. buNo: row.buNo,
  1564. orderNo: row.orderNo,
  1565. orderType: row.orderType,
  1566. requiredInboundDate: row.requiredInboundDate,
  1567. supplierId: row.supplierId,
  1568. supplierName: row.supplierName,
  1569. remarks: row.remarks,
  1570. updatedBy: this.$store.state.user.name,
  1571. }
  1572. this.modalDisableFlag = true
  1573. this.modalFlag = true
  1574. },
  1575. saveData() {
  1576. if (this.modalData.orderType === '' || this.modalData.orderType == null) {
  1577. this.$message.warning('请选择单据类型!')
  1578. return
  1579. }
  1580. if (
  1581. this.modalData.requiredInboundDate === '' ||
  1582. this.modalData.requiredInboundDate == null
  1583. ) {
  1584. this.$message.warning('请选择要求入库日期!')
  1585. return
  1586. }
  1587. this.saveLoading = true
  1588. if (this.modalData.flag === '1') {
  1589. // 新增
  1590. this.modalData.orderType = '退料入库'
  1591. this.modalData.site = localStorage.getItem('site')
  1592. createNotify(this.modalData)
  1593. .then(({ data }) => {
  1594. if (data && data.code === 0) {
  1595. this.getDataList()
  1596. this.modalFlag = false
  1597. this.$message.success('操作成功')
  1598. } else {
  1599. this.$message.error(data.msg)
  1600. }
  1601. })
  1602. .finally(() => {
  1603. this.saveLoading = false
  1604. })
  1605. } else {
  1606. // 修改
  1607. updateInboundNotification(this.modalData)
  1608. .then(({ data }) => {
  1609. if (data && data.code === 0) {
  1610. this.getDataList()
  1611. this.modalFlag = false
  1612. this.$message.success('操作成功')
  1613. } else {
  1614. this.$message.error(data.msg)
  1615. }
  1616. })
  1617. .finally(() => {
  1618. this.saveLoading = false
  1619. })
  1620. }
  1621. },
  1622. // 删除
  1623. deleteModal() {
  1624. if (this.currentRow.orderType === '采购入库') {
  1625. this.$message.warning('采购入库单据不能编辑!')
  1626. return
  1627. }
  1628. if (this.inboundSelection.length === 0) {
  1629. this.$message.warning('请勾选要删除的单据!')
  1630. return
  1631. }
  1632. this.$confirm(
  1633. `是否删除该 ` + this.inboundSelection.length + ` 条记录?`,
  1634. '提示',
  1635. {
  1636. confirmButtonText: '确定',
  1637. cancelButtonText: '取消',
  1638. type: 'warning',
  1639. }
  1640. ).then(() => {
  1641. let tempData = {
  1642. submitList: this.inboundSelection,
  1643. }
  1644. deleteInboundNotification(tempData).then(({ data }) => {
  1645. if (data && data.code === 0) {
  1646. this.getDataList()
  1647. this.inboundSelection = []
  1648. this.$message.success('操作成功')
  1649. } else {
  1650. this.$message.error(data.msg)
  1651. }
  1652. })
  1653. })
  1654. },
  1655. // 归档
  1656. archiveModal() {},
  1657. // 关闭
  1658. closeModal(row) {
  1659. this.$confirm(`确认关闭 ` + row.notifyNo + ` 记录?`, '提示', {
  1660. confirmButtonText: '确定',
  1661. cancelButtonText: '取消',
  1662. type: 'warning',
  1663. }).then(() => {
  1664. closeInboundNotification(row).then(({ data }) => {
  1665. if (data && data.code === 0) {
  1666. this.getDataList()
  1667. this.$message.success('操作成功')
  1668. } else {
  1669. this.$message.error(data.msg)
  1670. }
  1671. })
  1672. })
  1673. },
  1674. // 下达
  1675. issueModal(row) {
  1676. if (this.currentRow.orderType === '采购入库') {
  1677. this.$message.warning('采购入库单据不能编辑!')
  1678. return
  1679. }
  1680. issueInboundNotification(row).then(({ data }) => {
  1681. if (data && data.code === 0) {
  1682. this.getDataList()
  1683. this.$message.success('操作成功')
  1684. } else {
  1685. this.$message.error(data.msg)
  1686. }
  1687. })
  1688. },
  1689. // 列表表格选择替换
  1690. tabClick(tab, event) {
  1691. // 刷新列表数据
  1692. this.refreshCurrentTabTable()
  1693. },
  1694. // 当前值发生变化的时候修改
  1695. changeCurrentRow(row, oldRow) {
  1696. // 判断是否是获取焦点的事件
  1697. if (row) {
  1698. this.currentRow = JSON.parse(JSON.stringify(row))
  1699. //刷新当前页表
  1700. this.getNotifyNoOrderDetailByType()
  1701. }
  1702. },
  1703. // 复选
  1704. selectionInbound(val) {
  1705. this.inboundSelection = val
  1706. },
  1707. // 明细复选
  1708. selectionInboundDetail(val) {
  1709. this.inboundDetailSelection = val
  1710. },
  1711. rowStyle({ row }) {
  1712. if (this.currentRow.notifyNo === row.notifyNo) {
  1713. return { 'background-color': '#E8F7F6', cursor: 'pointer' }
  1714. }
  1715. },
  1716. // 单机选中信息
  1717. inboundClickRow(row, column) {
  1718. console.log('row', row)
  1719. this.currentRow = JSON.parse(JSON.stringify(row))
  1720. // 点击主表行时,立即刷新并加载入库明细
  1721. this.getNotifyNoOrderDetailByType()
  1722. },
  1723. // 刷新页签的table数据
  1724. refreshCurrentTabTable() {
  1725. if (this.activeTable === 'inboundDetail') {
  1726. this.getInboundDetail()
  1727. }
  1728. },
  1729. // 查询物料缺陷跟踪
  1730. getInboundDetail() {
  1731. let templateData = {
  1732. site: this.currentRow.site,
  1733. buNo: this.currentRow.buNo,
  1734. orderNo: this.currentRow.orderNo,
  1735. }
  1736. /* getInboundDetail(templateData).then(({ data }) => {
  1737. this.detailList = data.rows
  1738. }) */
  1739. },
  1740. // 新增明细
  1741. addInboundDetailModal() {
  1742. if (this.currentRow.orderType === '采购入库') {
  1743. this.$message.warning('采购入库单据不能编辑!')
  1744. return
  1745. }
  1746. this.detailSearchData = {
  1747. site: this.currentRow.site,
  1748. buNo: this.currentRow.buNo,
  1749. orderNo: this.currentRow.orderNo,
  1750. orderType: this.currentRow.orderType,
  1751. relatedOrderNo: '',
  1752. status: '',
  1753. partNo: '',
  1754. partDesc: '',
  1755. partNos: '',
  1756. page: 1,
  1757. limit: 10,
  1758. }
  1759. this.partSelections1 = []
  1760. this.partSelections2 = []
  1761. this.partList1 = []
  1762. this.partList2 = []
  1763. this.pageIndex2 = 1
  1764. this.pageSize2 = 20
  1765. this.totalPage2 = 0
  1766. if (this.currentRow.orderType === '生产入库') {
  1767. this.detailSearchData.status = '已开工'
  1768. }
  1769. this.handleGetProjectPartList()
  1770. },
  1771. handleGetProjectPartList() {
  1772. this.detailSearchData.limit = this.pageSize2
  1773. this.detailSearchData.page = this.pageIndex2
  1774. getInboundPartList(this.detailSearchData).then(({ data }) => {
  1775. if (data && data.code === 0) {
  1776. this.partList1 = data.page.list
  1777. this.pageIndex2 = data.page.currPage
  1778. this.pageSize2 = data.page.pageSize
  1779. this.totalPage2 = data.page.totalCount
  1780. this.detailModal = true
  1781. }
  1782. })
  1783. },
  1784. chooseSOSModal() {
  1785. this.seqNoData = {
  1786. site: localStorage.getItem('site'),
  1787. orderno: '',
  1788. seqno: '',
  1789. sResourceid: '',
  1790. sWorkcenterno: '',
  1791. operatorId: '',
  1792. sShiftno: '',
  1793. startDate: this.dayjs().format('YYYY-MM-DD'),
  1794. endDate: this.dayjs().format('YYYY-MM-DD'),
  1795. }
  1796. this.searchSOSRouting()
  1797. this.seqNoModalFlag = true
  1798. },
  1799. searchSOSRouting() {
  1800. getSOScheduledRoutingListForIssure(this.seqNoData).then(({ data }) => {
  1801. if (data.code === 0) {
  1802. this.seqNoList = data.rows
  1803. }
  1804. })
  1805. },
  1806. // 可选物料
  1807. partClickRow1(row) {
  1808. this.$refs.partTable1.toggleRowSelection(row)
  1809. },
  1810. // 已有物料
  1811. partClickRow2(row) {
  1812. this.$refs.partTable2.toggleRowSelection(row)
  1813. },
  1814. selectionPart1(val) {
  1815. this.partSelections1 = val
  1816. },
  1817. selectionPart2(val) {
  1818. this.partSelections2 = val
  1819. },
  1820. chooseSOS(row) {
  1821. if (this.dataList.length > 0) {
  1822. let stop = false
  1823. for (let i = 0; i < this.dataList.length; i++) {
  1824. if (this.dataList[i].seqNo == row.seqno) {
  1825. stop = true
  1826. }
  1827. }
  1828. if (stop) {
  1829. this.$alert('已经选择过此派工单,请返回点击明细直接操作!!', '提示', {
  1830. confirmButtonText: '确定',
  1831. })
  1832. return false
  1833. }
  1834. }
  1835. this.notifyOrderData.partNo = row.partNo
  1836. this.notifyOrderData.orderNo = row.orderNo
  1837. this.notifyOrderData.itemNo = row.itemNo
  1838. this.notifyOrderData.seqNo = row.seqNo
  1839. this.notifyOrderData.partDesc = row.partDesc
  1840. this.notifyOrderData.qtyRequired = row.qtyRequired
  1841. this.notifyOrderData.sResourceID = row.sResourceID
  1842. this.notifyOrderData.issureQty = ''
  1843. this.notifyOrderData.needDate = this.dayjs().format('YYYY-MM-DD HH:mm')
  1844. this.notifyOrderData.locationNo = row.sResourceID
  1845. this.saveSeqNoModalFlag = true
  1846. },
  1847. qtyAllForSeqNo() {
  1848. this.notifyOrderData.issureQty = this.notifyOrderData.qtyRequired
  1849. },
  1850. saveSOS() {
  1851. if (
  1852. this.notifyOrderData.needDate == null ||
  1853. this.notifyOrderData.needDate == ''
  1854. ) {
  1855. this.$message.warning('请选择时间!')
  1856. return false
  1857. }
  1858. if (
  1859. this.notifyOrderData.issureQty == null ||
  1860. this.notifyOrderData.issureQty == '' ||
  1861. this.notifyOrderData.issureQty <= 0
  1862. ) {
  1863. this.$message.warning('请填写领取数量!')
  1864. return false
  1865. }
  1866. let row = this.notifyOrderData
  1867. if (this.dataList.length > 0) {
  1868. let stop = false
  1869. for (let i = 0; i < this.dataList.length; i++) {
  1870. if (this.dataList[i].seqNo == row.seqno) {
  1871. stop = true
  1872. }
  1873. }
  1874. if (stop) {
  1875. this.$alert('已经选择过此工单,请返回点击明细直接操作!!', '提示', {
  1876. confirmButtonText: '确定',
  1877. })
  1878. return false
  1879. }
  1880. }
  1881. this.$confirm('确定选择工单' + row.seqno + '?', '提示', {
  1882. confirmButtonText: '确定',
  1883. cancelButtonText: '取消',
  1884. type: 'warning',
  1885. }).then(() => {
  1886. let inData = {
  1887. site: localStorage.getItem('site'),
  1888. notifyNo: this.notifyNo,
  1889. fGPartNo: row.partNo,
  1890. sOOrderNo: row.orderno,
  1891. opsItemNo: row.itemno,
  1892. seqNo: row.seqno,
  1893. locationNo: row.locationNo,
  1894. needDate: row.needDate,
  1895. issureQty: row.issureQty,
  1896. }
  1897. saveSOIssueNotifyOrderList(inData).then(({ data }) => {
  1898. if (data.code === 0) {
  1899. this.saveSeqNoModalFlag = false
  1900. this.getNotifyNoOrderDetailByType()
  1901. this.enterSOS(row)
  1902. this.itemNo = data.itemNo
  1903. } else {
  1904. this.$alert(data.msg, '错误', {
  1905. confirmButtonText: '确定',
  1906. })
  1907. }
  1908. })
  1909. })
  1910. },
  1911. getNotifyNoOrderDetailByType() {
  1912. if (!this.currentRow || !this.currentRow.notifyNo) {
  1913. this.detailList = []
  1914. return
  1915. }
  1916. let inData = {
  1917. site: this.currentRow.site || localStorage.getItem('site'),
  1918. notifyNo: this.currentRow.notifyNo,
  1919. }
  1920. getNotifyNoOrderDetailByType(inData)
  1921. .then(({ data }) => {
  1922. if (data.code === 0) {
  1923. this.detailList = data.rows || []
  1924. } else {
  1925. this.detailList = []
  1926. }
  1927. })
  1928. .catch(() => {
  1929. this.detailList = []
  1930. })
  1931. },
  1932. enterSOS(row) {
  1933. this.seqNoModalFlag = false
  1934. this.materialModalFlag = true
  1935. this.sobomList = []
  1936. this.sobomData = {
  1937. orderno: row.orderno,
  1938. seqno: row.seqno,
  1939. partNo: row.partNo,
  1940. }
  1941. this.bomLoadFlag = true
  1942. let inData = {
  1943. site: localStorage.getItem('site'),
  1944. notifyNo: this.notifyNo,
  1945. orderno: row.orderno,
  1946. seqno: row.seqno,
  1947. partNo: row.partNo,
  1948. itemno: row.itemno,
  1949. }
  1950. getSOSBOMForIssure(inData).then(({ data }) => {
  1951. this.bomLoadFlag = false
  1952. if (data.code === 0) {
  1953. this.sobomList = data.rows
  1954. }
  1955. })
  1956. },
  1957. // 改变事件
  1958. searchTypeChange() {
  1959. // 使用 map 提取 partNo 并加上单引号
  1960. let partNos = this.partList2.map((part) => part.partNo)
  1961. // 使用 join 将 partNo 连接成一个字符串
  1962. this.detailSearchData.partNos = partNos.join(',')
  1963. this.handleGetProjectPartList()
  1964. },
  1965. // 添加物料
  1966. addPart() {
  1967. if (this.partSelections1 == null || this.partSelections1.length === 0) {
  1968. this.$message.warning('请选择可选物料!')
  1969. return
  1970. }
  1971. this.partSelections1.forEach((item) => {
  1972. this.partList2.push(item)
  1973. })
  1974. this.searchTypeChange()
  1975. },
  1976. // 删除物料
  1977. deletePart() {
  1978. if (this.partSelections2 == null || this.partSelections2.length === 0) {
  1979. this.$message.warning('请选择已选物料!')
  1980. return
  1981. }
  1982. this.partSelections2.forEach((item) => {
  1983. // 使用 filter 过滤掉 partList2 中与 selection.part_no 相同的项
  1984. this.partList2 = this.partList2.filter(
  1985. (part) => part.partNo !== item.partNo
  1986. )
  1987. })
  1988. this.searchTypeChange()
  1989. },
  1990. // 新增明细
  1991. saveInboundDetail() {
  1992. let tempData = {
  1993. orderNo: this.detailSearchData.orderNo,
  1994. createdBy: this.$store.state.user.name,
  1995. partList: this.partList2,
  1996. }
  1997. this.saveLoading = true
  1998. saveInboundDetail(tempData)
  1999. .then(({ data }) => {
  2000. if (data && data.code === 0) {
  2001. this.getInboundDetail()
  2002. this.detailModal = false
  2003. this.$message.success('操作成功')
  2004. } else {
  2005. this.$message.error(data.msg)
  2006. }
  2007. })
  2008. .finally(() => {
  2009. this.saveLoading = false
  2010. })
  2011. },
  2012. // 删除物料缺陷跟踪
  2013. deleteInboundDetail() {
  2014. if (this.currentRow.orderType === '采购入库') {
  2015. this.$message.warning('采购入库单据不能编辑!')
  2016. return
  2017. }
  2018. if (this.inboundDetailSelection.length === 0) {
  2019. this.$message.warning('请勾选要删除的单据!')
  2020. return
  2021. }
  2022. this.$confirm(
  2023. `是否删除该 ` + this.inboundDetailSelection.length + ` 条记录?`,
  2024. '提示',
  2025. {
  2026. confirmButtonText: '确定',
  2027. cancelButtonText: '取消',
  2028. type: 'warning',
  2029. }
  2030. ).then(() => {
  2031. let tempData = {
  2032. submitList: this.inboundDetailSelection,
  2033. }
  2034. deleteInboundDetail(tempData).then(({ data }) => {
  2035. if (data && data.code === 0) {
  2036. this.getInboundDetail()
  2037. this.inboundDetailSelection = []
  2038. this.$message.success('操作成功')
  2039. } else {
  2040. this.$message.error(data.msg)
  2041. }
  2042. })
  2043. })
  2044. },
  2045. // 批量编辑模态框
  2046. editBatchModel() {
  2047. if (this.currentRow.orderType === '采购入库') {
  2048. this.$message.warning('采购入库单据不能编辑!')
  2049. return
  2050. }
  2051. if (this.editBatchVisible) {
  2052. this.editBatchVisible = false
  2053. } else {
  2054. this.editBatchVisible = true
  2055. }
  2056. },
  2057. // 批量保存
  2058. batchModel() {
  2059. let params = []
  2060. params = this.detailList
  2061. this.saveLoading = true
  2062. updateInboundDetail(params)
  2063. .then(({ data }) => {
  2064. if (data && data.code === 0) {
  2065. this.getInboundDetail()
  2066. this.$message.success(data.msg)
  2067. this.editBatchVisible = false
  2068. } else {
  2069. this.$message.error(data.msg)
  2070. }
  2071. })
  2072. .finally(() => {
  2073. this.saveLoading = false
  2074. })
  2075. },
  2076. // 入库明细
  2077. inboundDetailModal(row) {
  2078. getInboundDetail2(row).then(({ data }) => {
  2079. if (data && data.code === 0) {
  2080. this.detailList2 = data.rows
  2081. } else {
  2082. this.detailList2 = []
  2083. }
  2084. })
  2085. this.detailModal2 = true
  2086. },
  2087. // 库位输入校验
  2088. supplierBlur(tagNo) {
  2089. let tempData = {
  2090. tagno: tagNo,
  2091. conditionSql:
  2092. " and SupplierID = '" +
  2093. this.modalData.supplierId +
  2094. "'" +
  2095. " and site = '" +
  2096. this.modalData.site +
  2097. "'",
  2098. }
  2099. getChooselist(tempData).then(({ data }) => {
  2100. if (data && data.code === 0) {
  2101. if (data.baseListData.length > 0) {
  2102. this.modalData.supplierId = data.baseListData[0].SupplierID
  2103. this.modalData.supplierName = data.baseListData[0].SupplierName
  2104. } else {
  2105. this.modalData.supplierName = ''
  2106. }
  2107. }
  2108. })
  2109. },
  2110. chooseWareHouse(row) {
  2111. this.tempWareHouseRow = row
  2112. this.getBaseList(20)
  2113. },
  2114. saveNoOrderMaterialDetail() {
  2115. for (let i = 0; i < this.sobomList.length; i++) {
  2116. if (
  2117. this.sobomList[i].qtyToIssue === '' ||
  2118. this.sobomList[i].qtyToIssue == null
  2119. ) {
  2120. this.$message.warning('第'+(i+1)+'行数量为空,请填写申请数量!')
  2121. return false
  2122. }
  2123. this.sobomList[i].notifyNo = this.currentRow.notifyNo
  2124. this.sobomList[i].site = this.$store.state.user.site
  2125. }
  2126. let materialList = this.sobomList.filter((item) => item.qtyToIssue > 0)
  2127. if (materialList.length == 0) {
  2128. this.$alert('没有需要保存的内容!', '提示', {
  2129. confirmButtonText: '确定',
  2130. })
  2131. return false
  2132. }
  2133. console.log('this.sobomList', materialList)
  2134. saveNoOrderMaterialDetail(materialList).then(({ data }) => {
  2135. if (data.code === 0) {
  2136. this.materialModalFlag = false
  2137. this.getNotifyNoOrderDetailByType()
  2138. this.$message.success('操作成功')
  2139. } else {
  2140. this.$alert(data.msg, '错误', {
  2141. confirmButtonText: '确定',
  2142. })
  2143. }
  2144. })
  2145. },
  2146. // 获取基础数据列表S
  2147. getBaseList(val, type) {
  2148. this.tagNo = val
  2149. this.tagType = type
  2150. this.$nextTick(() => {
  2151. let strVal = ''
  2152. if (val === 506) {
  2153. strVal = this.modalData.supplierId
  2154. this.$refs.baseList.init(val, strVal)
  2155. }
  2156. if (val === 20) {
  2157. strVal = this.tempWareHouseRow.inWarehouse
  2158. this.$refs.baseList.init(val, strVal)
  2159. }
  2160. })
  2161. },
  2162. // 列表方法的回调
  2163. getBaseData(val) {
  2164. if (this.tagNo === 506) {
  2165. this.modalData.supplierId = val.SupplierID
  2166. this.modalData.supplierName = val.SupplierName
  2167. }
  2168. if (this.tagNo === 20) {
  2169. this.tempWareHouseRow.inWarehouse = val.WareHouseID
  2170. this.tempWareHouseRow.inWarehouseName = val.WareHouseName
  2171. console.log(this.tempWareHouseRow)
  2172. }
  2173. },
  2174. async exportExcel() {
  2175. this.searchData.limit = -1
  2176. this.searchData.page = 1
  2177. excel.exportTable({
  2178. url: '/inbound/searchInboundNotification',
  2179. columnMapping: this.columnList, //可以直接用table,不需要的列就剔除
  2180. mergeSetting: [], //需要合并的列
  2181. params: this.searchData,
  2182. fileName: this.exportName + '.xlsx',
  2183. rowFetcher: (res) => res.data,
  2184. columnFormatter: [],
  2185. dropColumns: [],
  2186. })
  2187. },
  2188. // 动态列开始 获取 用户保存的 格式列
  2189. async getTableUserColumn(tableId, columnId) {
  2190. let queryTableUser = {
  2191. userId: this.$store.state.user.name,
  2192. functionId: this.$route.meta.menuId,
  2193. tableId: tableId,
  2194. status: true,
  2195. languageCode: this.$i18n.locale,
  2196. }
  2197. await getTableUserListLanguage(queryTableUser).then(({ data }) => {
  2198. if (data.rows.length > 0) {
  2199. switch (columnId) {
  2200. case 1:
  2201. this.columnList = data.rows
  2202. break
  2203. }
  2204. } else {
  2205. this.getColumnList(tableId, columnId)
  2206. }
  2207. })
  2208. },
  2209. enterSOSDetail(row) {
  2210. let rows = {
  2211. site: this.$store.state.user.site,
  2212. notifyNo: this.currentRow.notifyNo,
  2213. soorderNo: row.soorderNo,
  2214. seqNo: row.seqNo,
  2215. partNo: row.fgpartNo,
  2216. itemNo: row.itemNo,
  2217. }
  2218. this.clickrow = row
  2219. this.searchUnissueNotifyMaterialList(rows)
  2220. },
  2221. searchUnissueNotifyMaterialList(row) {
  2222. this.bomLoadFlag = true
  2223. this.materialModalFlag = true
  2224. this.sobomData = {
  2225. orderNo: row.soorderNo || '',
  2226. seqNo: row.seqNo || '',
  2227. partNo: row.partNo || row.fgpartNo || '',
  2228. }
  2229. getNoOrderMaterialList(row)
  2230. .then(({ data }) => {
  2231. if (data.code === 0) {
  2232. this.sobomList = data.rows
  2233. }
  2234. })
  2235. .finally(() => {
  2236. this.bomLoadFlag = false
  2237. })
  2238. },
  2239. // 从申请明细弹框打开选择物料弹框
  2240. openSelectMaterialModalForDetail() {
  2241. this.isMaterialDetailModal = true
  2242. // 设置模板编号和名称(使用生产订单号)
  2243. this.modelCode = this.sobomData.orderNo || ''
  2244. this.modelName = this.sobomData.partNo || ''
  2245. // 将sobomList中的数据转换为选择物料弹框需要的格式,显示在右侧"已有物料"列表中
  2246. this.selectedMaterialList = this.sobomList.map(item => {
  2247. const convertedItem = JSON.parse(JSON.stringify(item))
  2248. // 将qtyToIssue转换为applyQty
  2249. convertedItem.applyQty = convertedItem.qtyToIssue || 0
  2250. // 确保partNo存在(可能使用componentPartNo)
  2251. if (!convertedItem.partNo && convertedItem.componentPartNo) {
  2252. convertedItem.partNo = convertedItem.componentPartNo
  2253. }
  2254. return convertedItem
  2255. })
  2256. // 重置分页
  2257. this.availableMaterialPage = 1
  2258. this.availableMaterialLimit = 100
  2259. this.$set(
  2260. this,
  2261. 'componentPartNo',
  2262. ''
  2263. ) // 清空物料编码搜索条件
  2264. // 加载可选物料列表
  2265. this.loadAvailableMaterialList()
  2266. // 打开弹框
  2267. this.selectMaterialModalFlag = true
  2268. },
  2269. // 加载可选物料列表
  2270. loadAvailableMaterialList() {
  2271. this.selectMaterialLoading = true
  2272. const params = {
  2273. page: this.availableMaterialPage,
  2274. limit: this.availableMaterialLimit,
  2275. componentPartNo: this.componentPartNo,
  2276. }
  2277. noOrderList(params)
  2278. .then(({ data }) => {
  2279. this.selectMaterialLoading = false
  2280. if (data && data.code === 0) {
  2281. if (data.page) {
  2282. // 过滤掉已选中的物料
  2283. const selectedPartNos = this.selectedMaterialList.map(
  2284. (item) => item.partNo || item.componentPartNo
  2285. )
  2286. // 如果是从申请明细弹框打开的,还需要过滤掉sobomList中已存在的物料
  2287. if (this.isMaterialDetailModal && this.sobomList && this.sobomList.length > 0) {
  2288. const sobomPartNos = this.sobomList.map(
  2289. (item) => item.partNo || item.componentPartNo
  2290. )
  2291. selectedPartNos.push(...sobomPartNos)
  2292. }
  2293. this.availableMaterialList = data.page.list.filter(
  2294. (item) => !selectedPartNos.includes(item.partNo)
  2295. )
  2296. } else {
  2297. this.availableMaterialList = []
  2298. }
  2299. this.availableMaterialPage = data.page.currPage
  2300. this.availableMaterialLimit = data.page.pageSize
  2301. this.availableMaterialTotal = data.page.totalCount
  2302. } else {
  2303. this.availableMaterialList = []
  2304. if (data && data.msg) {
  2305. this.$message.warning(data.msg)
  2306. }
  2307. }
  2308. })
  2309. .catch((e) => {
  2310. this.selectMaterialLoading = false
  2311. this.availableMaterialList = []
  2312. this.availableMaterialTotal = 0
  2313. this.$message.error(e.msg || '加载数据失败')
  2314. })
  2315. },
  2316. // 左侧表格分页 - 每页条数改变
  2317. handleAvailableSizeChange(val) {
  2318. this.availableMaterialLimit = val
  2319. this.availableMaterialPage = 1
  2320. this.loadAvailableMaterialList()
  2321. },
  2322. // 左侧表格分页 - 当前页改变
  2323. handleAvailableCurrentChange(val) {
  2324. this.availableMaterialPage = val
  2325. this.loadAvailableMaterialList()
  2326. },
  2327. // 处理左侧表格选择变化
  2328. handleAvailableSelectionChange(selection) {
  2329. this.availableMaterialSelections = selection
  2330. },
  2331. // 处理右侧表格选择变化
  2332. handleSelectedSelectionChange(selection) {
  2333. this.selectedMaterialSelections = selection
  2334. },
  2335. // 左侧表格行点击
  2336. itemClickRow1(row) {
  2337. // 可以在这里实现行点击逻辑
  2338. },
  2339. // 右侧表格行点击
  2340. itemClickRow2(row) {
  2341. // 可以在这里实现行点击逻辑
  2342. },
  2343. // 判断行是否可选
  2344. selectFlag(row, index) {
  2345. return true // 所有行都可选
  2346. },
  2347. // 添加到已选列表
  2348. addToSelected() {
  2349. if (this.availableMaterialSelections.length === 0) {
  2350. this.$message.warning('请先选择要添加的物料!')
  2351. return false
  2352. }
  2353. // 将选中的项添加到已选列表
  2354. this.availableMaterialSelections.forEach((item) => {
  2355. // 检查是否已存在(使用partNo作为唯一标识)
  2356. const itemNo = item.partNo
  2357. const exists = this.selectedMaterialList.some(
  2358. (row) => row.partNo === itemNo
  2359. )
  2360. if (!exists) {
  2361. const newItem = JSON.parse(JSON.stringify(item))
  2362. this.selectedMaterialList.push(newItem)
  2363. }
  2364. })
  2365. const addCount = this.availableMaterialSelections.length
  2366. // 清空选择
  2367. this.availableMaterialSelections = []
  2368. // 重新加载左侧数据(因为分页,需要重新获取以过滤掉已选中的)
  2369. this.loadAvailableMaterialList()
  2370. this.$message.success(`成功添加 ${addCount} 条数据`)
  2371. },
  2372. // 从已选列表移除
  2373. removeFromSelected() {
  2374. if (this.selectedMaterialSelections.length === 0) {
  2375. this.$message.warning('请先选择要删除的物料!')
  2376. return false
  2377. }
  2378. // 从已选列表中移除
  2379. const selectedItemNos = this.selectedMaterialSelections.map(
  2380. (item) => item.partNo
  2381. )
  2382. const removeCount = this.selectedMaterialSelections.length
  2383. this.selectedMaterialList = this.selectedMaterialList.filter(
  2384. (item) =>
  2385. !selectedItemNos.includes(
  2386. item.partNo
  2387. )
  2388. )
  2389. // 清空选择
  2390. this.selectedMaterialSelections = []
  2391. // 重新加载左侧数据(因为分页,需要重新获取,移除的项可能会出现在当前页)
  2392. this.loadAvailableMaterialList()
  2393. this.$message.success(`成功移除 ${removeCount} 条数据`)
  2394. },
  2395. // 确认选择物料
  2396. confirmSelectMaterial() {
  2397. if (this.isMaterialDetailModal) {
  2398. // 从申请明细弹框打开的情况,将右侧"已有物料"列表的完整数据更新到sobomList
  2399. const selectedItems = JSON.parse(JSON.stringify(this.selectedMaterialList))
  2400. // 将选中的物料转换为sobomList需要的格式
  2401. selectedItems.forEach(item => {
  2402. // 将applyQty转换为qtyToIssue
  2403. item.qtyToIssue = item.applyQty || 0
  2404. // 设置itemNo(使用clickrow中的itemNo)
  2405. item.itemNo = this.clickrow.itemNo
  2406. item.notifyNo = this.clickrow.notifyNo || this.currentRow.notifyNo
  2407. item.soorderNo = this.clickrow.soorderNo
  2408. item.site = this.$store.state.user.site
  2409. // 确保componentPartNo存在
  2410. if (!item.componentPartNo) {
  2411. item.componentPartNo = item.partNo
  2412. }
  2413. })
  2414. // 将右侧"已有物料"列表的完整数据替换sobomList(包括原有和新增的)
  2415. this.sobomList = selectedItems
  2416. this.isMaterialDetailModal = false
  2417. }
  2418. // 关闭弹框
  2419. this.selectMaterialModalFlag = false
  2420. // 清空数据
  2421. this.availableMaterialList = []
  2422. this.selectedMaterialList = []
  2423. this.availableMaterialSelections = []
  2424. this.selectedMaterialSelections = []
  2425. this.$message.success('操作成功')
  2426. },
  2427. // 删除
  2428. deleteNotifySOS(row) {
  2429. this.$confirm(`是否删除这个工单的申请信息?`, '提示', {
  2430. confirmButtonText: '确定',
  2431. cancelButtonText: '取消',
  2432. type: 'warning',
  2433. })
  2434. .then(() => {
  2435. deleteNotifyUnissue(row).then(({ data }) => {
  2436. if (data && data.code === 0) {
  2437. this.getNotifyNoOrderDetailByType()
  2438. this.$message({
  2439. message: '操作成功',
  2440. type: 'success',
  2441. duration: 1500,
  2442. onClose: () => {},
  2443. })
  2444. } else {
  2445. this.$alert(data.msg, '错误', {
  2446. confirmButtonText: '确定',
  2447. })
  2448. }
  2449. })
  2450. })
  2451. .catch(() => {})
  2452. },
  2453. // 获取 tableDefault 列
  2454. async getColumnList(tableId, columnId) {
  2455. let queryTable = {
  2456. functionId: this.$route.meta.menuId,
  2457. tableId: tableId,
  2458. languageCode: this.$i18n.locale,
  2459. }
  2460. await getTableDefaultListLanguage(queryTable).then(({ data }) => {
  2461. if (data.rows.length !== 0) {
  2462. switch (columnId) {
  2463. case 1:
  2464. this.columnList = data.rows
  2465. break
  2466. }
  2467. }
  2468. })
  2469. },
  2470. //获取按钮的权限数据
  2471. getButtonAuthData() {
  2472. if (this.$store.state.user.id === 1) {
  2473. return
  2474. }
  2475. let searchFlag = this.isAuth(this.menuId + ':search')
  2476. let saveFlag = this.isAuth(this.menuId + ':save')
  2477. let updateFlag = this.isAuth(this.menuId + ':update')
  2478. let deleteFlag = this.isAuth(this.menuId + ':delete')
  2479. let archiveFlag = this.isAuth(this.menuId + ':archive')
  2480. let closeFlag = this.isAuth(this.menuId + ':close')
  2481. let issueFlag = this.isAuth(this.menuId + ':issue')
  2482. //处理页面的权限数据
  2483. this.authSearch = !searchFlag
  2484. this.authSave = !saveFlag
  2485. this.authUpdate = !updateFlag
  2486. this.authDelete = !deleteFlag
  2487. this.authArchive = !archiveFlag
  2488. this.authClose = !closeFlag
  2489. this.authIssue = !issueFlag
  2490. },
  2491. /**
  2492. * @Description 取消下达处理方法 - rqrq
  2493. * @param row 当前行数据
  2494. */
  2495. cancelIssueShipmentHandle(row) {
  2496. // 先判断发起人是否有未下达的shipment申请单 - rqrq
  2497. let checkData = {
  2498. site: row.site,
  2499. username: row.username,
  2500. }
  2501. checkUserHasUnissueShipment(checkData)
  2502. .then(({ data }) => {
  2503. if (data && data.code === 0) {
  2504. // 如果有未下达的申请单 - rqrq
  2505. if (data.row != null) {
  2506. this.$alert('该用户有未下达的申请单,请先处理', '提示', {
  2507. confirmButtonText: '确定',
  2508. })
  2509. return
  2510. }
  2511. // 没有未下达的申请单,执行取消下达 - rqrq
  2512. this.$confirm(
  2513. `确定取消下达发货申请单【${row.notifyNo}】吗?`,
  2514. '提示',
  2515. {
  2516. confirmButtonText: '确定',
  2517. cancelButtonText: '取消',
  2518. type: 'warning',
  2519. }
  2520. )
  2521. .then(() => {
  2522. let cancelData = {
  2523. site: row.site,
  2524. notifyNo: row.notifyNo,
  2525. }
  2526. cancelIssueShipment(cancelData)
  2527. .then(({ data }) => {
  2528. if (data && data.code === 0) {
  2529. this.$message.success('取消下达成功')
  2530. // 重新加载数据 - rqrq
  2531. this.getDataList()
  2532. } else {
  2533. this.$alert(data.msg, '错误', {
  2534. confirmButtonText: '确定',
  2535. })
  2536. }
  2537. })
  2538. .catch(() => {
  2539. this.$message.error('取消下达失败')
  2540. })
  2541. })
  2542. .catch(() => {
  2543. // 用户取消操作 - rqrq
  2544. })
  2545. } else {
  2546. this.$alert(data.msg, '错误', {
  2547. confirmButtonText: '确定',
  2548. })
  2549. }
  2550. })
  2551. .catch(() => {
  2552. this.$message.error('检查用户申请单失败')
  2553. })
  2554. },
  2555. /**
  2556. * @Description 预览库存匹配情况 - rqrq
  2557. * @param row 当前申请单行数据
  2558. */
  2559. previewInventory(row) {
  2560. this.currentNotifyRow = row // 保存当前通知单行数据 - rqrq
  2561. this.previewDialogVisible = true
  2562. this.previewLoading = true
  2563. this.previewData = []
  2564. let inData = {
  2565. site: row.site,
  2566. notifyNo: row.notifyNo
  2567. }
  2568. checkIssueNotifyInventory(inData).then(({data}) => {
  2569. this.previewLoading = false
  2570. if (data && data.code === 0) {
  2571. this.previewData = data.rows || []
  2572. console.log('库存预览数据:', this.previewData)
  2573. } else {
  2574. this.$alert(data.msg, '错误', {
  2575. confirmButtonText: '确定'
  2576. })
  2577. }
  2578. }).catch(() => {
  2579. this.previewLoading = false
  2580. this.$message.error('获取库存预览失败')
  2581. })
  2582. },
  2583. /**
  2584. * @Description 根据订单满足状态设置行样式 - rqrq
  2585. */
  2586. getRowClassName({row}) {
  2587. if (row.orderSatisfactionStatus === 1) {
  2588. return 'success-row' // 绿色:完全立库满足
  2589. } else if (row.orderSatisfactionStatus === 2) {
  2590. return 'warning-row' // 黄色:立库+分切区满足
  2591. } else if (row.orderSatisfactionStatus === 3) {
  2592. return 'danger-row' // 红色:存在不满足
  2593. }
  2594. return ''
  2595. },
  2596. /**
  2597. * @Description 从预览对话框推送至WCS - rqrq
  2598. */
  2599. pushToWCS() {
  2600. // 全部推送 后端判断 - rqrq
  2601. const validData = this.previewData
  2602. if (validData.length === 0) {
  2603. this.$message.warning('没有可推送的数据')
  2604. return
  2605. }
  2606. this.$confirm(`确认推送 ${validData.length} 条数据至WCS?`, '提示', {
  2607. confirmButtonText: '确定',
  2608. cancelButtonText: '取消',
  2609. type: 'warning'
  2610. }).then(() => {
  2611. // 显示加载状态 - rqrq
  2612. this.previewLoading = true
  2613. const inData = {
  2614. site: this.currentNotifyRow.site,
  2615. notifyNo: this.currentNotifyRow.notifyNo,
  2616. inventoryList: validData
  2617. }
  2618. pushInventoryToWcs(inData).then(({data}) => {
  2619. this.previewLoading = false
  2620. if (data && data.code === 0) {
  2621. this.$message({
  2622. message: '推送WCS成功',
  2623. type: 'success',
  2624. duration: 1500
  2625. })
  2626. this.previewDialogVisible = false
  2627. this.getDataList() // 刷新列表
  2628. } else {
  2629. this.$alert(data.msg || '推送失败', '错误', {
  2630. confirmButtonText: '确定'
  2631. })
  2632. }
  2633. }).catch((error) => {
  2634. this.previewLoading = false
  2635. this.$message.error(error.message || '推送WCS失败,请重试')
  2636. })
  2637. }).catch(() => {
  2638. // 用户取消操作 - rqrq
  2639. console.log('用户取消推送')
  2640. })
  2641. },
  2642. },
  2643. }
  2644. </script>
  2645. <style scoped>
  2646. /deep/ .customer-tab .el-tabs__content {
  2647. padding: 5px !important;
  2648. }
  2649. .el-table /deep/ .cell {
  2650. height: auto;
  2651. line-height: 1.5;
  2652. }
  2653. /deep/ .wrap-text-column .cell {
  2654. white-space: normal !important;
  2655. word-break: break-all !important;
  2656. line-height: 1.5 !important;
  2657. }
  2658. /* rqrq - 表格行样式:根据满足状态显示不同背景色 */
  2659. /deep/ .el-table .success-row {
  2660. background-color: #f0f9ff !important;
  2661. border-left: 3px solid #67C23A;
  2662. }
  2663. /deep/ .el-table .warning-row {
  2664. background-color: #fdf6ec !important;
  2665. border-left: 3px solid #E6A23C;
  2666. }
  2667. /deep/ .el-table .danger-row {
  2668. background-color: #fef0f0 !important;
  2669. border-left: 3px solid #F56C6C;
  2670. }
  2671. /deep/ .el-table .success-row:hover > td {
  2672. background-color: #ecf5ff !important;
  2673. }
  2674. /deep/ .el-table .warning-row:hover > td {
  2675. background-color: #faecd8 !important;
  2676. }
  2677. /deep/ .el-table .danger-row:hover > td {
  2678. background-color: #fde2e2 !important;
  2679. }
  2680. </style>