fabric-list.vue 25 KB

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