123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433 |
- <template>
- <!-- 供应商产能报表 -->
- <div id="supplyCapacityTable">
- <!-- 查询区域 -->
- <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.csrccode"></a-input>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="8">
- <a-form-item label="起止月份">
- <a-range-picker
- style="width: 100%"
- v-model="timeRange"
- format="YYYY-MM"
- valueFormat="YYYY-MM"
- :mode="mode2"
- :open="open"
- :placeholder="['开始时间', '结束时间']"
- @panelChange="handlePanelChange2"
- @openChange="onDateChange"
- @change="changeData"
- />
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="8">
- <a-form-item label="订单类型">
- <a-select v-model="queryParam.orderType" placeholder="请选择订单类型" >
- <a-select-option value="">请选择</a-select-option>
- <a-select-option value="采购订单">采购订单</a-select-option>
- <a-select-option value="委外订单">委外订单</a-select-option>
- </a-select>
- <!-- <a-input placeholder="请输入" v-model="queryParam.orderType"></a-input> -->
- </a-form-item>
- </a-col>
- <template v-if="toggleSearchStatus">
- <a-col :md="6" :sm="8">
- <a-form-item label="供应商">
- <a-input placeholder="请输入供应商" v-model="queryParam.venName"></a-input>
- </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="6" :sm="8">
- <a-form-item label="供应商类型">
- <j-search-select-tag
- placeholder="请选择"
- v-model="queryParam.CVenCodeType"
- dict="view_cVenCodeType,cVenCodeType,cVenCodeType">
- </j-search-select-tag>
- <!-- <a-input placeholder="请输入供应商类型" v-model="queryParam.CVenCodeType"></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="部门">
- <j-search-select-tag
- placeholder="请选择"
- v-model="queryParam.CDepCode"
- dict="view_cdepcode,cdepcode,cdepcode">
- </j-search-select-tag>
- <!-- <a-input placeholder="请输入部门" v-model="queryParam.CDepCode"></a-input> -->
- </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="handleExportXls('供应链产能报表')" icon="download">合并导出</a-button>
- <a-button type="primary" @click="monthSupplyExport('月份供应商合计导出')" icon="download"
- >月份供应商合计导出</a-button
- >
- <a-button type="primary" @click="monthDepartExport('月份部门合计导出')" icon="download"
- >月份部门合计导出</a-button
- >
- </div>
- <!-- 合计 table rowKey="id" :scroll="{ x: 1500 }" :pagination="ipagination -->
- <a-table
- bordered
- :row-key="record => record.id"
- :columns="supplyCapacityColumns"
- :data-source="supplyCapacityData"
- :loading="loading"
- :pagination="pagination"
- :scroll="{ x: 1800}"
- @change="handleTableChange"
- >
- </a-table>
- </a-card>
- </div>
- </template>
- <script>
- import { JeecgListMixin } from '@/mixins/JeecgListMixin'
- import JEllipsis from '@/components/jeecg/JEllipsis'
- import moment from 'moment'
- import { supplyCapList } from '@api/reportForms/supply-capacity-table'
- import { downFile } from '@/api/manage'
- export default {
- name: 'SupplyCapacityTable', // 供应商产能报表
- mixins: [JeecgListMixin],
- components: { JEllipsis, moment },
- data() {
- // let ellipsis = (v, l = 20) => <j-ellipsis value={v} length={l} /> // 省略
- return {
- description: '供应商产能报表',
- mode2:['month', 'month'],
- timeRange:[],
- supplyCapacityColumns: [
- {
- title: '账套号',
- width: 60,
- align: 'left',
- dataIndex: 'account',
- ellipsis: true,
- className: 'replacecolor'
- },
- {
- title: '订单号',
- width: 95,
- align: 'left',
- dataIndex: 'csrccode',
- className: 'replacecolor',
- },
- {
- title: '款号',
- width:80,
- dataIndex: 'itemNumber',
- className: 'replacecolor',
- },
- { title: '部门', width: 70, dataIndex: 'cdepCode', className: 'replacecolor',ellipsis: true, },
- { title: '业务员', width: 60, dataIndex: 'cpersonCode', className: 'replacecolor',ellipsis: true, },
- { title: '供应商', width: 80, dataIndex: 'cvenCode', className: 'replacecolor',ellipsis: true,},
- { title: '供应商类型', width: 65, dataIndex: 'cvenCodeType', className: 'replacecolor',ellipsis: true, },
- { title: '订单类型', width: 70, dataIndex: 'iorderType', className: 'replacecolor',ellipsis: true, },
-
- {
- title: '预约发货月份 ',
- width: 75,
- dataIndex: 'darriveDate',
- // customRender: text => {
- // return moment(text).format('YYYY-MM')
- // },
- className: 'replacecolor',
- ellipsis: true,
- },
- // {
- // title: '计划到货日期',
- // width: 120,
- // dataIndex: 'darriveDate',
- // customRender: text => {
- // return moment(text).format('YYYY-MM')
- // },
- // className: 'replacecolor'
- // },
- // className: 'replacecolor'
- // },
- {
- title: '件数',
- width: 50,
- dataIndex: 'total',
- className: 'replacecolor',
- ellipsis: true,
- },
- { title: '工时(分)', width: 55, dataIndex: 'coefficient', className: 'replacecolor',ellipsis: true, },
-
- {
- title: '计划单号',
- width: 80,
- dataIndex: 'cplanLotNumber',
- className: 'replacecolor',
- ellipsis: true,
- },
- {
- title: '数量',
- width: 50,
- dataIndex: 'iquantity',
- className: 'replacecolor',
- ellipsis: true,
- },
- { title: '累计入库数量', width: 85, dataIndex: 'ireceivedQTY', className: 'replacecolor',ellipsis: true, },
- { title: '单位', width: 70, dataIndex: 'unit', className: 'replacecolor',ellipsis: true, },
- ],
- supplyCapacityData: [],
- loading: false, // 表格加载
- // 查询条件
- queryParam: {
- csrccode: '',
- startDate: '',
- endDate: '',
- CVenCodeType:'成衣厂',
- // timeRange = [], 月份范围
- orderType: '',
- venCode: '',
- planLotNumber: '',
- pageNo: '1',
- pageSize: '10'
- },
- open:false,
- // 分页
- pagination: {
- // total: '',
- // current: 0,
- // pageSize: 0
- },
- dateFormat: 'YYYY-MM-DD'
- }
- },
- created() {
- this.getData()
- this.getSupplyCapList() // 渲染 供应链产能报表
- },
- methods: {
- getData(){
- var month = moment(moment(new Date()).format('YYYY-MM'))
- var year =new Date().getFullYear()
- year = moment(year+'-'+'12')
- this.timeRange=[month,year]
- this.queryParam.startDate = this.timeRange[0].format('YYYY-MM')
- this.queryParam.endDate = this.timeRange[1].format('YYYY-MM')
- },
- // 供应商产能数据
- getSupplyCapList() {
- this.$nextTick(() => {
- this.loading = true
- supplyCapList(this.queryParam).then(res => {
- this.loading = false
- if (res.success) {
- // res.result.records.map(item=>{
- // item.
- // })
- this.supplyCapacityData = res.result.records
- console.log('【供应商产能报表数据】:', this.supplyCapacityData)
- this.pagination = {
- total: res.result.total,
- current: res.result.current,
- pageSize: res.result.size
- }
- }
- })
- })
- },
- //合并导出
- handleExportXls(fileName) {
- console.log('需导出的fileName:', fileName)
- const params = this.supplyCapacityData
- console.log('导出参数', params)
- downFile('/scas/supplierCapacity/excel1', this.queryParam).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对象
- }
- })
- },
- // 月份供应链合计导出
- monthSupplyExport(fileName) {
- console.log('需导出的fileName:', fileName)
- const params = this.supplyCapacityData
- console.log('导出参数', this.queryParam)
- downFile('/scas/supplierCapacity/excel3', this.queryParam).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对象
- }
- })
- },
- // 月份部门合计导出
- monthDepartExport(fileName) {
- console.log('需导出的fileName:', fileName)
- const params = this.supplyCapacityData
- console.log('导出参数', params)
- downFile('/scas/supplierCapacity/excel2', this.queryParam).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对象
- }
- })
- },
- // 查询按钮
- searchQuery() {
- this.queryParam.pageNo = ''
- this.getSupplyCapList()
- },
- searchReset() {
- this.queryParam = {
- CVenCodeType:'成衣厂'
- }
- this.getData()
- this.getSupplyCapList()
- },
- // 查询条件 月范围份转换成字符串并赋值
- onDateChange(status) {
- if(status){
- this.open = true;
- }else{
- this.open = false
- }
- },
- handlePanelChange2(value,mode){
- if (this.timeRange[1] && this.timeRange[1]._d != value[1]._d) {
- this.open = false;
- }
- this.timeRange = value
- this.mode2 = [mode[0] === 'date' ? 'month' : mode[0], mode[1] === 'date' ? 'month' : mode[1]];
- this.queryParam.startDate = value[0].format('YYYY-MM')
- this.queryParam.endDate = value[1].format('YYYY-MM')
- },
- onDateOk(value) {
- console.log('value', value)
- },
- changeData(value){
- this.timeRange = value
- this.queryParam.startDate = this.timeRange[0]
- this.queryParam.endDate = this.timeRange[1]
- },
- // 分页变化时触发
- handleTableChange(pagination, filters, sorter) {
- console.log('分页器信息', pagination)
- if (Object.keys(sorter).length > 0) {
- this.isorter.column = sorter.field
- this.isorter.order = sorter.order == 'ascend' ? 'asc' : 'desc'
- }
- this.queryParam.pageNo = pagination.current
- this.getSupplyCapList()
- }
- }
- }
- </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-footer .ant-table.body {
- // overflow: hidden !important;
- }
- /deep/ .ant-table.ant-table-bordered .ant-table-footer {
- border: none;
- padding: 0;
- }
- </style>
|