123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547 |
- <template>
- <!-- 预装箱单-成衣 列表-->
- <div id="adPaListClothes">
- <!-- 查询 -->
- <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.orderNumber"></a-input>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="8">
- <a-form-item label="款号">
- <a-input placeholder="请输入款号" v-model="queryParam.itemNumber"></a-input>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="8">
- <a-form-item label="品名">
- <a-input placeholder="请输入品名" v-model="queryParam.productName"></a-input>
- </a-form-item>
- </a-col>
- <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="margin:10px 0">
- <div class="table-operator">
- <a-button type="primary" icon="download" @click="handleExportXls('预装箱单-成衣')">导出</a-button>
- <a-upload
- productName="file"
- :showUploadList="false"
- :multiple="false"
- :headers="tokenHeader"
- :action="importExcelUrl"
- @change="handleImportExcel"
- >
- <a-button type="primary" icon="import">导入</a-button>
- </a-upload>
- <a-button type="primary" @click="addAdpacking" icon="plus">新增</a-button>
- </div>
- <!-- table rowKey="id" -->
- <a-table
- bordered
- :columns="adPaListClothesColumns"
- :data-source="adPaListClothesData"
- :loading="loading"
- :pagination="pagination"
- :row-key="record => record.id"
- :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
- @change="handleTableChange"
- :scroll="{ x: 1500 }"
- >
- <!-- 推送状态 -->
- <span slot="pushStatesSlot" slot-scope="text, record">
- <a-tag color="#2db7f5" v-if="record.pushStatus == '0'">未推送</a-tag>
- <a-tag color="#87d068" v-if="record.pushStatus == '1'">推送成功</a-tag>
- <a-tag color="#f50" v-if="record.pushStatus == '2'">推送失败</a-tag>
- </span>
- <!-- 单据状态 -->
- <span slot="statusSlot" 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 href="javascript:void(0);" @click="itemXls('')" style="color:green">导出</a>
- <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>
- <a-popconfirm title="确定提交吗?" ok-text="是" cancel-text="否" @confirm="submit(record)">
- <a href="javascript:void(0);" style="color:green;">提交</a>
- </a-popconfirm>
- </a-menu-item>
- <a-menu-item>
- <a-popconfirm title="确定删除吗?" ok-text="是" cancel-text="否" @confirm="handleDelete(record)">
- <a href="javascript:void(0);" style="color:red;">删除</a>
- </a-popconfirm>
- </a-menu-item>
- </a-menu>
- <!-- 已提交 且 推送成功 -->
- <a-menu slot="overlay" v-if="record.pushStatus == '1' && record.status == '1'">
- <a-menu-item>
- <a @click="details(record)">详情</a>
- </a-menu-item>
- </a-menu>
- <!-- 已提交 且 推送失败 -->
- <a-menu slot="overlay" v-if="record.pushStatus == '2' && record.status == '1'">
- <a-menu-item>
- <a @click="details(record)">详情</a>
- </a-menu-item>
- <a-menu-item>
- <a-popconfirm title="确定重新推送吗?" ok-text="是" cancel-text="否" @confirm="rePush(record)">
- <a href="javascript:void(0);" style="color:green;">重新推送</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>
- <a-popconfirm title="确定取消提交吗?" ok-text="是" cancel-text="否" @confirm="cancelSubmit(record)">
- <a href="javascript:void(0);" style="color:red;">取消提交</a>
- </a-popconfirm>
- </a-menu-item>
- <a-menu-item>
- <a-popconfirm title="确定推送吗?" ok-text="是" cancel-text="否" @confirm="push(record)">
- <a href="javascript:void(0);" style="color:green;">推送</a>
- </a-popconfirm>
- </a-menu-item>
- </a-menu>
- <!-- 未推送 -->
- <a-menu slot="overlay" v-if="record.pushStatus == '0'">
- <a-menu-item>
- <a @click="details(record)">详情</a>
- </a-menu-item>
- <a-menu-item>
- <a-popconfirm title="确定推送吗?" ok-text="是" cancel-text="否" @confirm="push(record)">
- <a href="javascript:void(0);" style="color:green;">推送</a>
- </a-popconfirm>
- </a-menu-item>
- </a-menu>
- </a-dropdown>
- </span>
- </a-table>
- </a-card>
- <!-- 抽屉 -->
- <div>
- <addAdpacking-drawer
- ref="addAdpackingDrawer"
- :fatherList="getadPaListClothes"
- @ok="modalFormOk"
- ></addAdpacking-drawer>
- <editAdpacking-drawer
- ref="editAdpackingDrawer"
- :fatherList="getadPaListClothes"
- @ok="modalFormOk"
- ></editAdpacking-drawer>
- <detailsAdpacking-drawer ref="detailsAdpackingDrawer" @ok="modalFormOk"></detailsAdpacking-drawer>
- </div>
- </div>
- </template>
- <script>
- import { JeecgListMixin } from '@/mixins/JeecgListMixin'
- import JEllipsis from '@/components/jeecg/JEllipsis'
- import moment from 'moment'
- import addAdpackingDrawer from '@views/advance-packingList/addAdpackingDrawer.vue'
- import detailsAdpackingDrawer from '@views/advance-packingList/detailsAdpackingDrawer.vue'
- import editAdpackingDrawer from '@views/advance-packingList/editAdpackingDrawer.vue'
- import { getadPaList } from '@api/document/advance-packingList.js'
- export default {
- productName: 'AdPaListClothes', // 预装线单-成衣
- mixins: [JeecgListMixin],
- components: { JEllipsis, moment, addAdpackingDrawer, detailsAdpackingDrawer, editAdpackingDrawer },
- data() {
- let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} />
- return {
- loading: false, // 表格加载
- id: '',
- // 表头
- adPaListClothesColumns: [
- {
- title: '款号',
- dataIndex: 'itemNumber',
- width: 120,
- fixed: 'left',
- className: 'replacecolor'
- },
- {
- title: '订单号',
- dataIndex: 'orderNumber',
- width: 120,
- fixed: 'left',
- className: 'replacecolor'
- },
- {
- title: '客户(简称)',
- dataIndex: 'customer',
- width: 100,
- fixed: 'left',
- className: 'replacecolor'
- },
- {
- title: '预发货日期',
- dataIndex: 'scheduledShipDate',
- width: 120,
- customRender: text => {
- return moment(text).format('YYYY-MM-DD')
- },
- className: 'replacecolor'
- },
- {
- title: '小po',
- dataIndex: 'smallPo',
- width: 100,
- className: 'replacecolor'
- },
- {
- title: '分销点',
- dataIndex: 'distributionPoint',
- width: 120,
- className: 'replacecolor'
- },
- {
- title: '存货名称',
- dataIndex: 'inventoryName',
- width: 120,
- className: 'replacecolor'
- },
- {
- title: '颜色',
- dataIndex: 'color',
- width: 180,
- className: 'replacecolor'
- },
- {
- title: '采购/委外订单号',
- dataIndex: 'spurOrSubOrder',
- width: 220,
- className: 'replacecolor'
- },
- {
- title: '订单类型',
- dataIndex: 'orderType',
- width: 100,
- className: 'replacecolor'
- },
- {
- title: '工厂单价',
- dataIndex: 'factoryUnitPrice',
- width: 100,
- className: 'replacecolor'
- },
- {
- title: '数量(按合并规则累计)',
- dataIndex: 'totalQuantity',
- width: 200,
- className: 'replacecolor'
- },
- {
- title: '箱数',
- dataIndex: 'boxNumber',
- width: 100,
- className: 'replacecolor'
- },
- {
- title: '总净重',
- dataIndex: 'totalNetWeight',
- width: 100,
- className: 'replacecolor'
- },
- {
- title: '总毛重',
- dataIndex: 'totalGrossWeight',
- width: 100,
- className: 'replacecolor'
- },
- {
- title: '总体积',
- dataIndex: 'totalVolume',
- width: 100,
- className: 'replacecolor'
- },
- {
- title: '总价',
- dataIndex: 'totalPrice',
- width: 100,
- className: 'replacecolor'
- },
- {
- title: '集装箱代号',
- dataIndex: 'containerCode',
- width: 120,
- className: 'replacecolor'
- },
- {
- title: '集装箱号',
- dataIndex: 'containerNumber',
- width: 120,
- className: 'replacecolor'
- },
- {
- title: '预托书号',
- dataIndex: 'depositaryReceiptNo',
- width: 100,
- className: 'replacecolor'
- },
- {
- title: '成衣工厂',
- dataIndex: 'garmentFactory',
- width: 160,
- className: 'replacecolor'
- },
- {
- title: '推送状态',
- dataIndex: 'pushStatus',
- width: 90,
- scopedSlots: { customRender: 'pushStatesSlot' },
- fixed: 'right',
- className: 'replacecolor'
- },
- {
- title: '单据状态',
- dataIndex: 'status',
- width: 90,
- scopedSlots: { customRender: 'statusSlot' },
- fixed: 'right',
- className: 'replacecolor'
- },
- {
- title: '原因',
- dataIndex: 'memo',
- width: 220,
- fixed: 'right',
- customRender: t => ellipsis(t),
- className: 'replacecolor'
- },
- {
- title: '操作',
- dataIndex: 'operation',
- scopedSlots: { customRender: 'operationSlot' },
- width: 160,
- fixed: 'right',
- className: 'replacecolor'
- }
- ],
- adPaListClothesData: [],
- queryParam: {
- // pageNo: '',
- // orderNumber: '',
- // itemNumber: '',
- // productName: '' // 品名
- },
- pagination: {
- // total: '',
- // current: 0,
- // pageSize: 0
- },
- selectedRowKeys: [], // 勾选航
- dateFormat: 'YYYY-MM-DD'
- }
- },
- created() {
- this.getadPaListClothes()
- },
- methods: {
- // 分页查询 预装箱单-成衣
- getadPaListClothes() {
- this.$nextTick(() => {
- getadPaList(this.queryParam).then(res => {
- if (res.success) {
- this.adPaListClothesData = res.result.records
- console.log('预装箱单-成衣', this.adPaListClothesData)
- this.pagination = {
- total: res.result.total,
- current: res.result.current,
- pageSize: res.result.size
- }
- }
- })
- })
- },
- // 编辑
- edit(record) {
- console.log('编辑', record)
- this.$refs.editAdpackingDrawer.visible = true
- // this.$refs.detailsAdpackingDrawer.visible = true
- this.$refs.editAdpackingDrawer.record = record //接口参数
- this.$refs.editAdpackingDrawer.getEditInfo()
- },
- // 详情
- details(record) {
- console.log('点击的record', record)
- this.$refs.detailsAdpackingDrawer.visible = true
- this.$refs.detailsAdpackingDrawer.record = record //接口参数
- this.$refs.detailsAdpackingDrawer.getDetailsById()
- },
- // 新增
- addAdpacking() {
- // console.log('新增预装箱单')
- this.$refs.addAdpackingDrawer.visible = true
- },
- // 列表导出
- handleExportXls(fileName) {
- console.log('需导出的fileName:', fileName)
- const params = this.dyeLossRateData
- console.log('导出参数', params)
- // downFile('/scas/dyeLoss/excel', params).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 + '.xls')
- // } 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 + '.xls')
- // document.body.appendChild(link)
- // link.click()
- // document.body.removeChild(link) // 下载完成移除元素
- // window.URL.revokeObjectURL(url) // 释放掉blob对象
- // }
- // })
- },
- // 删除
- handleDelete(record) {
- console.log('点击删除项id:', record.id)
- this.$nextTick(() => {
- deleteAdPaList({ id: record.id }).then(res => {
- console.log('res:', res)
- this.getadPaListClothes()
- this.$message.success('删除成功')
- })
- })
- },
- searchQuery() {
- this.queryParam.pageNo = ''
- this.getadPaListClothes()
- },
- searchReset() {
- this.queryParam = {}
- this.getadPaListClothes()
- },
- // 操作 单条数据导出
- itemXls() {},
- // 提交
- submit() {},
- // 选中行
- onSelectChange(keys, rows) {
- this.selectedRowKeys = keys
- this.selectedRows = rows
- },
- handleTableChange(pagination, filters, sorter) {
- // console.log('当前页信息>>>>',pagination)
- this.queryParam.pageNo = pagination.current
- this.getadPaListClothes()
- },
- aa() {}
- },
- computed: {
- // 导入
- importExcelUrl() {
- // return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
- },
- // 选中项
- 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
- }
- })
- }
- }
- }
- }
- </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;
- // }
- </style>
|