123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866 |
- <template>
- <!-- 装箱单-面料列表 -->
- <div id="fabricList">
- <!-- 查询 -->
- <a-card :bordered="false">
- <div class="table-page-search-wrapper">
- <a-form layout="inline" @keyup.enter.native="searchQuery">
- <a-row :gutter="24">
- <a-col :md="6" :sm="8">
- <a-form-item label="单据号">
- <a-input placeholder="请输入单据号" v-model="queryParam.documentNo"></a-input>
- </a-form-item>
- </a-col>
- <!-- <a-col :md="6" :sm="8">
- <a-form-item label="订单号">
- <a-input placeholder="请输入订单号" v-model="queryParam.orderNumber"></a-input>
- </a-form-item>
- </a-col> -->
- <a-col :md="6" :sm="8">
- <a-form-item label="集装箱号">
- <a-input placeholder="请输入集装箱号" v-model="queryParam.containerNumber"></a-input>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="8">
- <a-form-item label="外销发票号">
- <a-input placeholder="请输入外销发票号" v-model="queryParam.exportInvoiceNo"></a-input>
- </a-form-item>
- </a-col>
- <template v-if="toggleSearchStatus">
- <a-col :md="6" :sm="8">
- <a-form-item label="是否提交">
- <a-select v-model="queryParam.status">
- <a-select-option value="">请选择</a-select-option>
- <a-select-option value="0">否</a-select-option>
- <a-select-option value="1">是</a-select-option>
- </a-select>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="8">
- <a-form-item label="计划单号">
- <a-input placeholder="请输入" v-model="queryParam.planLotNumber"></a-input>
- </a-form-item>
- </a-col>
- <a-col :md="5" :sm="8">
- <a-form-item label="业务员">
- <!-- <a-input placeholder="请输入业务员" v-model="queryParam.salesman"></a-input> -->
- <j-search-select-tag
- placeholder="请选择业务员"
- v-model="queryParam.salesman"
- dict="view_salesman,salesman,salesman">
- </j-search-select-tag>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="8">
- <a-form-item label="制单人">
- <a-input placeholder="请输入制单人" v-model="queryParam.createBy"></a-input>
- </a-form-item>
- </a-col>
- <a-col :md="5" :sm="8">
- <a-form-model-item label="是否被参照">
- <a-select v-model="queryParam.isReference">
- <a-select-option value="">请选择</a-select-option>
- <a-select-option value="1">是</a-select-option>
- <a-select-option value="0">否</a-select-option>
- </a-select>
- </a-form-model-item>
- </a-col>
- <a-col :md="6" :sm="8">
- <a-form-item label="账套号">
- <j-search-select-tag
- placeholder="请选择账套号"
- v-model="queryParam.account"
- dict="view_account,account,account">
- </j-search-select-tag>
- </a-form-item>
- </a-col>
- </template>
- <a-col :md="6" :sm="8">
- <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
- <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
- <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
- <a @click="handleToggleSearch" style="margin-left: 8px">
- {{ toggleSearchStatus ? '收起' : '展开' }}
- <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
- </a>
- </span>
- </a-col>
- </a-row>
- </a-form>
- </div>
- </a-card>
- <!-- 操作按钮区域 推送 新增-->
- <a-card :bordered="false" style="marginTop:10px;">
- <div class="table-operator">
- <a-button type="primary" @click="addFabric" icon="plus">新增</a-button>
- <a-button type="primary" @click="bitchSubmitList" icon="check">批量提交</a-button>
- <a-button type="primary" @click="bitchCancelSubmitList" icon="close">批量取消提交</a-button>
- <!-- <a-button type="primary" @click="push" icon="export">推送</a-button> -->
- <a-button type="primary" icon="download" @click="handleExportXls('装箱单-面辅料')">装箱单面辅料导出</a-button>
- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" @change="handleImportExcel" :customRequest="uploadFlie" >
- <a-button type="primary" icon="import">导入-来源出运明细</a-button>
- </a-upload>
- <a-button type="primary" @click="synchronization" icon="reload">同步</a-button>
- <a-button type="primary" icon="download" @click="majorityDelet">批量删除</a-button>
- <a-button type="primary" icon="download" @click="majorityPush">批量推送</a-button>
- </div>
- <!-- 子表 :scroll="{ x: 1500 }" 内容少 无需滚动-->
- <a-table
- bordered
- :columns="fabricListColumns"
- :data-source="fabricListData"
- :loading="loading"
- :scroll="{ x: 1500 , y: 600 }"
- :pagination="pagination"
- :row-key="record => record.id"
- :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
- @change="handleTableChange"
- >
- <!-- 集装箱号 输入框
- <a-form-model
- slot="containerNo"
- slot-scope="text, record"
- :ref="record.index"
- :model="record"
- style="width:100%;height:40px"
- >
- <a-form-model-item prop="containerNo">
- <a-input style="width:100%" v-model="record.containerNumber" />
- </a-form-model-item>
- </a-form-model> -->
- <!-- 单据状态 -->
- <span slot="pushState" slot-scope="text, record">
- <a-tag color="orange" v-if="record.pushState == '0'">未推送</a-tag>
- <a-tag color="red" v-if="record.pushState == '2'">推送失败</a-tag>
- <a-tag color="green" v-if="record.pushState == '1'">推送成功</a-tag>
- <a-tag color="blue" v-if="record.pushState == '3'">推送中</a-tag>
- <a-tag color="#B7B7B7" v-if="record.pushState == '4'">不再推送</a-tag>
- </span>
- <span slot="whetherCloudFactoryPush" slot-scope="text, record" :title ="record.cause">
- <span v-if="record.whetherCloudFactoryPush == '0'">否</span>
- <span v-if="record.whetherCloudFactoryPush == '1'">是</span>
- </span>
- <!-- 单据状态 -->
- <span slot="state" slot-scope="text, record">
- <a-tag color="orange" v-if="record.status == '0'">已保存</a-tag>
- <a-tag color="green" v-if="record.status == '1'">已提交</a-tag>
- </span>
- <!-- 操作 -->
- <span slot="operationSlot" slot-scope="text, record">
- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="enclosureUrl" @change="handleImportExcel" :data="{id:record.id}" >
- <a style="color:green;">附件上传</a>
- </a-upload>
- <a-divider type="vertical" />
- <a-dropdown>
- <a class="ant-dropdown-link">更多<a-icon type="down"/></a>
- <a-menu slot="overlay" v-if="record.status=='0'">
- <a-menu-item><a @click="details(record)">详情</a></a-menu-item>
- <a-menu-item><a @click="edit(record)">编辑</a></a-menu-item>
- <a-menu-item v-if="record.pushState!=='4'"><a @click="pushU8(record)">推送U8</a></a-menu-item>
- <a-menu-item v-if="record.pushState!=='4'"><a @click="stopPush(record)">关闭推送</a></a-menu-item>
- <!-- <a-menu-item><a @click="itemXls(record)">导出</a></a-menu-item> -->
- <!-- <a-menu-item><a @click="submit(record)">提交</a></a-menu-item> -->
- <a-menu-item>
- <a-popconfirm title="确定删除吗?" ok-text="是" cancel-text="否" @confirm="handleDelete(record.id)">
- <a href="javascript:void(0);" style="color:red;">删除</a>
- </a-popconfirm>
- </a-menu-item>
- </a-menu>
- <!-- 已提交 -->
- <a-menu slot="overlay" v-if="record.status=='1'">
- <a-menu-item><a @click="details(record)">详情</a></a-menu-item>
- <a-menu-item v-if="record.pushState!=='4'"><a @click="pushU8(record)">推送U8</a></a-menu-item>
- <a-menu-item v-if="record.pushState!=='4'"><a @click="stopPush(record)">关闭推送</a></a-menu-item>
- <!-- <a-menu-item><a @click="itemXls(record)">导出</a></a-menu-item> -->
- <!-- <a-menu-item><a @click="cancel(record)">取消提交</a></a-menu-item> -->
- </a-menu>
-
- </a-dropdown>
- </span>
- </a-table>
- <span style="position: absolute;bottom: 4%;">共勾选{{selectedNumber}}条数</span>
- </a-card>
- <!-- 抽屉 -->
- <div>
- <addFabric-drawer ref="addFabricDrawer" :father="aa" @ok="modalFormOk" :fatherList="getFabricList"></addFabric-drawer>
- <detailsFabric-drawer ref="detailsFabricDrawer" :father="bb" @ok="modalFormOk"></detailsFabric-drawer>
- <editFabric-drawer ref="editFabricDrawer" :father="cc" @ok="modalFormOk"></editFabric-drawer>
- </div>
- <!-- 导入确认框 -->
- <div>
- <a-modal :visible="visible" title="是否继续导入" @ok="handleOk" @cancel="handleCancel" >
- <template #footer>
- <a-button @click="handleCancel" style="margin-left: 8px;">取消</a-button>
- <a-button type="primary" @click="handleOk" :disabled="handleOkButton">确定</a-button>
- </template>
- <ul>
- <li v-for="(item,index) in message" :key="index">{{item}}</li>
- </ul>
- </a-modal>
- </div>
- </div>
- </template>
- <script>
- import { JeecgListMixin } from '@/mixins/JeecgListMixin'
- import { downFile } from '@/api/manage'
- import JEllipsis from '@/components/jeecg/JEllipsis'
- import moment from 'moment'
- import addFabricDrawer from '@views/packing-list/packinglist-fabrics/addFabricDrawer.vue'
- import detailsFabricDrawer from '@views/packing-list/packinglist-fabrics/detailsFabricDrawer.vue'
- import editFabricDrawer from '@views/packing-list/packinglist-fabrics/editFabricDrawer.vue'
- import {bitchPush,cancelPush,fabricList,fabricListId,deleteFabricList,submitList,batchDelete,cancelSubmit,bitchSubmit,bitchCancelSubmit,synchronizationData,upload,fileDetail,pushOrderData} from '@api/document/packing-list/packinglist-fabrics'
- export default {
- name: 'FabricList', // 装箱单-面料
- mixins: [JeecgListMixin],
- components: { JEllipsis, moment, addFabricDrawer, detailsFabricDrawer, editFabricDrawer },
- data() {
- // let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
- return {
- // 表头
- fabricListColumns: [
-
- // {
- // title: '订单号',
- // dataIndex: 'orderNumber',
- // width: 160,
- // className: 'replacecolor'
- // },
- {
- title: '外销发票号',
- dataIndex: 'exportInvoiceNo',
- width: 150,
- ellipsis: true,
- fixed:'left',
- className: 'replacecolor'
- },
- {
- title: '集装箱号',
- dataIndex: 'containerNumber',
- width: 125,
- ellipsis: true,
- // scopedSlots: { customRender: 'containerNo' },
- className: 'replacecolor'
- },
- // {
- // title: '发票号',
- // dataIndex: 'invoiceNo',
- // width: 160,
- // ellipsis: true,
- // className: 'replacecolor'
- // },
-
-
- {
- title: '装柜日期',
- dataIndex: 'latestDateOfShipment',
- width: 110,
- ellipsis: true,
- className: 'replacecolor'
- },
- {
- title: '成衣工厂',
- dataIndex: 'garmentFactory',
- width: 120,
- ellipsis: true,
- className: 'replacecolor'
- },
-
- {
- title: '制单人',
- dataIndex: 'createBy',
- width: 120,
- ellipsis: true,
- className: 'replacecolor'
- },
- {
- title: '制单日期',
- dataIndex: 'preparedDate',
- width: 120,
- ellipsis: true,
- // 有问题,自动显示当日日期
- // customRender: text => {
- // return moment(text).format('YYYY-MM-DD')
- // },
- className: 'replacecolor'
- },
- {
- title: '托书号',
- dataIndex: 'shippingOrderNumber',
- width: 160,
- ellipsis: true,
- className: 'replacecolor'
- },
- {
- title: '单据号',
- dataIndex: 'documentNo',
- width: 160,
- ellipsis: true,
- className: 'replacecolor'
- },
- {
- title: '推送状态',
- dataIndex: 'pushState',
- scopedSlots: { customRender: 'pushState' },
- width: 140,
- fixed: 'right',
- className: 'replacecolor'
- },
- {
- title: '云工厂',
- dataIndex: 'whetherCloudFactoryPush ',
- width: 80,
- fixed: 'right',
- scopedSlots: { customRender: 'whetherCloudFactoryPush' },
- className: 'replacecolor'
- },
- {
- title: '状态',
- dataIndex: 'status',
- scopedSlots: { customRender: 'state' },
- width: 140,
- fixed: 'right',
- className: 'replacecolor'
- },
- {
- title: '操作',
- dataIndex: 'operation',
- scopedSlots: { customRender: 'operationSlot' },
- width: 150,
- fixed: 'right',
- className: 'replacecolor'
- }
- ],
- fabricListData: [],
- visible:false,
- file:{},
- message:[],//导入文件信息
- selectedRowKeys: [], // 勾选航
- loading: false, // 表格加载
- handleOkButton:false,//导入按钮状态
- // 查询条件
- queryParam: {
- pageNo: '', // 初始页
- isReference:'0',
- pageSize:'50'
- },
- pagination:{
- pageSizeOptions: ["50", "100", "150"],
- showSizeChanger: true,
- },
- selectedNumber:0,//已选择条数
- url: {
- // syncUser: '/act/process/extActProcess/doSyncUser',
- list: '/sys/user/list',
- // delete: '/sys/user/delete',
- // deleteBatch: '/sys/user/deleteBatch',
- exportXlsUrl: '/sys/user/exportXls', // 导出
- importExcelUrl: 'splfi/syPackingListFabric/importExcel', // 导入
- enclosureUrl:'splfi/syPackingListFabric/upload'//附件导入
- }
- }
- },
- created() {
- this.getFabricList()
- },
- watch:{
- selectedRowKeys(newVal){
- this.selectedNumber =newVal.length
- }
- },
- methods: {
- // 导入
- uploadFlie(file) {
- const formData = new FormData()
- formData.append('file', file.file)
- fileDetail(formData).then(res => {
- this.loading = false
- if (res.success) {
- this.visible = true
- this.message = res.message.split(';').filter((element) => {
- return element !== "";
- });
- this.file = file
- }else{
- this.$message.error(res.message);
- }
- })},
- //继续导入
- handleOk(){
- this.handleOkButton = true
- const formData = new FormData()
- formData.append('file', this.file.file)
- upload(formData).then(res => {
- this.visible = false
- if (res.success) {
- this.$message.success('导入成功')
- this.handleOkButton = false
- this.getFabricList()
- }else{
- this.$message.error(res.message);
- this.handleOkButton = false
- }
- })
- },
- //取消导入
- handleCancel(){
- this.visible = false
- this.loading = false
- },
- //分页查询
- getFabricList(){
- this.$nextTick(() => {
- // this.queryParam.pageSize = 50
- this.loading = true
- fabricList(this.queryParam).then(res => {
- this.loading = false
- if (res.success) {
- this.fabricListData = res.result.records;
- this.loading = false
- this.selectedRowKeys = []
- this.pagination = {
- total: res.result.total,
- current: res.result.current,
- pageSize: res.result.size
- }
- this.$forceUpdate()
- }else{
- this.$message.error(res.message);
- }
- })
- })
- },
- // 查询按钮
- searchQuery() {
- this.toggleSearchStatus = false
- this.queryParam.pageNo = ''
- this.getFabricList()
- },
- //重置查询
- searchReset() {
- this.queryParam = {
- isReference:'0',
- pageSize:this.pagination.pageSize
- }
- this.getFabricList()
- },
- // ------------------------------------
- // 推送
- push() {},
- // 新增
- addFabric() {
- console.log('新增-装箱单面料')
- this.$refs.addFabricDrawer.visible = true
- },
- // --------------------------------------
- // 操作 附件上传
- accessoryUpload() {},
- // 列表导出
- handleExportXls(fileName) {
- var obj ={}
- if(this.selectedRowKeys.length == this.pagination.pageSize || this.selectedRowKeys.length==this.fabricListData.length){
- obj=this.queryParam
- obj.selectAll = '1'
- }else{
- var arr =[]
- this.fabricListData.map(item=>{
- this.selectedRowKeys.map(e=>{
- if(item.id == e){
- arr.push(item.id)
- }
- })
- })
- obj.ids = arr.toString()
- obj.selectAll = '2'
- }
- downFile('/splfi/syPackingListFabric/exportXls',obj).then(data => {
- if (!data) {
- this.$message.warning('文件下载失败')
- return
- }
- if (typeof window.navigator.msSaveBlob !== 'undefined') {
- window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xlsx')
- } else {
- let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
- let link = document.createElement('a')
- link.style.display = 'none'
- link.href = url
- link.setAttribute('download', fileName + '.xlsx')
- document.body.appendChild(link)
- link.click()
- document.body.removeChild(link) // 下载完成移除元素
- window.URL.revokeObjectURL(url) // 释放掉blob对象
- }
- })
- },
- // 操作 单条数据导出
- itemXls(record) {
- downFile('/splfi/syPackingListFabric/exportXls',{id:record.id}).then(data => {
- if (!data) {
- this.$message.warning('文件下载失败')
- return
- }
- if (typeof window.navigator.msSaveBlob !== 'undefined') {
- window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), item + '.xlsx')
- }else {
- let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' }))
- let link = document.createElement('a')
- link.style.display = 'none'
- link.href = url
- link.setAttribute('download', '装箱单' + '.xlsx')
- document.body.appendChild(link)
- link.click()
- document.body.removeChild(link) // 下载完成移除元素
- window.URL.revokeObjectURL(url) // 释放掉blob对象
- }
- })
- },
- // 同步
- synchronization(){
- this.$nextTick(() => {
- synchronizationData().then(res => {
- if (res.success) {
- this.$message.success('同步成功')
- this.getFabricList();
- }else{
- this.$message.error(res.message);
- }
- })
- })
- },
- // 操作 详情
- details(record) {
- console.log('详情', record.id)
- // console.log('编辑')
- this.$nextTick(() => {
- fabricListId({id:record.id}).then(res => {
- if (res.success) {
- var data = res.result
- this.$refs.detailsFabricDrawer.visible = true
- this.$refs.detailsFabricDrawer.addFabric =data
- if(record.documentNo.substr(0, 2) == "FL"){
- this.$refs.detailsFabricDrawer.judageCloumn()
- }
- data.syPackingListFabricItem.map(item =>{
- item.totalPrice = Number(item.totalPrice).toFixed(2)
- if(item.manualYarnFlag == 0){
- item.manualYarnFlag = '否'
- }else {
- item.manualYarnFlag = '是'
- }
- })
- this.$refs.detailsFabricDrawer.accessory =(data.accessory!==''&&data.accessory) ?data.accessory.split(","):[]
- this.$refs.detailsFabricDrawer.recordingCode = (data.recordingCode!=='' && data.recordingCode) ? (data.recordingCode.split(";")) :[]
- this.$refs.detailsFabricDrawer.addFabricData = data.syPackingListFabricItem
- }else{
- this.$message.error(res.message);
- }
- })
- })
- },
- // 操作 编辑
- edit(record) {
- // console.log('编辑')
- this.$nextTick(() => {
- fabricListId({id:record.id}).then(res => {
- if (res.success) {
- var data = res.result
- this.$refs.addFabricDrawer.visible = true
- this.$refs.addFabricDrawer.defaultMethod = 'edit'
- this.$refs.addFabricDrawer.addFabric ={
- id:data.id,
- // orderNumber:data.orderNumber,
- documentNo:data.documentNo,
- containerNumber:data.containerNumber,
- latestDateOfShipment:data.latestDateOfShipment,
- garmentFactory:data.garmentFactory,
- invoiceNo:data.invoiceNo,
- preparedBy:data.preparedBy,
- preparedDate:data.preparedDate,
- exportInvoiceNo:data.exportInvoiceNo,
- shippingOrderNumber:data.shippingOrderNumber,
- remarks:data.remarks,
- plumbumNo:data.plumbumNo,
- }
- if(record.documentNo.substr(0, 2) == "FL"){
- this.$refs.addFabricDrawer.judageCloumn()
- }
- data.syPackingListFabricItem.map(item =>{
- item.totalPrice = Number(item.totalPrice).toFixed(2)
- if(item.manualYarnFlag == 0){
- this.$refs.addFabricDrawer.manualYarnDisabled = true
- this.$forceUpdate()
- }else {
- this.$refs.addFabricDrawer.manualYarnDisabled = false
- }
- })
- this.$refs.addFabricDrawer.addFabricData = data.syPackingListFabricItem
-
-
- }else{
- this.$message.error(res.message);
- }
- })
- })
-
- },
-
- //提交
- submit(record){
- console.log(record.id)
- submitList({id:record.id}).then(res =>{
- if (res.success) {
- record.status = 1
- this.getFabricList()
- this.$message.success('提交成功')
- }else{
- this.$message.error(res.message);
- }
- })
- },
- pushU8(record){
- pushOrderData({ids : record.id}).then(res =>{
- if (res.success) {
- this.getFabricList()
- this.$message.success('推送U8成功');
- }else{
- this.$message.error(res.message);
- }
- })
- },
- stopPush(record){
- cancelPush({id : record.id}).then(res =>{
- if (res.success) {
- this.getFabricList()
- this.$message.success('关闭推送成功');
- }else{
- this.$message.error(res.message);
- }
- })
- },
- cancel(record){
- console.log(record.id)
- cancelSubmit({id:record.id}).then(res =>{
- if (res.success) {
- record.status = 0
- this.getFabricList()
- this.$message.success('取消提交成功')
- }else{
- this.$message.error(res.message);
- }
- })
- },
- //批量提交
- bitchSubmitList(){
- // for(var i =0;i<this.selectedRows.length;i++){
- // var tickRow = this.selectedRows[i]
- // if(tickRow.status === '1'){
- // this.$message.error("部分数据是已提交,请勿重复提交!");
- // return
- // }
- // }
- var ids = this.selectedRowKeys.toString()
- bitchSubmit({ids : ids}).then(res =>{
- if (res.success) {
- this.getFabricList()
- this.selectedRowKeys = []
- this.$message.success('提交成功');
- }else{
- this.$message.error(res.message);
- }
- })
- },
- //批量推送
- majorityPush(){
- if(this.selectedRowKeys.length==0){
- this.$message.error('请勾选数据');
- }else{
- var ids = this.selectedRowKeys.toString()
- bitchPush({ids : ids}).then(res =>{
- this.fabricListData.map(item=>{
- this.selectedRowKeys.map(event=>{
- if(item.pushState!=='4'&&item.id==event){
- item.pushState = '3'
- this.$forceUpdate()
- }
- })
- })
- if (res.success) {
- this.getFabricList()
- this.selectedRowKeys = []
- this.$message.success('推送成功');
- }else{
- this.getFabricList()
- this.$message.error(res.message);
- }
- })
- }
- },
- //批量取消推送
- bitchCancelSubmitList(){
- // for(var i =0;i<this.selectedRows.length;i++){
- // var tickRow = this.selectedRows[i]
- // if(tickRow.status === '0'){
- // this.$message.error("含未提交数据,请重新选择!");
- // return
- // }
- // }
- var ids = this.selectedRowKeys.toString()
- bitchCancelSubmit({ids : ids}).then(res =>{
- if (res.success) {
- this.getFabricList()
- this.selectedRowKeys = []
- this.$message.success('取消提交成功');
- }else{
- this.$message.error(res.message);
- }
- })
- },
- // 操作 删除
- handleDelete(id) {
- this.$nextTick(() => {
- if(this.queryParam.pageNo > 1 && this.fabricListData.length === 1){
- this.queryParam.pageNo = this.queryParam.pageNo -1
- }
- deleteFabricList({ id: id }).then(res => {
- if (res.success) {
- this.getFabricList()
- this.$message.success('删除成功')
- } else {
- this.$message.error('删除成功')
- }
-
- })
- })
- },
- majorityDelet(){
- var ids = this.selectedRowKeys.toString()
- batchDelete({ ids: ids }).then(res => {
- if (res.success) {
- this.$message.success('批量删除成功');
- this.getFabricList()
- }else {
- this.$message.error(res.message);
- }
- })
- this.selectedRowKeys = []
- },
- // --------------------------------------
- // ??
- modalFormOk() {},
- // 选中行
- onSelectChange(keys, rows) {
- this.selectedRowKeys = keys
- this.selectedRows = rows
- },
- // --------------------------------------
- aa() {},
- bb() {},
- cc() {},
- // 分页、排序、筛选变化时触发
- handleTableChange(pagination, filters, sorter) {
- // console.log('当前页信息>>>>',pagination)
- this.queryParam.pageNo = pagination.current
- this.queryParam.pageSize = pagination.pageSize
- this.getFabricList()
- }
- },
- computed: {
- // 导入
- importExcelUrl: function() {
- return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
- },
- // 附件上传
- enclosureUrl: function() {
- return `${window._CONFIG['domianURL']}/${this.url.enclosureUrl}`
- },
- // 选中项
- rowSelection() {
- return {
- onChange: (selectedRowKeys, selectedRows) => {
- console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows)
- },
- getCheckboxProps: record => ({
- props: {
- disabled: record.title === 'Disabled User',
- // Column configuration not to be checked
- title: record.title
- }
- })
- }
- }
- },
- mounted() {}
- }
- </script>
- <style lang="less" scoped>
- @import '~@assets/less/common.less';
- @import '~@assets/less/overwriter.less';
- /deep/ .ant-table-thead > tr > th {
- text-align: center;
- // font-weight: 700;
- }
- /deep/ .ant-table-tbody {
- text-align: center;
- }
- // /deep/ th.replacecolor {
- // background-color: #ccc;
- // }
- /deep/ .ant-table-tbody .ant-table-row td{
- padding-top: 8px;
- padding-bottom: 8px;
- }
- /deep/.ant-card-body{
- padding-top: 10px !important;
- padding-bottom: 0px !important;
- }
- /deep/.table-operator .ant-btn{
- margin: 0 8px 3px 0;
- }
- /deep/.table-page-search-wrapper .ant-form-inline .ant-form-item{
- margin-bottom: 10px;
- }
- /deep/.table-page-search-wrapper .table-page-search-submitButtons{
- margin-bottom: 10px;
- }
- /deep/ thead.ant-table-thead>tr{
- height: 0 !important;
- }
- /deep/ .ant-table-thead > tr > th, .ant-table-tbody > tr > td{
- padding: 9px 16px
- }
- /deep/ .ant-table-fixed-left table,.ant-table-fixed-right table{
- width: min-content;
- }
- </style>
|