fabric-list.vue 30 KB

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