Commit 36e05896 authored by 沈翠玲's avatar 沈翠玲

9.16修改

parent e42fdcd9
...@@ -17,7 +17,7 @@ import store from './store' ...@@ -17,7 +17,7 @@ import store from './store'
import router from './router' import router from './router'
import directive from './directive' // directive import directive from './directive' // directive
import plugins from './plugins' // plugins import plugins from './plugins' // plugins
import { download } from '@/utils/request' import { download, download1, download2 } from '@/utils/request'
import './assets/icons' // icon import './assets/icons' // icon
import './permission' // permission control import './permission' // permission control
...@@ -67,6 +67,8 @@ Vue.prototype.addDateRange = addDateRange ...@@ -67,6 +67,8 @@ Vue.prototype.addDateRange = addDateRange
Vue.prototype.selectDictLabel = selectDictLabel Vue.prototype.selectDictLabel = selectDictLabel
Vue.prototype.selectDictLabels = selectDictLabels Vue.prototype.selectDictLabels = selectDictLabels
Vue.prototype.download = download Vue.prototype.download = download
Vue.prototype.download1 = download1
Vue.prototype.download2 = download2
Vue.prototype.handleTree = handleTree Vue.prototype.handleTree = handleTree
Vue.prototype.formatMoney = formatMoney Vue.prototype.formatMoney = formatMoney
......
...@@ -156,5 +156,54 @@ export function download(url, params, filename) { ...@@ -156,5 +156,54 @@ export function download(url, params, filename) {
downloadLoadingInstance.close(); downloadLoadingInstance.close();
}) })
} }
export function download1(url, params, filename) {
downloadLoadingInstance = Loading.service({ text: "正在下载数据,请稍候", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", })
return service.post(url, params, {
// transformRequest: [(params) => { return tansParams(params) }],
headers: { 'Content-Type': 'application/json;charset=utf-8' },
responseType: 'blob'
}).then(async (data) => {
const isLogin = await blobValidate(data);
if (isLogin) {
const blob = new Blob([data])
saveAs(blob, filename)
} else {
const resText = await data.text();
const rspObj = JSON.parse(resText);
const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default']
Message.error(errMsg);
}
downloadLoadingInstance.close();
}).catch((r) => {
console.error(r)
Message.error('下载文件出现错误,请联系管理员!')
downloadLoadingInstance.close();
})
}
export function download2(url, params, filename) {
downloadLoadingInstance = Loading.service({ text: "正在下载数据,请稍候", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", })
console.log('paramsparams', params)
return service.get(url, params, {
// transformRequest: [(params) => { return tansParams(params) }],
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
responseType: 'blob'
}).then(async (data) => {
const isLogin = await blobValidate(data);
if (isLogin) {
const blob = new Blob([data])
saveAs(blob, filename)
} else {
const resText = await data.text();
const rspObj = JSON.parse(resText);
const errMsg = errorCode[rspObj.code] || rspObj.msg || errorCode['default']
Message.error(errMsg);
}
downloadLoadingInstance.close();
}).catch((r) => {
console.error(r)
Message.error('下载文件出现错误,请联系管理员!')
downloadLoadingInstance.close();
})
}
export default service export default service
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
<el-table-column :label="$t('更新时间')" align="center" prop="updateTime" /> <el-table-column :label="$t('更新时间')" align="center" prop="updateTime" />
</el-table> </el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" :pageSizes="[30, 50, 100]"
@pagination="getList" /> @pagination="getList" />
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="confirmSelect">{{ $t('common.confirm') }}</el-button> <el-button type="primary" @click="confirmSelect">{{ $t('common.confirm') }}</el-button>
...@@ -108,7 +108,7 @@ export default { ...@@ -108,7 +108,7 @@ export default {
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 30,
workunitCode: null, workunitCode: null,
workunitName: null, workunitName: null,
workshopName: null, workshopName: null,
......
...@@ -62,6 +62,7 @@ ...@@ -62,6 +62,7 @@
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-printer" size="mini" :disabled="single" @click="handleQrcode" <el-button type="warning" plain icon="el-icon-printer" size="mini" :disabled="single" @click="handleQrcode"
v-hasPermi="['mes:pro:feedback:edit']">{{$t('打印二维码')}}</el-button> v-hasPermi="['mes:pro:feedback:edit']">{{$t('打印二维码')}}</el-button>
<el-button type="primary" size="mini" @click="handleExport">{{$t('导出')}}</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
...@@ -541,6 +542,15 @@ export default { ...@@ -541,6 +542,15 @@ export default {
}); });
} }
}, },
handleExport(){
this.download1(
'mes/pro/feedback/list/export',
{
...this.queryParams,
},
`feedback_${new Date().getTime()}.xlsx`
);
},
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const recordIds = row.recordId || this.ids; const recordIds = row.recordId || this.ids;
...@@ -590,7 +600,7 @@ export default { ...@@ -590,7 +600,7 @@ export default {
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download('pro/feedback/export', { this.download1('mes/pro/feedback/list/export', {
...this.queryParams ...this.queryParams
}, `feedback_${new Date().getTime()}.xlsx`) }, `feedback_${new Date().getTime()}.xlsx`)
}, },
......
...@@ -55,6 +55,8 @@ ...@@ -55,6 +55,8 @@
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('common.search') }}</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('common.search') }}</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('common.reset') }}</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('common.reset') }}</el-button>
<el-button size="mini" @click="handleExport">{{ $t('导出') }}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table
...@@ -65,14 +67,11 @@ ...@@ -65,14 +67,11 @@
> >
<el-table-column type="selection" width="55" align="center"/> <el-table-column type="selection" width="55" align="center"/>
<el-table-column :label="$t('生产工单')" align="center" prop="workorderCode"> <el-table-column :label="$t('生产工单')" align="center" prop="workorderCode">
<!-- <template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-tooltip :content="scope.row.productName" placement="right">
size="mini" <span>{{scope.row.workorderCode}}</span>
type="text" </el-tooltip>
@click="$emit('clickTask', scope.row.workorderCode)" </template>
>{{ scope.row.workorderCode }}</el-button
>
</template> -->
</el-table-column> </el-table-column>
<el-table-column :label="$t('产品编码')" align="center" prop="productCode"/> <el-table-column :label="$t('产品编码')" align="center" prop="productCode"/>
<el-table-column :label="$t('产品名称')" align="center" prop="productName"/> <el-table-column :label="$t('产品名称')" align="center" prop="productName"/>
...@@ -170,6 +169,15 @@ export default { ...@@ -170,6 +169,15 @@ export default {
this.getList(); this.getList();
}, },
methods: { methods: {
handleExport(){
this.download1(
'mes/pro/taskWorkunit/list/export',
{
...this.queryParams,
},
`taskWorkunit_${new Date().getTime()}.xlsx`
);
},
/** 查询物料编码列表 */ /** 查询物料编码列表 */
getList() { getList() {
this.loading = true; this.loading = true;
......
...@@ -16,6 +16,12 @@ ...@@ -16,6 +16,12 @@
<el-form-item :label="$t('所属产线')" prop="lineName"> <el-form-item :label="$t('所属产线')" prop="lineName">
<el-input v-model="queryParams.lineName" :placeholder="$t('请输入')" /> <el-input v-model="queryParams.lineName" :placeholder="$t('请输入')" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('排产次数')" prop="taskBatch">
<el-input v-model="queryParams.taskBatch" :placeholder="$t('请输入')" />
</el-form-item>
<el-form-item :label="$t('订单序号')" prop="orderSerial">
<el-input v-model="queryParams.orderSerial" :placeholder="$t('请输入')" />
</el-form-item>
<el-form-item :label="$t('工单状态')" prop="status"> <el-form-item :label="$t('工单状态')" prop="status">
<el-select v-model="queryParams.workOrderStatus" clearable multiple> <el-select v-model="queryParams.workOrderStatus" clearable multiple>
<el-option v-for="dict in dict.type.mes_workorder_status" :key="dict.value" :label="dict.label" <el-option v-for="dict in dict.type.mes_workorder_status" :key="dict.value" :label="dict.label"
...@@ -40,6 +46,8 @@ ...@@ -40,6 +46,8 @@
<el-table-column :label="$t('项目号')" align="center" prop="customerProjectNo"></el-table-column> <el-table-column :label="$t('项目号')" align="center" prop="customerProjectNo"></el-table-column>
<el-table-column :label="$t('订单号')" align="center" prop="orderCode"></el-table-column> <el-table-column :label="$t('订单号')" align="center" prop="orderCode"></el-table-column>
<el-table-column :label="$t('生产工单')" align="center" prop="workorderCode"></el-table-column> <el-table-column :label="$t('生产工单')" align="center" prop="workorderCode"></el-table-column>
<el-table-column :label="$t('排产次数')" align="center" prop="taskBatch"></el-table-column>
<el-table-column :label="$t('订单序号')" align="center" prop="orderSerial"></el-table-column>
<el-table-column :label="$t('所属产线')" align="center" prop="lineName"></el-table-column> <el-table-column :label="$t('所属产线')" align="center" prop="lineName"></el-table-column>
<el-table-column :label="$t('工单状态')" align="center" prop="status"> <el-table-column :label="$t('工单状态')" align="center" prop="status">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -160,6 +168,9 @@ export default { ...@@ -160,6 +168,9 @@ export default {
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
lineName: null,
orderSerial: null,
taskBatch: null,
pageSize: 10, pageSize: 10,
defectStatus: true, defectStatus: true,
workOrderStatus: [], workOrderStatus: [],
......
...@@ -283,6 +283,8 @@ import dayjs from 'dayjs' ...@@ -283,6 +283,8 @@ import dayjs from 'dayjs'
{label: i18n.t('不合格原因'), value: 'abnormalReason', width: '90px'}, {label: i18n.t('不合格原因'), value: 'abnormalReason', width: '90px'},
{label: i18n.t('标准工时'), value: 'stdWorkingTime', width: '80px'}, {label: i18n.t('标准工时'), value: 'stdWorkingTime', width: '80px'},
{label: i18n.t('实际工时'), value: 'machineTime', width: '80px'}, {label: i18n.t('实际工时'), value: 'machineTime', width: '80px'},
{label: i18n.t('排产次数'), value: 'taskBatch', width: '80px'},
{label: i18n.t('订单序号'), value: 'orderSerial', width: '80px'},
{label: i18n.t('计划完成时间'), value: 'scheduleEndDate', width: '100px'}, {label: i18n.t('计划完成时间'), value: 'scheduleEndDate', width: '100px'},
{label: i18n.t('报工时间'), value: 'feedbackTime', width: '100px'} {label: i18n.t('报工时间'), value: 'feedbackTime', width: '100px'}
] ]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment