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.

3116 lines
106 KiB

11 months ago
11 months ago
4 months ago
11 months ago
10 months ago
11 months ago
11 months ago
4 months ago
11 months ago
11 months ago
11 months ago
11 months ago
3 months ago
11 months ago
3 months ago
11 months ago
11 months ago
10 months ago
5 months ago
5 months ago
10 months ago
11 months ago
5 months ago
11 months ago
10 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
5 months ago
11 months ago
11 months ago
9 months ago
9 months ago
9 months ago
9 months ago
11 months ago
5 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
10 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
4 months ago
5 months ago
10 months ago
10 months ago
10 months ago
9 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
9 months ago
11 months ago
11 months ago
10 months ago
10 months ago
4 months ago
11 months ago
10 months ago
3 months ago
11 months ago
11 months ago
11 months ago
11 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
10 months ago
11 months ago
4 months ago
11 months ago
5 months ago
11 months ago
9 months ago
11 months ago
11 months ago
9 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
5 months ago
11 months ago
5 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
10 months ago
11 months ago
11 months ago
11 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
5 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
5 months ago
11 months ago
11 months ago
10 months ago
11 months ago
11 months ago
11 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
5 months ago
11 months ago
3 months ago
3 months ago
3 months ago
3 months ago
10 months ago
9 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
3 months ago
3 months ago
11 months ago
4 months ago
3 months ago
3 months ago
11 months ago
11 months ago
3 months ago
3 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
9 months ago
9 months ago
9 months ago
9 months ago
11 months ago
11 months ago
3 months ago
3 months ago
3 months ago
3 months ago
11 months ago
11 months ago
9 months ago
11 months ago
4 months ago
11 months ago
5 months ago
11 months ago
10 months ago
11 months ago
5 months ago
5 months ago
5 months ago
11 months ago
5 months ago
3 months ago
5 months ago
3 months ago
5 months ago
5 months ago
5 months ago
5 months ago
11 months ago
5 months ago
11 months ago
5 months ago
11 months ago
5 months ago
11 months ago
5 months ago
11 months ago
5 months ago
4 months ago
11 months ago
11 months ago
11 months ago
9 months ago
11 months ago
11 months ago
11 months ago
10 months ago
10 months ago
7 months ago
10 months ago
10 months ago
10 months ago
5 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
11 months ago
8 months ago
11 months ago
3 months ago
11 months ago
4 months ago
10 months ago
5 months ago
11 months ago
  1. <template>
  2. <div class="mod-config">
  3. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
  4. <el-form-item :label="'BU:'">
  5. <el-select v-model="searchData.buNo" placeholder="请选择" >
  6. <el-option label="全部" value=""></el-option>
  7. <el-option
  8. v-for = "i in buList"
  9. :key = "i.buNo"
  10. :label = "i.buDesc"
  11. :value = "i.buNo">
  12. </el-option>
  13. </el-select>
  14. </el-form-item>
  15. <el-form-item :label="'发货通知单:'">
  16. <el-input v-model="searchData.delNo" style="width: 120px"></el-input>
  17. </el-form-item>
  18. <el-form-item :label="'CMC Invoice:'">
  19. <el-input v-model="searchData.cmcInvoice" style="width: 120px"></el-input>
  20. </el-form-item>
  21. <el-form-item :label="'通知单状态:'">
  22. <el-select filterable v-model="searchData.notifyStatus" style="width: 120px">
  23. <el-option label="全部" value=""></el-option>
  24. <el-option label="已下达" value="已下达"></el-option>
  25. <el-option label="仓库已确认" value="仓库已确认"></el-option>
  26. <el-option label="已报关" value="已报关"></el-option>
  27. <el-option label="订单取消" value="订单取消"></el-option>
  28. </el-select>
  29. </el-form-item>
  30. <el-form-item :label="'ReadyDate'" >
  31. <el-date-picker
  32. style="width: 120px"
  33. v-model="searchData.startDate"
  34. type="date"
  35. format="yyyy-MM-dd"
  36. value-format="yyyy-MM-dd"
  37. placeholder="选择日期">
  38. </el-date-picker>
  39. </el-form-item>
  40. <el-form-item :label="'To'" >
  41. <el-date-picker
  42. style="width: 120px"
  43. v-model="searchData.endDate"
  44. type="date"
  45. format="yyyy-MM-dd"
  46. value-format="yyyy-MM-dd"
  47. placeholder="选择日期">
  48. </el-date-picker>
  49. </el-form-item>
  50. <el-form-item :label="'是否导出:'">
  51. <el-select v-model="searchData.exportFlag" style="width: 120px">
  52. <el-option label="全部" value=""></el-option>
  53. <el-option label="已导出" value="Y"></el-option>
  54. <el-option label="未导出" value="N"></el-option>
  55. </el-select>
  56. </el-form-item>
  57. <el-form-item label="改单">
  58. <el-checkbox v-model="searchData.modifyData" true-label="true" false-label="false" @change="searchTable()"></el-checkbox>
  59. </el-form-item>
  60. <el-form-item :label="' '" >
  61. <el-button @click="searchTable()" type="primary" style="margin-left: 2px;margin-top: 0px">{{'查询'}}</el-button>
  62. </el-form-item>
  63. </el-form>
  64. <el-table
  65. @row-click="changeData"
  66. highlight-current-row
  67. :height="height"
  68. :data="dataList"
  69. ref="mainTable"
  70. border :cell-style="cellStyle"
  71. :row-class-name="tableRowClassName"
  72. v-loading="dataListLoading"
  73. style="width: 100%;">
  74. <el-table-column
  75. header-align="center"
  76. align="center"
  77. width="100"
  78. fixed="left"
  79. label="操作">
  80. <template slot-scope="scope">
  81. <a type="text" size="small" v-if="scope.row.notifyStatus==='已报关'" @click="updateModelOpen(scope.row)">修改</a>
  82. <a type="text" size="small" v-if="scope.row.notifyStatus==='已下达'" @click="confirmModelOpen(scope.row)">仓库确认</a>
  83. <a type="text" size="small" v-if="scope.row.notifyStatus==='仓库已确认'" @click="cancerConfirm(scope.row)">取消确认</a>
  84. </template>
  85. </el-table-column>
  86. <el-table-column
  87. v-for="(item,index) in columnList1" :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]"
  99. style="width: 100px; height: 80px"/></span>
  100. </template>
  101. </el-table-column>
  102. </el-table>
  103. <el-pagination
  104. @size-change="sizeChangeHandle"
  105. @current-change="currentChangeHandle"
  106. :current-page="pageIndex"
  107. :page-sizes="[20, 50, 100, 1000]"
  108. :page-size="pageSize"
  109. :total="totalPage"
  110. layout="total, sizes, prev, pager, next, jumper">
  111. </el-pagination>
  112. <el-tabs style="font-size: 12px;min-height: 200px" class="customer-tab" v-model="activeName" type="border-card" @tab-click="tabClick" >
  113. <el-tab-pane :label="currentRow.cmcInvoice+'明细'" name="detail">
  114. <el-table
  115. :height="height" ref="cloDetailTable"
  116. :data="dataList2" show-summary :summary-method="getDetailSummaries"
  117. border :cell-style="cellStyleDetail"
  118. style="width: 100%;">
  119. <el-table-column
  120. v-for="(item,index) in columnList2" :key="index"
  121. :sortable="item.columnSortable"
  122. :prop="item.columnProp"
  123. :header-align="item.headerAlign"
  124. :show-overflow-tooltip="item.showOverflowTooltip"
  125. :align="item.align"
  126. :fixed="item.fixed==''?false:item.fixed"
  127. :min-width="item.columnWidth"
  128. :label="item.columnLabel">
  129. <template slot-scope="scope">
  130. <!-- 金额字段特殊处理 -->
  131. <span v-if="item.columnProp === 'ttlAmount' || item.columnProp === 'sumPrice'">
  132. {{!!scope.row[item.columnProp]?scope.row[item.columnProp].toFixed(2):''}}
  133. </span>
  134. <!-- PN字段特殊处理添加提示信息 -->
  135. <template v-else-if="item.columnProp === 'pn'">
  136. <el-tooltip
  137. v-if="isPnDataIncomplete(scope.row)"
  138. :content="getPnIncompleteTooltip(scope.row)"
  139. placement="top">
  140. <span
  141. v-if="!item.columnHidden"
  142. class="clickable-pn"
  143. @click="navigateToPartHsCode(scope.row.pn)">
  144. {{ scope.row[item.columnProp] }}
  145. </span>
  146. </el-tooltip>
  147. <span v-else-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  148. </template>
  149. <!-- 其他字段正常处理 -->
  150. <template v-else>
  151. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  152. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  153. </template>
  154. </template>
  155. </el-table-column>
  156. </el-table>
  157. </el-tab-pane>
  158. <el-tab-pane label="手工装箱" name="box">
  159. <el-button @click="oneClickPacking()" type="primary" style="margin-left: 2px;margin-top: 0px">{{'一键装箱'}}</el-button>
  160. <el-button @click="upLoadPallet()" type="primary" style="margin-left: 2px;margin-top: 0px">{{'导入装箱单'}}</el-button>
  161. <el-button @click="newPalletModel()" type="primary" style="margin-left: 2px;margin-top: 0px">{{'装箱'}}</el-button>
  162. <el-button @click="palletMaintenance()" type="primary" style="margin-left: 2px;margin-top: 0px">{{'栈板维护'}}</el-button>
  163. <el-button @click="exportExcel()" type="primary" style="margin-left: 2px;margin-top: 0px">{{'导出模版'}}</el-button>
  164. <el-table ref="detailTable"
  165. :data="dataList4"
  166. :height="height"
  167. border show-summary :summary-method="getSummaries"
  168. v-loading="dataListLoading"
  169. style="width: 100%; ">
  170. <el-table-column
  171. header-align="center"
  172. align="center"
  173. width="150"
  174. fixed="left"
  175. label="操作">
  176. <template slot-scope="scope">
  177. <a type="text" size="small" @click="updatePalletModel(scope.row)">修改</a>
  178. <a type="text" size="small" @click="deletePallet(scope.row)">删除</a>
  179. </template>
  180. </el-table-column>
  181. <el-table-column
  182. v-for="(item,index) in columnList4" :key="index"
  183. :sortable="item.columnSortable"
  184. :prop="item.columnProp"
  185. :header-align="item.headerAlign"
  186. :show-overflow-tooltip="item.showOverflowTooltip"
  187. :align="item.align"
  188. :fixed="item.fixed==''?false:item.fixed"
  189. :min-width="item.columnWidth"
  190. :label="item.columnLabel">
  191. <template slot-scope="scope">
  192. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  193. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  194. style="width: 100px; height: 80px"/></span>
  195. </template>
  196. </el-table-column>
  197. </el-table>
  198. </el-tab-pane>
  199. <el-tab-pane label="装箱明细" name="pallet">
  200. <packing-detail-tab
  201. ref="packingDetailTab"
  202. :current-row="currentRow"
  203. :height="height"
  204. :show-actions="true">
  205. </packing-detail-tab>
  206. </el-tab-pane>
  207. </el-tabs>
  208. <el-dialog title="仓库确认" :close-on-click-modal="false" v-drag :visible.sync="confirmModelFlag" width="400px">
  209. <el-form label-position="top" style="margin-left: 7px;margin-top: -5px;">
  210. <el-row :gutter="20">
  211. <el-col :span="12">
  212. <el-form-item :label="'CMC Invoice'" >
  213. <el-input v-model="confirmModel.cmcInvoice" disabled ></el-input>
  214. </el-form-item>
  215. </el-col>
  216. <el-col :span="12">
  217. <el-form-item :label="'ReadyDate'" >
  218. <el-input v-model="confirmModel.readyDate" disabled ></el-input>
  219. </el-form-item>
  220. </el-col>
  221. <el-col :span="12">
  222. <el-form-item :label="'预计发货日期'" >
  223. <el-date-picker
  224. style="width: 100%"
  225. v-model="confirmModel.notifyDate"
  226. type="date"
  227. format="yyyy-MM-dd"
  228. value-format="yyyy-MM-dd"
  229. placeholder="选择日期">
  230. </el-date-picker>
  231. </el-form-item>
  232. </el-col>
  233. </el-row>
  234. </el-form>
  235. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  236. <el-button type="primary" @click="confirmDo()">保存</el-button>
  237. <el-button type="primary" @click="confirmModelFlag=false">关闭</el-button>
  238. </el-footer>
  239. </el-dialog>
  240. <el-dialog title="修改" :close-on-click-modal="false" v-drag :visible.sync="updateModelFlag" width="350px">
  241. <el-form label-position="top" style="margin-left: 7px;margin-top: -5px;">
  242. <el-row :gutter="20">
  243. <el-col :span="12">
  244. <el-form-item :label="'ReadyDate'" >
  245. <el-date-picker
  246. style="width: 100%"
  247. v-model="confirmModel.readyDate"
  248. type="date"
  249. format="yyyy-MM-dd"
  250. value-format="yyyy-MM-dd"
  251. placeholder="选择日期">
  252. </el-date-picker>
  253. </el-form-item>
  254. </el-col>
  255. <el-col :span="12">
  256. <el-form-item :label="'预计发货日期'" >
  257. <el-date-picker
  258. style="width: 100%"
  259. v-model="confirmModel.notifyDate"
  260. type="date"
  261. format="yyyy-MM-dd"
  262. value-format="yyyy-MM-dd"
  263. placeholder="选择日期">
  264. </el-date-picker>
  265. </el-form-item>
  266. </el-col>
  267. </el-row>
  268. </el-form>
  269. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  270. <el-button type="primary" @click="updateDo()">保存</el-button>
  271. <el-button type="primary" @click="updateModelFlag=false">关闭</el-button>
  272. </el-footer>
  273. </el-dialog>
  274. <el-dialog title="维护箱" :close-on-click-modal="false" v-drag :visible.sync="boxModelFlag" width="500px">
  275. <el-form label-position="top" style="margin-left: 7px;margin-top: -5px;">
  276. <el-row :gutter="20">
  277. <el-col :span="12">
  278. <el-form-item :label="boxModelData.type===1?'物料编码':''">
  279. <span v-if="boxModelData.type===0" slot="label" @click="openPartDialog()"><a herf="#">物料编码</a></span>
  280. <el-input v-model="boxModelData.pn" :disabled="boxModelData.type===1" ></el-input>
  281. </el-form-item>
  282. </el-col>
  283. <el-col :span="12">
  284. <el-form-item :label="'数量'" >
  285. <el-input v-model="boxModelData.qty" type="number" ></el-input>
  286. </el-form-item>
  287. </el-col>
  288. <el-col :span="12" v-if="boxModelData.type===0">
  289. <el-form-item :label="'PO'" >
  290. <el-input v-model="boxModelData.poNo" ></el-input>
  291. </el-form-item>
  292. </el-col>
  293. <el-col :span="12">
  294. <el-form-item :label="'箱数'" >
  295. <el-input v-model="boxModelData.boxQty"></el-input>
  296. </el-form-item>
  297. </el-col>
  298. <el-col :span="12">
  299. <el-form-item :label="'ROLLS'" >
  300. <el-input v-model="boxModelData.rolls" ></el-input>
  301. </el-form-item>
  302. </el-col>
  303. <el-col :span="12">
  304. <el-form-item :label="'毛重'" >
  305. <el-input v-model="boxModelData.grossWeight"></el-input>
  306. </el-form-item>
  307. </el-col>
  308. <el-col :span="12">
  309. <el-form-item :label="'净重'" >
  310. <el-input v-model="boxModelData.netWeight" ></el-input>
  311. </el-form-item>
  312. </el-col>
  313. </el-row>
  314. </el-form>
  315. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  316. <el-button type="primary" @click="saveBoxHeader()">保存</el-button>
  317. <el-button type="primary" @click="boxModelFlag=false">关闭</el-button>
  318. </el-footer>
  319. </el-dialog>
  320. <!-- 装箱新增/修改栈板 -->
  321. <el-dialog
  322. :title="palletModelData.addFlag===1 ? '修改栈板' : '手工装箱'"
  323. :close-on-click-modal="false"
  324. v-drag
  325. :visible.sync="palletModelFlag"
  326. width="780px"
  327. class="pallet-dialog">
  328. <!-- 区域 1箱信息 -->
  329. <div class="section section-header">
  330. <h4 class="section-title">箱信息</h4>
  331. <el-divider></el-divider>
  332. <el-form label-position="top" class="box-info-form">
  333. <el-row :gutter="20">
  334. <el-col :span="8">
  335. <el-form-item label="箱数">
  336. <el-input v-model="palletModelData.boxQty" type="number" placeholder="请输入箱数" @input="calculateWeightsByBoxQty"></el-input>
  337. </el-form-item>
  338. </el-col>
  339. <el-col :span="8">
  340. <el-form-item label="毛重">
  341. <el-input v-model="palletModelData.grossWeight" type="number" placeholder="自动计算"></el-input>
  342. </el-form-item>
  343. </el-col>
  344. <el-col :span="8">
  345. <el-form-item label="净重">
  346. <el-input v-model="palletModelData.netWeight" type="number" placeholder="自动计算"></el-input>
  347. </el-form-item>
  348. </el-col>
  349. </el-row>
  350. </el-form>
  351. </div>
  352. <!-- 区域 2箱明细 -->
  353. <div class="section section-detail">
  354. <h4 class="section-title">箱明细</h4>
  355. <el-divider></el-divider>
  356. <div class="table-wrapper">
  357. <el-table
  358. ref="partTableRef"
  359. :data="dataList8"
  360. height="100%"
  361. stripe
  362. border
  363. class="zxClass"
  364. style="width: 100%;">
  365. <el-table-column prop="pn" label="PN" min-width="120"></el-table-column>
  366. <el-table-column prop="partDescription" label="Description" min-width="220"></el-table-column>
  367. <el-table-column prop="qty" label="原数量" align="right" width="70"></el-table-column>
  368. <el-table-column prop="surplusQty" label="可装箱数量" align="right" width="80"></el-table-column>
  369. <el-table-column label="装箱数量" align="center" width="80">
  370. <template slot-scope="scope">
  371. <el-input v-model.number="scope.row.useQty" type="number" :min="0" :max="999999" size="mini" @input="calculateRolls(scope.row)"></el-input>
  372. </template>
  373. </el-table-column>
  374. <el-table-column label="Rolls" align="center" width="80">
  375. <template slot-scope="scope">
  376. <el-input v-model.number="scope.row.rolls" type="number" :min="0" :max="999999" size="mini" placeholder="自动计算"></el-input>
  377. </template>
  378. </el-table-column>
  379. <el-table-column label="操作" align="center" width="70">
  380. <template slot-scope="scope">
  381. <a type="text" size="small" @click="fillUseQty(scope.row)">全数装箱</a>
  382. </template>
  383. </el-table-column>
  384. </el-table>
  385. </div>
  386. </div>
  387. <!-- 底部操作按钮 -->
  388. <div slot="footer" class="dialog-footer">
  389. <el-button type="primary" @click="savePalletHeader(0)">保存</el-button>
  390. <el-button type="primary" @click="savePalletHeader(1)">保存并关闭</el-button>
  391. <el-button @click="palletModelFlag=false">关闭</el-button>
  392. </div>
  393. </el-dialog>
  394. <el-dialog
  395. :title=" '修改栈板'"
  396. :close-on-click-modal="false"
  397. v-drag
  398. :visible.sync="palletEditFlag"
  399. width="240px"
  400. class="pallet-dialog">
  401. <div class="section section-header">
  402. <el-divider></el-divider>
  403. <el-form label-position="top" class="box-info-form">
  404. <el-row :gutter="20">
  405. <el-col :span="24">
  406. <el-form-item label="栈板高度(M)">
  407. <el-input v-model="palletModelData.height" type="number" placeholder="请输入栈板高度(M)"></el-input>
  408. </el-form-item>
  409. </el-col>
  410. <el-col :span="24">
  411. <el-form-item label="托数">
  412. <el-input v-model="palletModelData.palletQty" type="number" placeholder="请输入托数"></el-input>
  413. </el-form-item>
  414. </el-col>
  415. </el-row>
  416. </el-form>
  417. </div>
  418. <!-- 底部操作按钮 -->
  419. <div slot="footer" class="dialog-footer">
  420. <el-button type="primary" @click="updateCodelPalletHeaderPalletQty">保存</el-button>
  421. <el-button @click="palletEditFlag=false">关闭</el-button>
  422. </div>
  423. </el-dialog>
  424. <el-dialog title="一键装箱" :close-on-click-modal="false" v-drag :visible.sync="oneClickPackingModelFlag" width="170px">
  425. <el-form label-position="top" style="margin-left: 7px;margin-top: 10px;">
  426. <el-row :gutter="20">
  427. <el-col :span="12">
  428. <el-form-item :label="''" >
  429. <el-checkbox v-model="oneClickPackingModelData.boxRemnant">是否显示零数箱</el-checkbox>
  430. </el-form-item>
  431. </el-col>
  432. </el-row>
  433. </el-form>
  434. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  435. <el-button type="primary" @click="saveOneClickPacking()">保存</el-button>
  436. <el-button type="primary" @click="oneClickPackingModelFlag=false">关闭</el-button>
  437. </el-footer>
  438. </el-dialog>
  439. <el-dialog :close-on-click-modal="false" v-drag :visible.sync="palletMaintenanceModelFlag" width="450px">
  440. <div slot="title" class="dialog-title">
  441. <span>栈板维护</span>
  442. <el-tooltip effect="dark" placement="top">
  443. <div slot="content">
  444. <div>栈板维护功能说明</div>
  445. <div> 系统会自动加载当前BU下的所有栈板</div>
  446. <div> 栈板高度单位为米(M)请输入准确数值</div>
  447. <div> 只有托数大于0的栈板记录才会被保存</div>
  448. </div>
  449. <i class="el-icon-question" style="color: #17b3a3; margin-left: 8px; cursor: pointer; font-size: 16px;"></i>
  450. </el-tooltip>
  451. </div>
  452. <!-- 栈板记录列表 -->
  453. <div style="margin: 15px 0;">
  454. <el-table :data="palletMaintenanceRecords" border style="width: 100%; margin-bottom: 15px;" class="zxClass"
  455. max-height="200" v-if="palletMaintenanceRecords.length > 0">
  456. <el-table-column label="栈板类型" min-width="100">
  457. <template slot-scope="scope">
  458. <el-input v-model="scope.row.palletType" disabled style="width: 100%;"></el-input>
  459. </template>
  460. </el-table-column>
  461. <el-table-column width="120">
  462. <template slot="header">
  463. <span>栈板高度(M)</span>
  464. </template>
  465. <template slot-scope="scope">
  466. <el-input v-model="scope.row.height" type="text" placeholder="请输入高度" style="width: 100%;"></el-input>
  467. </template>
  468. </el-table-column>
  469. <el-table-column width="100">
  470. <template slot="header">
  471. <span>托数</span>
  472. </template>
  473. <template slot-scope="scope">
  474. <el-input v-model="scope.row.palletQty" type="text" placeholder="请输入托数" style="width: 100%;"></el-input>
  475. </template>
  476. </el-table-column>
  477. </el-table>
  478. <div v-if="palletMaintenanceRecords.length === 0" style="text-align: center; color: #999; padding: 20px; border: 1px dashed #ddd;">
  479. 正在加载栈板记录...
  480. </div>
  481. <!-- 操作提示 -->
  482. <div v-if="palletMaintenanceRecords.length > 0" style="margin-top: 10px; padding: 8px 12px; background: #f0f9ff; border: 1px solid #b3d8ff; border-radius: 4px; font-size: 12px; color: #409EFF;">
  483. <i class="el-icon-info" style="margin-right: 4px;"></i>
  484. <span>提示托数大于0的记录才会被保存</span>
  485. </div>
  486. </div>
  487. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  488. <el-button type="primary" @click="savePalletMaintenance()">确定</el-button>
  489. <el-button type="primary" @click="palletMaintenanceModelFlag=false">关闭</el-button>
  490. </el-footer>
  491. </el-dialog>
  492. <el-dialog title="物料信息" @close="closePartDialog" @open="openPartDialog" :visible.sync="partFlag" width="559px" v-drag>
  493. <el-form inline="inline" label-position="top" :model="partData" style="margin-left: 7px;margin-top: -5px;">
  494. </el-form>
  495. <el-table
  496. :height="height + 110"
  497. :data="partList"
  498. stripe
  499. highlight-current-row
  500. border
  501. @row-dblclick="partRowDblclick"
  502. style="width: 100%;">
  503. <el-table-column
  504. prop="pn"
  505. header-align="center"
  506. align="center"
  507. label="物料编码">
  508. </el-table-column>
  509. <el-table-column
  510. prop="part_desc"
  511. header-align="center"
  512. align="center"
  513. label="物料名称">
  514. </el-table-column>
  515. </el-table>
  516. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  517. <el-button @click="partFlag = false">关闭</el-button>
  518. </el-footer>
  519. </el-dialog>
  520. <el-dialog title="栈板" @close="closePalletDialog" @open="openPalletDialog" :visible.sync="palletFlag" width="559px" v-drag>
  521. <el-form inline="inline" label-position="top" :model="palletData" style="margin-left: 7px;margin-top: -5px;">
  522. <el-form-item label="栈板类型">
  523. <el-input v-model="palletData.palletType" clearable style="width: 110px"></el-input>
  524. </el-form-item>
  525. <el-form-item label=" ">
  526. <el-button type="primary" style="padding: 3px 12px" @click="searchPalletList()">查询</el-button>
  527. </el-form-item>
  528. </el-form>
  529. <el-table
  530. :height="height + 110"
  531. :data="palletList"
  532. stripe
  533. highlight-current-row
  534. border
  535. @row-dblclick="palletRowDblclick"
  536. style="width: 100%;">
  537. <el-table-column
  538. prop="palletNo"
  539. header-align="center"
  540. align="center"
  541. width="120"
  542. label="栈板编码">
  543. </el-table-column>
  544. <el-table-column
  545. prop="palletType"
  546. header-align="center"
  547. align="center"
  548. label="栈板类型">
  549. </el-table-column>
  550. <el-table-column
  551. prop="applicationArea"
  552. header-align="center"
  553. align="center"
  554. label="应用环境">
  555. </el-table-column>
  556. <el-table-column
  557. prop="length"
  558. header-align="center"
  559. align="center"
  560. label="长(M)">
  561. </el-table-column>
  562. <el-table-column
  563. prop="width"
  564. header-align="center"
  565. align="center"
  566. label="宽(M)">
  567. </el-table-column>
  568. <el-table-column
  569. prop="height"
  570. header-align="center"
  571. align="center"
  572. label="栈板高(M)">
  573. </el-table-column>
  574. </el-table>
  575. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  576. <el-button @click="palletFlag = false">关闭</el-button>
  577. </el-footer>
  578. </el-dialog>
  579. <!-- 导入 -->
  580. <pallet-upload-excel ref="palletUploadExcel" @refreshTable="searchPalletTable" v-drag></pallet-upload-excel>
  581. <!--列表的组件-->
  582. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  583. </div>
  584. </template>
  585. <script>
  586. import Chooselist from '@/views/modules/common/Chooselist_eam'
  587. import {} from "@/api/sysLanguage.js"
  588. import palletUploadExcel from "./pallet_upload_excel.vue";
  589. import PackingDetailTab from "./components/PackingDetailTab.vue";
  590. import {
  591. searchEcssCoDelNotifyHeaderForCK,
  592. searchEcssCoDelNotifyDetail,
  593. confirmEcssDel,
  594. updateEcssDel,
  595. cancerConfirmEcssDel,
  596. searchCoDelPalletDataNew,
  597. searchEcssCoDelPalletHeaderData,
  598. searchEcssCoDelPalletDetailData,
  599. savePalletHeader,
  600. deletePalletHeader,
  601. savePalletDetail,
  602. deletePalletDetail,
  603. saveOneClickPacking,
  604. savePalletMaintenance,
  605. getNotifyPartDetail,
  606. searchPalletList,
  607. updateExportFlag,
  608. updateCodelPalletHeaderPalletQty,
  609. getPartPackageProperties
  610. }from "@/api/ecss/ecss.js"
  611. import {getBuList}from '@/api/factory/site.js'
  612. import excel from "@/utils/excel-util.js";
  613. import excelOpts from '@/utils/export-options.js'
  614. import ExportUtil from "@/utils/export";
  615. import { getTableUserListLanguage} from "@/api/table.js"
  616. import {getTableDefaultListLanguage} from "../../../api/table";
  617. export default {
  618. name: "null",
  619. components:{
  620. palletUploadExcel,
  621. Chooselist,
  622. PackingDetailTab,
  623. },
  624. data() {
  625. return {
  626. multipleSelection: [],
  627. palletFlag:false,
  628. palletList:[],
  629. palletData:{},
  630. partFlag:false,
  631. partData:{},
  632. partList:[],
  633. pageIndex: 1,
  634. pageSize: 100,
  635. totalPage: 0,
  636. // 选中行持久化相关
  637. selectedRowKey: null, // 当前选中行的唯一标识
  638. height: 200,
  639. buList:[],
  640. dataList:[],
  641. dataList2:[],
  642. dataList3:[],
  643. dataList4:[],
  644. dataList5:[],
  645. dataList8:[],
  646. notifyDetailMap: new Map(),
  647. boxDetailData:{
  648. site:'',
  649. buNo:'',
  650. delNo:'',
  651. seqNo:'',
  652. },
  653. dataListLoading: false,
  654. boxDetailModelFlag: false,
  655. searchData: {
  656. page: 1,
  657. limit: 100,
  658. buNo:'',
  659. delNo:'',
  660. cmcInvoice:'',
  661. notifyStatus:'',
  662. startDate:'',
  663. endDate:'',
  664. exportFlag:'',
  665. username:this.$store.state.user.name,
  666. },
  667. oneClickPackingModelFlag:false,
  668. oneClickPackingModelData:{
  669. boxRemnant: false,
  670. },
  671. // 栈板维护相关
  672. palletMaintenanceModelFlag: false,
  673. palletMaintenanceRecords: [],
  674. palletModelFlag:false,
  675. palletEditFlag:false,
  676. palletModelData:{
  677. addFlag:0,
  678. site:'',
  679. buNo:'',
  680. delNo:'',
  681. seqNo:'',
  682. palletNo:'',
  683. palletQty:'',
  684. length:'',
  685. width:'',
  686. height:'',
  687. boxQty:'',
  688. grossWeight:'',
  689. netWeight:'',
  690. palletRemark:'',
  691. },
  692. boxModelFlag:false,
  693. boxModelData:{
  694. addFlag:0,
  695. site:'',
  696. buNo:'',
  697. delNo:'',
  698. seqNo:'',
  699. itemNo:'',
  700. partNo:'',
  701. pn:'',
  702. qty:'',
  703. poNo:'',
  704. boxQty:'',
  705. rolls:'',
  706. },
  707. buttons:{
  708. search:'查询',
  709. },
  710. confirmModelFlag:false,
  711. updateModelFlag:false,
  712. confirmModel:{
  713. site:'',
  714. buDesc:'',
  715. cmcInvoice:'',
  716. delNo:'',
  717. readyDate:'',
  718. shippingMode:'',
  719. destination:'',
  720. notifyDate:'',
  721. remark:'',
  722. },
  723. activeName:'detail',
  724. columnList1: [
  725. {
  726. userId: this.$store.state.user.name,
  727. functionId: 801002,
  728. serialNumber: '801002Table1BuDesc',
  729. tableId: "801002Table1",
  730. tableName: "关务系统发货通知单",
  731. columnProp: "buDesc",
  732. headerAlign: "center",
  733. align: "left",
  734. columnLabel: "BU",
  735. columnHidden: false,
  736. columnImage: false,
  737. columnSortable: false,
  738. sortLv: 0,
  739. status: true,
  740. fixed: '',
  741. columnWidth: 60
  742. },
  743. {
  744. userId: this.$store.state.user.name,
  745. functionId: 801002,
  746. serialNumber: '801002Table1CmcInvoice',
  747. tableId: "801002Table1",
  748. tableName: "关务系统发货通知单",
  749. columnProp: "cmcInvoice",
  750. headerAlign: "center",
  751. align: "left",
  752. columnLabel: "CMC Invoice",
  753. columnHidden: false,
  754. columnImage: false,
  755. columnSortable: false,
  756. sortLv: 0,
  757. status: true,
  758. fixed: '',
  759. columnWidth: 100
  760. },
  761. {
  762. userId: this.$store.state.user.name,
  763. functionId: 801002,
  764. serialNumber: '801002Table1DelNo',
  765. tableId: "801002Table1",
  766. tableName: "关务系统发货通知单",
  767. columnProp: "delNo",
  768. headerAlign: "center",
  769. align: "center",
  770. columnLabel: "发货通知单号",
  771. columnHidden: false,
  772. columnImage: false,
  773. columnSortable: false,
  774. sortLv: 0,
  775. status: true,
  776. fixed: '',
  777. columnWidth: 110
  778. },
  779. {
  780. userId: this.$store.state.user.name,
  781. functionId: 801002,
  782. serialNumber: '801002Table1ReadyDate',
  783. tableId: "801002Table1",
  784. tableName: "关务系统发货通知单",
  785. columnProp: "readyDate",
  786. headerAlign: "center",
  787. align: "center",
  788. columnLabel: "ReadyDate",
  789. columnHidden: false,
  790. columnImage: false,
  791. columnSortable: false,
  792. sortLv: 0,
  793. status: true,
  794. fixed: '',
  795. columnWidth: 100
  796. },
  797. {
  798. userId: this.$store.state.user.name,
  799. functionId: 801002,
  800. serialNumber: '801002Table1CustomerName',
  801. tableId: "801002Table1",
  802. tableName: "关务系统发货通知单",
  803. columnProp: "customerName",
  804. headerAlign: "center",
  805. align: "left",
  806. columnLabel: "客户名称",
  807. columnHidden: false,
  808. columnImage: false,
  809. columnSortable: false,
  810. sortLv: 0,
  811. status: true,
  812. fixed: '',
  813. columnWidth: 220
  814. },
  815. {
  816. userId: this.$store.state.user.name,
  817. functionId: 801002,
  818. serialNumber: '801002Table1ShippingMode',
  819. tableId: "801002Table1",
  820. tableName: "关务系统发货通知单",
  821. columnProp: "shippingMode",
  822. headerAlign: "center",
  823. align: "left",
  824. columnLabel: "ShippingMode",
  825. columnHidden: false,
  826. columnImage: false,
  827. columnSortable: false,
  828. sortLv: 0,
  829. status: true,
  830. fixed: '',
  831. columnWidth: 100
  832. },
  833. {
  834. userId: this.$store.state.user.name,
  835. functionId: 801002,
  836. serialNumber: '801002Table1Destination',
  837. tableId: "801002Table1",
  838. tableName: "关务系统发货通知单",
  839. columnProp: "destination",
  840. headerAlign: "center",
  841. align: "left",
  842. columnLabel: "Destination",
  843. columnHidden: false,
  844. columnImage: false,
  845. columnSortable: false,
  846. sortLv: 0,
  847. status: true,
  848. fixed: '',
  849. columnWidth: 100
  850. },
  851. {
  852. userId: this.$store.state.user.name,
  853. functionId: 801002,
  854. serialNumber: '801002Table1NotifyStatus',
  855. tableId: "801002Table1",
  856. tableName: "关务系统发货通知单",
  857. columnProp: "notifyStatus",
  858. headerAlign: "center",
  859. align: "left",
  860. columnLabel: "通知单状态",
  861. columnHidden: false,
  862. columnImage: false,
  863. columnSortable: false,
  864. sortLv: 0,
  865. status: true,
  866. fixed: '',
  867. columnWidth: 100
  868. },
  869. {
  870. userId: this.$store.state.user.name,
  871. functionId: 801001,
  872. serialNumber: '801001Table1NotifyStatus',
  873. tableId: "801001Table1",
  874. tableName: "关务系统发货通知单",
  875. columnProp: "modifyLabel",
  876. headerAlign: "center",
  877. align: "left",
  878. columnLabel: "改单",
  879. columnHidden: false,
  880. columnImage: false,
  881. columnSortable: false,
  882. sortLv: 0,
  883. status: true,
  884. fixed: '',
  885. columnWidth: 50
  886. },
  887. {
  888. userId: this.$store.state.user.name,
  889. functionId: 801002,
  890. serialNumber: '801002Table1ExportFlag',
  891. tableId: "801002Table1",
  892. tableName: "关务系统发货通知单",
  893. columnProp: "exportFlag",
  894. headerAlign: "center",
  895. align: "center",
  896. columnLabel: "是否导出",
  897. columnHidden: false,
  898. columnImage: false,
  899. columnSortable: false,
  900. sortLv: 0,
  901. status: true,
  902. fixed: '',
  903. columnWidth: 80
  904. },
  905. {
  906. userId: this.$store.state.user.name,
  907. functionId: 801002,
  908. serialNumber: '801002Table1NotifyDate',
  909. tableId: "801002Table1",
  910. tableName: "关务系统发货通知单",
  911. columnProp: "notifyDate",
  912. headerAlign: "center",
  913. align: "center",
  914. columnLabel: "发货日期",
  915. columnHidden: false,
  916. columnImage: false,
  917. columnSortable: false,
  918. sortLv: 0,
  919. status: true,
  920. fixed: '',
  921. columnWidth: 120
  922. },
  923. {
  924. userId: this.$store.state.user.name,
  925. functionId: 801002,
  926. serialNumber: '801002Table1ErpDelNo',
  927. tableId: "801002Table1",
  928. tableName: "关务系统发货通知单",
  929. columnProp: "walMartOrderFlag",
  930. headerAlign: "center",
  931. align: "left",
  932. columnLabel: "沃尔玛订单",
  933. columnHidden: false,
  934. columnImage: false,
  935. columnSortable: false,
  936. sortLv: 0,
  937. status: true,
  938. fixed: '',
  939. columnWidth: 100
  940. },
  941. {
  942. userId: this.$store.state.user.name,
  943. functionId: 801002,
  944. serialNumber: '801002Table1CreateBy',
  945. tableId: "801002Table1",
  946. tableName: "关务系统发货通知单",
  947. columnProp: "createBy",
  948. headerAlign: "center",
  949. align: "left",
  950. columnLabel: "创建人",
  951. columnHidden: false,
  952. columnImage: false,
  953. columnSortable: false,
  954. sortLv: 0,
  955. status: true,
  956. fixed: '',
  957. columnWidth: 80
  958. },
  959. {
  960. userId: this.$store.state.user.name,
  961. functionId: 801002,
  962. serialNumber: '801002Table1CreateDate',
  963. tableId: "801002Table1",
  964. tableName: "关务系统发货通知单",
  965. columnProp: "createDate",
  966. headerAlign: "center",
  967. align: "center",
  968. columnLabel: "创建时间",
  969. columnHidden: false,
  970. columnImage: false,
  971. columnSortable: false,
  972. sortLv: 0,
  973. status: true,
  974. fixed: '',
  975. columnWidth: 130
  976. },
  977. {
  978. userId: this.$store.state.user.name,
  979. functionId: 801002,
  980. serialNumber: '801002Table1UpdateBy',
  981. tableId: "801002Table1",
  982. tableName: "关务系统发货通知单",
  983. columnProp: "updateBy",
  984. headerAlign: "center",
  985. align: "left",
  986. columnLabel: "修改人",
  987. columnHidden: false,
  988. columnImage: false,
  989. columnSortable: false,
  990. sortLv: 0,
  991. status: true,
  992. fixed: '',
  993. columnWidth: 80
  994. },
  995. {
  996. userId: this.$store.state.user.name,
  997. functionId: 801002,
  998. serialNumber: '801002Table1UpdateDate',
  999. tableId: "801002Table1",
  1000. tableName: "关务系统发货通知单",
  1001. columnProp: "updateDate",
  1002. headerAlign: "center",
  1003. align: "center",
  1004. columnLabel: "修改时间",
  1005. columnHidden: false,
  1006. columnImage: false,
  1007. columnSortable: false,
  1008. sortLv: 0,
  1009. status: true,
  1010. fixed: '',
  1011. columnWidth: 130
  1012. },
  1013. {
  1014. userId: this.$store.state.user.name,
  1015. functionId: 801002,
  1016. serialNumber: '801002Table1Remark',
  1017. tableId: "801002Table1",
  1018. tableName: "关务系统发货通知单",
  1019. columnProp: "remark",
  1020. headerAlign: "center",
  1021. align: "left",
  1022. columnLabel: "Remark",
  1023. columnHidden: false,
  1024. columnImage: false,
  1025. columnSortable: false,
  1026. sortLv: 0,
  1027. status: true,
  1028. fixed: '',
  1029. columnWidth: 300
  1030. },
  1031. ],
  1032. columnList2: [
  1033. {
  1034. userId: this.$store.state.user.name,
  1035. functionId: 801002,
  1036. serialNumber: '801002Table2ItemNo',
  1037. tableId: "801002Table2",
  1038. tableName: "关务系统发货通知单明细",
  1039. columnProp: "itemNo",
  1040. headerAlign: "center",
  1041. align: "left",
  1042. columnLabel: "行号",
  1043. columnHidden: false,
  1044. columnImage: false,
  1045. columnSortable: false,
  1046. sortLv: 0,
  1047. status: true,
  1048. fixed: '',
  1049. columnWidth: 80
  1050. },
  1051. {
  1052. userId: this.$store.state.user.name,
  1053. functionId: 801002,
  1054. serialNumber: '801002Table2PartNo',
  1055. tableId: "801002Table2",
  1056. tableName: "关务系统发货通知单明细",
  1057. columnProp: "pn",
  1058. headerAlign: "center",
  1059. align: "left",
  1060. columnLabel: "PN",
  1061. columnHidden: false,
  1062. columnImage: false,
  1063. columnSortable: false,
  1064. sortLv: 0,
  1065. status: true,
  1066. fixed: '',
  1067. columnWidth: 100
  1068. },
  1069. {
  1070. userId: this.$store.state.user.name,
  1071. functionId: 801002,
  1072. serialNumber: '801002Table2PartDescription',
  1073. tableId: "801002Table2",
  1074. tableName: "关务系统发货通知单明细",
  1075. columnProp: "partDescription",
  1076. headerAlign: "center",
  1077. align: "left",
  1078. columnLabel: "Description",
  1079. columnHidden: false,
  1080. columnImage: false,
  1081. columnSortable: false,
  1082. sortLv: 0,
  1083. status: true,
  1084. fixed: '',
  1085. columnWidth: 300
  1086. },
  1087. {
  1088. userId: this.$store.state.user.name,
  1089. functionId: 801002,
  1090. serialNumber: '801002Table2Qty',
  1091. tableId: "801002Table2",
  1092. tableName: "关务系统发货通知单明细",
  1093. columnProp: "qty",
  1094. headerAlign: "center",
  1095. align: "right",
  1096. columnLabel: "Qty (pcs)",
  1097. columnHidden: false,
  1098. columnImage: false,
  1099. columnSortable: false,
  1100. sortLv: 0,
  1101. status: true,
  1102. fixed: '',
  1103. columnWidth: 100
  1104. },
  1105. {
  1106. userId: this.$store.state.user.name,
  1107. functionId: 801002,
  1108. serialNumber: '801002Table2SalesOrder',
  1109. tableId: "801002Table2",
  1110. tableName: "关务系统发货通知单明细",
  1111. columnProp: "salesOrder",
  1112. headerAlign: "center",
  1113. align: "left",
  1114. columnLabel: "销售订单号",
  1115. columnHidden: false,
  1116. columnImage: false,
  1117. columnSortable: false,
  1118. sortLv: 0,
  1119. status: true,
  1120. fixed: '',
  1121. columnWidth: 100
  1122. },
  1123. {
  1124. userId: this.$store.state.user.name,
  1125. functionId: 801002,
  1126. serialNumber: '801002Table2CustomerPO',
  1127. tableId: "801002Table2",
  1128. tableName: "关务系统发货通知单明细",
  1129. columnProp: "customerPO",
  1130. headerAlign: "center",
  1131. align: "left",
  1132. columnLabel: "客户采购单号",
  1133. columnHidden: false,
  1134. columnImage: false,
  1135. columnSortable: false,
  1136. sortLv: 0,
  1137. status: true,
  1138. fixed: '',
  1139. columnWidth: 100
  1140. },
  1141. {
  1142. userId: this.$store.state.user.name,
  1143. functionId: 801002,
  1144. serialNumber: '801002Table2Version',
  1145. tableId: "801002Table2",
  1146. tableName: "关务系统发货通知单明细",
  1147. columnProp: "version",
  1148. headerAlign: "center",
  1149. align: "left",
  1150. columnLabel: "Version",
  1151. columnHidden: false,
  1152. columnImage: false,
  1153. columnSortable: false,
  1154. sortLv: 0,
  1155. status: true,
  1156. fixed: '',
  1157. columnWidth: 100
  1158. },
  1159. {
  1160. userId: this.$store.state.user.name,
  1161. functionId: 801002,
  1162. serialNumber: '801002Table2Status',
  1163. tableId: "801002Table2",
  1164. tableName: "关务系统发货通知单明细",
  1165. columnProp: "status",
  1166. headerAlign: "center",
  1167. align: "left",
  1168. columnLabel: "Status",
  1169. columnHidden: false,
  1170. columnImage: false,
  1171. columnSortable: false,
  1172. sortLv: 0,
  1173. status: true,
  1174. fixed: '',
  1175. columnWidth: 100
  1176. },
  1177. {
  1178. userId: this.$store.state.user.name,
  1179. functionId: 801002,
  1180. serialNumber: '801002Table2Family',
  1181. tableId: "801002Table2",
  1182. tableName: "关务系统发货通知单明细",
  1183. columnProp: "family",
  1184. headerAlign: "center",
  1185. align: "left",
  1186. columnLabel: "Family",
  1187. columnHidden: false,
  1188. columnImage: false,
  1189. columnSortable: false,
  1190. sortLv: 0,
  1191. status: true,
  1192. fixed: '',
  1193. columnWidth: 100
  1194. },
  1195. {
  1196. userId: this.$store.state.user.name,
  1197. functionId: 801002,
  1198. serialNumber: '801002Table2Lt',
  1199. tableId: "801002Table2",
  1200. tableName: "关务系统发货通知单明细",
  1201. columnProp: "lt",
  1202. headerAlign: "center",
  1203. align: "right",
  1204. columnLabel: "LT (wks)",
  1205. columnHidden: false,
  1206. columnImage: false,
  1207. columnSortable: false,
  1208. sortLv: 0,
  1209. status: true,
  1210. fixed: '',
  1211. columnWidth: 100
  1212. },
  1213. {
  1214. userId: this.$store.state.user.name,
  1215. functionId: 801002,
  1216. serialNumber: '801002Table2CmcComment',
  1217. tableId: "801002Table2",
  1218. tableName: "关务系统发货通知单明细",
  1219. columnProp: "cmcComment",
  1220. headerAlign: "center",
  1221. align: "left",
  1222. columnLabel: "CMC Comment",
  1223. columnHidden: false,
  1224. columnImage: false,
  1225. columnSortable: false,
  1226. sortLv: 0,
  1227. status: true,
  1228. fixed: '',
  1229. columnWidth: 100
  1230. },
  1231. {
  1232. userId: this.$store.state.user.name,
  1233. functionId: 801002,
  1234. serialNumber: '801002Table2SaleType',
  1235. tableId: "801002Table2",
  1236. tableName: "关务系统发货通知单明细",
  1237. columnProp: "saleType",
  1238. headerAlign: "center",
  1239. align: "left",
  1240. columnLabel: "内外销方式",
  1241. columnHidden: false,
  1242. columnImage: false,
  1243. columnSortable: false,
  1244. sortLv: 0,
  1245. status: true,
  1246. fixed: '',
  1247. columnWidth: 100
  1248. },
  1249. {
  1250. userId: this.$store.state.user.name,
  1251. functionId: 801002,
  1252. serialNumber: '801002Table2AwbBl',
  1253. tableId: "801002Table2",
  1254. tableName: "关务系统发货通知单明细",
  1255. columnProp: "awbBl",
  1256. headerAlign: "center",
  1257. align: "left",
  1258. columnLabel: "AWB/ BL#",
  1259. columnHidden: false,
  1260. columnImage: false,
  1261. columnSortable: false,
  1262. sortLv: 0,
  1263. status: true,
  1264. fixed: '',
  1265. columnWidth: 100
  1266. },
  1267. {
  1268. userId: this.$store.state.user.name,
  1269. functionId: 801002,
  1270. serialNumber: '801002Table2ShippingNumber',
  1271. tableId: "801002Table2",
  1272. tableName: "关务系统发货通知单明细",
  1273. columnProp: "shippingNumber",
  1274. headerAlign: "center",
  1275. align: "left",
  1276. columnLabel: "ShippingNumber",
  1277. columnHidden: false,
  1278. columnImage: false,
  1279. columnSortable: false,
  1280. sortLv: 0,
  1281. status: true,
  1282. fixed: '',
  1283. columnWidth: 100
  1284. },
  1285. {
  1286. userId: this.$store.state.user.name,
  1287. functionId: 801002,
  1288. serialNumber: '801002Table2ForwarderInfo',
  1289. tableId: "801002Table2",
  1290. tableName: "关务系统发货通知单明细",
  1291. columnProp: "forwarderInfo",
  1292. headerAlign: "center",
  1293. align: "left",
  1294. columnLabel: "Forwarder Info",
  1295. columnHidden: false,
  1296. columnImage: false,
  1297. columnSortable: false,
  1298. sortLv: 0,
  1299. status: true,
  1300. fixed: '',
  1301. columnWidth: 100
  1302. },
  1303. {
  1304. userId: this.$store.state.user.name,
  1305. functionId: 801002,
  1306. serialNumber: '801002Table2Currency',
  1307. tableId: "801002Table2",
  1308. tableName: "关务系统发货通知单明细",
  1309. columnProp: "currency",
  1310. headerAlign: "center",
  1311. align: "left",
  1312. columnLabel: "Currency",
  1313. columnHidden: false,
  1314. columnImage: false,
  1315. columnSortable: false,
  1316. sortLv: 0,
  1317. status: true,
  1318. fixed: '',
  1319. columnWidth: 100
  1320. },
  1321. {
  1322. userId: this.$store.state.user.name,
  1323. functionId: 801002,
  1324. serialNumber: '801002Table2Tp',
  1325. tableId: "801002Table2",
  1326. tableName: "关务系统发货通知单明细",
  1327. columnProp: "tp",
  1328. headerAlign: "center",
  1329. align: "right",
  1330. columnLabel: "TP",
  1331. columnHidden: false,
  1332. columnImage: false,
  1333. columnSortable: false,
  1334. sortLv: 0,
  1335. status: true,
  1336. fixed: '',
  1337. columnWidth: 80
  1338. },
  1339. {
  1340. userId: this.$store.state.user.name,
  1341. functionId: 801002,
  1342. serialNumber: '801002Table2TtlAmount',
  1343. tableId: "801002Table2",
  1344. tableName: "关务系统发货通知单明细",
  1345. columnProp: "ttlAmount",
  1346. headerAlign: "center",
  1347. align: "right",
  1348. columnLabel: "TTL Amount",
  1349. columnHidden: false,
  1350. columnImage: false,
  1351. columnSortable: false,
  1352. sortLv: 0,
  1353. status: true,
  1354. fixed: '',
  1355. columnWidth: 80
  1356. },
  1357. {
  1358. userId: this.$store.state.user.name,
  1359. functionId: 801001,
  1360. serialNumber: '801001Table2Remark',
  1361. tableId: "801001Table2",
  1362. tableName: "关务系统发货通知单明细",
  1363. columnProp: "vat",
  1364. headerAlign: "center",
  1365. align: "right",
  1366. columnLabel: "VAT",
  1367. columnHidden: false,
  1368. columnImage: false,
  1369. columnSortable: false,
  1370. sortLv: 0,
  1371. status: true,
  1372. fixed: '',
  1373. columnWidth: 100
  1374. },
  1375. {
  1376. userId: this.$store.state.user.name,
  1377. functionId: 801002,
  1378. serialNumber: '801002Table2SumPrice',
  1379. tableId: "801002Table2",
  1380. tableName: "关务系统发货通知单明细",
  1381. columnProp: "sumPrice",
  1382. headerAlign: "center",
  1383. align: "right",
  1384. columnLabel: "价税合计",
  1385. columnHidden: false,
  1386. columnImage: false,
  1387. columnSortable: false,
  1388. sortLv: 0,
  1389. status: true,
  1390. fixed: '',
  1391. columnWidth: 80
  1392. },
  1393. {
  1394. userId: this.$store.state.user.name,
  1395. functionId: 801002,
  1396. serialNumber: '801002Table2So',
  1397. tableId: "801002Table2",
  1398. tableName: "关务系统发货通知单明细",
  1399. columnProp: "so",
  1400. headerAlign: "center",
  1401. align: "left",
  1402. columnLabel: "SO",
  1403. columnHidden: false,
  1404. columnImage: false,
  1405. columnSortable: false,
  1406. sortLv: 0,
  1407. status: true,
  1408. fixed: '',
  1409. columnWidth: 100
  1410. },
  1411. {
  1412. userId: this.$store.state.user.name,
  1413. functionId: 801002,
  1414. serialNumber: '801002Table2Upc',
  1415. tableId: "801002Table2",
  1416. tableName: "关务系统发货通知单明细",
  1417. columnProp: "upc",
  1418. headerAlign: "center",
  1419. align: "left",
  1420. columnLabel: "UPC",
  1421. columnHidden: false,
  1422. columnImage: false,
  1423. columnSortable: false,
  1424. sortLv: 0,
  1425. status: true,
  1426. fixed: '',
  1427. columnWidth: 100
  1428. },
  1429. {
  1430. userId: this.$store.state.user.name,
  1431. functionId: 801002,
  1432. serialNumber: '801002Table2Remark',
  1433. tableId: "801002Table2",
  1434. tableName: "关务系统发货通知单明细",
  1435. columnProp: "remark",
  1436. headerAlign: "center",
  1437. align: "left",
  1438. columnLabel: "Remark",
  1439. columnHidden: false,
  1440. columnImage: false,
  1441. columnSortable: false,
  1442. sortLv: 0,
  1443. status: true,
  1444. fixed: '',
  1445. columnWidth: 300
  1446. },
  1447. {
  1448. userId: this.$store.state.user.name,
  1449. functionId: 801001,
  1450. serialNumber: '801001Table2Remark',
  1451. tableId: "801001Table2",
  1452. tableName: "关务系统发货通知单明细",
  1453. columnProp: "roll",
  1454. headerAlign: "center",
  1455. align: "right",
  1456. columnLabel: "Roll",
  1457. columnHidden: false,
  1458. columnImage: false,
  1459. columnSortable: false,
  1460. sortLv: 0,
  1461. status: true,
  1462. fixed: '',
  1463. columnWidth: 100
  1464. },
  1465. {
  1466. userId: this.$store.state.user.name,
  1467. functionId: 801001,
  1468. serialNumber: '801001Table2Remark',
  1469. tableId: "801001Table2",
  1470. tableName: "关务系统发货通知单明细",
  1471. columnProp: "carton",
  1472. headerAlign: "center",
  1473. align: "right",
  1474. columnLabel: "Carton",
  1475. columnHidden: false,
  1476. columnImage: false,
  1477. columnSortable: false,
  1478. sortLv: 0,
  1479. status: true,
  1480. fixed: '',
  1481. columnWidth: 100
  1482. },
  1483. ],
  1484. columnList3:[
  1485. {
  1486. userId: this.$store.state.user.name,
  1487. functionId: 801002,
  1488. serialNumber: '801002Table3ItemNo',
  1489. tableId: "801002Table3",
  1490. tableName: "装箱明细",
  1491. columnProp: "itemNo",
  1492. headerAlign: "center",
  1493. align: "right",
  1494. columnLabel: "序号",
  1495. columnHidden: false,
  1496. columnImage: false,
  1497. columnSortable: false,
  1498. sortLv: 0,
  1499. status: true,
  1500. fixed: '',
  1501. columnWidth: 40
  1502. },
  1503. {
  1504. userId: this.$store.state.user.name,
  1505. functionId: 801002,
  1506. serialNumber: '801002Table3PoNo',
  1507. tableId: "801002Table3",
  1508. tableName: "装箱明细",
  1509. columnProp: "poNo",
  1510. headerAlign: "center",
  1511. align: "left",
  1512. columnLabel: "PO",
  1513. columnHidden: false,
  1514. columnImage: false,
  1515. columnSortable: false,
  1516. sortLv: 0,
  1517. status: true,
  1518. fixed: '',
  1519. columnWidth: 100
  1520. },
  1521. {
  1522. userId: this.$store.state.user.name,
  1523. functionId: 801002,
  1524. serialNumber: '801002Table3PN',
  1525. tableId: "801002Table3",
  1526. tableName: "装箱明细",
  1527. columnProp: "pn",
  1528. headerAlign: "center",
  1529. align: "left",
  1530. columnLabel: "PN",
  1531. columnHidden: false,
  1532. columnImage: false,
  1533. columnSortable: false,
  1534. sortLv: 0,
  1535. status: true,
  1536. fixed: '',
  1537. columnWidth: 100
  1538. },
  1539. {
  1540. userId: this.$store.state.user.name,
  1541. functionId: 801002,
  1542. serialNumber: '801002Table3Qty',
  1543. tableId: "801002Table3",
  1544. tableName: "装箱明细",
  1545. columnProp: "qty",
  1546. headerAlign: "center",
  1547. align: "right",
  1548. columnLabel: "数量",
  1549. columnHidden: false,
  1550. columnImage: false,
  1551. columnSortable: false,
  1552. sortLv: 0,
  1553. status: true,
  1554. fixed: '',
  1555. columnWidth: 50
  1556. },
  1557. {
  1558. userId: this.$store.state.user.name,
  1559. functionId: 801002,
  1560. serialNumber: '801002Table3Rolls',
  1561. tableId: "801002Table3",
  1562. tableName: "装箱明细",
  1563. columnProp: "rolls",
  1564. headerAlign: "center",
  1565. align: "right",
  1566. columnLabel: "Rolls",
  1567. columnHidden: false,
  1568. columnImage: false,
  1569. columnSortable: false,
  1570. sortLv: 0,
  1571. status: true,
  1572. fixed: '',
  1573. columnWidth: 50
  1574. },
  1575. ],
  1576. columnList4:[
  1577. {
  1578. userId: this.$store.state.user.name,
  1579. functionId: 801002,
  1580. serialNumber: '801002Table4SeqNo',
  1581. tableId: "801002Table4",
  1582. tableName: "装箱栈板主表",
  1583. columnProp: "seqNo",
  1584. headerAlign: "center",
  1585. align: "right",
  1586. columnLabel: "序号",
  1587. columnHidden: false,
  1588. columnImage: false,
  1589. columnSortable: false,
  1590. sortLv: 0,
  1591. status: true,
  1592. fixed: '',
  1593. columnWidth: 40
  1594. },
  1595. {
  1596. userId: this.$store.state.user.name,
  1597. functionId: 801002,
  1598. serialNumber: '801002Table4PalletRemark',
  1599. tableId: "801002Table4",
  1600. tableName: "装箱栈板主表",
  1601. columnProp: "palletRemark",
  1602. headerAlign: "center",
  1603. align: "left",
  1604. columnLabel: "栈板码",
  1605. columnHidden: false,
  1606. columnImage: false,
  1607. columnSortable: false,
  1608. sortLv: 0,
  1609. status: true,
  1610. fixed: '',
  1611. columnWidth: 60
  1612. },
  1613. {
  1614. userId: this.$store.state.user.name,
  1615. functionId: 801002,
  1616. serialNumber: '801002Table4PalletQty',
  1617. tableId: "801002Table4",
  1618. tableName: "装箱栈板主表",
  1619. columnProp: "palletQty",
  1620. headerAlign: "center",
  1621. align: "right",
  1622. columnLabel: "数量",
  1623. columnHidden: false,
  1624. columnImage: false,
  1625. columnSortable: false,
  1626. sortLv: 0,
  1627. status: true,
  1628. fixed: '',
  1629. columnWidth: 50
  1630. },
  1631. {
  1632. userId: this.$store.state.user.name,
  1633. functionId: 801002,
  1634. serialNumber: '801002Table4Length',
  1635. tableId: "801002Table4",
  1636. tableName: "装箱栈板主表",
  1637. columnProp: "length",
  1638. headerAlign: "center",
  1639. align: "right",
  1640. columnLabel: "长(M)",
  1641. columnHidden: false,
  1642. columnImage: false,
  1643. columnSortable: false,
  1644. sortLv: 0,
  1645. status: true,
  1646. fixed: '',
  1647. columnWidth: 50
  1648. },
  1649. {
  1650. userId: this.$store.state.user.name,
  1651. functionId: 801002,
  1652. serialNumber: '801002Table4Width',
  1653. tableId: "801002Table4",
  1654. tableName: "装箱栈板主表",
  1655. columnProp: "width",
  1656. headerAlign: "center",
  1657. align: "right",
  1658. columnLabel: "宽(M)",
  1659. columnHidden: false,
  1660. columnImage: false,
  1661. columnSortable: false,
  1662. sortLv: 0,
  1663. status: true,
  1664. fixed: '',
  1665. columnWidth: 50
  1666. },
  1667. {
  1668. userId: this.$store.state.user.name,
  1669. functionId: 801002,
  1670. serialNumber: '801002Table4Height',
  1671. tableId: "801002Table4",
  1672. tableName: "装箱栈板主表",
  1673. columnProp: "height",
  1674. headerAlign: "center",
  1675. align: "right",
  1676. columnLabel: "高(M)",
  1677. columnHidden: false,
  1678. columnImage: false,
  1679. columnSortable: false,
  1680. sortLv: 0,
  1681. status: true,
  1682. fixed: '',
  1683. columnWidth: 50
  1684. },
  1685. ],
  1686. columnList5:[
  1687. {
  1688. userId: this.$store.state.user.name,
  1689. functionId: 801002,
  1690. serialNumber: '801002Table5PartNo',
  1691. tableId: "801002Table5",
  1692. tableName: "栈板装箱明细",
  1693. columnProp: "pn",
  1694. headerAlign: "center",
  1695. align: "left",
  1696. columnLabel: "物料编码",
  1697. columnHidden: false,
  1698. columnImage: false,
  1699. columnSortable: false,
  1700. sortLv: 0,
  1701. status: true,
  1702. fixed: '',
  1703. columnWidth: 70
  1704. },
  1705. {
  1706. userId: this.$store.state.user.name,
  1707. functionId: 801002,
  1708. serialNumber: '801002Table5Qty',
  1709. tableId: "801002Table5",
  1710. tableName: "栈板装箱明细",
  1711. columnProp: "qty",
  1712. headerAlign: "center",
  1713. align: "right",
  1714. columnLabel: "数量",
  1715. columnHidden: false,
  1716. columnImage: false,
  1717. columnSortable: false,
  1718. sortLv: 0,
  1719. status: true,
  1720. fixed: '',
  1721. columnWidth: 80
  1722. },
  1723. {
  1724. userId: this.$store.state.user.name,
  1725. functionId: 801002,
  1726. serialNumber: '801002Table5BoxQty',
  1727. tableId: "801002Table5",
  1728. tableName: "栈板装箱明细",
  1729. columnProp: "boxQty",
  1730. headerAlign: "center",
  1731. align: "right",
  1732. columnLabel: "箱数",
  1733. columnHidden: false,
  1734. columnImage: false,
  1735. columnSortable: false,
  1736. sortLv: 0,
  1737. status: true,
  1738. fixed: '',
  1739. columnWidth: 70
  1740. },
  1741. {
  1742. userId: this.$store.state.user.name,
  1743. functionId: 801002,
  1744. serialNumber: '801002Table5Rolls',
  1745. tableId: "801002Table5",
  1746. tableName: "栈板装箱明细",
  1747. columnProp: "rolls",
  1748. headerAlign: "center",
  1749. align: "right",
  1750. columnLabel: "Rolls",
  1751. columnHidden: false,
  1752. columnImage: false,
  1753. columnSortable: false,
  1754. sortLv: 0,
  1755. status: true,
  1756. fixed: '',
  1757. columnWidth: 70
  1758. },
  1759. ],
  1760. currentRow:{},
  1761. }
  1762. },
  1763. mounted() {
  1764. this.$nextTick(() => {
  1765. this.height = (window.innerHeight - 260)/2;
  1766. })
  1767. },
  1768. methods: {
  1769. // 动态列开始 获取 用户保存的 格式列
  1770. async getTableUserColumn (tableId, columnId) {
  1771. let queryTableUser = {
  1772. userId: this.$store.state.user.name,
  1773. functionId: this.$route.meta.menuId,
  1774. tableId: tableId,
  1775. status: true,
  1776. languageCode: this.$i18n.locale
  1777. }
  1778. await getTableUserListLanguage(queryTableUser).then(({data}) => {
  1779. if (data.rows.length > 0) {
  1780. //this.columnList1 = []
  1781. switch (columnId) {
  1782. case 1:
  1783. this.columnList1 = data.rows
  1784. break;
  1785. // case 2:
  1786. // this.columnDetailList = data.rows
  1787. // break;
  1788. // case 3:
  1789. // this.columnList2 = data.rows
  1790. // break;
  1791. // case 4:
  1792. // this.columnList3 = data.rows
  1793. // break;
  1794. }
  1795. } else {
  1796. this.getColumnList(tableId, columnId)
  1797. }
  1798. })
  1799. },
  1800. // 获取 tableDefault 列
  1801. async getColumnList (tableId, columnId) {
  1802. let queryTable = {
  1803. functionId: this.$route.meta.menuId,
  1804. tableId: tableId,
  1805. languageCode: this.$i18n.locale
  1806. }
  1807. await getTableDefaultListLanguage(queryTable).then(({data}) => {
  1808. if (!data.rows.length == 0) {
  1809. switch (columnId) {
  1810. case 1:
  1811. this.columnList1 = data.rows
  1812. break;
  1813. // case 2:
  1814. // this.columnDetailList = data.rows
  1815. // break;
  1816. // case 3:
  1817. // this.columnList2 = data.rows
  1818. // break;
  1819. // case 4:
  1820. // this.columnList3 = data.rows
  1821. // break;
  1822. }
  1823. } else {
  1824. // this.showDefault = true.
  1825. }
  1826. })
  1827. },
  1828. isPnDataIncomplete(row) {
  1829. const hasBoxrolls = row.boxrolls !== null && row.boxrolls !== undefined && row.boxrolls !== '';
  1830. const hasRollqty = row.rollqty !== null && row.rollqty !== undefined && row.rollqty !== '';
  1831. const hasBoxweight = row.boxweight !== null && row.boxweight !== undefined && row.boxweight !== '';
  1832. const packageNo = row.packageNo !== null && row.packageNo !== undefined && row.packageNo !== '';
  1833. return !hasBoxrolls || !hasRollqty || !hasBoxweight || !packageNo;
  1834. },
  1835. // 获取PN数据缺失的具体字段提示信息
  1836. getPnIncompleteTooltip(row) {
  1837. const missingFields = [];
  1838. // 检查每个字段是否缺失
  1839. if (!(row.rollqty !== null && row.rollqty !== undefined && row.rollqty !== '')) {
  1840. missingFields.push('每卷数量');
  1841. }
  1842. if (!(row.boxrolls !== null && row.boxrolls !== undefined && row.boxrolls !== '')) {
  1843. missingFields.push('每箱卷数');
  1844. }
  1845. if (!(row.boxweight !== null && row.boxweight !== undefined && row.boxweight !== '')) {
  1846. missingFields.push('箱重量');
  1847. }
  1848. if (!(row.packageNo !== null && row.packageNo !== undefined && row.packageNo !== '')) {
  1849. missingFields.push('箱类型');
  1850. }
  1851. // 根据缺失字段生成提示信息
  1852. if (missingFields.length > 0) {
  1853. return `基本信息(${missingFields.join('、')})未维护,点击跳转到维护页面`;
  1854. }
  1855. return '';
  1856. },
  1857. // 跳转到PN维护页面
  1858. navigateToPartHsCode(pn) {
  1859. if (!pn) {
  1860. this.$message.warning('PN不能为空');
  1861. return;
  1862. }
  1863. this.$router.push({
  1864. path: '/ecss-partHsCode',
  1865. query: {
  1866. sku: pn
  1867. }
  1868. });
  1869. },
  1870. openPartDialog () {
  1871. this.searchPartList();
  1872. this.partFlag = true
  1873. },
  1874. closePartDialog () {
  1875. this.partList = []
  1876. this.partFlag = false
  1877. },
  1878. searchPartList () {
  1879. this.partData.site = this.currentRow.site
  1880. this.partData.delNo = this.currentRow.delNo
  1881. getNotifyPartDetail(this.partData).then(({data}) => {
  1882. if (data && data.code === 0){
  1883. this.partList = data.rows;
  1884. }
  1885. })
  1886. },
  1887. partRowDblclick (row) {
  1888. this.boxModelData.partNo = row.partNo
  1889. this.boxModelData.pn = row.pn
  1890. this.partFlag = false
  1891. },
  1892. // 获取基础数据列表S
  1893. getBaseList(val, type) {
  1894. this.tagNo = val
  1895. this.$nextTick(() => {
  1896. let strVal = ''
  1897. if (val === 507) {
  1898. strVal = this.boxModelData.partNo
  1899. }
  1900. this.$refs.baseList.init(val, strVal)
  1901. })
  1902. },
  1903. /* 列表方法的回调 */
  1904. getBaseData(val) {
  1905. if (this.tagNo === 507) {
  1906. this.boxModelData.partNo = val.part_no
  1907. }
  1908. },
  1909. // 每页数
  1910. sizeChangeHandle (val) {
  1911. this.pageSize = val
  1912. this.pageIndex = 1
  1913. this.searchTable()
  1914. },
  1915. // 当前页
  1916. currentChangeHandle (val) {
  1917. this.pageIndex = val
  1918. this.searchTable()
  1919. },
  1920. searchTable(){
  1921. this.searchData.limit = this.pageSize
  1922. this.searchData.page = this.pageIndex
  1923. searchEcssCoDelNotifyHeaderForCK(this.searchData).then(({data}) => {
  1924. //区分请求成功和失败的状况
  1925. if (data && data.code == 0) {
  1926. this.dataList = data.page.list
  1927. this.pageIndex = data.page.currPage
  1928. this.pageSize = data.page.pageSize
  1929. this.totalPage = data.page.totalCount
  1930. if(this.dataList.length>0){
  1931. this.dataList.forEach(o => {
  1932. if (o.notifyStatus==='仓库已确认'&&!o.notifyDate) {
  1933. o.notifyDate='发货日期不确定'
  1934. }
  1935. o.modifyLabel = !!o.modifyFlag?'是':'';
  1936. });
  1937. // 使用 $nextTick 确保 DOM 渲染完成后再设置选中行
  1938. this.$nextTick(() => {
  1939. try {
  1940. // 检查表格引用是否存在
  1941. if (!this.$refs.mainTable) {
  1942. console.warn('[确认页面行选择持久化] 表格引用不存在,跳过设置选中行');
  1943. return;
  1944. }
  1945. // 尝试恢复之前选中的行
  1946. const restoredRow = this.restoreSelectedRow();
  1947. if (restoredRow) {
  1948. this.$refs.mainTable.setCurrentRow(restoredRow);
  1949. this.changeData(restoredRow);
  1950. } else {
  1951. // 如果没有之前选中的行,默认选中第一行
  1952. this.$refs.mainTable.setCurrentRow(this.dataList[0]);
  1953. this.changeData(this.dataList[0]);
  1954. }
  1955. } catch (error) {
  1956. console.error('[确认页面行选择持久化] 设置选中行失败:', error);
  1957. // 降级处理:只调用 changeData,不设置表格选中状态
  1958. const restoredRow = this.restoreSelectedRow();
  1959. this.changeData(restoredRow || this.dataList[0]);
  1960. }
  1961. });
  1962. }else {
  1963. this.changeData(null)
  1964. }
  1965. } else {
  1966. this.dataList = [];
  1967. }
  1968. });
  1969. },
  1970. tableRowClassName({row}) {
  1971. if (row.notifyStatus==='订单取消') {
  1972. return 'warning-row';
  1973. }
  1974. },
  1975. cellStyle({row, column }) {
  1976. if (column.property === 'notifyDate' && row.notifyDate==='发货日期不确定') { // 根据列属性判断
  1977. return { color: '#ff5d03' };
  1978. }
  1979. if (column.property === 'modifyLabel' && row.modifyLabel==='是') { // 根据列属性判断
  1980. return { color: '#ff5d03' };
  1981. }
  1982. return {};
  1983. },
  1984. cellStyleDetail({row, column }) {
  1985. // 只有数量列且 modifyQtyFlag=true 时才变色
  1986. if (column.property === 'qty' && row.modifyQtyFlag===true) {
  1987. return { color: '#ff5d03' };
  1988. }
  1989. // PN列保持原有的 modifyFlag 判断
  1990. if (column.property === 'pn' && row.modifyFlag===true) {
  1991. return { color: '#ff5d03' };
  1992. }
  1993. // 检查 pn 列,当 boxrolls、rollqty、boxweight 其中任意一个没有值时,将 pn 颜色改成橙色
  1994. if (column.property === 'pn') {
  1995. const hasBoxrolls = row.boxrolls !== null && row.boxrolls !== undefined && row.boxrolls !== '';
  1996. const hasRollqty = row.rollqty !== null && row.rollqty !== undefined && row.rollqty !== '';
  1997. const hasBoxweight = row.boxweight !== null && row.boxweight !== undefined && row.boxweight !== '';
  1998. const packageNo = row.packageNo !== null && row.packageNo !== undefined && row.packageNo !== '';
  1999. if (!hasBoxrolls || !hasRollqty || !hasBoxweight || !packageNo) {
  2000. return { color: '#ff8c00' }; // 橙色
  2001. }
  2002. }
  2003. return {};
  2004. },
  2005. changeData(row){
  2006. this.currentRow = JSON.parse(JSON.stringify(row));
  2007. if (this.currentRow.notifyDate==='发货日期不确定') {
  2008. this.currentRow.notifyDate=''
  2009. }
  2010. this.headerData=row;
  2011. // 保存选中行的唯一标识到本地存储
  2012. if (row && row.delNo) {
  2013. this.selectedRowKey = row.delNo;
  2014. this.saveSelectedRowToStorage();
  2015. }
  2016. this.refreshCurrentTabTable ();
  2017. },
  2018. refreshCurrentTabTable(){
  2019. if(this.currentRow===''||this.currentRow===null){
  2020. this.currentRow={site:'',delNo:'',notifyStatus:''}
  2021. }
  2022. if(this.activeName==='detail'){
  2023. searchEcssCoDelNotifyDetail(this.currentRow).then(({data}) => {
  2024. //区分请求成功和失败的状况
  2025. if (data && data.code == 0) {
  2026. this.dataList2 = data.rows
  2027. } else {
  2028. this.dataList2 = [];
  2029. }
  2030. });
  2031. }
  2032. if(this.activeName==='pallet'){
  2033. // 刷新装箱明细组件
  2034. if (this.$refs.packingDetailTab) {
  2035. this.$refs.packingDetailTab.refresh();
  2036. }
  2037. }
  2038. if(this.activeName==='box'){
  2039. searchEcssCoDelPalletHeaderData(this.currentRow).then(({data}) => {
  2040. //区分请求成功和失败的状况
  2041. if (data && data.code == 0) {
  2042. this.dataList4 = data.rows
  2043. } else {
  2044. this.dataList4 = [];
  2045. }
  2046. });
  2047. }
  2048. },
  2049. tabClick (tab, event) {
  2050. // 刷新列表数据
  2051. this.refreshCurrentTabTable()
  2052. },
  2053. confirmDo(){
  2054. confirmEcssDel(this.confirmModel).then(({data}) => {
  2055. if (data && data.code === 0) {
  2056. // 保存当前选中行的标识,以便刷新后恢复
  2057. const currentSelectedKey = this.confirmModel ? this.confirmModel.delNo : null;
  2058. if (currentSelectedKey) {
  2059. this.selectedRowKey = currentSelectedKey;
  2060. this.saveSelectedRowToStorage();
  2061. }
  2062. this.searchTable()
  2063. this.confirmModelFlag=false
  2064. this.$message({
  2065. message: '操作成功',
  2066. type: 'success',
  2067. duration: 1500,
  2068. onClose: () => {}
  2069. })
  2070. } else {
  2071. this.$alert(data.msg, '错误', {
  2072. confirmButtonText: '确定'
  2073. })
  2074. }
  2075. })
  2076. },
  2077. cancerConfirm(row){
  2078. let indata=JSON.parse(JSON.stringify(row));
  2079. if (row.notifyDate==='发货日期不确定') {
  2080. indata.notifyDate=''
  2081. }
  2082. this.$confirm('取消确认这条发货通知单?', '提示').then(() => {
  2083. cancerConfirmEcssDel(indata).then(({data}) => {
  2084. if (data && data.code === 0) {
  2085. // 保存当前选中行的标识,以便刷新后恢复
  2086. const currentSelectedKey = row ? row.delNo : null;
  2087. if (currentSelectedKey) {
  2088. this.selectedRowKey = currentSelectedKey;
  2089. this.saveSelectedRowToStorage();
  2090. }
  2091. this.searchTable()
  2092. this.$message({
  2093. message: '操作成功',
  2094. type: 'success',
  2095. duration: 1500,
  2096. onClose: () => {}
  2097. })
  2098. } else {
  2099. this.$alert(data.msg, '错误', {
  2100. confirmButtonText: '确定'
  2101. })
  2102. }
  2103. })
  2104. })
  2105. },
  2106. getBu () {
  2107. let tempData = {
  2108. username: this.$store.state.user.name,
  2109. }
  2110. getBuList(tempData).then(({data}) => {
  2111. if (data.code === 0) {
  2112. this.buList = data.row2
  2113. if (this.buList.length===1) {
  2114. this.searchData.buNo = this.buList[0].buNo;
  2115. }
  2116. }
  2117. })
  2118. },
  2119. confirmModelOpen(row){
  2120. this.confirmModel=JSON.parse(JSON.stringify(row));
  2121. this.confirmModelFlag=true
  2122. },
  2123. updateModelOpen(row){
  2124. this.confirmModel=JSON.parse(JSON.stringify(row));
  2125. if (this.confirmModel.notifyDate==='发货日期不确定') {
  2126. this.confirmModel.notifyDate=''
  2127. }
  2128. this.updateModelFlag=true
  2129. },
  2130. updateDo(){
  2131. if (!this.confirmModel.readyDate) {
  2132. this.$alert('请选择ReadyDate!', '错误', {
  2133. confirmButtonText: '确定'
  2134. })
  2135. return false
  2136. }
  2137. // 添加更新人信息
  2138. this.confirmModel.updateBy = this.$store.state.user.name
  2139. updateEcssDel(this.confirmModel).then(({data}) => {
  2140. if (data && data.code === 0) {
  2141. // 保存当前选中行的标识,以便刷新后恢复
  2142. const currentSelectedKey = this.confirmModel ? this.confirmModel.delNo : null;
  2143. if (currentSelectedKey) {
  2144. this.selectedRowKey = currentSelectedKey;
  2145. this.saveSelectedRowToStorage();
  2146. }
  2147. this.searchTable()
  2148. this.updateModelFlag=false
  2149. this.$message({
  2150. message: '操作成功',
  2151. type: 'success',
  2152. duration: 1500,
  2153. onClose: () => {}
  2154. })
  2155. } else {
  2156. this.$alert(data.msg, '错误', {
  2157. confirmButtonText: '确定'
  2158. })
  2159. }
  2160. })
  2161. },
  2162. upLoadPallet(){
  2163. if(this.currentRow.site===''||this.currentRow.site==null){
  2164. this.$alert('请先选择发货通知单!', '错误', {
  2165. confirmButtonText: '确定'
  2166. })
  2167. return false
  2168. }
  2169. let inData={
  2170. site:this.currentRow.site,
  2171. buNo:this.currentRow.buNo,
  2172. delNo:this.currentRow.delNo,
  2173. cmcInvoice:this.currentRow.cmcInvoice,
  2174. shippingMode: this.currentRow.shippingMode,
  2175. destination : this.currentRow.destination,
  2176. walMartOrderFlag:this.currentRow.walMartOrderFlag
  2177. }
  2178. this.$nextTick(() => {
  2179. this.$refs.palletUploadExcel.init(inData)
  2180. })
  2181. },
  2182. async exportExcel() {
  2183. if(this.currentRow.site===''||this.currentRow.site==null){
  2184. this.$alert('请先选择发货通知单!', '错误', {
  2185. confirmButtonText: '确定'
  2186. })
  2187. return false
  2188. }
  2189. let exportParam = {
  2190. site: this.currentRow.site,
  2191. buNo: this.currentRow.buNo,
  2192. delNo: this.currentRow.delNo,
  2193. cmcInvoice: this.currentRow.cmcInvoice,
  2194. shippingMode: this.currentRow.shippingMode,
  2195. destination : this.currentRow.destination,
  2196. readyDate: this.currentRow.readyDate, // 增加ReadyDate列
  2197. remark: this.currentRow.remark, // 增加备注列
  2198. createBy: this.$store.state.user.name,
  2199. }
  2200. try {
  2201. // 使用后台Excel模版导出
  2202. ExportUtil.export(
  2203. "/ecss/coDel/exportPackingTemplate",
  2204. exportParam,
  2205. this.currentRow.cmcInvoice + "装箱数据.xlsx"
  2206. );
  2207. // 导出成功后更新export_flag字段
  2208. let updateData = {
  2209. site: this.currentRow.site,
  2210. buNo: this.currentRow.buNo,
  2211. delNo: this.currentRow.delNo,
  2212. exportFlag: 'Y',
  2213. updateBy: this.$store.state.user.name
  2214. }
  2215. updateExportFlag(updateData).then(({data}) => {
  2216. if (data.code === 0) {
  2217. // 刷新当前行的导出状态
  2218. this.currentRow.exportFlag = 'Y';
  2219. // 刷新表格数据
  2220. this.searchTable();
  2221. this.$message({
  2222. message: '导出成功',
  2223. type: 'success',
  2224. duration: 1500
  2225. });
  2226. } else {
  2227. this.$message.warning('导出成功,但更新导出状态失败:' + data.msg);
  2228. }
  2229. }).catch(error => {
  2230. this.$message.warning('导出成功,但更新导出状态失败');
  2231. console.error('更新导出状态失败:', error);
  2232. });
  2233. } catch (error) {
  2234. this.$message.error('导出失败');
  2235. console.error('导出失败:', error);
  2236. }
  2237. },
  2238. searchPalletTable(){
  2239. this.refreshCurrentTabTable();
  2240. },
  2241. boxDetailModel(row){
  2242. this.boxDetailData=row
  2243. searchEcssCoDelPalletDetailData(row).then(({data}) => {
  2244. if (data.code === 0) {
  2245. this.dataList5 = data.rows
  2246. }
  2247. })
  2248. this.boxDetailModelFlag=true
  2249. },
  2250. updatePalletModel(row){
  2251. this.palletModelData=JSON.parse(JSON.stringify(row))
  2252. this.palletModelData.palletRemark=row.palletRemark
  2253. this.palletModelData.addFlag=1
  2254. this.palletEditFlag=true
  2255. },
  2256. newPalletModel(){
  2257. if(this.currentRow.site===''||this.currentRow.site==null){
  2258. this.$alert('请先选择发货通知单!', '错误', {
  2259. confirmButtonText: '确定'
  2260. })
  2261. return false
  2262. }
  2263. this.palletModelData={
  2264. addFlag:0,
  2265. site:this.currentRow.site,
  2266. buNo:this.currentRow.buNo,
  2267. delNo:this.currentRow.delNo,
  2268. grossWeight:'',
  2269. netWeight:'',
  2270. boxQty:'',
  2271. }
  2272. searchEcssCoDelNotifyDetail(this.currentRow).then(({data}) => {
  2273. if (data && data.code == 0) {
  2274. this.dataList8 = data.rows
  2275. } else {
  2276. this.dataList8 = [];
  2277. }
  2278. });
  2279. this.palletModelFlag=true
  2280. },
  2281. fillUseQty(row) {
  2282. row.useQty = row.surplusQty || 0;
  2283. // 全数装箱后也需要计算rolls
  2284. this.calculateRolls(row);
  2285. },
  2286. /**
  2287. * 根据装箱数量自动计算Rolls卷数
  2288. * 计算公式Rolls = 装箱数量 / 每卷数量
  2289. * @param row 当前行数据
  2290. */
  2291. calculateRolls(row) {
  2292. // 如果装箱数量为空或为0,清空rolls
  2293. if (!row.useQty || row.useQty <= 0) {
  2294. this.$set(row, 'rolls', null);
  2295. // 装箱数量变化后,重新计算总箱数和重量
  2296. this.calculateTotalBoxQtyAndWeights();
  2297. return;
  2298. }
  2299. // 如果已经有缓存的每卷数量,直接计算
  2300. if (row.rollQtyCache && row.rollQtyCache > 0) {
  2301. const rolls = row.useQty / row.rollQtyCache;
  2302. this.$set(row, 'rolls', parseFloat(rolls.toFixed(4)));
  2303. // 装箱数量变化后,重新计算总箱数和重量
  2304. this.calculateTotalBoxQtyAndWeights();
  2305. return;
  2306. }
  2307. // 调用后端API获取每卷数量
  2308. const params = {
  2309. site: this.currentRow.site,
  2310. buNo: this.currentRow.buNo,
  2311. partNo: row.partNo
  2312. };
  2313. getPartPackageProperties(params).then(({data}) => {
  2314. if (data && data.code === 0 && data.data) {
  2315. const rollQty = data.data.rollQty;
  2316. if (rollQty && rollQty > 0) {
  2317. // 缓存每卷数量到row中,避免重复请求
  2318. this.$set(row, 'rollQtyCache', rollQty);
  2319. this.$set(row, 'boxRollsCache', data.data.boxRolls);
  2320. this.$set(row, 'boxWeightCache', data.data.boxWeight);
  2321. // 计算rolls:装箱数量 / 每卷数量
  2322. const rolls = row.useQty / rollQty;
  2323. this.$set(row, 'rolls', parseFloat(rolls.toFixed(4)));
  2324. // 装箱数量变化后,重新计算总箱数和重量
  2325. this.calculateTotalBoxQtyAndWeights();
  2326. } else {
  2327. this.$message.warning(`物料 ${row.partNo} 未配置每卷数量(ROLLQTY)属性,无法自动计算Rolls`);
  2328. this.$set(row, 'rolls', null);
  2329. }
  2330. } else {
  2331. console.error('获取物料包装属性失败:', data ? data.msg : '未知错误');
  2332. // 失败时不阻断用户操作,允许手动输入
  2333. this.$set(row, 'rolls', null);
  2334. }
  2335. }).catch(error => {
  2336. console.error('获取物料包装属性异常:', error);
  2337. // 异常时不阻断用户操作,允许手动输入
  2338. this.$set(row, 'rolls', null);
  2339. });
  2340. },
  2341. /**
  2342. * 根据物料装箱数量自动计算总箱数毛重和净重
  2343. */
  2344. calculateTotalBoxQtyAndWeights() {
  2345. // 获取有装箱数量的物料列表
  2346. const selectedRows = this.dataList8.filter(item => item.useQty && item.useQty > 0);
  2347. if (selectedRows.length === 0) {
  2348. // 没有装箱数量时,清空
  2349. this.palletModelData.boxQty = null;
  2350. this.palletModelData.grossWeight = null;
  2351. this.palletModelData.netWeight = null;
  2352. return;
  2353. }
  2354. // 检查是否所有物料都已缓存包装属性
  2355. const allHaveCache = selectedRows.every(row =>
  2356. row.rollQtyCache && row.boxRollsCache && row.boxWeightCache
  2357. );
  2358. if (!allHaveCache) {
  2359. // 如果有物料未缓存属性,不自动计算(避免数据不完整)
  2360. return;
  2361. }
  2362. // 计算总箱数和总重量
  2363. let totalBoxQty = 0;
  2364. let totalGrossWeight = 0;
  2365. selectedRows.forEach(row => {
  2366. // 每箱EA = 每卷数量 × 每箱卷数
  2367. const eaPerBox = row.rollQtyCache * row.boxRollsCache;
  2368. // 该物料的箱数(向上取整)
  2369. const partBoxQty = Math.ceil(row.useQty / eaPerBox);
  2370. // 该物料的毛重 = 箱数 × 箱重量
  2371. const partGrossWeight = partBoxQty * row.boxWeightCache;
  2372. totalBoxQty += partBoxQty;
  2373. totalGrossWeight += partGrossWeight;
  2374. });
  2375. // 净重 = 毛重 - (箱数 / 2)
  2376. const totalNetWeight = totalGrossWeight - (totalBoxQty / 2);
  2377. // 自动填入箱数、毛重、净重
  2378. this.palletModelData.boxQty = totalBoxQty;
  2379. this.palletModelData.grossWeight = parseFloat(totalGrossWeight.toFixed(2));
  2380. this.palletModelData.netWeight = parseFloat(totalNetWeight.toFixed(2));
  2381. },
  2382. /**
  2383. * 根据箱数自动计算毛重和净重
  2384. * 计算公式来自后端代码2991-2992
  2385. * 毛重 = 箱数 × 箱重量
  2386. * 净重 = 毛重 - (箱数 / 2)
  2387. */
  2388. calculateWeightsByBoxQty() {
  2389. // 如果箱数为空或为0,清空毛重和净重
  2390. if (!this.palletModelData.boxQty || this.palletModelData.boxQty <= 0) {
  2391. this.palletModelData.grossWeight = null;
  2392. this.palletModelData.netWeight = null;
  2393. return;
  2394. }
  2395. // 获取有装箱数量的物料列表
  2396. const selectedRows = this.dataList8.filter(item => item.useQty && item.useQty > 0);
  2397. if (selectedRows.length === 0) {
  2398. // 没有选择物料时,不自动计算,允许用户手动输入
  2399. return;
  2400. }
  2401. // 检查是否所有物料都已缓存箱重量
  2402. const needFetchProperties = selectedRows.filter(row => !row.boxWeightCache);
  2403. if (needFetchProperties.length === 0) {
  2404. // 所有物料都有缓存,直接计算
  2405. this.calculateWeightsWithCache(selectedRows);
  2406. } else {
  2407. // 需要获取部分物料的属性
  2408. this.fetchBoxWeightsAndCalculate(selectedRows, needFetchProperties);
  2409. }
  2410. },
  2411. /**
  2412. * 使用缓存的箱重量计算毛重和净重
  2413. */
  2414. calculateWeightsWithCache(selectedRows) {
  2415. // 根据装箱数量计算加权平均箱重量
  2416. let totalWeight = 0;
  2417. let totalQty = 0;
  2418. selectedRows.forEach(row => {
  2419. if (row.boxWeightCache && row.boxWeightCache > 0 && row.rollQtyCache && row.rollQtyCache > 0 && row.boxRollsCache && row.boxRollsCache > 0) {
  2420. // 每箱EA = 每卷数量 × 每箱卷数
  2421. const eaPerBox = row.rollQtyCache * row.boxRollsCache;
  2422. // 该物料的箱数
  2423. const partBoxQty = Math.ceil(row.useQty / eaPerBox);
  2424. // 累计重量和箱数
  2425. totalWeight += partBoxQty * row.boxWeightCache;
  2426. totalQty += partBoxQty;
  2427. }
  2428. });
  2429. if (totalQty > 0) {
  2430. // 计算平均箱重量
  2431. const avgBoxWeight = totalWeight / totalQty;
  2432. this.calculateFinalWeights(avgBoxWeight);
  2433. } else {
  2434. // 如果无法计算平均重量,使用第一个物料的箱重量
  2435. const firstRow = selectedRows.find(row => row.boxWeightCache && row.boxWeightCache > 0);
  2436. if (firstRow) {
  2437. this.calculateFinalWeights(firstRow.boxWeightCache);
  2438. }
  2439. }
  2440. },
  2441. /**
  2442. * 获取物料箱重量并计算毛重净重
  2443. */
  2444. fetchBoxWeightsAndCalculate(selectedRows, needFetchProperties) {
  2445. // 批量获取物料属性
  2446. const promises = needFetchProperties.map(row => {
  2447. const params = {
  2448. site: this.currentRow.site,
  2449. buNo: this.currentRow.buNo,
  2450. partNo: row.partNo
  2451. };
  2452. return getPartPackageProperties(params).then(({data}) => {
  2453. if (data && data.code === 0 && data.data) {
  2454. // 缓存物料属性
  2455. this.$set(row, 'rollQtyCache', data.data.rollQty);
  2456. this.$set(row, 'boxRollsCache', data.data.boxRolls);
  2457. this.$set(row, 'boxWeightCache', data.data.boxWeight);
  2458. return true;
  2459. }
  2460. return false;
  2461. }).catch(error => {
  2462. console.error(`获取物料 ${row.partNo} 属性失败:`, error);
  2463. return false;
  2464. });
  2465. });
  2466. Promise.all(promises).then(() => {
  2467. // 所有属性获取完成后,重新计算
  2468. this.calculateWeightsWithCache(selectedRows);
  2469. });
  2470. },
  2471. /**
  2472. * 计算最终的毛重和净重
  2473. * @param avgBoxWeight 平均箱重量
  2474. */
  2475. calculateFinalWeights(avgBoxWeight) {
  2476. const boxQty = parseFloat(this.palletModelData.boxQty);
  2477. // 毛重 = 箱数 × 箱重量
  2478. const grossWeight = boxQty * avgBoxWeight;
  2479. // 净重 = 毛重 - (箱数 / 2)
  2480. const netWeight = grossWeight - (boxQty / 2);
  2481. // 保留2位小数
  2482. this.palletModelData.grossWeight = parseFloat(grossWeight.toFixed(2));
  2483. this.palletModelData.netWeight = parseFloat(netWeight.toFixed(2));
  2484. },
  2485. savePalletHeader(type) {
  2486. // 过滤出 useQty > 0 的行
  2487. const selectedRows = this.dataList8.filter(item => item.useQty && item.useQty > 0);
  2488. if (this.palletModelData.addFlag === 0 && selectedRows.length === 0) {
  2489. this.$alert('请至少输入一行装箱数量!', '错误', {
  2490. confirmButtonText: '确定'
  2491. });
  2492. return false;
  2493. }
  2494. if (this.palletModelData.grossWeight<=0||this.palletModelData.grossWeight==null) {
  2495. this.$alert('请输入毛重!', '错误', {
  2496. confirmButtonText: '确定'
  2497. });
  2498. return false;
  2499. }
  2500. if (this.palletModelData.netWeight<=0||this.palletModelData.netWeight==null) {
  2501. this.$alert('请输入净重!', '错误', {
  2502. confirmButtonText: '确定'
  2503. });
  2504. return false;
  2505. }
  2506. if (this.palletModelData.boxQty<=0||this.palletModelData.boxQty==null) {
  2507. this.$alert('请输入箱数!', '错误', {
  2508. confirmButtonText: '确定'
  2509. });
  2510. return false;
  2511. }
  2512. // 校验:装箱数量不能大于可装箱数量 (item.qty)
  2513. const invalidRow = selectedRows.find(item => item.useQty > item.surplusQty);
  2514. if (invalidRow) {
  2515. this.$alert(`PN ${invalidRow.pn} 的装箱数量不能大于可装箱数量(${invalidRow.surplusQty})!`, '错误', {
  2516. confirmButtonText: '确定'
  2517. });
  2518. return false;
  2519. }
  2520. this.palletModelData.walMartOrderFlag = this.currentRow.walMartOrderFlag;
  2521. this.palletModelData.notifyDetailList = selectedRows;
  2522. savePalletHeader(this.palletModelData).then(({ data }) => {
  2523. if (data && data.code === 0) {
  2524. if (type===0) {
  2525. this.palletModelData={
  2526. addFlag:0,
  2527. site:this.currentRow.site,
  2528. buNo:this.currentRow.buNo,
  2529. delNo:this.currentRow.delNo,
  2530. grossWeight:'',
  2531. netWeight:'',
  2532. boxQty:'',
  2533. }
  2534. searchEcssCoDelNotifyDetail(this.currentRow).then(({data}) => {
  2535. if (data && data.code == 0) {
  2536. this.dataList8 = data.rows
  2537. } else {
  2538. this.dataList8 = [];
  2539. }
  2540. });
  2541. } else {
  2542. this.refreshCurrentTabTable()
  2543. this.palletModelFlag=false;
  2544. }
  2545. this.$message({
  2546. message: '操作成功',
  2547. type: 'success',
  2548. duration: 1500
  2549. });
  2550. } else {
  2551. this.$alert(data.msg, '错误', {
  2552. confirmButtonText: '确定'
  2553. });
  2554. }
  2555. });
  2556. },
  2557. updateCodelPalletHeaderPalletQty(row){
  2558. updateCodelPalletHeaderPalletQty(this.palletModelData).then(({data}) => {
  2559. if (data && data.code === 0) {
  2560. this.palletEditFlag = false
  2561. this.refreshCurrentTabTable()
  2562. this.$message({
  2563. message: '操作成功',
  2564. type: 'success',
  2565. duration: 1500,
  2566. onClose: () => {}
  2567. })
  2568. } else {
  2569. this.$alert(data.msg, '错误', {
  2570. confirmButtonText: '确定'
  2571. })
  2572. }
  2573. })
  2574. },
  2575. deletePallet(row){
  2576. this.$confirm('确认删除此明细?', '提示').then(() => {
  2577. deletePalletHeader(row).then(({data}) => {
  2578. if (data && data.code === 0) {
  2579. this.refreshCurrentTabTable()
  2580. this.$message({
  2581. message: '操作成功',
  2582. type: 'success',
  2583. duration: 1500,
  2584. onClose: () => {}
  2585. })
  2586. } else {
  2587. this.$alert(data.msg, '错误', {
  2588. confirmButtonText: '确定'
  2589. })
  2590. }
  2591. })
  2592. })
  2593. },
  2594. updateBoxModel(row,type){
  2595. this.boxModelData=JSON.parse(JSON.stringify(row))
  2596. this.boxModelData.addFlag=1
  2597. this.boxModelData.type=type
  2598. this.boxModelFlag=true
  2599. },
  2600. newBoxModel(){
  2601. this.boxModelData={
  2602. addFlag:0,
  2603. site:this.boxDetailData.site,
  2604. buNo:this.boxDetailData.buNo,
  2605. delNo:this.boxDetailData.delNo,
  2606. seqNo:this.boxDetailData.seqNo,
  2607. itemNo:'',
  2608. partNo:'',
  2609. pn:'',
  2610. qty:'',
  2611. poNo:'',
  2612. boxQty:'',
  2613. rolls:'',
  2614. type:0
  2615. }
  2616. this.boxModelFlag=true
  2617. },
  2618. saveBoxHeader(){
  2619. if(this.boxModelData.partNo===''||this.boxModelData.partNo==null){
  2620. this.$alert('请输入物料!', '错误', {
  2621. confirmButtonText: '确定'
  2622. })
  2623. return false
  2624. }
  2625. if(this.boxModelData.qty<=0||this.boxModelData.qty==null){
  2626. this.$alert('请输入数量!', '错误', {
  2627. confirmButtonText: '确定'
  2628. })
  2629. return false
  2630. }
  2631. savePalletDetail(this.boxModelData).then(({data}) => {
  2632. if (data && data.code === 0) {
  2633. searchEcssCoDelPalletDetailData(this.boxDetailData).then(({data}) => {
  2634. if (data.code === 0) {
  2635. this.dataList5 = data.rows
  2636. }
  2637. })
  2638. searchCoDelPalletDataNew(this.currentRow).then(({data}) => {
  2639. if (data && data.code == 0) {
  2640. this.dataList3 = data.rows
  2641. } else {
  2642. this.dataList3 = [];
  2643. }
  2644. });
  2645. this.boxModelFlag=false;
  2646. this.$message({
  2647. message: '操作成功',
  2648. type: 'success',
  2649. duration: 1500,
  2650. onClose: () => {}
  2651. })
  2652. } else {
  2653. this.$alert(data.msg, '错误', {
  2654. confirmButtonText: '确定'
  2655. })
  2656. }
  2657. })
  2658. },
  2659. oneClickPacking(){
  2660. if(this.currentRow.site===''||this.currentRow.site==null){
  2661. this.$alert('请先选择发货通知单!', '错误', {
  2662. confirmButtonText: '确定'
  2663. })
  2664. return false
  2665. }
  2666. this.oneClickPackingModelData={
  2667. boxRemnant: false,
  2668. }
  2669. this.oneClickPackingModelFlag=true
  2670. },
  2671. saveOneClickPacking(){
  2672. let saveData = {
  2673. site: this.currentRow.site,
  2674. buNo: this.currentRow.buNo,
  2675. delNo: this.currentRow.delNo,
  2676. boxRemnant: this.oneClickPackingModelData.boxRemnant,
  2677. }
  2678. saveOneClickPacking(saveData).then(({data}) => {
  2679. if (data && data.code === 0) {
  2680. this.refreshCurrentTabTable()
  2681. this.oneClickPackingModelFlag=false;
  2682. this.$message({
  2683. message: '操作成功',
  2684. type: 'success',
  2685. duration: 1500,
  2686. onClose: () => {}
  2687. })
  2688. } else {
  2689. this.$alert(data.msg, '错误', {
  2690. confirmButtonText: '确定'
  2691. })
  2692. }
  2693. })
  2694. },
  2695. openPalletDialog () {
  2696. //请求
  2697. this.searchPalletList();
  2698. },
  2699. closePalletDialog () {
  2700. this.palletList = []
  2701. this.palletFlag = false
  2702. },
  2703. searchPalletList () {
  2704. this.palletData.buNo = this.palletModelData.buNo
  2705. searchPalletList(this.palletData).then(({data}) => {
  2706. if (data && data.code === 0){
  2707. this.palletList = data.rows;
  2708. }
  2709. })
  2710. },
  2711. palletRowDblclick (row) {
  2712. this.palletModelData.pallet = row.palletNo
  2713. this.palletFlag = false
  2714. },
  2715. // 栈板维护相关方法
  2716. palletMaintenance() {
  2717. if(this.currentRow.site===''||this.currentRow.site==null){
  2718. this.$alert('请先选择发货通知单!', '错误', {
  2719. confirmButtonText: '确定'
  2720. })
  2721. return false
  2722. }
  2723. // 重置栈板记录
  2724. this.palletMaintenanceRecords = []
  2725. // 默认根据buNo获取全部栈板
  2726. this.loadAllPalletsForMaintenance()
  2727. this.palletMaintenanceModelFlag = true
  2728. },
  2729. // 根据buNo加载全部栈板用于维护
  2730. loadAllPalletsForMaintenance() {
  2731. let searchData = {
  2732. palletType: '', // 不限制栈板类型,获取全部
  2733. buNo: this.currentRow.buNo
  2734. }
  2735. searchPalletList(searchData).then(({data}) => {
  2736. if (data.code === 0) {
  2737. const pallets = data.rows || []
  2738. // 为每个栈板创建一条记录
  2739. this.palletMaintenanceRecords = pallets.map(pallet => ({
  2740. pallet: pallet.palletNo,
  2741. palletType: pallet.palletType,
  2742. palletQty: '', // 默认为空,用户需要输入
  2743. height: '' // 使用栈板的默认高度
  2744. }))
  2745. }
  2746. }).catch(error => {
  2747. console.error('加载栈板列表失败:', error)
  2748. // 如果加载失败,至少添加一行空记录
  2749. this.palletMaintenanceRecords = [{
  2750. pallet: '',
  2751. palletType: '',
  2752. palletQty: '',
  2753. height: ''
  2754. }]
  2755. })
  2756. },
  2757. savePalletMaintenance() {
  2758. // 过滤出托数大于0的栈板记录
  2759. const validPalletRecords = this.palletMaintenanceRecords.filter(record => {
  2760. return record.palletQty && parseFloat(record.palletQty) > 0
  2761. })
  2762. if (validPalletRecords.length === 0) {
  2763. this.$alert('请至少输入一条有效的栈板记录!', '错误', {
  2764. confirmButtonText: '确定'
  2765. })
  2766. return false
  2767. }
  2768. // 验证有效的栈板记录
  2769. for (let i = 0; i < validPalletRecords.length; i++) {
  2770. const record = validPalletRecords[i]
  2771. if (!record.pallet) {
  2772. this.$alert(`栈板不能为空!`, '错误', {
  2773. confirmButtonText: '确定'
  2774. })
  2775. return false
  2776. }
  2777. if (!record.height || record.height <= 0) {
  2778. this.$alert(`栈板高度必须大于0!`, '错误', {
  2779. confirmButtonText: '确定'
  2780. })
  2781. return false
  2782. }
  2783. }
  2784. // 这里只新增栈板记录,不做其他事情
  2785. let saveData = {
  2786. site: this.currentRow.site,
  2787. buNo: this.currentRow.buNo,
  2788. delNo: this.currentRow.delNo,
  2789. palletRecords: JSON.stringify(validPalletRecords),
  2790. }
  2791. // 使用相同的API,但传递maintenanceOnly标识
  2792. savePalletMaintenance(saveData).then(({data}) => {
  2793. if (data && data.code === 0) {
  2794. this.refreshCurrentTabTable()
  2795. this.palletMaintenanceModelFlag = false;
  2796. this.$message({
  2797. message: '栈板记录新增成功',
  2798. type: 'success',
  2799. duration: 1500,
  2800. onClose: () => {}
  2801. })
  2802. } else {
  2803. this.$alert(data.msg, '错误', {
  2804. confirmButtonText: '确定'
  2805. })
  2806. }
  2807. })
  2808. },
  2809. getSummaries(param) {
  2810. const { columns } = param;
  2811. const sums = [];
  2812. columns.forEach((column, index) => {
  2813. if (index === 0) {
  2814. sums[index] = '合计';
  2815. return;
  2816. }
  2817. let sumDataList = this.dataList4.filter(item => item.palletQty>0);
  2818. const values = sumDataList.map(item => Number(item[column.property]));
  2819. if (!values.every(value => isNaN(value))) {
  2820. switch(column.property) {
  2821. case 'palletQty':
  2822. sums[index] = `${values.reduce((a, b) => a + b, 0)}`;
  2823. break;
  2824. default:
  2825. sums[index] = '';
  2826. }
  2827. } else {
  2828. sums[index] = '';
  2829. }
  2830. });
  2831. this.$nextTick(() => this.$refs.detailTable.doLayout());// 强制刷新布局, 否则会被表格覆盖
  2832. return sums;
  2833. },
  2834. getDetailSummaries(param) {
  2835. const { columns } = param;
  2836. const sums = [];
  2837. columns.forEach((column, index) => {
  2838. if (index === 0) {
  2839. sums[index] = '合计';
  2840. return;
  2841. }
  2842. let sumDataList = this.dataList2.filter(item => item.qty>0);
  2843. const values = sumDataList.map(item => Number(item[column.property]));
  2844. if (!values.every(value => isNaN(value))) {
  2845. switch(column.property) {
  2846. case 'qty':
  2847. sums[index] = `${values.reduce((a, b) => a + b, 0)}`;
  2848. break;
  2849. case 'ttlAmount':
  2850. sums[index] = `${values.reduce((a, b) => a + b, 0).toFixed(2)}`;
  2851. break;
  2852. case 'sumPrice':
  2853. sums[index] = `${values.reduce((a, b) => a + b, 0).toFixed(2)}`;
  2854. break;
  2855. default:
  2856. sums[index] = '';
  2857. }
  2858. } else {
  2859. sums[index] = '';
  2860. }
  2861. });
  2862. this.$nextTick(() => this.$refs.cloDetailTable.doLayout());// 强制刷新布局, 否则会被表格覆盖
  2863. return sums;
  2864. },
  2865. /**
  2866. * 保存选中行到本地存储
  2867. * 使用页面路径和用户名作为存储键的一部分确保不同页面和用户的选择互不影响
  2868. */
  2869. saveSelectedRowToStorage() {
  2870. try {
  2871. const storageKey = `codelnotifyConfirm_selected_row_${this.$store.state.user.name}`;
  2872. localStorage.setItem(storageKey, this.selectedRowKey);
  2873. console.log(`[确认页面行选择持久化] 已保存选中行: ${this.selectedRowKey}`);
  2874. } catch (error) {
  2875. console.warn('保存选中行状态失败:', error);
  2876. }
  2877. },
  2878. /**
  2879. * 从本地存储恢复选中行
  2880. * @returns {Object|null} 返回匹配的行数据如果没有找到则返回null
  2881. */
  2882. restoreSelectedRow() {
  2883. try {
  2884. const storageKey = `codelnotifyConfirm_selected_row_${this.$store.state.user.name}`;
  2885. const savedRowKey = localStorage.getItem(storageKey);
  2886. // 检查必要的条件
  2887. if (!savedRowKey) {
  2888. console.log('[确认页面行选择持久化] 没有保存的选中行');
  2889. return null;
  2890. }
  2891. if (!this.dataList || this.dataList.length === 0) {
  2892. console.log('[确认页面行选择持久化] 数据列表为空,无法恢复选中行');
  2893. return null;
  2894. }
  2895. // 在当前数据列表中查找匹配的行
  2896. const matchedRow = this.dataList.find(row => row && row.delNo === savedRowKey);
  2897. if (matchedRow) {
  2898. this.selectedRowKey = savedRowKey;
  2899. console.log(`[确认页面行选择持久化] 已恢复选中行: ${savedRowKey}`);
  2900. return matchedRow;
  2901. } else {
  2902. console.log(`[确认页面行选择持久化] 未找到匹配的行: ${savedRowKey},当前数据列表长度: ${this.dataList.length}`);
  2903. }
  2904. return null;
  2905. } catch (error) {
  2906. console.warn('恢复选中行状态失败:', error);
  2907. return null;
  2908. }
  2909. },
  2910. /**
  2911. * 清除本地存储的选中行状态
  2912. */
  2913. clearSelectedRowStorage() {
  2914. try {
  2915. const storageKey = `codelnotifyConfirm_selected_row_${this.$store.state.user.name}`;
  2916. localStorage.removeItem(storageKey);
  2917. this.selectedRowKey = null;
  2918. } catch (error) {
  2919. console.warn('清除选中行状态失败:', error);
  2920. }
  2921. },
  2922. },
  2923. activated() {
  2924. this.searchTable()
  2925. },
  2926. created() {
  2927. this.getBu ()
  2928. // 动态列
  2929. this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
  2930. // 初始化时从本地存储加载选中行状态
  2931. try {
  2932. const storageKey = `codelnotifyConfirm_selected_row_${this.$store.state.user.name}`;
  2933. const savedRowKey = localStorage.getItem(storageKey);
  2934. if (savedRowKey) {
  2935. this.selectedRowKey = savedRowKey;
  2936. }
  2937. } catch (error) {
  2938. console.warn('初始化选中行状态失败:', error);
  2939. }
  2940. }
  2941. }
  2942. </script>
  2943. <style lang="scss">
  2944. .warning-row td{
  2945. color: darkred !important;
  2946. }
  2947. .zxClass .cell {
  2948. line-height: 24px;
  2949. font-size: 12px;
  2950. height: 24px;
  2951. }
  2952. /* 可点击的PN样式 */
  2953. .clickable-pn {
  2954. cursor: pointer;
  2955. text-decoration: underline;
  2956. }
  2957. .clickable-pn:hover {
  2958. opacity: 0.8;
  2959. }
  2960. /* 对话框标题样式 */
  2961. .dialog-title {
  2962. display: flex;
  2963. align-items: center;
  2964. font-size: 16px;
  2965. font-weight: 500;
  2966. }
  2967. .dialog-title .el-icon-question:hover {
  2968. color: #66b1ff;
  2969. transform: scale(1.1);
  2970. transition: all 0.3s ease;
  2971. }
  2972. /* 表格头部提示图标样式 */
  2973. /deep/ .el-table th .el-icon-question:hover {
  2974. color: #409EFF;
  2975. transform: scale(1.1);
  2976. transition: all 0.2s ease;
  2977. }
  2978. /* 提示框内容样式 */
  2979. /deep/ .el-tooltip__popper {
  2980. max-width: 300px;
  2981. }
  2982. /deep/ .el-tooltip__popper .el-tooltip__content {
  2983. line-height: 1.6;
  2984. }
  2985. /deep/ .el-tooltip__popper .el-tooltip__content div {
  2986. margin-bottom: 4px;
  2987. }
  2988. /deep/ .el-tooltip__popper .el-tooltip__content div:first-child {
  2989. font-weight: bold;
  2990. margin-bottom: 8px;
  2991. color: #409EFF;
  2992. }
  2993. .pallet-dialog .section {
  2994. margin: 10px 7px;
  2995. }
  2996. .section-title {
  2997. font-size: 14px;
  2998. font-weight: bold;
  2999. color: #333;
  3000. margin-bottom: 8px;
  3001. }
  3002. .table-wrapper {
  3003. height: 300px; /* 让表格部分固定高度并滚动 */
  3004. overflow-y: auto;
  3005. }
  3006. </style>