fabric-list.vue 28 KB

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