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.

3265 lines
114 KiB

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