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.

2142 lines
74 KiB

4 months ago
4 months ago
4 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.orderNo" clearable style="width: 120px"></el-input>
  7. </el-form-item>
  8. <el-form-item :label="'单据类型'">
  9. <el-select v-model="searchData.orderType" clearable style="width: 100px">
  10. <el-option label="采购入库" value="采购入库"></el-option>
  11. <el-option label="生产入库" value="生产入库"></el-option>
  12. <el-option label="销售退货" value="销售退货"></el-option>
  13. <el-option label="其他入库" value="其他入库"></el-option>
  14. </el-select>
  15. </el-form-item>
  16. <el-form-item :label="'单据状态'">
  17. <el-select multiple collapse-tags v-model="searchData.orderStatusList" clearable style="width: 160px">
  18. <el-option label="草稿" value="草稿"></el-option>
  19. <el-option label="待检验" value="待检验"></el-option>
  20. <el-option label="编辑中" value="编辑中"></el-option>
  21. <el-option label="待入库" value="待入库"></el-option>
  22. <el-option label="已完成" value="已完成"></el-option>
  23. <el-option label="已关闭" value="已关闭"></el-option>
  24. <el-option label="已归档" value="已归档"></el-option>
  25. </el-select>
  26. </el-form-item>
  27. <el-form-item :label="'部门'">
  28. <el-select v-model="searchData.departmentNo" clearable placeholder="请选择" style="width: 140px">
  29. <el-option
  30. v-for="item in departmentList"
  31. :key="item.departmentNo"
  32. :label="item.departmentDesc"
  33. :value="item.departmentNo">
  34. </el-option>
  35. </el-select>
  36. </el-form-item>
  37. <el-form-item :label="'要求入库日期'">
  38. <el-date-picker
  39. style="width: 120px"
  40. v-model="searchData.startDate"
  41. type="date"
  42. value-format="yyyy-MM-dd"
  43. placeholder="选择日期">
  44. </el-date-picker>
  45. </el-form-item>
  46. <el-form-item style="margin-top: 23px;">
  47. <laber style="margin-left: -9px;font-size: 19px">&#10142</laber>
  48. </el-form-item>
  49. <el-form-item :label="' '">
  50. <el-date-picker
  51. style="width: 120px"
  52. v-model="searchData.endDate"
  53. type="date"
  54. value-format="yyyy-MM-dd"
  55. placeholder="选择日期">
  56. </el-date-picker>
  57. </el-form-item>
  58. <el-form-item :label="' '">
  59. <el-button v-if="!authSearch" type="primary" :loading="searchLoading" @click="getDataList()">查询</el-button>
  60. <el-button v-if="!authSave" type="primary" @click="saveModal()">新增</el-button>
  61. <el-button v-if="!authDelete" type="primary" @click="deleteModal()">删除</el-button>
  62. <el-button v-if="!authArchive" type="primary" @click="archiveModal()">归档</el-button>
  63. </el-form-item>
  64. <el-form-item :label="' '">
  65. <el-button @click="exportExcel()" type="primary" style="margin-left: 2px">{{'导出'}}</el-button>
  66. </el-form-item>
  67. </el-form>
  68. <!-- 展示列表 -->
  69. <el-table
  70. :height="height"
  71. :data="dataList"
  72. border
  73. v-loading="searchLoading"
  74. ref="inboundTable"
  75. :row-style="rowStyle"
  76. @row-click="inboundClickRow"
  77. @current-change="changeCurrentRow"
  78. @selection-change="selectionInbound"
  79. style="width: 100%;">
  80. <el-table-column
  81. type="selection"
  82. header-align="center"
  83. align="center"
  84. width="50">
  85. </el-table-column>
  86. <el-table-column
  87. v-for="(item,index) in columnList" :key="index"
  88. :sortable="item.columnSortable"
  89. :prop="item.columnProp"
  90. :header-align="item.headerAlign"
  91. :show-overflow-tooltip="item.showOverflowTooltip"
  92. :align="item.align"
  93. :fixed="item.fixed==''?false:item.fixed"
  94. :min-width="item.columnWidth"
  95. :label="item.columnLabel">
  96. <template slot-scope="scope">
  97. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  98. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  99. </template>
  100. </el-table-column>
  101. <el-table-column
  102. fixed="right"
  103. header-align="center"
  104. align="center"
  105. width="120"
  106. label="操作">
  107. <template slot-scope="scope">
  108. <template v-if="!authUpdate">
  109. <el-link v-if="scope.row.orderStatus === '草稿' || scope.row.orderStatus === '待检验' || scope.row.orderStatus === '编辑中'" style="cursor: pointer" @click="updateModal(scope.row)">编辑</el-link>
  110. </template>
  111. <template v-if="!authClose">
  112. <el-link v-if="scope.row.orderStatus !== '草稿' && scope.row.orderStatus !== '已关闭'" style="cursor: pointer" @click="closeModal(scope.row)">关闭</el-link>
  113. </template>
  114. <template v-if="!authIssue">
  115. <el-link v-if="scope.row.orderStatus === '草稿' || scope.row.orderStatus === '编辑中'" style="cursor: pointer" @click="issueModal(scope.row)">下达</el-link>
  116. </template>
  117. </template>
  118. </el-table-column>
  119. </el-table>
  120. <!-- 分页栏 -->
  121. <el-pagination
  122. style="margin-top: 0px"
  123. @size-change="sizeChangeHandle"
  124. @current-change="currentChangeHandle"
  125. :current-page="pageIndex"
  126. :page-sizes="[20, 50, 100, 200, 500]"
  127. :page-size="pageSize"
  128. :total="totalPage"
  129. layout="total, sizes, prev, pager, next, jumper">
  130. </el-pagination>
  131. <!-- 收货入库通知新增/修改 -->
  132. <el-dialog title="收货入库通知" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="545px">
  133. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" ref="modalForm" style="margin-left: 7px;margin-top: -5px;">
  134. <el-form-item label="BU" prop="bu">
  135. <el-select v-model="modalData.bu" placeholder="请选择" :disabled="modalDisableFlag" style="width: 100px">
  136. <el-option
  137. v-for = "i in userBuList"
  138. :key = "i.buNo"
  139. :label = "i.sitename"
  140. :value = "i.buNo">
  141. <span style="float: left;width: 60px">{{ i.sitename }}</span>
  142. <span style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 70px">
  143. {{ i.buDesc }}
  144. </span>
  145. </el-option>
  146. </el-select>
  147. </el-form-item>
  148. <el-form-item label="单据类型" prop="orderType">
  149. <el-select v-model="modalData.orderType" placeholder="请选择" :disabled="modalDisableFlag" style="width: 100px">
  150. <el-option label="生产入库" value="生产入库"></el-option>
  151. <el-option label="其他入库" value="其他入库"></el-option>
  152. </el-select>
  153. </el-form-item>
  154. <el-form-item label="要求入库日期" prop="requiredInboundDate">
  155. <el-date-picker
  156. style="width: 120px"
  157. v-model="modalData.requiredInboundDate"
  158. type="date"
  159. value-format="yyyy-MM-dd">
  160. </el-date-picker>
  161. </el-form-item>
  162. <el-form-item label="入库类别" prop="category">
  163. <el-select v-model="modalData.category" placeholder="请选择" style="width: 140px">
  164. <el-option
  165. v-for="item in categoryList"
  166. :key="item.crdcode"
  167. :label="item.crdcode + '-' + item.crdname"
  168. :value="item.crdcode">
  169. </el-option>
  170. </el-select>
  171. </el-form-item>
  172. <el-form-item>
  173. <span style="cursor: pointer" slot="label" @click="getBaseList(506)"><a href="#">供应商</a></span>
  174. <el-input v-model="modalData.supplierId" @change="supplierBlur(506)" style="width: 120px"></el-input>
  175. <el-input v-model="modalData.supplierName" disabled style="width: 223px"></el-input>
  176. </el-form-item>
  177. <el-form-item label="部门" prop="departmentNo">
  178. <el-select v-model="modalData.departmentNo" placeholder="请选择" style="width: 140px">
  179. <el-option
  180. v-for="item in departmentList"
  181. :key="item.departmentNo"
  182. :label="item.departmentNo + '-' + item.departmentDesc"
  183. :value="item.departmentNo">
  184. </el-option>
  185. </el-select>
  186. </el-form-item>
  187. <el-form-item :label="'备注'">
  188. <el-input type="textarea" v-model="modalData.remarks" :rows="3" resize='none' show-word-limit style="width: 505px;height: 20px"></el-input>
  189. </el-form-item>
  190. </el-form>
  191. <el-footer style="height:35px;margin-top: 55px;text-align:center">
  192. <el-button type="primary" :loading="saveLoading" @click="saveData()">保存</el-button>
  193. <el-button type="primary" @click="modalFlag = false">关闭</el-button>
  194. </el-footer>
  195. </el-dialog>
  196. <!-- 页签 -->
  197. <el-tabs v-model="activeTable" style="width: 100%" :style="{height: secondHeight + 'px'}" type="border-card" @tab-click="tabClick" class="customer-tab">
  198. <el-tab-pane label="入库明细" name="inboundDetail">
  199. <div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px;">
  200. <el-form label-position="top" style="margin-left: 2px; margin-bottom: 0;">
  201. <el-button v-if="(currentRow.orderStatus === '草稿' || currentRow.orderStatus === '编辑中') && !hasActualInboundQty" type="primary" @click="addInboundDetailModal()" icon="el-icon-plus">新增</el-button>
  202. <el-button v-if="(currentRow.orderStatus === '草稿' || currentRow.orderStatus === '编辑中') && !hasActualInboundQty" type="primary" @click="deleteInboundDetail()" icon="el-icon-minus">删除</el-button>
  203. <el-button v-if="!editBatchVisible && (currentRow.orderStatus === '草稿' || currentRow.orderStatus === '编辑中') && !hasActualInboundQty" @click="editBatchModel">批量编辑</el-button>
  204. <el-button v-if="!editBatchVisible && (currentRow.orderStatus === '草稿' || currentRow.orderStatus === '编辑中')" @click="changeWarehouseBatch">更换仓库</el-button>
  205. <el-button v-if="editBatchVisible" @click="batchModel" :loading="saveLoading">批量保存</el-button>
  206. <el-button v-if="editBatchVisible" @click="editBatchVisible = false" type="info">取消编辑</el-button>
  207. </el-form>
  208. <div style="display: flex; align-items: center; font-size: 14px; color: #606266;">
  209. <span style="margin-right: 20px;">总张数<span style="color: #409EFF; font-weight: bold;">{{ detailList.length }}</span></span>
  210. <span>总数量<span style="color: #409EFF; font-weight: bold;">{{ detailTotalQty }}</span></span>
  211. </div>
  212. </div>
  213. <el-table
  214. :data="detailList"
  215. :height="secondHeight - 68"
  216. border
  217. @selection-change="selectionInboundDetail"
  218. style="width: 100%;">
  219. <el-table-column
  220. type="selection"
  221. header-align="center"
  222. align="center"
  223. width="50">
  224. </el-table-column>
  225. <el-table-column
  226. v-for="(item,index) in columnDetailList" :key="index"
  227. :sortable="item.columnSortable"
  228. :prop="item.columnProp"
  229. :header-align="item.headerAlign"
  230. :show-overflow-tooltip="item.showOverflowTooltip"
  231. :align="item.align"
  232. :fixed="item.fixed==''?false:item.fixed"
  233. :min-width="item.columnWidth"
  234. :label="item.columnLabel">
  235. <template slot-scope="scope">
  236. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  237. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  238. </template>
  239. </el-table-column>
  240. <el-table-column
  241. prop="requiredQty"
  242. header-align="center"
  243. align="right"
  244. min-width="100"
  245. label="要求入库数量">
  246. <template slot-scope="scope">
  247. <span v-if="editBatchVisible">
  248. <el-input :controls="false" v-model="scope.row.requiredQty"
  249. @input="value => scope.row.requiredQty = value.match(/^(\d+\.?\d*|\.\d+)$/) ? value : ''"
  250. style="height: 11px; width: 98%;">
  251. </el-input>
  252. </span>
  253. <span v-else>
  254. <span>{{scope.row[scope.column.property]}}</span>
  255. </span>
  256. </template>
  257. </el-table-column>
  258. <el-table-column
  259. prop="inWarehouseName"
  260. header-align="center"
  261. align="center"
  262. min-width="180"
  263. label="入库仓库">
  264. <template slot-scope="scope">
  265. <span v-if="editBatchVisible">
  266. <el-button type="text" @click="chooseWareHouse(scope.row)" style="width:18%;padding: 3px 7px">选择</el-button>
  267. <el-input v-model="scope.row.inWarehouseName" readonly style="width:77%"></el-input>
  268. </span>
  269. <span v-else>
  270. <span>{{scope.row[scope.column.property]}}</span>
  271. </span>
  272. </template>
  273. </el-table-column>
  274. <el-table-column
  275. prop="actualStockInQty"
  276. header-align="center"
  277. align="right"
  278. min-width="100"
  279. label="实际入库数量">
  280. </el-table-column>
  281. <el-table-column
  282. prop="remark"
  283. header-align="center"
  284. align="left"
  285. min-width="150"
  286. label="备注">
  287. <template slot-scope="scope">
  288. <span v-if="editBatchVisible">
  289. <el-input v-model="scope.row.remark" clearable style="width: 98%;"></el-input>
  290. </span>
  291. <span v-else>
  292. <span>{{scope.row[scope.column.property]}}</span>
  293. </span>
  294. </template>
  295. </el-table-column>
  296. <!-- <el-table-column-->
  297. <!-- prop="inBatchNo"-->
  298. <!-- header-align="center"-->
  299. <!-- align="left"-->
  300. <!-- min-width="100"-->
  301. <!-- label="入库批次号">-->
  302. <!-- <template slot-scope="scope">-->
  303. <!-- <span v-if="editBatchVisible">-->
  304. <!-- <el-input :controls="false" v-model="scope.row.inBatchNo" style="height: 11px; width: 98%;"></el-input>-->
  305. <!-- </span>-->
  306. <!-- <span v-else>-->
  307. <!-- <span>{{scope.row[scope.column.property]}}</span>-->
  308. <!-- </span>-->
  309. <!-- </template>-->
  310. <!-- </el-table-column>-->
  311. <el-table-column
  312. fixed="right"
  313. header-align="center"
  314. align="center"
  315. width="150"
  316. label="操作">
  317. <template slot-scope="scope">
  318. <el-link style="cursor: pointer" @click="inboundDetailModal(scope.row)">入库明细</el-link>
  319. <el-link v-if="(currentRow.orderStatus === '草稿' || currentRow.orderStatus === '编辑中') && !hasActualInboundQty" style="cursor: pointer; margin-left: 10px;" type="warning" @click="labelImportModal(scope.row)">标签导入</el-link>
  320. </template>
  321. </el-table-column>
  322. </el-table>
  323. </el-tab-pane>
  324. </el-tabs>
  325. <!-- 收获入库单明细新增 -->
  326. <el-dialog title="收货入库单明细" :close-on-click-modal="false" v-drag :visible.sync="detailModal" width="900px">
  327. <div style="font-size: 12px">
  328. <el-form :inline="true" label-position="top" :model="detailSearchData">
  329. <el-form-item :label="'物料编码'">
  330. <el-input v-model="detailSearchData.partNo" clearable style="width: 120px"></el-input>
  331. </el-form-item>
  332. <el-form-item :label="'物料名称'">
  333. <el-input v-model="detailSearchData.partDesc" clearable style="width: 120px"></el-input>
  334. </el-form-item>
  335. <el-form-item :label="'规格型号'">
  336. <el-input v-model="detailSearchData.spec" clearable style="width: 120px"></el-input>
  337. </el-form-item>
  338. <template v-if="detailSearchData.orderType === '生产入库'">
  339. <el-form-item :label="'生产订单'">
  340. <el-input v-model="detailSearchData.relatedOrderNo" clearable style="width: 120px"></el-input>
  341. </el-form-item>
  342. <el-form-item :label="'订单状态'">
  343. <el-select v-model="detailSearchData.status" clearable style="width: 100px">
  344. <el-option label="已计划" value="已计划"></el-option>
  345. <el-option label="已下达" value="已下达"></el-option>
  346. <el-option label="已排产" value="已排产"></el-option>
  347. <el-option label="已开工" value="已开工"></el-option>
  348. <el-option label="已取消" value="已取消"></el-option>
  349. <el-option label="已停工" value="已停工"></el-option>
  350. <el-option label="已关闭" value="已关闭"></el-option>
  351. </el-select>
  352. </el-form-item>
  353. </template>
  354. <el-form-item label=" ">
  355. <el-button type="primary" @click="searchTypeChange">查询</el-button>
  356. </el-form-item>
  357. </el-form>
  358. </div>
  359. <el-container v-if="detailSearchData.orderType === '其他入库'">
  360. <el-header style="width: 880px;height: 200px;padding: 0 0 0 0">
  361. <span style="font-size: 12px" >可选物料</span>
  362. <el-table
  363. key="otherInboundTablePart1"
  364. height="200px"
  365. :data="partList1"
  366. border
  367. ref="partTable1Other"
  368. @selection-change="selectionPart1"
  369. highlight-current-row
  370. style="width: 100%">
  371. <el-table-column
  372. type="selection"
  373. header-align="center"
  374. align="center"
  375. width="50">
  376. </el-table-column>
  377. <el-table-column
  378. prop="partNo"
  379. header-align="center"
  380. align="left"
  381. min-width="120"
  382. label="物料编码">
  383. </el-table-column>
  384. <el-table-column
  385. prop="partDesc"
  386. header-align="center"
  387. align="left"
  388. min-width="200"
  389. label="物料名称">
  390. </el-table-column>
  391. <el-table-column
  392. prop="spec"
  393. header-align="center"
  394. align="left"
  395. min-width="120"
  396. label="规格型号">
  397. </el-table-column>
  398. <el-table-column
  399. prop="umName"
  400. header-align="center"
  401. align="center"
  402. min-width="100"
  403. label="物料单位">
  404. </el-table-column>
  405. </el-table>
  406. <!-- 分页-->
  407. <el-pagination
  408. style="margin-top: 5px"
  409. @size-change="sizeChangeHandle2"
  410. @current-change="currentChangeHandle2"
  411. :current-page="pageIndex2"
  412. :page-sizes="[20, 50, 100, 200, 500]"
  413. :page-size="pageSize2"
  414. :total="totalPage2"
  415. layout="total, sizes, prev, pager, next, jumper">
  416. </el-pagination>
  417. </el-header>
  418. <el-main style="width: 880px;height: 27px;margin-top: 70px;padding: 0 0 0 0;text-align:center">
  419. <div>
  420. <el-button type="primary" @click="addPart">添加>></el-button>
  421. <el-button type="primary" @click="deletePart">删除<<</el-button>
  422. </div>
  423. </el-main>
  424. <el-footer style="width: 880px;height: 200px;padding: 0 0 0 0;">
  425. <span style="font-size: 12px" >已选物料</span>
  426. <div class="rq">
  427. <el-table
  428. key="otherInboundTable"
  429. height="200px"
  430. :data="partList2"
  431. border
  432. ref="partTable2Other"
  433. @selection-change="selectionPart2"
  434. highlight-current-row
  435. style="width: 100%">
  436. <el-table-column
  437. type="selection"
  438. header-align="center"
  439. align="center"
  440. width="50">
  441. </el-table-column>
  442. <el-table-column
  443. prop="partNo"
  444. header-align="center"
  445. align="left"
  446. min-width="120"
  447. label="物料编码">
  448. </el-table-column>
  449. <el-table-column
  450. prop="partDesc"
  451. header-align="center"
  452. align="left"
  453. min-width="200"
  454. label="物料名称">
  455. </el-table-column>
  456. <el-table-column
  457. prop=""
  458. header-align="center"
  459. align="right"
  460. min-width="80"
  461. label="要求入库数量">
  462. <template slot-scope="scope">
  463. <el-input
  464. :controls="false"
  465. v-model="scope.row.requiredQty"
  466. @input="value => scope.row.requiredQty = value.match(/^(\d+\.?\d*|\.\d+)$/) ? value : ''"
  467. style="height: 11px; width: 98%;">
  468. </el-input>
  469. </template>
  470. </el-table-column>
  471. <el-table-column
  472. prop=""
  473. header-align="center"
  474. align="left"
  475. min-width="100"
  476. label="关联单号">
  477. <template slot-scope="scope">
  478. <el-input
  479. :controls="false"
  480. v-model="scope.row.relatedOrderNo"
  481. style="height: 11px; width: 98%;">
  482. </el-input>
  483. </template>
  484. </el-table-column>
  485. <el-table-column
  486. prop=""
  487. header-align="center"
  488. align="left"
  489. min-width="100"
  490. label="关联单行号">
  491. <template slot-scope="scope">
  492. <el-input
  493. :controls="false"
  494. v-model="scope.row.relatedOrderLineNo"
  495. style="height: 11px; width: 98%;">
  496. </el-input>
  497. </template>
  498. </el-table-column>
  499. </el-table>
  500. </div>
  501. </el-footer>
  502. </el-container>
  503. <el-container v-else-if="detailSearchData.orderType === '生产入库'">
  504. <el-header style="width: 880px;height: 200px;padding: 0 0 0 0">
  505. <span style="font-size: 12px" >可选物料</span>
  506. <el-table
  507. key="productionInboundTablePart1"
  508. height="200px"
  509. :data="partList1"
  510. border
  511. ref="partTable1Production"
  512. @selection-change="selectionPart1"
  513. highlight-current-row
  514. style="width: 100%">
  515. <el-table-column
  516. type="selection"
  517. header-align="center"
  518. align="center"
  519. width="50">
  520. </el-table-column>
  521. <el-table-column
  522. prop="relatedOrderNo"
  523. header-align="center"
  524. align="left"
  525. min-width="120"
  526. label="生产订单">
  527. </el-table-column>
  528. <el-table-column
  529. prop="partNo"
  530. header-align="center"
  531. align="left"
  532. min-width="120"
  533. label="物料编码">
  534. </el-table-column>
  535. <el-table-column
  536. prop="partDesc"
  537. header-align="center"
  538. align="left"
  539. min-width="200"
  540. label="物料名称">
  541. </el-table-column>
  542. <el-table-column
  543. prop="spec"
  544. header-align="center"
  545. align="left"
  546. min-width="120"
  547. label="规格型号">
  548. </el-table-column>
  549. <el-table-column
  550. prop="umName"
  551. header-align="center"
  552. align="center"
  553. min-width="100"
  554. label="物料单位">
  555. </el-table-column>
  556. <el-table-column
  557. prop="orderQty"
  558. header-align="center"
  559. align="right"
  560. min-width="80"
  561. label="订单数量">
  562. </el-table-column>
  563. <el-table-column
  564. prop="requiredQty"
  565. header-align="center"
  566. align="right"
  567. min-width="80"
  568. label="可入库数">
  569. </el-table-column>
  570. <el-table-column
  571. prop="rollNo"
  572. header-align="center"
  573. align="left"
  574. min-width="120"
  575. label="卷号">
  576. </el-table-column>
  577. <el-table-column
  578. prop="remark"
  579. header-align="center"
  580. align="left"
  581. min-width="150"
  582. show-overflow-tooltip
  583. label="备注">
  584. </el-table-column>
  585. </el-table>
  586. <!-- 分页-->
  587. <el-pagination
  588. style="margin-top: 5px"
  589. @size-change="sizeChangeHandle2"
  590. @current-change="currentChangeHandle2"
  591. :current-page="pageIndex2"
  592. :page-sizes="[20, 50, 100, 200, 500]"
  593. :page-size="pageSize2"
  594. :total="totalPage2"
  595. layout="total, sizes, prev, pager, next, jumper">
  596. </el-pagination>
  597. </el-header>
  598. <el-main style="width: 880px;height: 27px;margin-top: 70px;padding: 0 0 0 0;text-align:center">
  599. <div>
  600. <el-button type="primary" @click="addPart">添加>></el-button>
  601. <el-button type="primary" @click="deletePart">删除<<</el-button>
  602. </div>
  603. </el-main>
  604. <el-footer style="width: 880px;height: 200px;padding: 0 0 0 0;">
  605. <span style="font-size: 12px" >已选物料</span>
  606. <div class="rq">
  607. <el-table
  608. key="productionInboundTable"
  609. height="200px"
  610. :data="partList2"
  611. border
  612. ref="partTable2Production"
  613. @selection-change="selectionPart2"
  614. highlight-current-row
  615. style="width: 100%">
  616. <el-table-column
  617. type="selection"
  618. header-align="center"
  619. align="center"
  620. width="50">
  621. </el-table-column>
  622. <el-table-column
  623. prop="relatedOrderNo"
  624. header-align="center"
  625. align="left"
  626. min-width="100"
  627. label="关联单号">
  628. </el-table-column>
  629. <el-table-column
  630. prop="relatedOrderLineNo"
  631. header-align="center"
  632. align="left"
  633. min-width="80"
  634. label="关联单行号">
  635. </el-table-column>
  636. <el-table-column
  637. prop="partNo"
  638. header-align="center"
  639. align="left"
  640. min-width="100"
  641. label="物料编码">
  642. </el-table-column>
  643. <el-table-column
  644. prop="partDesc"
  645. header-align="center"
  646. align="left"
  647. min-width="150"
  648. label="物料名称">
  649. </el-table-column>
  650. <el-table-column
  651. prop="rollNo"
  652. header-align="center"
  653. align="left"
  654. min-width="100"
  655. label="卷号">
  656. </el-table-column>
  657. <el-table-column
  658. prop=""
  659. header-align="center"
  660. align="center"
  661. min-width="100"
  662. label="要求入库数量">
  663. <template slot-scope="scope">
  664. <el-input
  665. :controls="false"
  666. v-model="scope.row.requiredQty"
  667. @input="value => scope.row.requiredQty = value.match(/^(\d+\.?\d*|\.\d+)$/) ? value : ''"
  668. style="height: 11px; width: 98%;">
  669. </el-input>
  670. </template>
  671. </el-table-column>
  672. </el-table>
  673. </div>
  674. </el-footer>
  675. </el-container>
  676. <el-footer style="height:30px;margin-top: 35px;text-align:center">
  677. <el-button type="primary" :loading="saveLoading" @click="saveInboundDetail">保存</el-button>
  678. <el-button type="primary" @click="detailModal = false">关闭</el-button>
  679. </el-footer>
  680. </el-dialog>
  681. <!-- 入库明细 -->
  682. <el-dialog title="入库明细" :close-on-click-modal="false" v-drag :visible.sync="detailModal2" width="900px">
  683. <el-table
  684. height="400px"
  685. :data="detailList2"
  686. border
  687. style="width: 100%;">
  688. <el-table-column
  689. v-for="(item,index) in columnDetailList2" :key="index"
  690. :sortable="item.columnSortable"
  691. :prop="item.columnProp"
  692. :header-align="item.headerAlign"
  693. :show-overflow-tooltip="item.showOverflowTooltip"
  694. :align="item.align"
  695. :fixed="item.fixed===''?false:item.fixed"
  696. :min-width="item.columnWidth"
  697. :label="item.columnLabel">
  698. </el-table-column>
  699. </el-table>
  700. <el-footer style="height:35px;margin-top: 15px;text-align:center">
  701. <el-button type="primary" @click="detailModal2 = false">关闭</el-button>
  702. </el-footer>
  703. </el-dialog>
  704. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  705. <!-- 标签导入组件 -->
  706. <LabelImportUpload ref="labelImportUpload" @refreshPageTables="getInboundDetail"></LabelImportUpload>
  707. </div>
  708. </template>
  709. <script>
  710. import {
  711. searchInboundNotification, // 查询收获入库单
  712. saveInboundNotification, // 新增收获入库单
  713. updateInboundNotification, // 编辑收获入库单
  714. deleteInboundNotification, // 删除收获入库单
  715. closeInboundNotification, // 关闭收获入库单
  716. issueInboundNotification, // 下达收获入库单
  717. getInboundDetail, // 查询收获入库单明细
  718. saveInboundDetail, // 新增收获入库单明细
  719. deleteInboundDetail, // 删除收获入库单明细
  720. getInboundPartList, // 查物料
  721. updateInboundDetail, // 批量编辑明细
  722. getInboundDetail2, // 获取入库明细
  723. getInboundCategoryList, // 查询入库类别列表
  724. getDepartmentList, // 查询部门列表
  725. } from "@/api/qc/Inbound_notification.js"
  726. import {
  727. getSiteAndBuByUserName,
  728. } from "@/api/qc/qc.js"
  729. import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
  730. import Chooselist from '@/views/modules/common/Chooselist_eam'
  731. import LabelImportUpload from './label_import_upload'
  732. import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
  733. import excel from "@/utils/excel-util.js"
  734. import {verifyData} from "@/api/chooselist/chooselist.js"
  735. export default {
  736. components: {
  737. Chooselist,
  738. LabelImportUpload,
  739. },
  740. data () {
  741. return {
  742. columnsProp:['createBy', 'updateBy'],
  743. // 是否收藏
  744. favorite: false,
  745. // 导出 start
  746. exportData: [],
  747. exportName: "收货入库" + this.dayjs().format('YYYYMMDDHHmmss'),
  748. exportHeader: ["收货入库"],
  749. exportFooter: [],
  750. exportList: [],
  751. // 导出 end
  752. tagNo: '',
  753. tagType: '',
  754. searchData: {
  755. site: '',
  756. userName: this.$store.state.user.name,
  757. orderNo: '',
  758. orderType: '',
  759. orderStatus: '',
  760. orderStatusList: ['草稿'],
  761. departmentNo: '', // 部门查询条件
  762. startDate: '',
  763. endDate: '',
  764. page: 1,
  765. limit: 10,
  766. },
  767. detailSearchData: {
  768. site: '',
  769. buNo: '',
  770. orderNo: '',
  771. partNo: '',
  772. partDesc: '',
  773. spec: '',
  774. partNos: '',
  775. orderType: '',
  776. relatedOrderNo: '',
  777. status: '',
  778. page: 1,
  779. limit: 10,
  780. },
  781. height: 200,
  782. secondHeight: 200,
  783. pageIndex: 1,
  784. pageSize: 20,
  785. totalPage: 0,
  786. pageIndex2: 1,
  787. pageSize2: 20,
  788. totalPage2: 0,
  789. modalFlag: false,
  790. modalDisableFlag: false,
  791. modalData: {
  792. site: '',
  793. bu: '',
  794. buNo: '',
  795. flag: '',
  796. orderNo: '',
  797. orderType: '',
  798. orderStatus: '',
  799. requiredInboundDate: '',
  800. supplierId: '',
  801. supplierName: '',
  802. remarks: '',
  803. createdBy: '',
  804. updatedBy: '',
  805. category: '', // 入库类别
  806. },
  807. categoryList: [], // 入库类别列表
  808. departmentList: [], // 部门列表
  809. dataList: [],
  810. detailList: [],
  811. userBuList: [],
  812. inboundSelection: [],
  813. inboundDetailSelection: [],
  814. partSelections1: [],
  815. partSelections2: [],
  816. partList1: [],
  817. partList2: [],
  818. dataListLoading: false,
  819. // 展示列集
  820. columnList: [
  821. {
  822. userId: this.$store.state.user.name,
  823. functionId: 610,
  824. serialNumber: '610Table1OrderNo',
  825. tableId: "610Table1",
  826. tableName: "收货入库任务表",
  827. columnProp: 'orderNo',
  828. headerAlign: "center",
  829. align: "center",
  830. columnLabel: '单据号',
  831. columnHidden: false,
  832. columnImage: false,
  833. columnSortable: false,
  834. sortLv: 0,
  835. status: true,
  836. fixed: '',
  837. columnWidth: 120,
  838. },
  839. {
  840. userId: this.$store.state.user.name,
  841. functionId: 610,
  842. serialNumber: '610Table1OrderType',
  843. tableId: "610Table1",
  844. tableName: "收货入库任务表",
  845. columnProp: 'orderType',
  846. headerAlign: "center",
  847. align: "center",
  848. columnLabel: '单据类型',
  849. columnHidden: false,
  850. columnImage: false,
  851. columnSortable: false,
  852. sortLv: 0,
  853. status: true,
  854. fixed: '',
  855. columnWidth: 100,
  856. },
  857. {
  858. userId: this.$store.state.user.name,
  859. functionId: 610,
  860. serialNumber: '610Table1OrderStatus',
  861. tableId: "610Table1",
  862. tableName: "收货入库任务表",
  863. columnProp: 'orderStatus',
  864. headerAlign: "center",
  865. align: "left",
  866. columnLabel: '单据状态',
  867. columnHidden: false,
  868. columnImage: false,
  869. columnSortable: false,
  870. sortLv: 0,
  871. status: true,
  872. fixed: '',
  873. columnWidth: 100,
  874. },
  875. {
  876. userId: this.$store.state.user.name,
  877. functionId: 610,
  878. serialNumber: '610Table1SupplierId',
  879. tableId: "610Table1",
  880. tableName: "收货入库任务表",
  881. columnProp: 'supplierId',
  882. headerAlign: "center",
  883. align: "left",
  884. columnLabel: '供应商编码',
  885. columnHidden: false,
  886. columnImage: false,
  887. columnSortable: false,
  888. sortLv: 0,
  889. status: true,
  890. fixed: '',
  891. columnWidth: 120,
  892. },
  893. {
  894. userId: this.$store.state.user.name,
  895. functionId: 610,
  896. serialNumber: '610Table1SupplierName',
  897. tableId: "610Table1",
  898. tableName: "收货入库任务表",
  899. columnProp: 'supplierName',
  900. headerAlign: "center",
  901. align: "left",
  902. columnLabel: '供应商名称',
  903. columnHidden: false,
  904. columnImage: false,
  905. columnSortable: false,
  906. sortLv: 0,
  907. status: true,
  908. fixed: '',
  909. columnWidth: 200,
  910. },
  911. {
  912. userId: this.$store.state.user.name,
  913. functionId: 610,
  914. serialNumber: '610Table1RequiredInboundDate',
  915. tableId: "610Table1",
  916. tableName: "收货入库任务表",
  917. columnProp: 'requiredInboundDate',
  918. headerAlign: "center",
  919. align: "center",
  920. columnLabel: '要求入库日期',
  921. columnHidden: false,
  922. columnImage: false,
  923. columnSortable: false,
  924. sortLv: 0,
  925. status: true,
  926. fixed: '',
  927. columnWidth: 150,
  928. },
  929. {
  930. userId: this.$store.state.user.name,
  931. functionId: 610,
  932. serialNumber: '610Table1Category',
  933. tableId: "610Table1",
  934. tableName: "收货入库任务表",
  935. columnProp: 'categoryName',
  936. headerAlign: "center",
  937. align: "center",
  938. columnLabel: '入库类别',
  939. columnHidden: false,
  940. columnImage: false,
  941. columnSortable: false,
  942. sortLv: 0,
  943. status: true,
  944. fixed: '',
  945. columnWidth: 100,
  946. },
  947. {
  948. userId: this.$store.state.user.name,
  949. functionId: 610,
  950. serialNumber: '610Table1DepartmentName',
  951. tableId: "610Table1",
  952. tableName: "收货入库任务表",
  953. columnProp: 'departmentName',
  954. headerAlign: "center",
  955. align: "center",
  956. columnLabel: '部门',
  957. columnHidden: false,
  958. columnImage: false,
  959. columnSortable: false,
  960. sortLv: 0,
  961. status: true,
  962. fixed: '',
  963. columnWidth: 120,
  964. },
  965. {
  966. userId: this.$store.state.user.name,
  967. functionId: 610,
  968. serialNumber: '610Table1CreatedDate',
  969. tableId: "610Table1",
  970. tableName: "收货入库任务表",
  971. columnProp: 'createdDate',
  972. headerAlign: "center",
  973. align: "center",
  974. columnLabel: '创建时间',
  975. columnHidden: false,
  976. columnImage: false,
  977. columnSortable: false,
  978. sortLv: 0,
  979. status: true,
  980. fixed: '',
  981. columnWidth: 170,
  982. },
  983. {
  984. userId: this.$store.state.user.name,
  985. functionId: 610,
  986. serialNumber: '610Table1CreatedBy',
  987. tableId: "610Table1",
  988. tableName: "收货入库任务表",
  989. columnProp: 'createdBy',
  990. headerAlign: "center",
  991. align: "center",
  992. columnLabel: '创建人',
  993. columnHidden: false,
  994. columnImage: false,
  995. columnSortable: false,
  996. sortLv: 0,
  997. status: true,
  998. fixed: '',
  999. columnWidth: 100,
  1000. },
  1001. {
  1002. userId: this.$store.state.user.name,
  1003. functionId: 610,
  1004. serialNumber: '610Table1UpdatedDate',
  1005. tableId: "610Table1",
  1006. tableName: "收货入库任务表",
  1007. columnProp: 'updatedDate',
  1008. headerAlign: "center",
  1009. align: "center",
  1010. columnLabel: '更新时间',
  1011. columnHidden: false,
  1012. columnImage: false,
  1013. columnSortable: false,
  1014. sortLv: 0,
  1015. status: true,
  1016. fixed: '',
  1017. columnWidth: 170,
  1018. },
  1019. {
  1020. userId: this.$store.state.user.name,
  1021. functionId: 610,
  1022. serialNumber: '610Table1UpdatedBy',
  1023. tableId: "610Table1",
  1024. tableName: "收货入库任务表",
  1025. columnProp: 'updatedBy',
  1026. headerAlign: "center",
  1027. align: "center",
  1028. columnLabel: '更新人',
  1029. columnHidden: false,
  1030. columnImage: false,
  1031. columnSortable: false,
  1032. sortLv: 0,
  1033. status: true,
  1034. fixed: '',
  1035. columnWidth: 100,
  1036. },
  1037. ],
  1038. columnDetailList: [
  1039. {
  1040. columnProp: 'relatedOrderNo',
  1041. headerAlign: "center",
  1042. align: "left",
  1043. columnLabel: '关联单号',
  1044. columnHidden: false,
  1045. columnImage: false,
  1046. columnSortable: false,
  1047. sortLv: 0,
  1048. status: true,
  1049. fixed: '',
  1050. columnWidth: 100,
  1051. },
  1052. {
  1053. columnProp: 'relatedOrderLineNo',
  1054. headerAlign: "center",
  1055. align: "left",
  1056. columnLabel: '关联单行号',
  1057. columnHidden: false,
  1058. columnImage: false,
  1059. columnSortable: false,
  1060. sortLv: 0,
  1061. status: true,
  1062. fixed: '',
  1063. columnWidth: 100,
  1064. },
  1065. {
  1066. columnProp: 'partNo',
  1067. headerAlign: "center",
  1068. align: "left",
  1069. columnLabel: '物料编码',
  1070. columnHidden: false,
  1071. columnImage: false,
  1072. columnSortable: false,
  1073. sortLv: 0,
  1074. status: true,
  1075. fixed: '',
  1076. columnWidth: 120,
  1077. },
  1078. {
  1079. columnProp: 'partDesc',
  1080. headerAlign: "center",
  1081. align: "left",
  1082. columnLabel: '物料名称',
  1083. columnHidden: false,
  1084. columnImage: false,
  1085. columnSortable: false,
  1086. sortLv: 0,
  1087. status: true,
  1088. fixed: '',
  1089. columnWidth: 200,
  1090. },
  1091. {
  1092. columnProp: 'rollNo',
  1093. headerAlign: "center",
  1094. align: "left",
  1095. columnLabel: '卷号',
  1096. columnHidden: false,
  1097. columnImage: false,
  1098. columnSortable: false,
  1099. sortLv: 0,
  1100. status: true,
  1101. fixed: '',
  1102. columnWidth: 120,
  1103. },
  1104. {
  1105. columnProp: 'umName',
  1106. headerAlign: "center",
  1107. align: "center",
  1108. columnLabel: '单位',
  1109. columnHidden: false,
  1110. columnImage: false,
  1111. columnSortable: false,
  1112. sortLv: 0,
  1113. status: true,
  1114. fixed: '',
  1115. columnWidth: 80,
  1116. },
  1117. ],
  1118. columnDetailList2: [
  1119. {
  1120. columnProp: 'subNo',
  1121. headerAlign: "center",
  1122. align: "left",
  1123. columnLabel: '标签条码',
  1124. columnHidden: false,
  1125. columnImage: false,
  1126. columnSortable: false,
  1127. sortLv: 0,
  1128. status: true,
  1129. fixed: '',
  1130. columnWidth: 100,
  1131. },
  1132. {
  1133. columnProp: 'subQty',
  1134. headerAlign: "center",
  1135. align: "right",
  1136. columnLabel: '入库数量',
  1137. columnHidden: false,
  1138. columnImage: false,
  1139. columnSortable: false,
  1140. sortLv: 0,
  1141. status: true,
  1142. fixed: '',
  1143. columnWidth: 100,
  1144. },
  1145. {
  1146. columnProp: 'orderRef4',
  1147. headerAlign: "center",
  1148. align: "left",
  1149. columnLabel: '入库仓库',
  1150. columnHidden: false,
  1151. columnImage: false,
  1152. columnSortable: false,
  1153. sortLv: 0,
  1154. status: true,
  1155. fixed: '',
  1156. columnWidth: 150,
  1157. },
  1158. {
  1159. columnProp: 'orderRef5',
  1160. headerAlign: "center",
  1161. align: "left",
  1162. columnLabel: '入库库位',
  1163. columnHidden: false,
  1164. columnImage: false,
  1165. columnSortable: false,
  1166. sortLv: 0,
  1167. status: true,
  1168. fixed: '',
  1169. columnWidth: 150,
  1170. },
  1171. {
  1172. columnProp: 'userName',
  1173. headerAlign: "center",
  1174. align: "left",
  1175. columnLabel: '操作员',
  1176. columnHidden: false,
  1177. columnImage: false,
  1178. columnSortable: false,
  1179. sortLv: 0,
  1180. status: true,
  1181. fixed: '',
  1182. columnWidth: 100,
  1183. },
  1184. {
  1185. columnProp: 'transDate',
  1186. headerAlign: "center",
  1187. align: "center",
  1188. columnLabel: '操作时间',
  1189. columnHidden: false,
  1190. columnImage: false,
  1191. columnSortable: false,
  1192. sortLv: 0,
  1193. status: true,
  1194. fixed: '',
  1195. columnWidth: 170,
  1196. },
  1197. ],
  1198. rules: {
  1199. bu: [
  1200. {
  1201. required: true,
  1202. message: ' ',
  1203. trigger: ['blur','change']
  1204. }
  1205. ],
  1206. orderType: [
  1207. {
  1208. required: true,
  1209. message: ' ',
  1210. trigger: ['blur','change']
  1211. }
  1212. ],
  1213. requiredInboundDate: [
  1214. {
  1215. required: true,
  1216. message: ' ',
  1217. trigger: ['blur','change']
  1218. }
  1219. ],
  1220. category: [
  1221. {
  1222. required: true,
  1223. message: ' ',
  1224. trigger: ['blur','change']
  1225. }
  1226. ],
  1227. departmentNo: [
  1228. {
  1229. required: true,
  1230. message: ' ',
  1231. trigger: ['blur','change']
  1232. }
  1233. ]
  1234. },
  1235. searchLoading: false,
  1236. saveLoading: false,
  1237. activeTable: 'inboundDetail',
  1238. detailModal: false,
  1239. authSearch: false,
  1240. authSave: false,
  1241. authUpdate: false,
  1242. authDelete: false,
  1243. authArchive: false,
  1244. authClose: false,
  1245. authIssue: false,
  1246. editBatchVisible: false,
  1247. menuId: this.$route.meta.menuId,
  1248. tempWareHouseRow: {},
  1249. isChangeWarehouseBatch: false, // 是否批量更换仓库
  1250. detailList2: [],
  1251. detailModal2: false,
  1252. currentRow: {}
  1253. }
  1254. },
  1255. computed: {
  1256. // 计算明细列表要求入库数量总和
  1257. detailTotalQty() {
  1258. if (!this.detailList || this.detailList.length === 0) {
  1259. return 0;
  1260. }
  1261. return this.detailList.reduce((sum, item) => {
  1262. const qty = parseFloat(item.requiredQty) || 0;
  1263. return sum + qty;
  1264. }, 0);
  1265. },
  1266. // 判断是否有实际入库数量大于零的明细(有则禁止编辑)
  1267. hasActualInboundQty() {
  1268. if (!this.detailList || this.detailList.length === 0) {
  1269. return false;
  1270. }
  1271. return this.detailList.some(item => {
  1272. const qty = parseFloat(item.actualStockInQty) || 0;
  1273. return qty > 0;
  1274. });
  1275. }
  1276. },
  1277. mounted () {
  1278. this.$nextTick(() => {
  1279. this.height = window.innerHeight / 2 - 100
  1280. /*第二个表格高度的动态调整*/
  1281. this.secondHeight = window.innerHeight - this.height - 170
  1282. })
  1283. },
  1284. created () {
  1285. // 按钮控制
  1286. this.getButtonAuthData()
  1287. // 获取用户的 site 和 bu
  1288. this.getSiteAndBuByUserName()
  1289. // 校验用户是否收藏
  1290. this.favoriteIsOk()
  1291. // 加载部门列表(用于查询条件)
  1292. this.loadDepartmentList()
  1293. // 动态列
  1294. this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
  1295. this.getTableUserColumn(this.$route.meta.menuId+'table2',2)
  1296. if (!this.authSearch) {
  1297. // 获取数据列表
  1298. this.getDataList()
  1299. }
  1300. },
  1301. methods: {
  1302. // 获取用户的bu
  1303. getSiteAndBuByUserName () {
  1304. let tempData = {
  1305. username: this.$store.state.user.name,
  1306. }
  1307. getSiteAndBuByUserName(tempData).then(({data}) => {
  1308. if (data.code === 0) {
  1309. this.userBuList = data.rows
  1310. }
  1311. })
  1312. },
  1313. // 获取数据列表
  1314. getDataList () {
  1315. this.searchData.limit = this.pageSize
  1316. this.searchData.page = this.pageIndex
  1317. this.searchData.orderStatus = this.searchData.orderStatusList.join(',')
  1318. this.searchLoading = true
  1319. searchInboundNotification(this.searchData).then(({data}) => {
  1320. if (data.code === 0) {
  1321. this.dataList = data.page.list
  1322. this.pageIndex = data.page.currPage
  1323. this.pageSize = data.page.pageSize
  1324. this.totalPage = data.page.totalCount
  1325. // 判断是否全部存在数据
  1326. if (this.dataList.length > 0) {
  1327. // 设置选中行
  1328. this.$refs.inboundTable.setCurrentRow(this.dataList[0])
  1329. this.inboundClickRow(this.dataList[0])
  1330. } else {
  1331. this.currentRow = {}
  1332. this.refreshCurrentTabTable()
  1333. }
  1334. }
  1335. }).finally(()=>{
  1336. this.searchLoading = false
  1337. })
  1338. },
  1339. // 每页数
  1340. sizeChangeHandle (val) {
  1341. this.pageSize = val
  1342. this.pageIndex = 1
  1343. this.getDataList()
  1344. },
  1345. // 当前页
  1346. currentChangeHandle (val) {
  1347. this.pageIndex = val
  1348. this.getDataList()
  1349. },
  1350. // 子明细每页数
  1351. sizeChangeHandle2 (val) {
  1352. this.pageSize2 = val
  1353. this.pageIndex2 = 1
  1354. this.searchTypeChange()
  1355. },
  1356. // 子明细当前页
  1357. currentChangeHandle2 (val) {
  1358. this.pageIndex2 = val
  1359. this.searchTypeChange()
  1360. },
  1361. saveModal () {
  1362. this.modalData = {
  1363. flag: '1',
  1364. site: '',
  1365. bu: this.userBuList[0].buNo,
  1366. buNo: '',
  1367. orderNo: '',
  1368. orderType: '',
  1369. orderStatus: '草稿',
  1370. requiredInboundDate: this.dayjs().format('YYYY-MM-DD'), // 默认为当天
  1371. supplierId: '',
  1372. supplierName: '',
  1373. remarks: '',
  1374. createdBy: this.$store.state.user.name,
  1375. category: '', // 入库类别
  1376. departmentNo: '', // 部门
  1377. }
  1378. this.modalDisableFlag = false
  1379. this.loadCategoryList() // 加载入库类别列表
  1380. this.loadDepartmentList() // 加载部门列表
  1381. this.modalFlag = true
  1382. // 重置表单验证状态
  1383. this.$nextTick(() => {
  1384. if (this.$refs.modalForm) {
  1385. this.$refs.modalForm.clearValidate()
  1386. }
  1387. })
  1388. },
  1389. updateModal (row) {
  1390. if (this.currentRow.orderType === '采购入库' || this.currentRow.orderType === '销售退货') {
  1391. this.$message.warning('该类型单据不能编辑!')
  1392. return
  1393. }
  1394. // 校验当前行的明细是否有实际入库数量大于零
  1395. if (this.hasActualInboundQty) {
  1396. this.$message.warning('该单据已有实际入库数量,不能编辑主信息!')
  1397. return
  1398. }
  1399. this.modalData = {
  1400. flag: '2',
  1401. site: row.site,
  1402. bu: row.site + '_' + row.buNo,
  1403. buNo: row.buNo,
  1404. orderNo: row.orderNo,
  1405. orderType: row.orderType,
  1406. requiredInboundDate: row.requiredInboundDate,
  1407. supplierId: row.supplierId,
  1408. supplierName: row.supplierName,
  1409. remarks: row.remarks,
  1410. updatedBy: this.$store.state.user.name,
  1411. category: row.category || '', // 入库类别
  1412. departmentNo: row.departmentNo || '', // 部门
  1413. }
  1414. this.modalDisableFlag = true
  1415. this.loadCategoryList() // 加载入库类别列表
  1416. this.loadDepartmentList() // 加载部门列表
  1417. this.modalFlag = true
  1418. // 重置表单验证状态
  1419. this.$nextTick(() => {
  1420. if (this.$refs.modalForm) {
  1421. this.$refs.modalForm.clearValidate()
  1422. }
  1423. })
  1424. },
  1425. saveData () {
  1426. // 使用表单验证
  1427. this.$refs.modalForm.validate((valid) => {
  1428. if (!valid) {
  1429. this.$message.warning('请填写完整的必填项!')
  1430. return false
  1431. }
  1432. this.saveLoading = true
  1433. if (this.modalData.flag === '1') { // 新增
  1434. saveInboundNotification(this.modalData).then(({data}) => {
  1435. if (data && data.code === 0) {
  1436. const newOrderNo = data.orderNo // 获取新创建的单据号
  1437. this.modalFlag = false
  1438. this.$message.success('操作成功')
  1439. // 清空搜索条件,设置为新单据号以便精确查询
  1440. this.searchData.orderNo = newOrderNo
  1441. this.searchData.orderStatusList = [] // 清空状态筛选以确保能找到新单据
  1442. // 刷新列表并定位到新单据
  1443. this.searchData.limit = this.pageSize
  1444. this.searchData.page = 1
  1445. this.pageIndex = 1
  1446. this.searchData.orderStatus = ''
  1447. this.searchLoading = true
  1448. searchInboundNotification(this.searchData).then(({data: listData}) => {
  1449. if (listData.code === 0) {
  1450. this.dataList = listData.page.list
  1451. this.pageIndex = listData.page.currPage
  1452. this.pageSize = listData.page.pageSize
  1453. this.totalPage = listData.page.totalCount
  1454. // 找到新创建的单据并定位
  1455. const foundRow = this.dataList.find(item => item.orderNo === newOrderNo)
  1456. if (foundRow) {
  1457. this.currentRow = JSON.parse(JSON.stringify(foundRow))
  1458. this.$nextTick(() => {
  1459. this.$refs.inboundTable.setCurrentRow(foundRow)
  1460. this.refreshCurrentTabTable()
  1461. })
  1462. } else if (this.dataList.length > 0) {
  1463. this.$refs.inboundTable.setCurrentRow(this.dataList[0])
  1464. this.inboundClickRow(this.dataList[0])
  1465. }
  1466. }
  1467. // 恢复搜索条件
  1468. this.searchData.orderNo = ''
  1469. this.searchData.orderStatusList = ['草稿']
  1470. }).finally(() => {
  1471. this.searchLoading = false
  1472. })
  1473. } else {
  1474. this.$message.error(data.msg)
  1475. }
  1476. }).finally(()=>{
  1477. this.saveLoading = false
  1478. })
  1479. } else { // 修改
  1480. updateInboundNotification(this.modalData).then(({data}) => {
  1481. if (data && data.code === 0) {
  1482. this.getDataList()
  1483. this.modalFlag = false
  1484. this.$message.success('操作成功')
  1485. } else {
  1486. this.$message.error(data.msg)
  1487. }
  1488. }).finally(()=>{
  1489. this.saveLoading = false
  1490. })
  1491. }
  1492. })
  1493. },
  1494. // 删除
  1495. deleteModal () {
  1496. if (this.inboundSelection.length === 0) {
  1497. this.$message.warning('请勾选要删除的单据!')
  1498. return
  1499. }
  1500. this.$confirm(`是否删除该 `+ this.inboundSelection.length +` 条记录?`, '提示', {
  1501. confirmButtonText: '确定',
  1502. cancelButtonText: '取消',
  1503. type: 'warning'
  1504. }).then(() => {
  1505. let tempData = {
  1506. submitList: this.inboundSelection
  1507. }
  1508. deleteInboundNotification(tempData).then(({data}) => {
  1509. if (data && data.code === 0) {
  1510. this.getDataList()
  1511. this.inboundSelection = []
  1512. this.$message.success('操作成功')
  1513. } else {
  1514. this.$message.error(data.msg)
  1515. }
  1516. })
  1517. })
  1518. },
  1519. // 归档
  1520. archiveModal () {
  1521. },
  1522. // 关闭
  1523. closeModal (row) {
  1524. if (this.currentRow.orderType === '采购入库' || this.currentRow.orderType === '销售退货') {
  1525. this.$message.warning('该类型单据不能编辑!')
  1526. return
  1527. }
  1528. closeInboundNotification(row).then(({data}) => {
  1529. if (data && data.code === 0) {
  1530. this.getDataList()
  1531. this.$message.success('操作成功')
  1532. } else {
  1533. this.$message.error(data.msg)
  1534. }
  1535. })
  1536. },
  1537. // 下达
  1538. issueModal (row) {
  1539. if (this.currentRow.orderType === '采购入库' || this.currentRow.orderType === '销售退货') {
  1540. this.$message.warning('该类型单据不能编辑!')
  1541. return
  1542. }
  1543. // 校验明细是否有数据
  1544. if (!this.detailList || this.detailList.length === 0) {
  1545. this.$message.warning('入库明细不能为空,请先添加明细!')
  1546. return
  1547. }
  1548. // 校验所有明细的仓库、关联单号、关联单行号必填
  1549. for (let i = 0; i < this.detailList.length; i++) {
  1550. const detail = this.detailList[i]
  1551. if (!detail.inWarehouse) {
  1552. this.$message.warning(`${i + 1}行明细的入库仓库不能为空!`)
  1553. return
  1554. }
  1555. if (!detail.relatedOrderNo) {
  1556. this.$message.warning(`${i + 1}行明细的关联单号不能为空!`)
  1557. return
  1558. }
  1559. if (!detail.relatedOrderLineNo) {
  1560. this.$message.warning(`${i + 1}行明细的关联单行号不能为空!`)
  1561. return
  1562. }
  1563. }
  1564. issueInboundNotification(row).then(({data}) => {
  1565. if (data && data.code === 0) {
  1566. this.getDataList()
  1567. this.$message.success('操作成功')
  1568. } else {
  1569. this.$message.error(data.msg)
  1570. }
  1571. })
  1572. },
  1573. // 列表表格选择替换
  1574. tabClick (tab, event) {
  1575. // 刷新列表数据
  1576. this.refreshCurrentTabTable()
  1577. },
  1578. // 当前值发生变化的时候修改
  1579. changeCurrentRow (row, oldRow) {
  1580. // 判断是否是获取焦点的事件
  1581. if (row) {
  1582. this.currentRow = JSON.parse(JSON.stringify(row))
  1583. //刷新当前页表
  1584. this.refreshCurrentTabTable()
  1585. }
  1586. },
  1587. // 复选
  1588. selectionInbound (val) {
  1589. this.inboundSelection = val
  1590. },
  1591. // 明细复选
  1592. selectionInboundDetail (val) {
  1593. this.inboundDetailSelection = val
  1594. },
  1595. rowStyle ({row}) {
  1596. if (this.currentRow.orderNo === row.orderNo) {
  1597. return { 'background-color': '#E8F7F6', cursor: 'pointer' }
  1598. }
  1599. },
  1600. // 单机选中信息
  1601. inboundClickRow (row,column) {
  1602. this.currentRow = JSON.parse(JSON.stringify(row))
  1603. },
  1604. // 刷新页签的table数据
  1605. refreshCurrentTabTable () {
  1606. if (this.activeTable === 'inboundDetail') {
  1607. this.getInboundDetail()
  1608. }
  1609. },
  1610. // 查询物料缺陷跟踪
  1611. getInboundDetail () {
  1612. let templateData = {
  1613. site: this.currentRow.site,
  1614. buNo: this.currentRow.buNo,
  1615. orderNo: this.currentRow.orderNo,
  1616. }
  1617. getInboundDetail(templateData).then(({data}) => {
  1618. this.detailList = data.rows
  1619. })
  1620. },
  1621. // 新增明细
  1622. addInboundDetailModal () {
  1623. if (this.currentRow.orderType === '采购入库' || this.currentRow.orderType === '销售退货') {
  1624. this.$message.warning('该类型单据不能编辑!')
  1625. return
  1626. }
  1627. this.detailSearchData = {
  1628. site: this.currentRow.site,
  1629. buNo: this.currentRow.buNo,
  1630. orderNo: this.currentRow.orderNo,
  1631. orderType: this.currentRow.orderType,
  1632. relatedOrderNo: '',
  1633. status: '',
  1634. partNo: '',
  1635. partDesc: '',
  1636. spec: '',
  1637. partNos: '',
  1638. page: 1,
  1639. limit: 10,
  1640. }
  1641. this.partSelections1 = []
  1642. this.partSelections2 = []
  1643. this.partList1 = []
  1644. this.partList2 = []
  1645. this.pageIndex2 = 1
  1646. this.pageSize2 = 20
  1647. this.totalPage2 = 0
  1648. if (this.currentRow.orderType === '生产入库') {
  1649. this.detailSearchData.status = '已开工'
  1650. }
  1651. this.handleGetProjectPartList()
  1652. },
  1653. handleGetProjectPartList () {
  1654. this.detailSearchData.limit = this.pageSize2
  1655. this.detailSearchData.page = this.pageIndex2
  1656. getInboundPartList(this.detailSearchData).then(({data}) => {
  1657. if (data && data.code === 0){
  1658. this.partList1 = data.page.list
  1659. this.pageIndex2 = data.page.currPage
  1660. this.pageSize2 = data.page.pageSize
  1661. this.totalPage2 = data.page.totalCount
  1662. this.detailModal = true
  1663. }
  1664. })
  1665. },
  1666. // 可选物料
  1667. partClickRow1 (row) {
  1668. const tableRef = this.detailSearchData.orderType === '其他入库'
  1669. ? this.$refs.partTable1Other
  1670. : this.$refs.partTable1Production
  1671. if (tableRef) {
  1672. tableRef.toggleRowSelection(row)
  1673. }
  1674. },
  1675. // 已有物料
  1676. partClickRow2 (row) {
  1677. const tableRef = this.detailSearchData.orderType === '其他入库'
  1678. ? this.$refs.partTable2Other
  1679. : this.$refs.partTable2Production
  1680. if (tableRef) {
  1681. tableRef.toggleRowSelection(row)
  1682. }
  1683. },
  1684. selectionPart1 (val) {
  1685. this.partSelections1 = val
  1686. },
  1687. selectionPart2 (val) {
  1688. this.partSelections2 = val
  1689. },
  1690. // 改变事件
  1691. searchTypeChange () {
  1692. // 生产入库按卷号排除,其他入库按物料编码排除
  1693. if (this.detailSearchData.orderType === '生产入库') {
  1694. let rollNos = this.partList2.map(part => part.rollNo)
  1695. this.detailSearchData.partNos = rollNos.join(",")
  1696. } else {
  1697. let partNos = this.partList2.map(part => part.partNo)
  1698. this.detailSearchData.partNos = partNos.join(",")
  1699. }
  1700. this.handleGetProjectPartList()
  1701. },
  1702. // 添加物料
  1703. addPart () {
  1704. if (this.partSelections1 == null || this.partSelections1.length === 0) {
  1705. this.$message.warning('请选择可选物料!')
  1706. return
  1707. }
  1708. this.partSelections1.forEach(item => {
  1709. this.partList2.push(item)
  1710. })
  1711. this.searchTypeChange()
  1712. },
  1713. // 删除物料
  1714. deletePart () {
  1715. if(this.partSelections2 == null || this.partSelections2.length === 0) {
  1716. this.$message.warning('请选择已选物料!')
  1717. return
  1718. }
  1719. this.partSelections2.forEach(item => {
  1720. // 生产入库按卷号删除,其他入库按物料编码删除
  1721. if (this.detailSearchData.orderType === '生产入库') {
  1722. this.partList2 = this.partList2.filter(part => part.rollNo !== item.rollNo)
  1723. } else {
  1724. this.partList2 = this.partList2.filter(part => part.partNo !== item.partNo)
  1725. }
  1726. })
  1727. this.searchTypeChange()
  1728. },
  1729. // 新增明细
  1730. saveInboundDetail () {
  1731. // 校验已选物料列表不能为空
  1732. if (!this.partList2 || this.partList2.length === 0) {
  1733. this.$message.warning('请选择物料!')
  1734. return
  1735. }
  1736. // 校验关联单号和关联单行号必填
  1737. for (let i = 0; i < this.partList2.length; i++) {
  1738. const part = this.partList2[i]
  1739. if (!part.relatedOrderNo || part.relatedOrderNo.trim() === '') {
  1740. this.$message.warning(`物料 ${part.partNo} 的关联单号不能为空!`)
  1741. return
  1742. }
  1743. if (!part.relatedOrderLineNo || part.relatedOrderLineNo.toString().trim() === '') {
  1744. this.$message.warning(`物料 ${part.partNo} 的关联单行号不能为空!`)
  1745. return
  1746. }
  1747. }
  1748. let tempData = {
  1749. orderNo: this.detailSearchData.orderNo,
  1750. createdBy: this.$store.state.user.name,
  1751. partList: this.partList2,
  1752. }
  1753. this.saveLoading = true
  1754. saveInboundDetail(tempData).then(({data}) => {
  1755. if (data && data.code === 0) {
  1756. this.getInboundDetail()
  1757. this.detailModal = false
  1758. this.$message.success('操作成功')
  1759. } else {
  1760. this.$message.error(data.msg)
  1761. }
  1762. }).finally(()=>{
  1763. this.saveLoading = false
  1764. })
  1765. },
  1766. // 删除入库明细
  1767. deleteInboundDetail () {
  1768. if (this.currentRow.orderType === '采购入库' || this.currentRow.orderType === '销售退货') {
  1769. this.$message.warning('该类型单据不能编辑!')
  1770. return
  1771. }
  1772. if (this.inboundDetailSelection.length === 0) {
  1773. this.$message.warning('请勾选要删除的单据!')
  1774. return
  1775. }
  1776. this.$confirm(`是否删除该 `+ this.inboundDetailSelection.length +` 条记录?`, '提示', {
  1777. confirmButtonText: '确定',
  1778. cancelButtonText: '取消',
  1779. type: 'warning'
  1780. }).then(() => {
  1781. let tempData = {
  1782. submitList: this.inboundDetailSelection
  1783. }
  1784. deleteInboundDetail(tempData).then(({data}) => {
  1785. if (data && data.code === 0) {
  1786. this.getInboundDetail()
  1787. this.inboundDetailSelection = []
  1788. this.$message.success('操作成功')
  1789. } else {
  1790. this.$message.error(data.msg)
  1791. }
  1792. })
  1793. })
  1794. },
  1795. // 批量编辑模态框
  1796. editBatchModel() {
  1797. if (this.currentRow.orderType === '采购入库' || this.currentRow.orderType === '销售退货') {
  1798. this.$message.warning('该类型单据不能编辑!')
  1799. return
  1800. }
  1801. if (this.editBatchVisible) {
  1802. this.editBatchVisible = false
  1803. } else {
  1804. this.editBatchVisible = true
  1805. }
  1806. },
  1807. // 批量保存
  1808. batchModel() {
  1809. let params = []
  1810. params = this.detailList
  1811. this.saveLoading = true
  1812. updateInboundDetail(params).then(({data}) => {
  1813. if (data && data.code === 0) {
  1814. this.getInboundDetail()
  1815. this.$message.success(data.msg)
  1816. this.editBatchVisible = false
  1817. } else {
  1818. this.$message.error(data.msg)
  1819. }
  1820. }).finally(() => {
  1821. this.saveLoading = false
  1822. })
  1823. },
  1824. // 入库明细
  1825. inboundDetailModal (row) {
  1826. let tempData = {
  1827. ...row,
  1828. orderType: this.currentRow.orderType
  1829. }
  1830. getInboundDetail2(tempData).then(({data}) => {
  1831. if (data && data.code === 0) {
  1832. this.detailList2 = data.rows
  1833. } else {
  1834. this.detailList2 = []
  1835. }
  1836. })
  1837. this.detailModal2 = true
  1838. },
  1839. // 库位输入校验
  1840. supplierBlur (tagNo) {
  1841. let tempData = {
  1842. tagno: tagNo,
  1843. conditionSql: " and SupplierID = '" + this.modalData.supplierId + "'" + " and site = '" + this.modalData.site + "'"
  1844. }
  1845. verifyData(tempData).then(({data}) => {
  1846. if (data && data.code === 0) {
  1847. if (data.baseListData.length > 0) {
  1848. this.modalData.supplierId = data.baseListData[0].SupplierID
  1849. this.modalData.supplierName = data.baseListData[0].SupplierName
  1850. } else {
  1851. this.modalData.supplierName = ''
  1852. }
  1853. }
  1854. })
  1855. },
  1856. chooseWareHouse (row) {
  1857. this.isChangeWarehouseBatch = false
  1858. this.tempWareHouseRow = row
  1859. this.getBaseList(20)
  1860. },
  1861. // 批量更换仓库
  1862. changeWarehouseBatch () {
  1863. if (this.currentRow.orderType === '采购入库' || this.currentRow.orderType === '销售退货') {
  1864. this.$message.warning('该类型单据不能编辑!')
  1865. return
  1866. }
  1867. if (this.inboundDetailSelection.length === 0) {
  1868. this.$message.warning('请先勾选需要更换仓库的明细行!')
  1869. return
  1870. }
  1871. this.isChangeWarehouseBatch = true
  1872. this.getBaseList(20)
  1873. },
  1874. // 获取基础数据列表S
  1875. getBaseList (val, type) {
  1876. this.tagNo = val
  1877. this.tagType = type
  1878. this.$nextTick(() => {
  1879. let strVal = ''
  1880. if (val === 506) {
  1881. strVal = this.modalData.supplierId
  1882. this.$refs.baseList.init(val, strVal)
  1883. }
  1884. if (val === 20) {
  1885. strVal = this.tempWareHouseRow.inWarehouse
  1886. this.$refs.baseList.init(val, strVal)
  1887. }
  1888. })
  1889. },
  1890. // 列表方法的回调
  1891. getBaseData (val) {
  1892. if (this.tagNo === 506) {
  1893. this.modalData.supplierId = val.SupplierID
  1894. this.modalData.supplierName = val.SupplierName
  1895. }
  1896. if (this.tagNo === 20) {
  1897. if (this.isChangeWarehouseBatch) {
  1898. // 批量更换仓库
  1899. this.inboundDetailSelection.forEach(row => {
  1900. row.inWarehouse = val.WareHouseID
  1901. row.inWarehouseName = val.WareHouseName
  1902. })
  1903. // 批量保存更新
  1904. this.saveLoading = true
  1905. updateInboundDetail(this.detailList).then(({data}) => {
  1906. if (data && data.code === 0) {
  1907. this.getInboundDetail()
  1908. this.$message.success('更换仓库成功')
  1909. } else {
  1910. this.$message.error(data.msg)
  1911. }
  1912. }).finally(() => {
  1913. this.saveLoading = false
  1914. this.isChangeWarehouseBatch = false
  1915. })
  1916. } else {
  1917. // 单行编辑仓库
  1918. this.tempWareHouseRow.inWarehouse = val.WareHouseID
  1919. this.tempWareHouseRow.inWarehouseName = val.WareHouseName
  1920. }
  1921. }
  1922. },
  1923. // 校验用户是否收藏
  1924. favoriteIsOk () {
  1925. let userFavorite = {
  1926. userId: this.$store.state.user.id,
  1927. languageCode: this.$i18n.locale
  1928. }
  1929. userFavoriteList(userFavorite).then(({data}) => {
  1930. for (let i = 0; i < data.list.length; i++) {
  1931. if (this.$route.meta.menuId === data.list[i].menuId) {
  1932. this.favorite = true
  1933. }
  1934. }
  1935. })
  1936. },
  1937. // 收藏 OR 取消收藏
  1938. favoriteFunction () {
  1939. let userFavorite = {
  1940. userId: this.$store.state.user.id,
  1941. functionId: this.$route.meta.menuId,
  1942. }
  1943. if (this.favorite) {
  1944. removeUserFavorite(userFavorite).then(({data}) => {
  1945. this.$message.success(data.msg)
  1946. this.favorite = false
  1947. })
  1948. } else {
  1949. // 收藏
  1950. saveUserFavorite(userFavorite).then(({data}) => {
  1951. this.$message.success(data.msg)
  1952. this.favorite = true
  1953. })
  1954. }
  1955. },
  1956. async exportExcel() {
  1957. this.searchData.limit = -1
  1958. this.searchData.page = 1
  1959. excel.exportTable({
  1960. url: "/inbound/searchInboundNotification",
  1961. columnMapping: this.columnList, //可以直接用table,不需要的列就剔除
  1962. mergeSetting: [],//需要合并的列
  1963. params: this.searchData,
  1964. fileName: this.exportName+".xlsx",
  1965. rowFetcher: res => res.data,
  1966. columnFormatter: [],
  1967. dropColumns: [],
  1968. })
  1969. },
  1970. // 动态列开始 获取 用户保存的 格式列
  1971. async getTableUserColumn (tableId, columnId) {
  1972. let queryTableUser = {
  1973. userId: this.$store.state.user.name,
  1974. functionId: this.$route.meta.menuId,
  1975. tableId: tableId,
  1976. status: true,
  1977. languageCode: this.$i18n.locale
  1978. }
  1979. await getTableUserListLanguage(queryTableUser).then(({data}) => {
  1980. if (data.rows.length > 0) {
  1981. switch (columnId) {
  1982. case 1:
  1983. this.columnList = data.rows
  1984. break;
  1985. }
  1986. } else {
  1987. this.getColumnList(tableId, columnId)
  1988. }
  1989. })
  1990. },
  1991. // 获取 tableDefault 列
  1992. async getColumnList (tableId, columnId) {
  1993. let queryTable = {
  1994. functionId: this.$route.meta.menuId,
  1995. tableId: tableId,
  1996. languageCode: this.$i18n.locale
  1997. }
  1998. await getTableDefaultListLanguage(queryTable).then(({data}) => {
  1999. if (data.rows.length !== 0) {
  2000. switch (columnId) {
  2001. case 1:
  2002. this.columnList = data.rows
  2003. break;
  2004. }
  2005. }
  2006. })
  2007. },
  2008. //获取按钮的权限数据
  2009. getButtonAuthData () {
  2010. let searchFlag = this.isAuth(this.menuId + ":search")
  2011. let saveFlag = this.isAuth(this.menuId + ":save")
  2012. let updateFlag = this.isAuth(this.menuId + ":update")
  2013. let deleteFlag = this.isAuth(this.menuId + ":delete")
  2014. let archiveFlag = this.isAuth(this.menuId + ":archive")
  2015. let closeFlag = this.isAuth(this.menuId + ":close")
  2016. let issueFlag = this.isAuth(this.menuId + ":issue")
  2017. //处理页面的权限数据
  2018. this.authSearch = !searchFlag
  2019. this.authSave = !saveFlag
  2020. this.authUpdate = !updateFlag
  2021. this.authDelete = !deleteFlag
  2022. this.authArchive = !archiveFlag
  2023. this.authClose = !closeFlag
  2024. this.authIssue = !issueFlag
  2025. },
  2026. // 加载入库类别列表
  2027. loadCategoryList () {
  2028. getInboundCategoryList({}).then(({data}) => {
  2029. if (data && data.code === 0) {
  2030. this.categoryList = data.rows || []
  2031. }
  2032. })
  2033. },
  2034. // 加载部门列表
  2035. loadDepartmentList () {
  2036. getDepartmentList({}).then(({data}) => {
  2037. if (data && data.code === 0) {
  2038. this.departmentList = data.rows || []
  2039. }
  2040. })
  2041. },
  2042. // 标签导入
  2043. labelImportModal (row) {
  2044. // 权限检查:与批量编辑按钮相同的权限控制
  2045. if (this.currentRow.orderStatus !== '草稿' && this.currentRow.orderStatus !== '编辑中') {
  2046. this.$message.warning('只有草稿或编辑中状态的单据才能导入标签!')
  2047. return
  2048. }
  2049. // 准备传递给组件的数据
  2050. let currentData = {
  2051. site: this.currentRow.site,
  2052. buNo: this.currentRow.buNo,
  2053. orderNo: this.currentRow.orderNo,
  2054. orderType: this.currentRow.orderType,
  2055. orderStatus: this.currentRow.orderStatus,
  2056. relatedOrderNo: row.relatedOrderNo,
  2057. relatedOrderLineNo: row.relatedOrderLineNo,
  2058. partNo: row.partNo
  2059. }
  2060. // 打开标签导入组件
  2061. this.$nextTick(() => {
  2062. this.$refs.labelImportUpload.init(currentData)
  2063. })
  2064. },
  2065. }
  2066. }
  2067. </script>
  2068. <style scoped>
  2069. /deep/ .customer-tab .el-tabs__content {
  2070. padding: 5px !important;
  2071. }
  2072. .el-table /deep/ .cell{
  2073. height: auto;
  2074. line-height: 1.5;
  2075. }
  2076. </style>