fabric-list.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866
  1. <template>
  2. <!-- 装箱单-面料列表 -->
  3. <div id="fabricList">
  4. <!-- 查询 -->
  5. <a-card :bordered="false">
  6. <div class="table-page-search-wrapper">
  7. <a-form layout="inline" @keyup.enter.native="searchQuery">
  8. <a-row :gutter="24">
  9. <a-col :md="6" :sm="8">
  10. <a-form-item label="单据号">
  11. <a-input placeholder="请输入单据号" v-model="queryParam.documentNo"></a-input>
  12. </a-form-item>
  13. </a-col>
  14. <!-- <a-col :md="6" :sm="8">
  15. <a-form-item label="订单号">
  16. <a-input placeholder="请输入订单号" v-model="queryParam.orderNumber"></a-input>
  17. </a-form-item>
  18. </a-col> -->
  19. <a-col :md="6" :sm="8">
  20. <a-form-item label="集装箱号">
  21. <a-input placeholder="请输入集装箱号" v-model="queryParam.containerNumber"></a-input>
  22. </a-form-item>
  23. </a-col>
  24. <a-col :md="6" :sm="8">
  25. <a-form-item label="外销发票号">
  26. <a-input placeholder="请输入外销发票号" v-model="queryParam.exportInvoiceNo"></a-input>
  27. </a-form-item>
  28. </a-col>
  29. <template v-if="toggleSearchStatus">
  30. <a-col :md="6" :sm="8">
  31. <a-form-item label="是否提交">
  32. <a-select v-model="queryParam.status">
  33. <a-select-option value="">请选择</a-select-option>
  34. <a-select-option value="0">否</a-select-option>
  35. <a-select-option value="1">是</a-select-option>
  36. </a-select>
  37. </a-form-item>
  38. </a-col>
  39. <a-col :md="6" :sm="8">
  40. <a-form-item label="计划单号">
  41. <a-input placeholder="请输入" v-model="queryParam.planLotNumber"></a-input>
  42. </a-form-item>
  43. </a-col>
  44. <a-col :md="5" :sm="8">
  45. <a-form-item label="业务员">
  46. <!-- <a-input placeholder="请输入业务员" v-model="queryParam.salesman"></a-input> -->
  47. <j-search-select-tag
  48. placeholder="请选择业务员"
  49. v-model="queryParam.salesman"
  50. dict="view_salesman,salesman,salesman">
  51. </j-search-select-tag>
  52. </a-form-item>
  53. </a-col>
  54. <a-col :md="6" :sm="8">
  55. <a-form-item label="制单人">
  56. <a-input placeholder="请输入制单人" v-model="queryParam.createBy"></a-input>
  57. </a-form-item>
  58. </a-col>
  59. <a-col :md="5" :sm="8">
  60. <a-form-model-item label="是否被参照">
  61. <a-select v-model="queryParam.isReference">
  62. <a-select-option value="">请选择</a-select-option>
  63. <a-select-option value="1">是</a-select-option>
  64. <a-select-option value="0">否</a-select-option>
  65. </a-select>
  66. </a-form-model-item>
  67. </a-col>
  68. <a-col :md="6" :sm="8">
  69. <a-form-item label="账套号">
  70. <j-search-select-tag
  71. placeholder="请选择账套号"
  72. v-model="queryParam.account"
  73. dict="view_account,account,account">
  74. </j-search-select-tag>
  75. </a-form-item>
  76. </a-col>
  77. </template>
  78. <a-col :md="6" :sm="8">
  79. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  80. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  81. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  82. <a @click="handleToggleSearch" style="margin-left: 8px">
  83. {{ toggleSearchStatus ? '收起' : '展开' }}
  84. <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
  85. </a>
  86. </span>
  87. </a-col>
  88. </a-row>
  89. </a-form>
  90. </div>
  91. </a-card>
  92. <!-- 操作按钮区域 推送 新增-->
  93. <a-card :bordered="false" style="marginTop:10px;">
  94. <div class="table-operator">
  95. <a-button type="primary" @click="addFabric" icon="plus">新增</a-button>
  96. <a-button type="primary" @click="bitchSubmitList" icon="check">批量提交</a-button>
  97. <a-button type="primary" @click="bitchCancelSubmitList" icon="close">批量取消提交</a-button>
  98. <!-- <a-button type="primary" @click="push" icon="export">推送</a-button> -->
  99. <a-button type="primary" icon="download" @click="handleExportXls('装箱单-面辅料')">装箱单面辅料导出</a-button>
  100. <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" @change="handleImportExcel" :customRequest="uploadFlie" >
  101. <a-button type="primary" icon="import">导入-来源出运明细</a-button>
  102. </a-upload>
  103. <a-button type="primary" @click="synchronization" icon="reload">同步</a-button>
  104. <a-button type="primary" icon="download" @click="majorityDelet">批量删除</a-button>
  105. <a-button type="primary" icon="download" @click="majorityPush">批量推送</a-button>
  106. </div>
  107. <!-- 子表 :scroll="{ x: 1500 }" 内容少 无需滚动-->
  108. <a-table
  109. bordered
  110. :columns="fabricListColumns"
  111. :data-source="fabricListData"
  112. :loading="loading"
  113. :scroll="{ x: 1500 , y: 600 }"
  114. :pagination="pagination"
  115. :row-key="record => record.id"
  116. :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
  117. @change="handleTableChange"
  118. >
  119. <!-- 集装箱号 输入框
  120. <a-form-model
  121. slot="containerNo"
  122. slot-scope="text, record"
  123. :ref="record.index"
  124. :model="record"
  125. style="width:100%;height:40px"
  126. >
  127. <a-form-model-item prop="containerNo">
  128. <a-input style="width:100%" v-model="record.containerNumber" />
  129. </a-form-model-item>
  130. </a-form-model> -->
  131. <!-- 单据状态 -->
  132. <span slot="pushState" slot-scope="text, record">
  133. <a-tag color="orange" v-if="record.pushState == '0'">未推送</a-tag>
  134. <a-tag color="red" v-if="record.pushState == '2'">推送失败</a-tag>
  135. <a-tag color="green" v-if="record.pushState == '1'">推送成功</a-tag>
  136. <a-tag color="blue" v-if="record.pushState == '3'">推送中</a-tag>
  137. <a-tag color="#B7B7B7" v-if="record.pushState == '4'">不再推送</a-tag>
  138. </span>
  139. <span slot="whetherCloudFactoryPush" slot-scope="text, record" :title ="record.cause">
  140. <span v-if="record.whetherCloudFactoryPush == '0'">否</span>
  141. <span v-if="record.whetherCloudFactoryPush == '1'">是</span>
  142. </span>
  143. <!-- 单据状态 -->
  144. <span slot="state" slot-scope="text, record">
  145. <a-tag color="orange" v-if="record.status == '0'">已保存</a-tag>
  146. <a-tag color="green" v-if="record.status == '1'">已提交</a-tag>
  147. </span>
  148. <!-- 操作 -->
  149. <span slot="operationSlot" slot-scope="text, record">
  150. <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="enclosureUrl" @change="handleImportExcel" :data="{id:record.id}" >
  151. <a style="color:green;">附件上传</a>
  152. </a-upload>
  153. <a-divider type="vertical" />
  154. <a-dropdown>
  155. <a class="ant-dropdown-link">更多<a-icon type="down"/></a>
  156. <a-menu slot="overlay" v-if="record.status=='0'">
  157. <a-menu-item><a @click="details(record)">详情</a></a-menu-item>
  158. <a-menu-item><a @click="edit(record)">编辑</a></a-menu-item>
  159. <a-menu-item v-if="record.pushState!=='4'"><a @click="pushU8(record)">推送U8</a></a-menu-item>
  160. <a-menu-item v-if="record.pushState!=='4'"><a @click="stopPush(record)">关闭推送</a></a-menu-item>
  161. <!-- <a-menu-item><a @click="itemXls(record)">导出</a></a-menu-item> -->
  162. <!-- <a-menu-item><a @click="submit(record)">提交</a></a-menu-item> -->
  163. <a-menu-item>
  164. <a-popconfirm title="确定删除吗?" ok-text="是" cancel-text="否" @confirm="handleDelete(record.id)">
  165. <a href="javascript:void(0);" style="color:red;">删除</a>
  166. </a-popconfirm>
  167. </a-menu-item>
  168. </a-menu>
  169. <!-- 已提交 -->
  170. <a-menu slot="overlay" v-if="record.status=='1'">
  171. <a-menu-item><a @click="details(record)">详情</a></a-menu-item>
  172. <a-menu-item v-if="record.pushState!=='4'"><a @click="pushU8(record)">推送U8</a></a-menu-item>
  173. <a-menu-item v-if="record.pushState!=='4'"><a @click="stopPush(record)">关闭推送</a></a-menu-item>
  174. <!-- <a-menu-item><a @click="itemXls(record)">导出</a></a-menu-item> -->
  175. <!-- <a-menu-item><a @click="cancel(record)">取消提交</a></a-menu-item> -->
  176. </a-menu>
  177. </a-dropdown>
  178. </span>
  179. </a-table>
  180. <span style="position: absolute;bottom: 4%;">共勾选{{selectedNumber}}条数</span>
  181. </a-card>
  182. <!-- 抽屉 -->
  183. <div>
  184. <addFabric-drawer ref="addFabricDrawer" :father="aa" @ok="modalFormOk" :fatherList="getFabricList"></addFabric-drawer>
  185. <detailsFabric-drawer ref="detailsFabricDrawer" :father="bb" @ok="modalFormOk"></detailsFabric-drawer>
  186. <editFabric-drawer ref="editFabricDrawer" :father="cc" @ok="modalFormOk"></editFabric-drawer>
  187. </div>
  188. <!-- 导入确认框 -->
  189. <div>
  190. <a-modal :visible="visible" title="是否继续导入" @ok="handleOk" @cancel="handleCancel" >
  191. <template #footer>
  192. <a-button @click="handleCancel" style="margin-left: 8px;">取消</a-button>
  193. <a-button type="primary" @click="handleOk" :disabled="handleOkButton">确定</a-button>
  194. </template>
  195. <ul>
  196. <li v-for="(item,index) in message" :key="index">{{item}}</li>
  197. </ul>
  198. </a-modal>
  199. </div>
  200. </div>
  201. </template>
  202. <script>
  203. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  204. import { downFile } from '@/api/manage'
  205. import JEllipsis from '@/components/jeecg/JEllipsis'
  206. import moment from 'moment'
  207. import addFabricDrawer from '@views/packing-list/packinglist-fabrics/addFabricDrawer.vue'
  208. import detailsFabricDrawer from '@views/packing-list/packinglist-fabrics/detailsFabricDrawer.vue'
  209. import editFabricDrawer from '@views/packing-list/packinglist-fabrics/editFabricDrawer.vue'
  210. import {bitchPush,cancelPush,fabricList,fabricListId,deleteFabricList,submitList,batchDelete,cancelSubmit,bitchSubmit,bitchCancelSubmit,synchronizationData,upload,fileDetail,pushOrderData} from '@api/document/packing-list/packinglist-fabrics'
  211. export default {
  212. name: 'FabricList', // 装箱单-面料
  213. mixins: [JeecgListMixin],
  214. components: { JEllipsis, moment, addFabricDrawer, detailsFabricDrawer, editFabricDrawer },
  215. data() {
  216. // let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
  217. return {
  218. // 表头
  219. fabricListColumns: [
  220. // {
  221. // title: '订单号',
  222. // dataIndex: 'orderNumber',
  223. // width: 160,
  224. // className: 'replacecolor'
  225. // },
  226. {
  227. title: '外销发票号',
  228. dataIndex: 'exportInvoiceNo',
  229. width: 150,
  230. ellipsis: true,
  231. fixed:'left',
  232. className: 'replacecolor'
  233. },
  234. {
  235. title: '集装箱号',
  236. dataIndex: 'containerNumber',
  237. width: 125,
  238. ellipsis: true,
  239. // scopedSlots: { customRender: 'containerNo' },
  240. className: 'replacecolor'
  241. },
  242. // {
  243. // title: '发票号',
  244. // dataIndex: 'invoiceNo',
  245. // width: 160,
  246. // ellipsis: true,
  247. // className: 'replacecolor'
  248. // },
  249. {
  250. title: '装柜日期',
  251. dataIndex: 'latestDateOfShipment',
  252. width: 110,
  253. ellipsis: true,
  254. className: 'replacecolor'
  255. },
  256. {
  257. title: '成衣工厂',
  258. dataIndex: 'garmentFactory',
  259. width: 120,
  260. ellipsis: true,
  261. className: 'replacecolor'
  262. },
  263. {
  264. title: '制单人',
  265. dataIndex: 'createBy',
  266. width: 120,
  267. ellipsis: true,
  268. className: 'replacecolor'
  269. },
  270. {
  271. title: '制单日期',
  272. dataIndex: 'preparedDate',
  273. width: 120,
  274. ellipsis: true,
  275. // 有问题,自动显示当日日期
  276. // customRender: text => {
  277. // return moment(text).format('YYYY-MM-DD')
  278. // },
  279. className: 'replacecolor'
  280. },
  281. {
  282. title: '托书号',
  283. dataIndex: 'shippingOrderNumber',
  284. width: 160,
  285. ellipsis: true,
  286. className: 'replacecolor'
  287. },
  288. {
  289. title: '单据号',
  290. dataIndex: 'documentNo',
  291. width: 160,
  292. ellipsis: true,
  293. className: 'replacecolor'
  294. },
  295. {
  296. title: '推送状态',
  297. dataIndex: 'pushState',
  298. scopedSlots: { customRender: 'pushState' },
  299. width: 140,
  300. fixed: 'right',
  301. className: 'replacecolor'
  302. },
  303. {
  304. title: '云工厂',
  305. dataIndex: 'whetherCloudFactoryPush ',
  306. width: 80,
  307. fixed: 'right',
  308. scopedSlots: { customRender: 'whetherCloudFactoryPush' },
  309. className: 'replacecolor'
  310. },
  311. {
  312. title: '状态',
  313. dataIndex: 'status',
  314. scopedSlots: { customRender: 'state' },
  315. width: 140,
  316. fixed: 'right',
  317. className: 'replacecolor'
  318. },
  319. {
  320. title: '操作',
  321. dataIndex: 'operation',
  322. scopedSlots: { customRender: 'operationSlot' },
  323. width: 150,
  324. fixed: 'right',
  325. className: 'replacecolor'
  326. }
  327. ],
  328. fabricListData: [],
  329. visible:false,
  330. file:{},
  331. message:[],//导入文件信息
  332. selectedRowKeys: [], // 勾选航
  333. loading: false, // 表格加载
  334. handleOkButton:false,//导入按钮状态
  335. // 查询条件
  336. queryParam: {
  337. pageNo: '', // 初始页
  338. isReference:'0',
  339. pageSize:'50'
  340. },
  341. pagination:{
  342. pageSizeOptions: ["50", "100", "150"],
  343. showSizeChanger: true,
  344. },
  345. selectedNumber:0,//已选择条数
  346. url: {
  347. // syncUser: '/act/process/extActProcess/doSyncUser',
  348. list: '/sys/user/list',
  349. // delete: '/sys/user/delete',
  350. // deleteBatch: '/sys/user/deleteBatch',
  351. exportXlsUrl: '/sys/user/exportXls', // 导出
  352. importExcelUrl: 'splfi/syPackingListFabric/importExcel', // 导入
  353. enclosureUrl:'splfi/syPackingListFabric/upload'//附件导入
  354. }
  355. }
  356. },
  357. created() {
  358. this.getFabricList()
  359. },
  360. watch:{
  361. selectedRowKeys(newVal){
  362. this.selectedNumber =newVal.length
  363. }
  364. },
  365. methods: {
  366. // 导入
  367. uploadFlie(file) {
  368. const formData = new FormData()
  369. formData.append('file', file.file)
  370. fileDetail(formData).then(res => {
  371. this.loading = false
  372. if (res.success) {
  373. this.visible = true
  374. this.message = res.message.split(';').filter((element) => {
  375. return element !== "";
  376. });
  377. this.file = file
  378. }else{
  379. this.$message.error(res.message);
  380. }
  381. })},
  382. //继续导入
  383. handleOk(){
  384. this.handleOkButton = true
  385. const formData = new FormData()
  386. formData.append('file', this.file.file)
  387. upload(formData).then(res => {
  388. this.visible = false
  389. if (res.success) {
  390. this.$message.success('导入成功')
  391. this.handleOkButton = false
  392. this.getFabricList()
  393. }else{
  394. this.$message.error(res.message);
  395. this.handleOkButton = false
  396. }
  397. })
  398. },
  399. //取消导入
  400. handleCancel(){
  401. this.visible = false
  402. this.loading = false
  403. },
  404. //分页查询
  405. getFabricList(){
  406. this.$nextTick(() => {
  407. // this.queryParam.pageSize = 50
  408. this.loading = true
  409. fabricList(this.queryParam).then(res => {
  410. this.loading = false
  411. if (res.success) {
  412. this.fabricListData = res.result.records;
  413. this.loading = false
  414. this.selectedRowKeys = []
  415. this.pagination = {
  416. total: res.result.total,
  417. current: res.result.current,
  418. pageSize: res.result.size
  419. }
  420. this.$forceUpdate()
  421. }else{
  422. this.$message.error(res.message);
  423. }
  424. })
  425. })
  426. },
  427. // 查询按钮
  428. searchQuery() {
  429. this.toggleSearchStatus = false
  430. this.queryParam.pageNo = ''
  431. this.getFabricList()
  432. },
  433. //重置查询
  434. searchReset() {
  435. this.queryParam = {
  436. isReference:'0',
  437. pageSize:this.pagination.pageSize
  438. }
  439. this.getFabricList()
  440. },
  441. // ------------------------------------
  442. // 推送
  443. push() {},
  444. // 新增
  445. addFabric() {
  446. console.log('新增-装箱单面料')
  447. this.$refs.addFabricDrawer.visible = true
  448. },
  449. // --------------------------------------
  450. // 操作 附件上传
  451. accessoryUpload() {},
  452. // 列表导出
  453. handleExportXls(fileName) {
  454. var obj ={}
  455. if(this.selectedRowKeys.length == this.pagination.pageSize || this.selectedRowKeys.length==this.fabricListData.length){
  456. obj=this.queryParam
  457. obj.selectAll = '1'
  458. }else{
  459. var arr =[]
  460. this.fabricListData.map(item=>{
  461. this.selectedRowKeys.map(e=>{
  462. if(item.id == e){
  463. arr.push(item.id)
  464. }
  465. })
  466. })
  467. obj.ids = arr.toString()
  468. obj.selectAll = '2'
  469. }
  470. downFile('/splfi/syPackingListFabric/exportXls',obj).then(data => {
  471. if (!data) {
  472. this.$message.warning('文件下载失败')
  473. return
  474. }
  475. if (typeof window.navigator.msSaveBlob !== 'undefined') {
  476. window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xlsx')
  477. } else {
  478. let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
  479. let link = document.createElement('a')
  480. link.style.display = 'none'
  481. link.href = url
  482. link.setAttribute('download', fileName + '.xlsx')
  483. document.body.appendChild(link)
  484. link.click()
  485. document.body.removeChild(link) // 下载完成移除元素
  486. window.URL.revokeObjectURL(url) // 释放掉blob对象
  487. }
  488. })
  489. },
  490. // 操作 单条数据导出
  491. itemXls(record) {
  492. downFile('/splfi/syPackingListFabric/exportXls',{id:record.id}).then(data => {
  493. if (!data) {
  494. this.$message.warning('文件下载失败')
  495. return
  496. }
  497. if (typeof window.navigator.msSaveBlob !== 'undefined') {
  498. window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), item + '.xlsx')
  499. }else {
  500. let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
  501. let link = document.createElement('a')
  502. link.style.display = 'none'
  503. link.href = url
  504. link.setAttribute('download', '装箱单' + '.xlsx')
  505. document.body.appendChild(link)
  506. link.click()
  507. document.body.removeChild(link) // 下载完成移除元素
  508. window.URL.revokeObjectURL(url) // 释放掉blob对象
  509. }
  510. })
  511. },
  512. // 同步
  513. synchronization(){
  514. this.$nextTick(() => {
  515. synchronizationData().then(res => {
  516. if (res.success) {
  517. this.$message.success('同步成功')
  518. this.getFabricList();
  519. }else{
  520. this.$message.error(res.message);
  521. }
  522. })
  523. })
  524. },
  525. // 操作 详情
  526. details(record) {
  527. console.log('详情', record.id)
  528. // console.log('编辑')
  529. this.$nextTick(() => {
  530. fabricListId({id:record.id}).then(res => {
  531. if (res.success) {
  532. var data = res.result
  533. this.$refs.detailsFabricDrawer.visible = true
  534. this.$refs.detailsFabricDrawer.addFabric =data
  535. if(record.documentNo.substr(0, 2) == "FL"){
  536. this.$refs.detailsFabricDrawer.judageCloumn()
  537. }
  538. data.syPackingListFabricItem.map(item =>{
  539. item.totalPrice = Number(item.totalPrice).toFixed(2)
  540. if(item.manualYarnFlag == 0){
  541. item.manualYarnFlag = '否'
  542. }else {
  543. item.manualYarnFlag = '是'
  544. }
  545. })
  546. this.$refs.detailsFabricDrawer.accessory =(data.accessory!==''&&data.accessory) ?data.accessory.split(","):[]
  547. this.$refs.detailsFabricDrawer.recordingCode = (data.recordingCode!=='' && data.recordingCode) ? (data.recordingCode.split(";")) :[]
  548. this.$refs.detailsFabricDrawer.addFabricData = data.syPackingListFabricItem
  549. }else{
  550. this.$message.error(res.message);
  551. }
  552. })
  553. })
  554. },
  555. // 操作 编辑
  556. edit(record) {
  557. // console.log('编辑')
  558. this.$nextTick(() => {
  559. fabricListId({id:record.id}).then(res => {
  560. if (res.success) {
  561. var data = res.result
  562. this.$refs.addFabricDrawer.visible = true
  563. this.$refs.addFabricDrawer.defaultMethod = 'edit'
  564. this.$refs.addFabricDrawer.addFabric ={
  565. id:data.id,
  566. // orderNumber:data.orderNumber,
  567. documentNo:data.documentNo,
  568. containerNumber:data.containerNumber,
  569. latestDateOfShipment:data.latestDateOfShipment,
  570. garmentFactory:data.garmentFactory,
  571. invoiceNo:data.invoiceNo,
  572. preparedBy:data.preparedBy,
  573. preparedDate:data.preparedDate,
  574. exportInvoiceNo:data.exportInvoiceNo,
  575. shippingOrderNumber:data.shippingOrderNumber,
  576. remarks:data.remarks,
  577. plumbumNo:data.plumbumNo,
  578. }
  579. if(record.documentNo.substr(0, 2) == "FL"){
  580. this.$refs.addFabricDrawer.judageCloumn()
  581. }
  582. data.syPackingListFabricItem.map(item =>{
  583. item.totalPrice = Number(item.totalPrice).toFixed(2)
  584. if(item.manualYarnFlag == 0){
  585. this.$refs.addFabricDrawer.manualYarnDisabled = true
  586. this.$forceUpdate()
  587. }else {
  588. this.$refs.addFabricDrawer.manualYarnDisabled = false
  589. }
  590. })
  591. this.$refs.addFabricDrawer.addFabricData = data.syPackingListFabricItem
  592. }else{
  593. this.$message.error(res.message);
  594. }
  595. })
  596. })
  597. },
  598. //提交
  599. submit(record){
  600. console.log(record.id)
  601. submitList({id:record.id}).then(res =>{
  602. if (res.success) {
  603. record.status = 1
  604. this.getFabricList()
  605. this.$message.success('提交成功')
  606. }else{
  607. this.$message.error(res.message);
  608. }
  609. })
  610. },
  611. pushU8(record){
  612. pushOrderData({ids : record.id}).then(res =>{
  613. if (res.success) {
  614. this.getFabricList()
  615. this.$message.success('推送U8成功');
  616. }else{
  617. this.$message.error(res.message);
  618. }
  619. })
  620. },
  621. stopPush(record){
  622. cancelPush({id : record.id}).then(res =>{
  623. if (res.success) {
  624. this.getFabricList()
  625. this.$message.success('关闭推送成功');
  626. }else{
  627. this.$message.error(res.message);
  628. }
  629. })
  630. },
  631. cancel(record){
  632. console.log(record.id)
  633. cancelSubmit({id:record.id}).then(res =>{
  634. if (res.success) {
  635. record.status = 0
  636. this.getFabricList()
  637. this.$message.success('取消提交成功')
  638. }else{
  639. this.$message.error(res.message);
  640. }
  641. })
  642. },
  643. //批量提交
  644. bitchSubmitList(){
  645. // for(var i =0;i<this.selectedRows.length;i++){
  646. // var tickRow = this.selectedRows[i]
  647. // if(tickRow.status === '1'){
  648. // this.$message.error("部分数据是已提交,请勿重复提交!");
  649. // return
  650. // }
  651. // }
  652. var ids = this.selectedRowKeys.toString()
  653. bitchSubmit({ids : ids}).then(res =>{
  654. if (res.success) {
  655. this.getFabricList()
  656. this.selectedRowKeys = []
  657. this.$message.success('提交成功');
  658. }else{
  659. this.$message.error(res.message);
  660. }
  661. })
  662. },
  663. //批量推送
  664. majorityPush(){
  665. if(this.selectedRowKeys.length==0){
  666. this.$message.error('请勾选数据');
  667. }else{
  668. var ids = this.selectedRowKeys.toString()
  669. bitchPush({ids : ids}).then(res =>{
  670. this.fabricListData.map(item=>{
  671. this.selectedRowKeys.map(event=>{
  672. if(item.pushState!=='4'&&item.id==event){
  673. item.pushState = '3'
  674. this.$forceUpdate()
  675. }
  676. })
  677. })
  678. if (res.success) {
  679. this.getFabricList()
  680. this.selectedRowKeys = []
  681. this.$message.success('推送成功');
  682. }else{
  683. this.getFabricList()
  684. this.$message.error(res.message);
  685. }
  686. })
  687. }
  688. },
  689. //批量取消推送
  690. bitchCancelSubmitList(){
  691. // for(var i =0;i<this.selectedRows.length;i++){
  692. // var tickRow = this.selectedRows[i]
  693. // if(tickRow.status === '0'){
  694. // this.$message.error("含未提交数据,请重新选择!");
  695. // return
  696. // }
  697. // }
  698. var ids = this.selectedRowKeys.toString()
  699. bitchCancelSubmit({ids : ids}).then(res =>{
  700. if (res.success) {
  701. this.getFabricList()
  702. this.selectedRowKeys = []
  703. this.$message.success('取消提交成功');
  704. }else{
  705. this.$message.error(res.message);
  706. }
  707. })
  708. },
  709. // 操作 删除
  710. handleDelete(id) {
  711. this.$nextTick(() => {
  712. if(this.queryParam.pageNo > 1 && this.fabricListData.length === 1){
  713. this.queryParam.pageNo = this.queryParam.pageNo -1
  714. }
  715. deleteFabricList({ id: id }).then(res => {
  716. if (res.success) {
  717. this.getFabricList()
  718. this.$message.success('删除成功')
  719. } else {
  720. this.$message.error('删除成功')
  721. }
  722. })
  723. })
  724. },
  725. majorityDelet(){
  726. var ids = this.selectedRowKeys.toString()
  727. batchDelete({ ids: ids }).then(res => {
  728. if (res.success) {
  729. this.$message.success('批量删除成功');
  730. this.getFabricList()
  731. }else {
  732. this.$message.error(res.message);
  733. }
  734. })
  735. this.selectedRowKeys = []
  736. },
  737. // --------------------------------------
  738. // ??
  739. modalFormOk() {},
  740. // 选中行
  741. onSelectChange(keys, rows) {
  742. this.selectedRowKeys = keys
  743. this.selectedRows = rows
  744. },
  745. // --------------------------------------
  746. aa() {},
  747. bb() {},
  748. cc() {},
  749. // 分页、排序、筛选变化时触发
  750. handleTableChange(pagination, filters, sorter) {
  751. // console.log('当前页信息>>>>',pagination)
  752. this.queryParam.pageNo = pagination.current
  753. this.queryParam.pageSize = pagination.pageSize
  754. this.getFabricList()
  755. }
  756. },
  757. computed: {
  758. // 导入
  759. importExcelUrl: function() {
  760. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
  761. },
  762. // 附件上传
  763. enclosureUrl: function() {
  764. return `${window._CONFIG['domianURL']}/${this.url.enclosureUrl}`
  765. },
  766. // 选中项
  767. rowSelection() {
  768. return {
  769. onChange: (selectedRowKeys, selectedRows) => {
  770. console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
  771. },
  772. getCheckboxProps: record => ({
  773. props: {
  774. disabled: record.title === 'Disabled User',
  775. // Column configuration not to be checked
  776. title: record.title
  777. }
  778. })
  779. }
  780. }
  781. },
  782. mounted() {}
  783. }
  784. </script>
  785. <style lang="less" scoped>
  786. @import '~@assets/less/common.less';
  787. @import '~@assets/less/overwriter.less';
  788. /deep/ .ant-table-thead > tr > th {
  789. text-align: center;
  790. // font-weight: 700;
  791. }
  792. /deep/ .ant-table-tbody {
  793. text-align: center;
  794. }
  795. // /deep/ th.replacecolor {
  796. // background-color: #ccc;
  797. // }
  798. /deep/ .ant-table-tbody .ant-table-row td{
  799. padding-top: 8px;
  800. padding-bottom: 8px;
  801. }
  802. /deep/.ant-card-body{
  803. padding-top: 10px !important;
  804. padding-bottom: 0px !important;
  805. }
  806. /deep/.table-operator .ant-btn{
  807. margin: 0 8px 3px 0;
  808. }
  809. /deep/.table-page-search-wrapper .ant-form-inline .ant-form-item{
  810. margin-bottom: 10px;
  811. }
  812. /deep/.table-page-search-wrapper .table-page-search-submitButtons{
  813. margin-bottom: 10px;
  814. }
  815. /deep/ thead.ant-table-thead>tr{
  816. height: 0 !important;
  817. }
  818. /deep/ .ant-table-thead > tr > th, .ant-table-tbody > tr > td{
  819. padding: 9px 16px
  820. }
  821. /deep/ .ant-table-fixed-left table,.ant-table-fixed-right table{
  822. width: min-content;
  823. }
  824. </style>