生产日报

master
zhaoxiaolin 1 year ago
parent 8524e051e9
commit 4ce59f6fc0

@ -67,3 +67,10 @@ export function getDailyReport(query) {
params: query params: query
}); });
} }
export function getWorkcenterList() {
return request({
url: '/mes/reportWork/getWorkcenterList',
method: 'get'
});
}

@ -12,11 +12,14 @@
</el-form-item> </el-form-item>
<el-form-item label="工作中心"> <el-form-item label="工作中心">
<el-input <el-select v-model="queryParams.workCenter" filterable placeholder="请选择工作中心">
v-model="queryParams.workCenter" <el-option
placeholder="请输入工作中心" v-for="item in options"
clearable :key="item.factoryCode"
/> :label="item.factoryName"
:value="item.factoryCode">
</el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
@ -48,12 +51,12 @@
<el-table-column <el-table-column
prop="teamDesc" prop="teamDesc"
label="组别" label="组别"
width="100"> width="90">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="prodType" prop="prodType"
label="分类" label="分类"
width="100"> width="80">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="teamLeaderName" prop="teamLeaderName"
@ -63,7 +66,7 @@
<el-table-column <el-table-column
prop="productCode" prop="productCode"
label="产品编码" label="产品编码"
width="100"> width="120">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="spec" prop="spec"
@ -178,7 +181,7 @@
</template> </template>
<script> <script>
import { getDailyReport} from "@/api/mes/reportWork"; import { getDailyReport,getWorkcenterList} from "@/api/mes/reportWork";
import moment from 'moment'; import moment from 'moment';
export default { export default {
name: "Prepare", name: "Prepare",
@ -213,11 +216,13 @@ export default {
// //
form: {}, form: {},
// //
rules: {} rules: {},
options: null
}; };
}, },
created() { created() {
this.getList(); this.getList();
this.getWorkcenterList();
}, },
methods: { methods: {
indexMethod(index){ indexMethod(index){
@ -229,10 +234,7 @@ export default {
this.$modal.msgSuccess("日期不能为空"); this.$modal.msgSuccess("日期不能为空");
return return
} }
if(this.queryParams.workCenter == null){
this.$modal.msgSuccess("工作中心不能为空");
return
}
this.loading = true; this.loading = true;
getDailyReport(this.queryParams).then(response => { getDailyReport(this.queryParams).then(response => {
this.prepareList = response.rows; this.prepareList = response.rows;
@ -240,6 +242,13 @@ export default {
this.loading = false; this.loading = false;
}); });
}, },
getWorkcenterList(){
getWorkcenterList().then(data => {
this.options = data;
});
this.queryParams.workCenter = this.options[0].factoryCode;
},
// //
cancel() { cancel() {
this.open = false; this.open = false;
@ -265,9 +274,9 @@ export default {
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download('mes/reportWork/productionExport', { this.download('mes/reportWork/getDailyReportExport', {
...this.queryParams ...this.queryParams
}, `prepare_${new Date().getTime()}.xlsx`) }, `dailyReport${new Date().getTime()}.xlsx`)
}, },
getSummaries(param) { getSummaries(param) {
const { columns, data } = param; const { columns, data } = param;
@ -288,7 +297,7 @@ export default {
} }
}, 0); }, 0);
sums[index] += ''; sums[index] += '';
if(sums[index] > 1000000){ if(index<6){
sums[index] = ''; sums[index] = '';
} }
} else { } else {

Loading…
Cancel
Save