Compare commits

..

No commits in common. "e211e585af384d02f5d341fa578595a66bb73cc4" and "db2cbb64c9749f843300da6769b94cccd46b72d6" have entirely different histories.

66 changed files with 901 additions and 1660 deletions

View File

@ -34,15 +34,6 @@ export function workOrderList(query) {
}) })
} }
// 条件获得工单列表
export function getFreeWOlist(query) {
return request({
url: '/base/core-work-order/getFreeWOlist',
method: 'get',
params: query
})
}
// 获得订单分页 // 获得订单分页
export function getOrderPage(query) { export function getOrderPage(query) {
return request({ return request({

View File

@ -6,12 +6,3 @@ export function getLineAll() {
method: 'get' method: 'get'
}) })
} }
// 根据车间获得所有工厂产线列表
export function getLinelistByRoom(query) {
return request({
url: '/base/core-production-line/listFilter',
method: 'get',
params: query
})
}

View File

@ -1,7 +1,7 @@
/* /*
* @Author: zhp * @Author: zhp
* @Date: 2023-10-18 09:33:57 * @Date: 2023-10-18 09:33:57
* @LastEditTime: 2024-03-15 15:18:09 * @LastEditTime: 2023-11-03 09:31:17
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
*/ */
@ -33,12 +33,3 @@ export function exportEnergyPlcExcel(query) {
responseType: 'blob' responseType: 'blob'
}) })
} }
export function exportEquipmentTraceabilityExcel(query) {
return request({
url: '/analysis/equipment-analysis/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -116,9 +116,7 @@ export const DICT_TYPE = {
ENVIRONMENT_CHECK_UNIT: 'environment_check_unit', ENVIRONMENT_CHECK_UNIT: 'environment_check_unit',
// ============== GROUP - 班组模块 ============= // ============== GROUP - 班组模块 =============
WORK_SHOP: 'workshop', WORK_SHOP: 'workshop'
// ============== GROUP - 质量模块 =============
MATERIAL_GRADE: 'material_grade'
} }
/** /**

View File

@ -123,7 +123,6 @@
filterable filterable
clearable clearable
style="width: 100%" style="width: 100%"
@change="setLine"
placeholder="请选择车间名称"> placeholder="请选择车间名称">
<el-option <el-option
v-for="(dict, index) in getDictDatas('workshop')" v-for="(dict, index) in getDictDatas('workshop')"
@ -164,7 +163,7 @@
import { getProductAll } from '@/api/base/product' import { getProductAll } from '@/api/base/product'
import { getProcessFlowList, workOrderList } from '@/api/base/orderManage' import { getProcessFlowList, workOrderList } from '@/api/base/orderManage'
import { createCoreWO, updateCoreWO, getCode, getCoreWO } from '@/api/base/coreWorkOrder' import { createCoreWO, updateCoreWO, getCode, getCoreWO } from '@/api/base/coreWorkOrder'
import { getLinelistByRoom, getLineAll } from '@/api/base/productionLine' import { getLineAll } from '@/api/base/productionLine'
import basicAdd from '../../core/mixins/basic-add'; import basicAdd from '../../core/mixins/basic-add';
export default { export default {
@ -226,14 +225,6 @@ export default {
this.getDict() this.getDict()
}, },
methods: { methods: {
setLine() {
// 线
getLinelistByRoom({
room: this.dataForm.roomNameDict
}).then(res => {
this.productLineList = res.data || []
})
},
// //
materialMethodChange(val) { materialMethodChange(val) {
if (val === 2 && !this.dataForm.processFlowId) { if (val === 2 && !this.dataForm.processFlowId) {

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2024-03-15 15:34:58 * @LastEditTime: 2024-03-13 14:47:44
* @Description: * @Description:
--> -->
<template> <template>
@ -17,47 +17,30 @@
</small-title> </small-title>
<div class="content"> <div class="content">
<div class="formContent"> <div class="formContent">
<el-form :model="dataForm" ref="dataForm" label-width="120px" label-position="top" class="demo-ruleForm" :rules="rules">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="8"> <el-col :span="8">
<el-form-item label="工单名称" prop="name"> <div class="blodTip">工单名称</div>
<!-- <el-input v-model="dataForm.name" autocomplete="off"></el-input> --> <div class="lightTip">{{ dataForm.name }}</div>
<span>{{ dataForm.name }}</span>
</el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="工单编码" prop="code"> <div class="blodTip">工单编码</div>
<span>{{ dataForm.code }}</span> <div class="lightTip">{{ dataForm.code }}</div>
</el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="产品名称" prop="productName"> <div class="blodTip">产品名称</div>
<span>{{ dataForm.productName }}</span> <div class="lightTip">{{ dataForm.productName }}</div>
</el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="8"> <el-col :span="8">
<el-form-item label="产品规格" prop="specifications"> <div class="blodTip">产品规格</div>
<span>{{ dataForm.specifications }}</span> <div class="lightTip">{{ dataForm.specifications }}</div>
</el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="实际生产数量" prop="actualQuantity"> <div class="blodTip">实际生产数量</div>
<el-input v-model.number="dataForm.actualQuantity" autocomplete="off" style="width: 80%" /> <div class="lightTip">{{ dataForm.expectedTime }}</div>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="实际生产完成时间" prop="finishProduceTime">
<el-date-picker
v-model="dataForm.finishProduceTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期时间" />
</el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form>
</div> </div>
<div class="attr-list"> <div class="attr-list">
@ -116,11 +99,11 @@
</div> </div>
<div class="drawer-body__footer"> <div class="drawer-body__footer">
<el-button style="" @click="goback()">取消</el-button> <el-button style="" type="primary" @click="goback()">关闭</el-button>
<!-- <el-button v-if="isdetail" type="primary" @click="goEdit()"> <!-- <el-button v-if="isdetail" type="primary" @click="goEdit()">
编辑 编辑
</el-button> --> </el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button> <el-button v-else type="primary" @click="dataFormSubmit()">确定</el-button> -->
</div> </div>
</div> </div>
@ -134,7 +117,7 @@
<script> <script>
import basicAdd from '../../core/mixins/basic-add'; import basicAdd from '../../core/mixins/basic-add';
import { getConOrderList, updateConCoreWOr, getCoreWO, statusChange } from '@/api/base/coreWorkOrder'; import { getConOrderList, updateConCoreWOr, getCoreWO } from '@/api/base/coreWorkOrder';
import SmallTitle from '../material/SmallTitle'; import SmallTitle from '../material/SmallTitle';
// import { parseTime } from '../../core/mixins/code-filter'; // import { parseTime } from '../../core/mixins/code-filter';
// import attrAdd from './attr-add'; // import attrAdd from './attr-add';
@ -165,43 +148,11 @@ export default {
tableData: [], tableData: [],
visible: false, visible: false,
isdetail: false, isdetail: false,
idAttrShow: false, idAttrShow: false
rules: {
name: [{ required: true, message: "工单名称不能为空", trigger: "blur" }],
finishProduceTime: [{ required: true, message: "实际生产完成时间不能为空", trigger: "change" }]
},
}; };
}, },
mounted() {}, mounted() {},
methods: { methods: {
//
dataFormSubmit() {
this.$refs["dataForm"].validate((valid) => {
if (!valid) {
return false;
}
//
if (this.dataForm.id) {
statusChange({
id: this.dataForm.id,
status: 4,
finishProduceTime: this.dataForm.finishProduceTime,
actualQuantity: this.dataForm.actualQuantity
}).then(response => {
this.$modal.msgSuccess("操作成功!工单状态稍后将会更新!");
this.visible = false;
this.$emit("refreshDataList");
});
return;
}
//
// this.urlOptions.createURL(this.dataForm).then(response => {
// this.$modal.msgSuccess("");
// this.visible = false;
// this.$emit("refreshDataList");
// });
});
},
initData() { initData() {
// this.materialAttrList.splice(0); // this.materialAttrList.splice(0);
this.listQuery.total = 0; this.listQuery.total = 0;
@ -304,9 +255,6 @@ export default {
}; };
</script> </script>
<style scoped> <style scoped>
/* .item .el-form-item__label {
color: red;
} */
.drawer >>> .el-drawer { .drawer >>> .el-drawer {
border-radius: 8px 0 0 8px; border-radius: 8px 0 0 8px;
display: flex; display: flex;
@ -315,7 +263,6 @@ export default {
.drawer >>> .el-form-item__label { .drawer >>> .el-form-item__label {
padding: 0; padding: 0;
font-weight: 600;
} }
.drawer >>> .el-drawer__header { .drawer >>> .el-drawer__header {

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2024-03-15 15:40:24 * @LastEditTime: 2024-03-13 14:42:32
* @Description: * @Description:
--> -->
<template> <template>
@ -97,10 +97,6 @@
<div class="blodTip">关联工艺</div> <div class="blodTip">关联工艺</div>
<div class="lightTip">{{ dataForm.processFlowName }}</div> <div class="lightTip">{{ dataForm.processFlowName }}</div>
</el-col> </el-col>
<el-col :span="3">
<div class="blodTip">车间名称</div>
<div class="lightTip">{{ (dataForm.roomNameDict || dataForm.roomNameDict === 0) ? getDictDataLabel('workshop', dataForm.roomNameDict) : '-' }}</div>
</el-col>
</el-row> </el-row>
</div> </div>
</div> </div>

View File

@ -431,7 +431,6 @@ export default {
opration = '终止' opration = '终止'
} }
console.log('22',val) console.log('22',val)
if (param.status !== 4) {
this.$confirm(`确定${opration}${'"工单' + val.data.name + '"'}?`, "提示", { this.$confirm(`确定${opration}${'"工单' + val.data.name + '"'}?`, "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
@ -446,18 +445,14 @@ export default {
onClose: () => { onClose: () => {
this.getDataList(); this.getDataList();
// //
// if (param.status === 4) { if (param.status === 4) {
// this.allocationOrder(param); this.allocationOrder(param);
// } }
}, },
}); });
}); });
}) })
.catch(() => { }); .catch(() => { });
} else {
//
this.allocationOrder(param);
}
} }
}, },
allocationOrder(val) { allocationOrder(val) {
@ -465,7 +460,7 @@ export default {
getConOrderList({ getConOrderList({
workOrderId: val.id, workOrderId: val.id,
}).then((response) => { }).then((response) => {
if (response.data.length > 0) {
this.$confirm('工单结束,可分配产量', "提示", { this.$confirm('工单结束,可分配产量', "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
@ -474,16 +469,11 @@ export default {
.then(() => { .then(() => {
this.allocationVisible = true; this.allocationVisible = true;
this.$nextTick(() => { this.$nextTick(() => {
if (response.data.length > 0) { this.$refs.allocation.init(val.id, true);
// id
this.$refs.allocation.init(val.id);
} else {
this.$refs.allocation.init();
}
}); });
}) })
.catch(() => { }); .catch(() => { });
}
// this.listQuery.total = response.data.total; // this.listQuery.total = response.data.total;
}); });
}, },

View File

@ -46,7 +46,6 @@
import BalanceChart from '../balanceChart'; import BalanceChart from '../balanceChart';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import AnalysisChart from './chart.vue'; import AnalysisChart from './chart.vue';
import { parseTime } from '@/utils/ruoyi'
export default { export default {
components: { components: {
@ -83,7 +82,7 @@ export default {
{ {
type: 'datePicker', type: 'datePicker',
label: '时间', label: '时间',
dateType: 'month', dateType: 'monthrange',
format: 'yyyy-MM', format: 'yyyy-MM',
valueFormat: 'timestamp', valueFormat: 'timestamp',
rangeSeparator: '-', rangeSeparator: '-',
@ -256,13 +255,13 @@ export default {
const date = eq.dynamicName; const date = eq.dynamicName;
eq.children.forEach((sub) => { eq.children.forEach((sub) => {
if (sub.dynamicName == '设备CT') if (sub.dynamicName == '设备CT')
row[date + '_eq_ct'] = sub?.dynamicValue?.toFixed(2); row[date + '_eq_ct'] = sub.dynamicValue;
if (sub.dynamicName == '设备TT') if (sub.dynamicName == '设备TT')
row[date + '_eq_tt'] = sub?.dynamicValue?.toFixed(2); row[date + '_eq_tt'] = sub.dynamicValue;
if (sub.dynamicName == '产线CT') if (sub.dynamicName == '产线CT')
row[date + '_pl_ct'] = sub.dynamicValue?.toFixed(2); row[date + '_pl_ct'] = sub.dynamicValue;
if (sub.dynamicName == '产线TT') if (sub.dynamicName == '产线TT')
row[date + '_pl_tt'] = sub.dynamicValue?.toFixed(2); row[date + '_pl_tt'] = sub.dynamicValue;
}); });
}); });
this.tableData.push(row); this.tableData.push(row);
@ -370,63 +369,21 @@ export default {
// this.dataListLoading = false; // this.dataListLoading = false;
}); });
}, },
changeTime(val) {
console.log(val)
if(val) {
const timeStamp = new Date(val).getMonth(); //
console.log('沃尔沃', timeStamp)
const fullyear = new Date(val).getFullYear()
let days = 0
switch (timeStamp) {
case 0:
case 2:
case 4:
case 6:
case 7:
case 9:
case 11:
days = 31
break
case 3:
case 4:
case 8:
case 10:
days = 30
break
case 1:
if ((fullyear % 400 === 0) || (fullyear % 4 === 0 && fullyear % 100 !== 0)) {
days = 29
} else {
days = 28
}
break
}
this.queryParams.startTime = new Date(fullyear, timeStamp, 1, 0, 0, 0).getTime() //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.queryParams.endTime = new Date(fullyear, timeStamp, days, 23, 59, 59).getTime() //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
} else {
this.queryParams.startTime = undefined
this.queryParams.endTime = undefined
}
},
handleSearchBarBtnClick(btn) { handleSearchBarBtnClick(btn) {
switch (btn.btnName) { switch (btn.btnName) {
case 'search': case 'search':
this.queryParams.lineId = btn.lineIds || null; this.queryParams.lineId = btn.lineIds || null;
console.log('2222', new Date(btn.timeArr).getFullYear()) this.queryParams.startTime = btn.timeArr ? btn.timeArr[0] : null;
this.changeTime(btn.timeArr) this.queryParams.endTime = btn.timeArr ? btn.timeArr[1] : null;
// this.queryParams.startTime = btn.timeArr ? btn.timeArr[0] : null;
// this.queryParams.endTime = btn.timeArr ? btn.timeArr[1] : null;
if (!btn.lineIds || !btn.timeArr) { if (!btn.lineIds || !btn.timeArr.length) {
this.$message({ this.$message({
message: '请选择产线和时间', message: '请选择产线和时间',
type: 'warning', type: 'warning',
}); });
} else {
this.getList();
} }
this.getList();
break; break;
} }
}, },

View File

@ -4,23 +4,38 @@
<el-col :span='12'> <el-col :span='12'>
<el-form-item label="能源类型" prop="energyTypeId"> <el-form-item label="能源类型" prop="energyTypeId">
<el-select v-model="form.energyTypeId" placeholder="请选择" style="width: 100%;" filterable> <el-select v-model="form.energyTypeId" placeholder="请选择" style="width: 100%;" filterable>
<el-option v-for="item in this.energyTypeList" :key="item.id" :label="item.name" :value="item.id"> <el-option
v-for="item in this.energyTypeList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='12'> <el-col :span='12'>
<el-form-item label="抄表日期" prop="recordTime"> <el-form-item label="抄表日期" prop="recordTime">
<el-date-picker v-model="form.recordTime" type="date" format="yyyy-MM-dd" value-format="timestamp" <el-date-picker
placeholder="选择日期" style="width: 100%;"> v-model="form.recordTime"
type="date"
format="yyyy-MM-dd"
value-format="timestamp"
placeholder="选择日期"
style="width: 100%;">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span='24'> <el-col :span='24'>
<base-table border :table-props="tableProps" :table-data="tableData" :add-button-show="addButtonShow" <base-table
@emitFun="inputChange" @emitButtonClick="emitButtonClick" /> border
:table-props="tableProps"
:table-data="tableData"
:add-button-show="addButtonShow"
@emitFun="inputChange"
@emitButtonClick="emitButtonClick"
/>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
@ -33,12 +48,12 @@ import SelectArea from './SelectArea'
const tableProps = [ const tableProps = [
{ {
prop: 'tableName', prop: 'tableName',
label: '表名*', label: '表名',
subcomponent: SelectArea subcomponent: SelectArea
}, },
{ {
prop: 'readingQuantity', prop: 'readingQuantity',
label: '抄表数*', label: '抄表数',
subcomponent: InputArea subcomponent: InputArea
} }
] ]

View File

@ -2,20 +2,44 @@
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> <search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
/>
<!-- 列表 --> <!-- 列表 -->
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list" <base-table
:max-height="tableH" @selection-change="selectChange"> :page="queryParams.pageNo"
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn" :limit="queryParams.pageSize"
@clickBtn="handleClick" /> :table-props="tableProps"
:table-data="list"
:max-height="tableH"
@selection-change="selectChange"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick"
/>
</base-table> </base-table>
<pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total" <pagination
@pagination="getList" /> :page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
<!-- 新增 --> <!-- 新增 -->
<base-dialog :dialogTitle="addOrEditTitle" :dialogVisible="centervisible" @cancel="handleCancel" <base-dialog
@confirm="handleConfirm" :before-close="handleCancel"> :dialogTitle="addOrEditTitle"
<energy-quantity-manual-add ref="energyQuantityManualAdd" :energyTypeList="energyTypeList" :dialogVisible="centervisible"
@successSubmit="successSubmit" /> @cancel="handleCancel"
@confirm="handleConfirm"
:before-close="handleCancel"
>
<energy-quantity-manual-add ref="energyQuantityManualAdd" :energyTypeList="energyTypeList" @successSubmit="successSubmit" />
</base-dialog> </base-dialog>
</div> </div>
</template> </template>
@ -44,7 +68,7 @@ const tableProps = [
}, },
{ {
prop: 'tableName', prop: 'tableName',
label: '能源表名', label: '水/气表名',
filter: publicFormatter('table_name'), filter: publicFormatter('table_name'),
minWidth: 110 minWidth: 110
}, },
@ -185,7 +209,7 @@ export default {
break break
default: default:
this.$modal.confirm('是否确认导出').then(() => { this.$modal.confirm('是否确认导出').then(() => {
return energyQuantityManualExport({ energyTypeId: this.queryParams.energyTypeId, recordTime: this.queryParams.recordTime }); return energyQuantityManualExport({...this.queryParams});
}).then(response => { }).then(response => {
this.$download.excel(response, '能源报表.xls'); this.$download.excel(response, '能源报表.xls');
}).catch(() => {}) }).catch(() => {})

View File

@ -2,12 +2,27 @@
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> <search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick"
/>
<!-- 列表 --> <!-- 列表 -->
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" :table-data="list" <base-table
:selectWidth="55" :max-height="tableH" @selection-change="selectChange" /> :page="queryParams.pageNo"
<pagination :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" :total="total" :limit="queryParams.pageSize"
@pagination="getList" /> :table-props="tableProps"
:table-data="list"
:selectWidth="55"
:max-height="tableH"
@selection-change="selectChange"
/>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList"
/>
</div> </div>
</template> </template>
@ -56,8 +71,7 @@ export default {
type: 'select', type: 'select',
label: '能源类型', label: '能源类型',
selectOptions: [], selectOptions: [],
param: 'energyTypeId', param: 'energyTypeId'
filterable: true
}, },
{ {
type: 'datePicker', type: 'datePicker',

View File

@ -16,7 +16,10 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="单位" prop="unit"> <el-form-item label="单位" prop="unit">
<el-select v-model="form.unit" placeholder="请选择" style="width: 100%;"> <el-select v-model="form.unit" placeholder="请选择" style="width: 100%;">
<el-option v-for="item in getDictDatas(DICT_TYPE.ENERGY_UNIT)" :key="item.value" :label="item.label" <el-option
v-for="item in getDictDatas(DICT_TYPE.ENERGY_UNIT)"
:key="item.value"
:label="item.label"
:value="item.value"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
@ -35,8 +38,7 @@
<el-row> <el-row>
<el-col :span="12" v-show="form.pricingMethod === 2"> <el-col :span="12" v-show="form.pricingMethod === 2">
<el-form-item label="单价(元)" prop="pricingMethod"> <el-form-item label="单价(元)" prop="pricingMethod">
<el-input-number v-model="form.singlePrice" :precision="2" :min="0" :max="999999999" <el-input-number v-model="form.singlePrice" :precision="2" :min="0" :max="999999999" style="width: 100%;"></el-input-number>
style="width: 100%;"></el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-show="form.pricingMethod === 1"> <el-col :span="12" v-show="form.pricingMethod === 1">
@ -49,19 +51,43 @@
</el-col> </el-col>
<el-col :span="24" v-show="form.pricingMethod === 0"> <el-col :span="24" v-show="form.pricingMethod === 0">
<el-form-item label="时间段" prop="pricingMethod"> <el-form-item label="时间段" prop="pricingMethod">
<base-table :key='timeKye' :table-props="tableProps1" :table-data="tableData1" <base-table
:add-button-show="addButtonShow" @emitButtonClick="emitButtonClick1" @emitFun="inputChange1"> :key='timeKye'
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="80" label="操作" :method-list="tableBtn" :table-props="tableProps1"
@clickBtn="handleClick1" /> :table-data="tableData1"
:add-button-show="addButtonShow"
@emitButtonClick="emitButtonClick1"
@emitFun="inputChange1"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick1"
/>
</base-table> </base-table>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24" v-show="form.pricingMethod === 1"> <el-col :span="24" v-show="form.pricingMethod === 1">
<el-form-item label="使用量" prop="pricingMethod"> <el-form-item label="使用量" prop="pricingMethod">
<base-table :key='usedKye' :table-props="tableProps2" :table-data="tableData2" <base-table
:add-button-show="addButtonShow" @emitButtonClick="emitButtonClick2" @emitFun="inputChange2"> :key='usedKye'
<method-btn v-if="tableBtn.length" slot="handleBtn" :width="80" label="操作" :method-list="tableBtn" :table-props="tableProps2"
@clickBtn="handleClick2" /> :table-data="tableData2"
:add-button-show="addButtonShow"
@emitButtonClick="emitButtonClick2"
@emitFun="inputChange2"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="80"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick2"
/>
</base-table> </base-table>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -127,11 +153,9 @@ export default {
name: '', name: '',
code: '', code: '',
unit: '', unit: '',
singlePrice: 0,
pricingMethod: 2, pricingMethod: 2,
dim: '', leaderName: '',
push: false, push: false
description: ''
}, },
isEdit: false, // isEdit: false, //
rules: { rules: {
@ -164,18 +188,16 @@ export default {
this.form.code = res.data.code this.form.code = res.data.code
this.form.unit = res.data.unit this.form.unit = res.data.unit
this.form.pricingMethod = res.data.pricingMethod this.form.pricingMethod = res.data.pricingMethod
this.form.leaderName = res.data.leaderName
this.form.push = res.data.push ? true : false this.form.push = res.data.push ? true : false
this.form.description = res.data.description
switch(this.form.pricingMethod) { switch(this.form.pricingMethod) {
case 0: case 0:
this.tableData1 = res.data.segPriceList || [] this.tableData1 = res.data.segPriceList || []
break; break;
case 1: case 1:
this.tableData2 = res.data.usedPriceList || [] this.tableData2 = res.data.usedPriceList || []
this.form.dim = res.data.dim
break; break;
default: default:
this.form.singlePrice = res.data.singlePrice || 0
} }
} }
}) })

View File

@ -35,20 +35,20 @@ import {
} from '@/api/equipment/analysis/statistics'; } from '@/api/equipment/analysis/statistics';
const tableProps = [ const tableProps = [
// { {
// prop: 'recordTime', prop: 'recordTime',
// label: '', label: '时间段',
// filter: (val) => { filter: (val) => {
// if (val && val.length > 0) { if (val && val.length > 0) {
// return ( return (
// moment(val[0]).format('YYYY-MM-DD HH:mm:ss') + moment(val[0]).format('YYYY-MM-DD HH:mm:ss') +
// ' ~ ' + ' ~ ' +
// moment(val[1]).format('YYYY-MM-DD HH:mm:ss') moment(val[1]).format('YYYY-MM-DD HH:mm:ss')
// ); );
// } }
// return '-'; return '-';
// }, },
// }, },
{ {
prop: 'lineName', prop: 'lineName',
label: '产线', label: '产线',
@ -158,7 +158,7 @@ export default {
: '', : '',
btnName: '导出', btnName: '导出',
name: 'export', name: 'export',
color: 'primary', color: 'warning',
plain: true, plain: true,
}, },
], ],

View File

@ -19,7 +19,6 @@
:page="queryParams.pageNo" :page="queryParams.pageNo"
:limit="queryParams.pageSize" :limit="queryParams.pageSize"
:table-data="list" :table-data="list"
max-height="600"
@emitFun="handleEmitFun"> @emitFun="handleEmitFun">
<!-- <method-btn <!-- <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
@ -94,29 +93,17 @@ export default {
{ prop: 'downCount', label: '故障次数' }, { prop: 'downCount', label: '故障次数' },
], ],
searchBarFormConfig: [ searchBarFormConfig: [
// {
// type: 'select',
// label: '',
// placeholder: '',
// param: 'month',
// selectOptions: Array(12)
// .fill(0)
// .map((v, i) => ({
// id: i + 1,
// name: `${i + 1}`,
// })),
// },
{ {
type: 'datePicker', type: 'select',
label: '时间', label: '请选择月份',
dateType: 'month', placeholder: '请选择月份',
format: 'yyyy-MM',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
width: 240,
param: 'month', param: 'month',
selectOptions: Array(12)
.fill(0)
.map((v, i) => ({
id: i + 1,
name: `${i + 1}`,
})),
}, },
{ {
__index: 'line', __index: 'line',
@ -124,7 +111,6 @@ export default {
label: '产线', label: '产线',
placeholder: '请选择产线', placeholder: '请选择产线',
param: 'lineId', param: 'lineId',
filterable: true
}, },
{ {
type: 'button', type: 'button',
@ -178,13 +164,7 @@ export default {
}, },
}); });
if (code === 0) { if (code === 0) {
this.list = data.map(item => { this.list = data;
item.mtbf = item.mtbf?.toFixed(2)
item.mttr = item.mttr?.toFixed(2)
item.workTime = item.workTime?.toFixed(2)
item.downTime = item.downTime?.toFixed(2)
return item
});
} else { } else {
this.list.splice(0); this.list.splice(0);
} }
@ -194,14 +174,12 @@ export default {
switch (btn.btnName) { switch (btn.btnName) {
case 'search': case 'search':
if (btn.month) { if (btn.month) {
// this.queryParams.recordTime = [ this.queryParams.recordTime = [
// moment() moment()
// .month(btn.month - 1) .month(btn.month - 1)
// .format('YYYY-MM') + '-01 00:00:00', .format('YYYY-MM') + '-01 00:00:00',
// moment().month(btn.month).format('YYYY-MM') + '-01 00:00:00', moment().month(btn.month).format('YYYY-MM') + '-01 00:00:00',
// ]; ];
this.queryParams.recordTime = [btn.month, moment().month(new Date(btn.month).getMonth() + 1).format('YYYY-MM') + '-01 00:00:00']
console.log(btn.month, moment().month(new Date(btn.month).getMonth() + 1).format('YYYY-MM') + '-01 00:00:00')
} else { } else {
this.queryParams.recordTime = null; this.queryParams.recordTime = null;
} }

View File

@ -464,9 +464,7 @@ export default {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = '添加设备采集配置'; this.title = '添加设备采集配置';
this.$nextTick(() => {
this.$refs.addOrUpdate.init() this.$refs.addOrUpdate.init()
})
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2024-03-15 18:54:23 * @LastEditTime: 2024-03-13 16:47:02
* @Description: * @Description:
--> -->
<template> <template>

View File

@ -99,7 +99,7 @@
<el-option <el-option
v-for="plc in plcList" v-for="plc in plcList"
:key="plc.id" :key="plc.id"
:label="plc.plcTableName" :label="plc.name"
:value="plc.id"></el-option> :value="plc.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -404,9 +404,9 @@ export default {
this.eqList = data; this.eqList = data;
}); });
this.$axios({ this.$axios({
url: '/base/equipment-plc/listAll', url: '/base/equipment-plc/page',
}).then(({ code, data }) => { }).then(({ code, data }) => {
this.plcList = data; this.plcList = data.list;
}); });
} }
for (const section of this.sections) { for (const section of this.sections) {

View File

@ -2,15 +2,14 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2024-03-18 15:47:20 * @LastEditTime: 2024-03-04 11:14:28
* @Description: * @Description:
--> -->
<template> <template>
<el-drawer <el-drawer
:visible.sync="visible" :visible.sync="visible"
:show-close="false" :show-close="false"
:wrapper-closable="true" :wrapper-closable="isdetail"
:before-close="beforeClose"
class="drawer" class="drawer"
size="60%"> size="60%">
<small-title slot="title" :no-padding="true"> <small-title slot="title" :no-padding="true">
@ -270,17 +269,6 @@ export default {
this.getDict() this.getDict()
}, },
methods: { methods: {
beforeClose(done) {
if (!this.isdetail) {
this.$confirm('确认关闭?')
.then(_ => {
done();
})
.catch(_ => {});
} else {
done()
}
},
async getDict() { async getDict() {
// //
const res = await groupClassesListAll(); const res = await groupClassesListAll();
@ -384,7 +372,6 @@ export default {
if (id) { if (id) {
this.idAttrShow = true this.idAttrShow = true
} else { } else {
this.dataForm.checkPerson = [this.$store.getters.nickname]
this.idAttrShow = false this.idAttrShow = false
} }

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2024-03-15 18:38:52 * @LastEditTime: 2024-03-01 19:44:59
* @Description: * @Description:
--> -->
<template> <template>
@ -27,7 +27,7 @@
<el-form-item <el-form-item
label="部门" label="部门"
prop="departmentId" prop="departmentId"
:rules="[{ required: false, message: '请选择部门', trigger: 'blur' }]"> :rules="[{ required: true, message: '请选择部门', trigger: 'blur' }]">
<el-select <el-select
v-model="dataForm.departmentId" v-model="dataForm.departmentId"
:placeholder="`请选择部门`" :placeholder="`请选择部门`"

View File

@ -17,7 +17,7 @@
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
label="操作" label="操作"
:width="120" :width="180"
:method-list="tableBtn" :method-list="tableBtn"
@clickBtn="handleTableBtnClick" /> @clickBtn="handleTableBtnClick" />
</base-table> </base-table>
@ -52,7 +52,6 @@ import basicPageMixin from '@/mixins/lb/basicPageMixin';
import addOrUpdata from './add-or-updata.vue'; import addOrUpdata from './add-or-updata.vue';
import add from './add.vue'; import add from './add.vue';
import { parseTime } from '../../../../core/mixins/code-filter'; import { parseTime } from '../../../../core/mixins/code-filter';
import { groupClassesListAll } from '@/api/monitoring/teamProduction';
// import { publicFormatter } from '@/utils/dict'; // import { publicFormatter } from '@/utils/dict';
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'); // const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
@ -112,12 +111,6 @@ export default {
width: 150, width: 150,
filter: parseTime, filter: parseTime,
}, },
{
prop: 'checkPeriod',
label: '巡检频率(天/次)',
width: 150,
showOverflowtooltip: true,
},
{ {
prop: 'confirmTimeLimit', prop: 'confirmTimeLimit',
label: '确认时限', label: '确认时限',

View File

@ -220,7 +220,7 @@
label="维修工" label="维修工"
prop="repairman" prop="repairman"
:rules="[ :rules="[
{ required: false, message: '维修工不能为空', trigger: 'blur' }, { required: true, message: '维修工不能为空', trigger: 'blur' },
]"> ]">
<el-select <el-select
v-model="form.repairman" v-model="form.repairman"
@ -262,7 +262,7 @@
prop="repairMode" prop="repairMode"
:rules="[ :rules="[
{ {
required: false, required: true,
message: '维修方式不能为空', message: '维修方式不能为空',
trigger: 'blur', trigger: 'blur',
}, },

View File

@ -83,41 +83,33 @@ export default {
data() { data() {
return { return {
tableProps: [ tableProps: [
{ prop: 'equipmentName', label: '设备名称', minWidth: 100, showOverflowtooltip: true }, { prop: 'equipmentName', label: '设备名称' },
{ prop: 'equipmentCode', label: '设备编码', minWidth: 150, showOverflowtooltip: true }, { prop: 'equipmentCode', label: '设备编码' },
{ prop: 'inQuantity', label: '投入数', minWidth: 80, showOverflowtooltip: true }, { prop: 'inQuantity', label: '投入数' },
{ prop: 'outQuantity', label: '产出数', minWidth: 80, showOverflowtooltip: true }, { prop: 'outQuantity', label: '产出数' },
{ {
prop: 'run', prop: 'run',
label: '是否运行', label: '是否运行',
filter: (val) => (val != null ? (val ? '是' : '否') : ''), filter: (val) => (val != null ? (val ? '是' : '否') : ''),
minWidth: 100,
showOverflowtooltip: true
}, },
{ {
prop: 'status', prop: 'status',
label: '状态', label: '状态',
filter: (val) => filter: (val) =>
val != null ? ['正常', '计划停机', '故障'][val] : '', val != null ? ['正常', '计划停机', '故障'][val] : '',
minWidth: 90,
showOverflowtooltip: true
}, },
{ {
prop: 'error', prop: 'error',
label: '是否故障', label: '是否故障',
filter: (val) => (val != null ? (val ? '是' : '否') : ''), filter: (val) => (val != null ? (val ? '是' : '否') : ''),
minWidth: 100,
showOverflowtooltip: true
}, },
{ {
prop: 'quantityRecordTime', prop: 'quantityRecordTime',
label: '生产量记录时间', label: '生产量记录时间',
filter: parseTime, filter: parseTime,
minWidth: 150,
showOverflowtooltip: true
}, },
{ prop: 'statusRecordTime', label: '状态记录时间', filter: parseTime, minWidth: 150, showOverflowtooltip: true }, { prop: 'statusRecordTime', label: '状态记录时间', filter: parseTime },
// { prop: 'opt1', label: '', name: '', subcomponent: btn }, { prop: 'opt1', label: '状态可视化', name: '查看', subcomponent: btn },
{ prop: 'opt2', label: '参数监控', name: '查看', subcomponent: btn }, { prop: 'opt2', label: '参数监控', name: '查看', subcomponent: btn },
], ],
searchBarForm: { searchBarForm: {

View File

@ -17,7 +17,7 @@
padding: 16px 16px 0; padding: 16px 16px 0;
border-radius: 8px; border-radius: 8px;
"> ">
<!-- <div class="blue-title">生产节拍时序图</div> --> <div class="blue-title">生产节拍时序图</div>
<!-- <h1>设备状态时序图</h1> --> <!-- <h1>设备状态时序图</h1> -->
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<SearchBar <SearchBar
@ -76,7 +76,6 @@
<script> <script>
import LineChart from './components/lineChart.vue'; import LineChart from './components/lineChart.vue';
import moment from 'moment';
// import response from './response.json'; // import response from './response.json';
export default { export default {
@ -85,7 +84,6 @@ export default {
props: {}, props: {},
data() { data() {
return { return {
moment,
startTime: null, // new Date(2023, 8, 26, 0, 0, 0, 0).getTime(), startTime: null, // new Date(2023, 8, 26, 0, 0, 0, 0).getTime(),
accumulators: new Map(), accumulators: new Map(),
searchBarFormConfig: [ searchBarFormConfig: [
@ -96,7 +94,6 @@ export default {
selectOptions: [], selectOptions: [],
param: 'lineId', param: 'lineId',
onchange: true, onchange: true,
filterable: true
}, },
{ {
type: 'select', type: 'select',
@ -104,12 +101,11 @@ export default {
placeholder: '请选择工段', placeholder: '请选择工段',
selectOptions: [], selectOptions: [],
param: 'sectionId', param: 'sectionId',
filterable: true
}, },
// //
{ {
type: 'datePicker', type: 'datePicker',
label: '日期', label: '时间段',
dateType: 'date', // datetimerange dateType: 'date', // datetimerange
// format: 'yyyy-MM-dd HH:mm:ss', // format: 'yyyy-MM-dd HH:mm:ss',
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
@ -267,11 +263,7 @@ export default {
this.initProductline(); this.initProductline();
this.initWorksection(); this.initWorksection();
this.initEquipment(); this.initEquipment();
let end = moment().format('YYYY-MM-DD 23:59:59') // this.getList();
let start = moment().format('YYYY-MM-DD 00:00:00')
this.searchBarFormConfig[2].defaultSelect = start
this.queryParams.recordTime = [start, end]
this.getList();
}, },
methods: { methods: {
handleSearchBarBtnClick({ btnName, ...payload }) { handleSearchBarBtnClick({ btnName, ...payload }) {
@ -301,10 +293,8 @@ export default {
}, },
handleSearchBarChanged({ param, value }) { handleSearchBarChanged({ param, value }) {
this.searchBarFormConfig[1].defaultSelect = null
if (!value) { if (!value) {
this.searchBarFormConfig[1].selectOptions = []; this.searchBarFormConfig[1].selectOptions = [];
// this.searchBarFormConfig[1].defaultSelect = null
return; return;
} }
switch (param) { switch (param) {
@ -496,10 +486,7 @@ export default {
const { code, data } = await this.$axios({ const { code, data } = await this.$axios({
url: '/monitoring/equipment-monitor/quantity-series', url: '/monitoring/equipment-monitor/quantity-series',
method: 'get', method: 'get',
params: { params: this.queryParams,
equipmentId: this.queryParams.equipmentId,
recordTime: this.queryParams.recordTime
}
}); });
this.queryParams.equipmentId = null; // this.queryParams.equipmentId = null; //

View File

@ -17,7 +17,7 @@
padding: 16px 16px 0; padding: 16px 16px 0;
border-radius: 8px; border-radius: 8px;
"> ">
<!-- <div class="blue-title">生产节拍时序图</div> --> <div class="blue-title">生产节拍时序图</div>
<SearchBar <SearchBar
:formConfigs="searchBarFormConfig" :formConfigs="searchBarFormConfig"
ref="search-bar" ref="search-bar"
@ -119,7 +119,6 @@ export default {
selectOptions: [], selectOptions: [],
param: 'lineId', param: 'lineId',
onchange: true, onchange: true,
filterable: true
}, },
{ {
type: 'select', type: 'select',
@ -127,7 +126,6 @@ export default {
placeholder: '请选择工段', placeholder: '请选择工段',
selectOptions: [], selectOptions: [],
param: 'sectionId', param: 'sectionId',
filterable: true
}, },
// //
{ {

View File

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<el-drawer title="查看详情" :visible.sync="visible" size="70%" :show-close='false'> <el-drawer title="查看详情" :visible.sync="visible" size="70%">
<div class="box"> <div class="box">
<el-row class="topBox"> <el-row class="topBox">
<el-col :span="6"> <el-col :span="6">

View File

@ -210,8 +210,8 @@ export default {
mobileCodeTimer: 0, mobileCodeTimer: 0,
loginForm: { loginForm: {
loginType: 'uname', loginType: 'uname',
username: '', username: 'admin',
password: '', password: 'admin123',
captchaVerification: '', captchaVerification: '',
mobile: '', mobile: '',
mobileCode: '', mobileCode: '',
@ -297,9 +297,9 @@ export default {
this.handleLogin({}); this.handleLogin({});
}, },
getCookie() { getCookie() {
// const username = getUsername(); const username = getUsername();
// const password = getPassword(); const password = getPassword();
// const rememberMe = getRememberMe(); const rememberMe = getRememberMe();
const tenantName = getTenantName(); const tenantName = getTenantName();
this.loginForm = { this.loginForm = {
...this.loginForm, ...this.loginForm,

View File

@ -272,7 +272,7 @@ export default {
{ prop: 'lineName', label: '产线' }, { prop: 'lineName', label: '产线' },
{ prop: 'sectionName', label: '工段' }, { prop: 'sectionName', label: '工段' },
// { prop: 'externalCode', label: '' }, // { prop: 'externalCode', label: '' },
{ prop: 'equipmentCode', label: '设备编码' }, { prop: 'equipmentId', label: '设备编码' },
{ prop: 'equipmentName', label: '设备名称' }, { prop: 'equipmentName', label: '设备名称' },
{ prop: 'totalQuantity', label: '加工数量' }, { prop: 'totalQuantity', label: '加工数量' },
], ],

View File

@ -5,8 +5,7 @@
<span class="blueTitle"></span> <span class="blueTitle"></span>
<span>集团编码: {{orderGroupMsg.code}}</span> <span>集团编码: {{orderGroupMsg.code}}</span>
</div> </div>
<el-button type="primary" plain size="small" style="float: right;" @click="returnOrderManage"><svg-icon <el-button type="primary" plain size="small" style="float: right;" @click="returnOrderManage"><svg-icon icon-class="return"/> 返回</el-button>
icon-class="return" /> 返回</el-button>
<div style="padding-left: 14px;"> <div style="padding-left: 14px;">
<el-row> <el-row>
<el-col :span='4'> <el-col :span='4'>
@ -154,8 +153,13 @@
<span class="blueTitle"></span> <span class="blueTitle"></span>
<span>工单信息</span> <span>工单信息</span>
</div> </div>
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps" <base-table
:table-data="item.coreWorkOrderRespVOS || []" :max-height="tableH" /> :page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="item.coreWorkOrderRespVOS || []"
:max-height="tableH"
/>
</div> </div>
</div> </div>
</template> </template>
@ -188,14 +192,14 @@ const tableProps = [
filter: publicFormatter('workshop') filter: publicFormatter('workshop')
}, },
{ {
prop: 'planAssignmentQuantity', prop: 'planQuantity',
label: '计划分配数量', label: '计划加工量',
width: 110 width: 100
}, },
{ {
prop: 'actualAssignmentQuantity', prop: 'actualQuantity',
label: '实际分配数量', label: '实际加工量',
width: 110 width: 100
}, },
{ {
prop: 'actualArea', prop: 'actualArea',
@ -281,12 +285,9 @@ export default {
height: calc(100vh - 120px - 8px); height: calc(100vh - 120px - 8px);
background-color: rgb(242, 244, 249); background-color: rgb(242, 244, 249);
overflow: auto; overflow: auto;
.box1, .box2 {
.box1,
.box2 {
background-color: #fff; background-color: #fff;
border-radius: 9px; border-radius: 9px;
.blodTip { .blodTip {
height: 16px; height: 16px;
font-size: 14px; font-size: 14px;
@ -294,7 +295,6 @@ export default {
color: rgba(0,0,0,0.85); color: rgba(0,0,0,0.85);
margin-bottom: 8px; margin-bottom: 8px;
} }
.lightTip { .lightTip {
height: 16px; height: 16px;
font-size: 14px; font-size: 14px;
@ -306,18 +306,15 @@ export default {
text-overflow: ellipsis; text-overflow: ellipsis;
} }
} }
.box2 { .box2 {
height: 415px; height: 415px;
padding: 12px 16px 0; padding: 12px 16px 0;
margin: 8px 0; margin: 8px 0;
} }
.box1 { .box1 {
height: 215px; height: 215px;
padding: 16px 16px 0 16px; padding: 16px 16px 0 16px;
} }
.boxTitle { .boxTitle {
display: inline-block; display: inline-block;
font-size: 16px; font-size: 16px;
@ -325,7 +322,6 @@ export default {
color: #000000; color: #000000;
margin:0 10px 20px 0; margin:0 10px 20px 0;
} }
.blueTitle { .blueTitle {
content: ''; content: '';
display: inline-block; display: inline-block;

View File

@ -6,9 +6,12 @@
<el-input v-model="form.name"></el-input> <el-input v-model="form.name"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="工单名称" prop="workOrderId" v-if='isBind'> <el-form-item label="工单名称" prop="workOrderId" v-if='isBind'>
<el-select v-model="form.workOrderId" placeholder="请选择" style="width: 100%;" filterable <el-select v-model="form.workOrderId" placeholder="请选择" style="width: 100%;" filterable @change="getWorkOrderMsg">
@change="getWorkOrderMsg"> <el-option
<el-option v-for="item in workOrderList" :key="item.id" :label="item.name" :value="item.id"> v-for="item in workOrderList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -21,7 +24,11 @@
<el-col :span='6'> <el-col :span='6'>
<el-form-item label="产品名称" prop="planProductId"> <el-form-item label="产品名称" prop="planProductId">
<el-select v-model="form.planProductId" placeholder="请选择" disabled style="width: 100%;"> <el-select v-model="form.planProductId" placeholder="请选择" disabled style="width: 100%;">
<el-option v-for="item in productList" :key="item.id" :label="item.name" :value="item.id"> <el-option
v-for="item in productList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -35,28 +42,36 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span='6'> <el-col :span='6'>
<el-form-item label="计划开始时间"> <el-form-item label="计划开始时间">
<el-date-picker v-model="planStartTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" <el-date-picker
style="width: 100%;" placeholder="选择日期" :disabled="isBind"> v-model="planStartTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
style="width: 100%;"
placeholder="选择日期"
:disabled="isBind">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='6'> <el-col :span='6'>
<el-form-item label="计划完成时间"> <el-form-item label="计划完成时间">
<el-date-picker v-model="planFinishTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" <el-date-picker
style="width: 100%;" placeholder="选择日期" :disabled="isBind"> v-model="planFinishTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
style="width: 100%;"
placeholder="选择日期"
:disabled="isBind">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='6'> <el-col :span='6'>
<el-form-item label="计划投入数量" prop="planAssignQuantity"> <el-form-item label="计划投入数量" prop="planAssignQuantity">
<el-input-number v-model="form.planAssignQuantity" :min="0" :max="9999999999999" :disabled="isBind" <el-input-number v-model="form.planAssignQuantity" :min="0" :max="9999999999999" :disabled="isBind" style="width: 100%;"></el-input-number>
style="width: 100%;"></el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='6'> <el-col :span='6'>
<el-form-item label="计划生产数量" prop="planQuantity"> <el-form-item label="计划生产数量" prop="planQuantity">
<el-input-number v-model="form.planQuantity" :min="0" :max="9999999999999" :disabled="isBind" <el-input-number v-model="form.planQuantity" :min="0" :max="9999999999999" :disabled="isBind" style="width: 100%;"></el-input-number>
style="width: 100%;"></el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -64,15 +79,18 @@
<el-col :span='6'> <el-col :span='6'>
<el-form-item label="关联工艺" prop="processFlowId"> <el-form-item label="关联工艺" prop="processFlowId">
<el-select v-model="form.processFlowId" placeholder="请选择" :disabled="isBind" style="width: 100%;"> <el-select v-model="form.processFlowId" placeholder="请选择" :disabled="isBind" style="width: 100%;">
<el-option v-for="item in processFlowList" :key="item.id" :label="item.name" :value="item.id"> <el-option
v-for="item in processFlowList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span='6'> <el-col :span='6'>
<el-form-item label="物料计算方式" prop="materialMethod"> <el-form-item label="物料计算方式" prop="materialMethod">
<el-select v-model="form.materialMethod" placeholder="请选择" style="width: 100%;" :disabled="isBind" <el-select v-model="form.materialMethod" placeholder="请选择" style="width: 100%;" :disabled="isBind" @change='selectMethod'>
@change='selectMethod'>
<el-option label="产品基础BOM" :value="1"></el-option> <el-option label="产品基础BOM" :value="1"></el-option>
<el-option label="工艺扩展BOM" :value="2"></el-option> <el-option label="工艺扩展BOM" :value="2"></el-option>
</el-select> </el-select>
@ -81,7 +99,10 @@
<el-col :span='6'> <el-col :span='6'>
<el-form-item label="优先级" prop="priority"> <el-form-item label="优先级" prop="priority">
<el-select v-model="form.priority" placeholder="请选择" style="width: 100%;" :disabled="isBind"> <el-select v-model="form.priority" placeholder="请选择" style="width: 100%;" :disabled="isBind">
<el-option v-for="item in getDictDatas(DICT_TYPE.ORDER_PRIORITY)" :key="item.value" :label="item.label" <el-option
v-for="item in getDictDatas(DICT_TYPE.ORDER_PRIORITY)"
:key="item.value"
:label="item.label"
:value="item.value"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
@ -90,7 +111,11 @@
<el-col :span='6'> <el-col :span='6'>
<el-form-item label="工单类型" prop="type"> <el-form-item label="工单类型" prop="type">
<el-select v-model="form.type" placeholder="请选择" style="width: 100%;" :disabled="isBind"> <el-select v-model="form.type" placeholder="请选择" style="width: 100%;" :disabled="isBind">
<el-option v-for="item in workOrderTypeList" :key="item.id" :label="item.name" :value="item.id"> <el-option
v-for="item in workOrderTypeList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -100,7 +125,11 @@
<el-col :span='6'> <el-col :span='6'>
<el-form-item label="关联产线" prop="productLineId"> <el-form-item label="关联产线" prop="productLineId">
<el-select v-model="form.productLineId" placeholder="请选择" multiple style="width: 100%;" :disabled="isBind"> <el-select v-model="form.productLineId" placeholder="请选择" multiple style="width: 100%;" :disabled="isBind">
<el-option v-for="item in productLineList" :key="item.id" :label="item.name" :value="item.id"> <el-option
v-for="item in productLineList"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -108,7 +137,10 @@
<el-col :span='6'> <el-col :span='6'>
<el-form-item label="负责车间" prop="roomNameDict"> <el-form-item label="负责车间" prop="roomNameDict">
<el-select v-model="form.roomNameDict" placeholder="请选择" style="width: 100%;" :disabled="isBind"> <el-select v-model="form.roomNameDict" placeholder="请选择" style="width: 100%;" :disabled="isBind">
<el-option v-for="item in getDictDatas(DICT_TYPE.WORK_SHOP)" :key="item.value" :label="item.label" <el-option
v-for="item in getDictDatas(DICT_TYPE.WORK_SHOP)"
:key="item.value"
:label="item.label"
:value="item.value"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
@ -121,8 +153,7 @@
</el-col> </el-col>
<el-col :span='6'> <el-col :span='6'>
<el-form-item label="计划分配订单量" prop="planAssignmentQuantity"> <el-form-item label="计划分配订单量" prop="planAssignmentQuantity">
<el-input-number v-model="form.planAssignmentQuantity" :min="0" :max="9999999999999" <el-input-number v-model="form.planAssignmentQuantity" :min="0" :max="9999999999999" style="width: 100%;"></el-input-number>
style="width: 100%;"></el-input-number>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -130,7 +161,7 @@
</template> </template>
<script> <script>
import { getProductAll } from '@/api/base/product' import { getProductAll } from '@/api/base/product'
import { getProcessFlowList, getWorkOrderCode, orderIssue, getFreeWOlist, getWorkOrderById } from '@/api/base/orderManage' import { getProcessFlowList, getWorkOrderCode, orderIssue, workOrderList, getWorkOrderById } from '@/api/base/orderManage'
import { getLineAll } from '@/api/base/productionLine' import { getLineAll } from '@/api/base/productionLine'
import moment from 'moment' import moment from 'moment'
export default { export default {
@ -213,7 +244,7 @@ export default {
this.processFlowList = res.data || [] this.processFlowList = res.data || []
}) })
// list // list
getFreeWOlist({ workOrderList({
status: 1 status: 1
}).then(res => { }).then(res => {
this.workOrderList = res.data || [] this.workOrderList = res.data || []

View File

@ -2,17 +2,14 @@
<div class="orderDetailData"> <div class="orderDetailData">
<div v-show="!isSingle" style="position: relative;padding-right: 90px;"> <div v-show="!isSingle" style="position: relative;padding-right: 90px;">
<TopTab :orderIdList='orderIdList' :orderId="orderId" @emitFun='toggleName'/> <TopTab :orderIdList='orderIdList' :orderId="orderId" @emitFun='toggleName'/>
<el-button type="primary" plain size="small" <el-button type="primary" plain size="small" style="position: absolute;right: 0; top: 0;height: 48px;font-size: 14px;" @click="returnOrderManage"><svg-icon icon-class="return"/> 返回</el-button>
style="position: absolute;right: 0; top: 0;height: 48px;font-size: 14px;" @click="returnOrderManage"><svg-icon
icon-class="return" /> 返回</el-button>
</div> </div>
<div class="box1"> <div class="box1">
<div class="boxTitle"> <div class="boxTitle">
<span class="blueTitle"></span> <span class="blueTitle"></span>
<span>订单编码: {{orderMsg.code}}</span> <span>订单编码: {{orderMsg.code}}</span>
</div> </div>
<el-button v-show="isSingle" type="primary" plain size="small" style="float: right;" <el-button v-show="isSingle" type="primary" plain size="small" style="float: right;" @click="returnOrderManage"><svg-icon icon-class="return"/> 返回</el-button>
@click="returnOrderManage"><svg-icon icon-class="return" /> 返回</el-button>
<div style="padding-left: 14px;"> <div style="padding-left: 14px;">
<el-row> <el-row>
<el-col :span='4'> <el-col :span='4'>
@ -88,8 +85,13 @@
<span>工单信息</span> <span>工单信息</span>
</div> </div>
<!-- 列表 --> <!-- 列表 -->
<base-table :page="queryParams.pageNo" :limit="queryParams.pageSize" :table-props="tableProps1" <base-table
:table-data="list1" :max-height="tableH" /> :page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps1"
:table-data="list1"
:max-height="tableH"
/>
</div> </div>
</div> </div>
</template> </template>
@ -123,14 +125,14 @@ const tableProps1 = [
filter: publicFormatter('workshop') filter: publicFormatter('workshop')
}, },
{ {
prop: 'planAssignmentQuantity', prop: 'planQuantity',
label: '计划分配数量', label: '计划加工量',
width: 110 width: 100
}, },
{ {
prop: 'actualAssignmentQuantity', prop: 'actualQuantity',
label: '实际分配数量', label: '实际加工量',
width: 110 width: 100
}, },
{ {
prop: 'actualArea', prop: 'actualArea',
@ -251,23 +253,18 @@ export default {
<style lang='scss' scoped> <style lang='scss' scoped>
.orderDetailData { .orderDetailData {
background-color: rgb(242, 244, 249); background-color: rgb(242, 244, 249);
.box1, .box2{
.box1,
.box2 {
background-color: #fff; background-color: #fff;
border-radius: 9px; border-radius: 9px;
} }
.box2 { .box2 {
height: calc(100vh - 351px); height: calc(100vh - 351px);
padding: 12px 16px 0; padding: 12px 16px 0;
margin-top: 8px; margin-top: 8px;
} }
.box1 { .box1 {
height: 215px; height: 215px;
padding: 16px 16px 0 16px; padding: 16px 16px 0 16px;
.blodTip { .blodTip {
height: 16px; height: 16px;
font-size: 14px; font-size: 14px;
@ -275,7 +272,6 @@ export default {
color: rgba(0,0,0,0.85); color: rgba(0,0,0,0.85);
margin-bottom: 8px; margin-bottom: 8px;
} }
.lightTip { .lightTip {
height: 16px; height: 16px;
font-size: 14px; font-size: 14px;
@ -284,7 +280,6 @@ export default {
margin-bottom: 12px; margin-bottom: 12px;
} }
} }
.boxTitle { .boxTitle {
display: inline-block; display: inline-block;
font-size: 16px; font-size: 16px;
@ -292,7 +287,6 @@ export default {
color: #000000; color: #000000;
margin:0 10px 20px 0; margin:0 10px 20px 0;
} }
.blueTitle { .blueTitle {
content: ''; content: '';
display: inline-block; display: inline-block;

View File

@ -108,7 +108,6 @@ export default {
{ {
prop: 'inspectionInfoList', prop: 'inspectionInfoList',
label: '检测内容', label: '检测内容',
showOverflowtooltip: true,
} }
], ],
// //
@ -172,7 +171,7 @@ export default {
type: "warning", type: "warning",
}) })
.then(() => { .then(() => {
this.urlOptions.deleteURL(data.id).then(({ data }) => { this.urlOptions.deleteURL(id).then(({ data }) => {
this.$message({ this.$message({
message: "操作成功", message: "操作成功",
type: "success", type: "success",

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-01-30 10:53:32 * @Date: 2024-01-30 10:53:32
* @LastEditTime: 2024-03-15 14:07:15 * @LastEditTime: 2024-02-23 15:16:35
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -31,7 +31,7 @@
<el-col :span="12" style="border-left: 1px solid #ccc"> <el-col :span="12" style="border-left: 1px solid #ccc">
<div class="select-list"> <div class="select-list">
<div class="sl__header" style="background: #f3f4fb; padding: 12px"> <div class="sl__header" style="background: #f3f4fb; padding: 12px">
<span style="">选择工</span> <span style="">选择工</span>
</div> </div>
<BomSelection ref="materialsBomList" :key="materialsBomList.equipmentId + 'materialsBomList'" <BomSelection ref="materialsBomList" :key="materialsBomList.equipmentId + 'materialsBomList'"

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-01-30 10:52:01 * @Date: 2024-01-30 10:52:01
* @LastEditTime: 2024-03-15 14:06:55 * @LastEditTime: 2024-02-01 14:43:53
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -64,7 +64,7 @@
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@pagination="getList" /> --> @pagination="getList" /> -->
<base-dialog dialogTitle="选择产线工" :dialogVisible="open" width="45%" @close="cancel" @cancel="cancel" <base-dialog dialogTitle="选择产线工" :dialogVisible="open" width="45%" @close="cancel" @cancel="cancel"
@confirm="submitForm"> @confirm="submitForm">
<el-row> <el-row>
<el-form ref="dataForm" :model="dataForm" label-width="120px" :inline="true" class="demo-form-inline"> <el-form ref="dataForm" :model="dataForm" label-width="120px" :inline="true" class="demo-form-inline">

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-12-08 13:46:17 * @Date: 2023-12-08 13:46:17
* @LastEditTime: 2024-03-15 14:54:38 * @LastEditTime: 2024-03-12 14:54:05
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -247,8 +247,6 @@ export default {
// code: [{ required: true, message: "", trigger: "blur" }], // code: [{ required: true, message: "", trigger: "blur" }],
name: [{ required: true, message: "设备物料名称不能为空", trigger: "blur" }], name: [{ required: true, message: "设备物料名称不能为空", trigger: "blur" }],
equipmentId: [{ required: true, message: "设备名称不能为空", trigger: "change" }], equipmentId: [{ required: true, message: "设备名称不能为空", trigger: "change" }],
checkResult: [{ required: true, message: "判定结果不能为空", trigger: "change" }],
// : [{ required: true, message: "", trigger: "change" }], // : [{ required: true, message: "", trigger: "change" }],
// processTime: [{ required: true, message: "线", trigger: "blur" }] // processTime: [{ required: true, message: "线", trigger: "blur" }]
} }
@ -407,7 +405,7 @@ export default {
getSupplierList().then(res => { getSupplierList().then(res => {
this.supplierList = res.data this.supplierList = res.data
}) })
const res = await getDictDatas(this.DICT_TYPE.MATERIAL_GRADE) const res = await getDictDatas(this.DICT_TYPE.EQU_ALARM_LEVEL)
console.log('111', res) console.log('111', res)
this.gradeList = res this.gradeList = res
}, },

View File

@ -145,7 +145,7 @@ export default {
width: 180, width: 180,
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'), filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
}, },
{ prop: 'typeName', label: '检测类型', }, { prop: 'typeName', label: '类型名称', },
{ prop: 'content', label: '检测内容', }, { prop: 'content', label: '检测内容', },
{ prop: 'code', label: '检测编码', }, { prop: 'code', label: '检测编码', },
{ prop: 'remark', label: '备注', }, { prop: 'remark', label: '备注', },

View File

@ -29,7 +29,7 @@
@cancel="handleCancel" @cancel="handleCancel"
@confirm="handleConfirm" @confirm="handleConfirm"
:before-close="handleCancel" :before-close="handleCancel"
width="40%"> width="30%">
<add-or-update <add-or-update
ref="addOrUpdate" ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update> @refreshDataList="successSubmit"></add-or-update>

View File

@ -1,13 +1,13 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-11-06 15:15:30 * @Date: 2023-11-06 15:15:30
* @LastEditTime: 2024-03-15 14:31:10 * @LastEditTime: 2024-03-01 10:33:48
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
<template> <template>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="auto"> <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="auto">
<el-row :gutter="20"> <el-row :gutter="24">
<el-col :span="8"> <el-col :span="8">
<el-form-item label="工单号" prop="workOrderId"> <el-form-item label="工单号" prop="workOrderId">
<el-select v-model="dataForm.workOrderId" placeholder="请选择工单号"> <el-select v-model="dataForm.workOrderId" placeholder="请选择工单号">
@ -22,7 +22,7 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="报废时间" prop="logTime"> <el-form-item label="报废时间" prop="logTime">
<el-date-picker style="width: 100%;" v-model="dataForm.logTime" type="datetime" value-format="timestamp" placeholder="选择日期"> <el-date-picker v-model="dataForm.logTime" type="datetime" value-format="timestamp" placeholder="选择日期">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -130,14 +130,15 @@ export default {
this.getDict() this.getDict()
console.log('我看看', this.dataForm) console.log('我看看', this.dataForm)
// this.getCurrentTime() // this.getCurrentTime()
// this.dataForm.logTime = new Date() this.getWorksectionById()
}, },
methods: { methods: {
// getCurrentTime() { getCurrentTime() {
// // new Date().Format("yyyy-MM-dd HH:mm:ss") // new Date().Format("yyyy-MM-dd HH:mm:ss")
// // this.dataForm.logTime = year + "-" + month + "-" + day; this.dataForm.logTime = new Date()
// // console.log(this.dataForm.logTime); // this.dataForm.logTime = year + "-" + month + "-" + day;
// }, console.log(this.dataForm.logTime);
},
async getDict() { async getDict() {
// //
const res = await getList() const res = await getList()

View File

@ -1,7 +1,7 @@
/* /*
* @Author: zhp * @Author: zhp
* @Date: 2024-02-28 09:51:25 * @Date: 2024-02-28 09:51:25
* @LastEditTime: 2024-03-15 14:34:29 * @LastEditTime: 2024-03-08 13:46:46
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
*/ */
@ -24,25 +24,10 @@ export default {
} }
}, },
created() { created() {
this.dataForm.logTime = this.format(new Date().getTime())
console.log(this.dataForm.logTime);
}, },
mounted () { activated() {
}, },
// activated() {
// },
methods: { methods: {
format(dataString) {
//dataString是整数否则要parseInt转换
var time = new Date(dataString);
var year = time.getFullYear();
var month = time.getMonth() + 1;
var day = time.getDate();
var hour = time.getHours();
var minute = time.getMinutes();
var second = time.getSeconds();
return year + '-' + (month < 10 ? '0' + month : month) + '-' + (day < 10 ? '0' + day : day) + ' ' + (hour < 10 ? '0' + hour : hour) + ':' + (minute < 10 ? '0' + minute : minute) + ':' + (second < 10 ? '0' + second : second)
},
init(id) { init(id) {
this.dataForm.id = id || ""; this.dataForm.id = id || "";
this.visible = true; this.visible = true;
@ -56,7 +41,6 @@ export default {
console.log(response) console.log(response)
this.dataForm = response.data this.dataForm = response.data
this.dataForm.detId = response.data.detIdList this.dataForm.detId = response.data.detIdList
this.getWorksectionById(this.dataForm.lineId)
this.dataForm.logTime = new Date(response.data.logTime) this.dataForm.logTime = new Date(response.data.logTime)
// if (this.setData) { // if (this.setData) {

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-11-06 15:15:30 * @Date: 2023-11-06 15:15:30
* @LastEditTime: 2024-03-15 14:33:12 * @LastEditTime: 2024-03-01 10:18:39
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -110,7 +110,6 @@ export default {
name: '自动', name: '自动',
} }
], ],
sectionList:[],
visible:false, visible:false,
dataForm: { dataForm: {
id: undefined, id: undefined,
@ -139,18 +138,19 @@ export default {
mounted() { mounted() {
this.getDict() this.getDict()
console.log('我看看', this.dataForm) console.log('我看看', this.dataForm)
// this.getCurrentTime() this.getCurrentTime()
// this.getWorksectionById()
}, },
methods: { methods: {
// init() { // init() {
// this.dialogVisible = true // this.dialogVisible = true
// }, // },
// getCurrentTime() { getCurrentTime() {
// // new Date().Format("yyyy-MM-dd HH:mm:ss") // new Date().Format("yyyy-MM-dd HH:mm:ss")
// this.dataForm.logTime = new Date() this.dataForm.logTime = new Date()
// // this.dataForm.logTime = year + "-" + month + "-" + day; // this.dataForm.logTime = year + "-" + month + "-" + day;
// console.log(this.dataForm.logTime); console.log(this.dataForm.logTime);
// }, },
async getDict() { async getDict() {
// //
const res = await getList() const res = await getList()

View File

@ -29,7 +29,7 @@
@cancel="handleCancel" @cancel="handleCancel"
@confirm="handleConfirm" @confirm="handleConfirm"
:before-close="handleCancel" :before-close="handleCancel"
width="40%"> width="30%">
<add-or-update <add-or-update
ref="addOrUpdate" ref="addOrUpdate"
@refreshDataList="successSubmit"></add-or-update> @refreshDataList="successSubmit"></add-or-update>

View File

@ -89,9 +89,7 @@
// import moment from 'moment'; // import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import PieChart from './components/pieChart.vue'; import PieChart from './components/pieChart.vue';
import {
exportEquipmentTraceabilityExcel
} from '@/api/quality/deviceParameters';
export default { export default {
name: 'EfficiencyAnalysis', name: 'EfficiencyAnalysis',
mixins: [basicPageMixin], mixins: [basicPageMixin],
@ -258,7 +256,7 @@ export default {
// parent: 'dateFilterType', // parent: 'dateFilterType',
// //
type: 'datePicker', type: 'datePicker',
label: '时间段', // label: '',
dateType: 'daterange', dateType: 'daterange',
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd HH:mm:ss', valueFormat: 'yyyy-MM-dd HH:mm:ss',
@ -286,12 +284,6 @@ export default {
btnName: '查询', btnName: '查询',
name: 'search', name: 'search',
color: 'primary', color: 'primary',
},
{
type: 'button',
btnName: '导出',
name: 'export',
color: 'warning',
}, },
// { // {
// type: 'separate', // type: 'separate',
@ -380,23 +372,6 @@ export default {
this.trendOpen = true; this.trendOpen = true;
break; break;
} }
},
handleExport() {
//
let params = { ...this.queryParams };
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal
.confirm('是否确认导出设备状态追溯?')
.then(() => {
this.exportLoading = true;
return exportEquipmentTraceabilityExcel(params);
})
.then((response) => {
this.$download.excel(response, '设备状态追溯.xls');
this.exportLoading = false;
})
.catch(() => { });
}, },
/** 查询列表 */ /** 查询列表 */
async getList() { async getList() {
@ -430,7 +405,6 @@ export default {
]; ];
} }
} else { } else {
this.handleExport()
this.queryParams.recordTime = null; this.queryParams.recordTime = null;
} }
this.getList(); this.getList();

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-08-01 14:55:51 * @Date: 2023-08-01 14:55:51
* @LastEditors: zhp * @LastEditors: zhp
* @LastEditTime: 2024-03-15 15:22:59 * @LastEditTime: 2023-12-01 16:43:10
* @Description: * @Description:
--> -->
<template> <template>
@ -121,7 +121,7 @@ export default {
}, },
{ {
type: 'datePicker', type: 'datePicker',
label: '时间', label: '工单开始时间',
dateType: 'daterange', dateType: 'daterange',
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
valueFormat: "yyyy-MM-dd", valueFormat: "yyyy-MM-dd",

View File

@ -263,7 +263,7 @@ export default {
width: 90, width: 90,
prop: 'source', prop: 'source',
label: '来源', label: '来源',
filter: (val) => val == 1 ? '平板端' : '网页端', filter: (val) => ['平板端', '网页端'][val],
}, },
], ],
// keys, queryParams pageNo, pageSize key // keys, queryParams pageNo, pageSize key
@ -457,7 +457,7 @@ export default {
return; return;
} }
// //
let str = this.form.checkPerson ? this.form.checkPerson.join() : null let str = this.form.checkPerson.join()
this.form.checkPerson = str this.form.checkPerson = str
if (this.form.id != null) { if (this.form.id != null) {
updateQualityInspectionRecord(this.form).then((response) => { updateQualityInspectionRecord(this.form).then((response) => {

View File

@ -223,7 +223,7 @@ export default {
{ {
// width: 128, // width: 128,
prop: 'sumScrap', prop: 'sumScrap',
label: '未通过检测总数', label: '未检测总数',
}, },
{ {
// width: 128, // width: 128,

View File

@ -1,15 +1,13 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-01-24 15:15:24 * @Date: 2024-01-24 15:15:24
* @LastEditTime: 2024-03-18 16:00:41 * @LastEditTime: 2024-03-13 15:21:30
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
<template> <template>
<div class="app-container"> <div class="app-container">
<div> <div>
<!-- <el-alert title="自定义 close-text" type="warning" close-text="知道了">
</el-alert> -->
<el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip"> <el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
<el-form-item label="日" prop="reportTime"> <el-form-item label="日" prop="reportTime">
<el-date-picker v-model="reportTime" @change="changeTime" type="date" placeholder="选择日期"> <el-date-picker v-model="reportTime" @change="changeTime" type="date" placeholder="选择日期">
@ -23,8 +21,8 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<inputTable :date="date" :data="tableData" :time="[startTimeStamp, endTimeStamp]" :sum="all" <inputTable :date="date" :data="tableData" :time="[startTimeStamp, endTimeStamp]" :sum="all" :type="listQuery.reportType"
:type="listQuery.reportType" @refreshDataList="getDataList" /> @refreshDataList="getDataList" />
<!-- <pagination <!-- <pagination
:limit.sync="listQuery.pageSize" :limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo" :page.sync="listQuery.pageNo"
@ -39,8 +37,7 @@ import { getGlassPage, exportGlasscExcel } from '@/api/report/glass';
import inputTable from './inputTable.vue'; import inputTable from './inputTable.vue';
import { getCorePLList } from '@/api/base/coreProductionLine'; import { getCorePLList } from '@/api/base/coreProductionLine';
import moment from 'moment' import moment from 'moment'
import FileSaver from 'file-saver'
import * as XLSX from 'xlsx'
export default { export default {
components: { inputTable }, components: { inputTable },
data() { data() {
@ -82,8 +79,6 @@ export default {
}, },
// //
multipliedByHundred(str) { multipliedByHundred(str) {
// console.log(str)
if (str != 0) {
let floatVal = parseFloat(str); let floatVal = parseFloat(str);
if (isNaN(floatVal)) { if (isNaN(floatVal)) {
return 0; return 0;
@ -99,58 +94,30 @@ export default {
strVal += '0'; strVal += '0';
} }
return parseFloat(strVal); return parseFloat(strVal);
}
}, },
async getDataList() { async getDataList() {
this.dataListLoading = true this.dataListLoading = true;
if (this.listQuery.reportTime.length == 0) { await this.urlOptions.getDataListURL(this.listQuery).then(response => {
this.$message({ this.tableData = response.data.filter(item => {
message: '请选择时间',
type: 'warning'
})
return false
}
await this.urlOptions.getDataListURL(this.listQuery).then(res => {
res.data.forEach((ele, index) => {
if (ele.det === false) {
res.data[index].lineName = '合计'
this.remark = res.data[index].remark
res.data[index].dailyOutputTrend = res.data[index].dailyOutputTrend != 0 ? this.multipliedByHundred(res.data[index].dailyOutputTrend) + '%' : res.data[index].dailyOutputTrend == 0 ? 0 : undefined
res.data[index].originalGlassStatisticsTrend = res.data[index].originalGlassStatisticsTrend != 0 ? this.multipliedByHundred(res.data[index].originalGlassStatisticsTrend) + '%' : res.data[index].originalGlassStatisticsTrend == 0 ? 0 : undefined
res.data[index].actualProductTrend = res.data[index].actualProductTrend != 0 ? this.multipliedByHundred(res.data[index].actualProductTrend) + '%' : res.data[index].actualProductTrend == 0 ? 0 : undefined
res.data[index].originalGlassPassTrend = res.data[index].originalGlassPassTrend != 0 ? this.multipliedByHundred(res.data[index].originalGlassPassTrend) + '%' : res.data[index].originalGlassPassTrend == 0 ? 0 : undefined
}
})
res.data.forEach(item => {
this.proLineList.forEach(it => { this.proLineList.forEach(it => {
if (item.lineId === it.id) { if (item.lineId === it.id) {
console.log(item)
item.lineName = it.name item.lineName = it.name
item.dailyOutputTrend = item.dailyOutputTrend != 0 ? this.multipliedByHundred(item.dailyOutputTrend) + '%' : item.dailyOutputTrend == 0 ? 0 : undefined
item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend != 0 ? this.multipliedByHundred(item.originalGlassStatisticsTrend) + '%' : item.originalGlassStatisticsTrend == 0 ? 0 : undefined item.dailyOutputTrend = item.dailyOutputTrend ? parseFloat((item.dailyOutputTrend * 100).toFixed(2)) + '%' : null
item.actualProductTrend = item.actualProductTrend != 0 ? this.multipliedByHundred(item.actualProductTrend) + '%' : item.actualProductTrend == 0 ? 0 : undefined item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
item.originalGlassPassTrend = item.originalGlassPassTrend != 0 ? this.multipliedByHundred(item.originalGlassPassTrend) + '%' : item.originalGlassPassTrend == 0 ? 0 : undefined item.actualProductTrend = item.actualProductTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
item.originalGlassPassTrend = item.originalGlassPassTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
} }
}) })
}) if (item.det === false) {
this.tableData = res.data this.all = {
// this.tableData = response.data.filter(item => { id: item.id,
// this.proLineList.forEach(it => { remark: item.remark
// if (item.lineId === it.id) { }
// item.lineName = it.name }
return item.det === true
// } });
// }) this.listQuery.total = response.data.length;
// if (item.det === false) {
// this.all = {
// id: item.id,
// remark: item.remark
// }
// }
// return item.det === true
// });
this.listQuery.total = res.data.length;
this.dataListLoading = false; this.dataListLoading = false;
}); });
}, },
@ -175,9 +142,6 @@ export default {
// console.log(val.setHours(7, 0, 0)) // console.log(val.setHours(7, 0, 0))
// console.log(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000) // console.log(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000)
// let time = this.format(val.setHours(7, 0, 0)) // let time = this.format(val.setHours(7, 0, 0))
this.startTimeStamp = this.format(val.setHours(7, 0, 1)) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.endTimeStamp = this.format(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// console.log(this.listQuery.reportTime);
this.listQuery.reportTime[0] = this.format(val.setHours(7, 0, 1)) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000 this.listQuery.reportTime[0] = this.format(val.setHours(7, 0, 1)) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.listQuery.reportTime[1] = this.format(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000 this.listQuery.reportTime[1] = this.format(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
console.log(this.listQuery.reportTime); console.log(this.listQuery.reportTime);
@ -212,33 +176,17 @@ export default {
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
// //
var xlsxParam = { raw: true }; let params = { ...this.listQuery };
/* 从表生成工作簿对象 */ params.pageNo = undefined;
var wb = XLSX.utils.table_to_book( params.pageSize = undefined;
document.querySelector("#exportTable"), this.$modal.confirm('是否确认导出所有数据项?').then(() => {
xlsxParam this.exportLoading = true;
); return this.urlOptions.exportURL(params);
/* 获取二进制字符串作为输出 */ }).then(response => {
var wbout = XLSX.write(wb, { this.$download.excel(response, '原片生产日报.xls');
bookType: "xlsx", this.exportLoading = false;
bookSST: true, }).catch(() => { });
type: "array",
});
try {
FileSaver.saveAs(
//Blob
//Blob JavaScript
//File Blob blob 使
// Blob
new Blob([wbout], { type: "application/octet-stream" }),
//
"许昌安彩日原片生产汇总.xlsx"
);
} catch (e) {
if (typeof console !== "undefined") console.log(e, wbout);
} }
return wbout;
},
}, },
}; };
</script> </script>

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: Do not edit * @Author: Do not edit
* @Date: 2023-12-13 14:10:04 * @Date: 2023-12-13 14:10:04
* @LastEditTime: 2024-03-18 09:57:30 * @LastEditTime: 2024-03-13 15:27:43
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -9,10 +9,10 @@
<div> <div>
<el-row style="float: right; margin-bottom: 5px"> <el-row style="float: right; margin-bottom: 5px">
<el-button v-if="!edit" size="small" @click="edit = true">编辑</el-button> <el-button v-if="!edit" size="small" @click="edit = true">编辑</el-button>
<el-button v-if="edit" size="small" @click="handleReturn()">返回</el-button> <el-button v-if="edit" size="small" @click="edit= false">返回</el-button>
<el-button v-if="edit" size="small" @click="updateData">保存</el-button> <el-button v-if="edit" size="small" @click="updateData">保存</el-button>
</el-row> </el-row>
<el-table :id="id" :data="data" border style="width: 100%"> <el-table :data="data" border show-summary style="width: 100%">
<el-table-column v-for="(item, index) in cols" :key="index" :prop="item.prop" :label="item.label" <el-table-column v-for="(item, index) in cols" :key="index" :prop="item.prop" :label="item.label"
:align="item.align ? item.align : 'left'"> :align="item.align ? item.align : 'left'">
<el-table-column v-for="(it, index1) in item.children" :key="index1" :prop="it.prop" :label="it.label" <el-table-column v-for="(it, index1) in item.children" :key="index1" :prop="it.prop" :label="it.label"
@ -20,16 +20,14 @@
<el-table-column v-for="(y, index2) in it.children" :key="index2" :prop="y.prop" :label="y.label"> <el-table-column v-for="(y, index2) in it.children" :key="index2" :prop="y.prop" :label="y.label">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="!edit">{{ scope.row[y.prop] }}</span> <span v-if="!edit">{{ scope.row[y.prop] }}</span>
<el-input @change="handleChange" :disabled="y.prop == 'dailyOutputTrend' || y.prop === 'originalGlassStatisticsTrend' <el-input v-else v-model="scope.row[y.prop]"></el-input>
|| y.prop === 'actualProductTrend' || y.prop === 'originalGlassPassTrend' || y.prop === 'originalGlassPassNow' || y.prop === 'originalGlassPassHis'
" v-else v-model="scope.row[y.prop]"></el-input>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-input type="textarea" v-model="remark" placeholder="备注" :disabled="!edit" :autosize="{ minRows: 2, maxRows: 6}"> <el-input type="textarea" v-model="sum.remark" placeholder="备注" :disabled="!edit"
</el-input> :autosize="{ minRows: 2, maxRows: 6}"></el-input>
</div> </div>
</template> </template>
@ -132,10 +130,6 @@ const cols = [
type: Array, type: Array,
default: () => [], default: () => [],
}, },
id: {
type: String,
default:'exportTable'
},
time: { time: {
type: Array, type: Array,
default: () => [], default: () => [],
@ -156,7 +150,6 @@ const cols = [
data() { data() {
return { return {
cols, cols,
remark:null,
edit: false, edit: false,
}; };
}, },
@ -203,43 +196,15 @@ const cols = [
} }
}, },
methods: { methods: {
handleReturn() {
// this.disabled = true
this.edit = false
},
handleChange(e) {
// console.log(q)
console.log(e);
},
updateData() { updateData() {
let obj = {}
this.data.forEach((ele, index) => { this.data.forEach((ele, index) => {
if (ele.det === false) {
this.data[index].lineId = ''
this.data[index].remark = this.remark
obj = ele
delete this.data[index].dailyOutputTrend
delete this.data[index].originalGlassStatisticsTrend
delete this.data[index].actualProductTrend
delete this.data[index].originalGlassPassTrend
this.data.splice(index, 1)
}
})
let updateArr = this.data
updateArr.forEach((ele, index) => {
delete ele.dailyOutputTrend delete ele.dailyOutputTrend
delete ele.originalGlassStatisticsTrend delete ele.originalGlassStatisticsTrend
delete ele.actualProductTrend delete ele.actualProductTrend
delete ele.originalGlassPassTrend delete ele.originalGlassPassTrend
}); });
// this.data.forEach((ele, index) => { updateGlass(this.data).then(response => {
// delete ele.dailyOutputTrend updateGlassRemark(this.sum).then(res => {
// delete ele.originalGlassStatisticsTrend
// delete ele.actualProductTrend
// delete ele.originalGlassPassTrend
// });
updateGlass(updateArr).then(response => {
updateGlassRemark(obj).then(res => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.edit = false; this.edit = false;
this.$emit("refreshDataList"); this.$emit("refreshDataList");

View File

@ -29,8 +29,7 @@ import { parseTime } from '../../core/mixins/code-filter';
import { getGlassPage, exportGlasscExcel } from '@/api/report/glass'; import { getGlassPage, exportGlasscExcel } from '@/api/report/glass';
import inputTable from './inputTable.vue'; import inputTable from './inputTable.vue';
import { getCorePLList } from '@/api/base/coreProductionLine'; import { getCorePLList } from '@/api/base/coreProductionLine';
import FileSaver from 'file-saver'
import * as XLSX from 'xlsx'
export default { export default {
components: { inputTable }, components: { inputTable },
data() { data() {
@ -73,61 +72,29 @@ export default {
// console.log(date) // console.log(date)
this.changeTime(date) this.changeTime(date)
// console.log(date.valueOf()); // console.log(date.valueOf());
},
multipliedByHundred(str) {
if (str) {
let floatVal = parseFloat(str);
if (isNaN(floatVal)) {
return 0;
}
floatVal = Math.round(str * 10000) / 100;
let strVal = floatVal.toString();
let searchVal = strVal.indexOf('.');
if (searchVal < 0) {
searchVal = strVal.length;
strVal += '.';
}
while (strVal.length <= searchVal + 2) {
strVal += '0';
}
return parseFloat(strVal);
}
}, },
// //
async getDataList() { async getDataList() {
this.dataListLoading = true; this.dataListLoading = true;
if (this.listQuery.reportTime.length == 0) { await this.urlOptions.getDataListURL(this.listQuery).then(response => {
this.$message({ this.tableData = response.data.filter(item => {
message: '请选择时间',
type: 'warning'
})
return false
}
await this.urlOptions.getDataListURL(this.listQuery).then(res => {
res.data.forEach((ele, index) => {
if (ele.det === false) {
res.data[index].lineName = '合计'
this.remark = res.data[index].remark
res.data[index].dailyOutputTrend = res.data[index].dailyOutputTrend != 0 ? this.multipliedByHundred(res.data[index].dailyOutputTrend) + '%' : res.data[index].dailyOutputTrend == 0 ? 0 : undefined
res.data[index].originalGlassStatisticsTrend = res.data[index].originalGlassStatisticsTrend != 0 ? this.multipliedByHundred(res.data[index].originalGlassStatisticsTrend) + '%' : res.data[index].originalGlassStatisticsTrend == 0 ? 0 : undefined
res.data[index].actualProductTrend = res.data[index].actualProductTrend != 0 ? this.multipliedByHundred(res.data[index].actualProductTrend) + '%' : res.data[index].actualProductTrend == 0 ? 0 : undefined
res.data[index].originalGlassPassTrend = res.data[index].originalGlassPassTrend != 0 ? this.multipliedByHundred(res.data[index].originalGlassPassTrend) + '%' : res.data[index].originalGlassPassTrend == 0 ? 0 : undefined
}
})
res.data.forEach(item => {
this.proLineList.forEach(it => { this.proLineList.forEach(it => {
if (item.lineId === it.id) { if (item.lineId === it.id) {
console.log(item)
item.lineName = it.name item.lineName = it.name
item.dailyOutputTrend = item.dailyOutputTrend != 0 ? this.multipliedByHundred(item.dailyOutputTrend) + '%' : item.dailyOutputTrend == 0 ? 0 : undefined item.dailyOutputTrend = item.dailyOutputTrend ? parseFloat((item.dailyOutputTrend * 100).toFixed(2)) + '%' : null
item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend != 0 ? this.multipliedByHundred(item.originalGlassStatisticsTrend) + '%' : item.originalGlassStatisticsTrend == 0 ? 0 : undefined item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
item.actualProductTrend = item.actualProductTrend != 0 ? this.multipliedByHundred(item.actualProductTrend) + '%' : item.actualProductTrend == 0 ? 0 : undefined item.actualProductTrend = item.actualProductTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
item.originalGlassPassTrend = item.originalGlassPassTrend != 0 ? this.multipliedByHundred(item.originalGlassPassTrend) + '%' : item.originalGlassPassTrend == 0 ? 0 : undefined item.originalGlassPassTrend = item.originalGlassPassTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
} }
}) })
}) if (item.det === false) {
this.tableData = res.data this.all = {
id: item.id,
remark: item.remark
}
}
return item.det === true
});
this.listQuery.total = response.data.length; this.listQuery.total = response.data.length;
this.dataListLoading = false; this.dataListLoading = false;
}); });
@ -198,32 +165,16 @@ export default {
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
// //
var xlsxParam = { raw: true }; let params = { ...this.listQuery };
/* 从表生成工作簿对象 */ params.pageNo = undefined;
var wb = XLSX.utils.table_to_book( params.pageSize = undefined;
document.querySelector("#exportTable"), this.$modal.confirm('是否确认导出所有数据项?').then(() => {
xlsxParam this.exportLoading = true;
); return this.urlOptions.exportURL(params);
/* 获取二进制字符串作为输出 */ }).then(response => {
var wbout = XLSX.write(wb, { this.$download.excel(response, '原片生产周报.xls');
bookType: "xlsx", this.exportLoading = false;
bookSST: true, }).catch(() => { });
type: "array",
});
try {
FileSaver.saveAs(
//Blob
//Blob JavaScript
//File Blob blob 使
// Blob
new Blob([wbout], { type: "application/octet-stream" }),
//
"许昌安彩月原片生产汇总.xlsx"
);
} catch (e) {
if (typeof console !== "undefined") console.log(e, wbout);
}
return wbout;
} }
}, },
}; };

View File

@ -31,8 +31,7 @@ import { parseTime } from '../../core/mixins/code-filter';
import { getGlassPage, exportGlasscExcel } from '@/api/report/glass'; import { getGlassPage, exportGlasscExcel } from '@/api/report/glass';
import inputTable from './inputTable.vue'; import inputTable from './inputTable.vue';
import { getCorePLList } from '@/api/base/coreProductionLine'; import { getCorePLList } from '@/api/base/coreProductionLine';
import FileSaver from 'file-saver'
import * as XLSX from 'xlsx'
export default { export default {
components: { inputTable }, components: { inputTable },
data() { data() {
@ -164,61 +163,29 @@ export default {
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); // // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
// this.changeTime(reportTime) // this.changeTime(reportTime)
} }
},
multipliedByHundred(str) {
if (str) {
let floatVal = parseFloat(str);
if (isNaN(floatVal)) {
return 0;
}
floatVal = Math.round(str * 10000) / 100;
let strVal = floatVal.toString();
let searchVal = strVal.indexOf('.');
if (searchVal < 0) {
searchVal = strVal.length;
strVal += '.';
}
while (strVal.length <= searchVal + 2) {
strVal += '0';
}
return parseFloat(strVal);
}
}, },
// //
async getDataList() { async getDataList() {
this.dataListLoading = true; this.dataListLoading = true;
if (this.listQuery.reportTime.length == 0) { await this.urlOptions.getDataListURL(this.listQuery).then(response => {
this.$message({ this.tableData = response.data.filter(item => {
message: '请选择时间',
type: 'warning'
})
return false
}
await this.urlOptions.getDataListURL(this.listQuery).then(res => {
res.data.forEach((ele, index) => {
if (ele.det === false) {
res.data[index].lineName = '合计'
this.remark = res.data[index].remark
res.data[index].dailyOutputTrend = res.data[index].dailyOutputTrend != 0 ? this.multipliedByHundred(res.data[index].dailyOutputTrend) + '%' : res.data[index].dailyOutputTrend == 0 ? 0 : undefined
res.data[index].originalGlassStatisticsTrend = res.data[index].originalGlassStatisticsTrend != 0 ? this.multipliedByHundred(res.data[index].originalGlassStatisticsTrend) + '%' : res.data[index].originalGlassStatisticsTrend == 0 ? 0 : undefined
res.data[index].actualProductTrend = res.data[index].actualProductTrend != 0 ? this.multipliedByHundred(res.data[index].actualProductTrend) + '%' : res.data[index].actualProductTrend == 0 ? 0 : undefined
res.data[index].originalGlassPassTrend = res.data[index].originalGlassPassTrend != 0 ? this.multipliedByHundred(res.data[index].originalGlassPassTrend) + '%' : res.data[index].originalGlassPassTrend == 0 ? 0 : undefined
}
})
res.data.forEach(item => {
this.proLineList.forEach(it => { this.proLineList.forEach(it => {
if (item.lineId === it.id) { if (item.lineId === it.id) {
console.log(item)
item.lineName = it.name item.lineName = it.name
item.dailyOutputTrend = item.dailyOutputTrend != 0 ? this.multipliedByHundred(item.dailyOutputTrend) + '%' : item.dailyOutputTrend == 0 ? 0 : undefined item.dailyOutputTrend = item.dailyOutputTrend ? parseFloat((item.dailyOutputTrend * 100).toFixed(2)) + '%' : null
item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend != 0 ? this.multipliedByHundred(item.originalGlassStatisticsTrend) + '%' : item.originalGlassStatisticsTrend == 0 ? 0 : undefined item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
item.actualProductTrend = item.actualProductTrend != 0 ? this.multipliedByHundred(item.actualProductTrend) + '%' : item.actualProductTrend == 0 ? 0 : undefined item.actualProductTrend = item.actualProductTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
item.originalGlassPassTrend = item.originalGlassPassTrend != 0 ? this.multipliedByHundred(item.originalGlassPassTrend) + '%' : item.originalGlassPassTrend == 0 ? 0 : undefined item.originalGlassPassTrend = item.originalGlassPassTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
} }
}) })
}) if (item.det === false) {
this.tableData = res.data this.all = {
id: item.id,
remark: item.remark
}
}
return item.det === true
});
this.listQuery.total = response.data.length; this.listQuery.total = response.data.length;
this.dataListLoading = false; this.dataListLoading = false;
}); });
@ -263,32 +230,16 @@ export default {
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
// //
var xlsxParam = { raw: true }; let params = { ...this.listQuery };
/* 从表生成工作簿对象 */ params.pageNo = undefined;
var wb = XLSX.utils.table_to_book( params.pageSize = undefined;
document.querySelector("#exportTable"), this.$modal.confirm('是否确认导出所有数据项?').then(() => {
xlsxParam this.exportLoading = true;
); return this.urlOptions.exportURL(params);
/* 获取二进制字符串作为输出 */ }).then(response => {
var wbout = XLSX.write(wb, { this.$download.excel(response, '原片生产周报.xls');
bookType: "xlsx", this.exportLoading = false;
bookSST: true, }).catch(() => { });
type: "array",
});
try {
FileSaver.saveAs(
//Blob
//Blob JavaScript
//File Blob blob 使
// Blob
new Blob([wbout], { type: "application/octet-stream" }),
//
"许昌安彩周原片生产汇总.xlsx"
);
} catch (e) {
if (typeof console !== "undefined") console.log(e, wbout);
}
return wbout;
} }
}, },
}; };

View File

@ -26,8 +26,7 @@ import { parseTime } from '../../core/mixins/code-filter';
import { getGlassPage, exportGlasscExcel } from '@/api/report/glass'; import { getGlassPage, exportGlasscExcel } from '@/api/report/glass';
import inputTable from './inputTable.vue'; import inputTable from './inputTable.vue';
import { getCorePLList } from '@/api/base/coreProductionLine'; import { getCorePLList } from '@/api/base/coreProductionLine';
import FileSaver from 'file-saver'
import * as XLSX from 'xlsx'
export default { export default {
components: { inputTable }, components: { inputTable },
data() { data() {
@ -75,61 +74,29 @@ export default {
// 线 // 线
const res = await getCorePLList(); const res = await getCorePLList();
this.proLineList = res.data; this.proLineList = res.data;
},
multipliedByHundred(str) {
if (str) {
let floatVal = parseFloat(str);
if (isNaN(floatVal)) {
return 0;
}
floatVal = Math.round(str * 10000) / 100;
let strVal = floatVal.toString();
let searchVal = strVal.indexOf('.');
if (searchVal < 0) {
searchVal = strVal.length;
strVal += '.';
}
while (strVal.length <= searchVal + 2) {
strVal += '0';
}
return parseFloat(strVal);
}
}, },
// //
async getDataList() { async getDataList() {
this.dataListLoading = true; this.dataListLoading = true;
if (this.listQuery.reportTime.length == 0) { await this.urlOptions.getDataListURL(this.listQuery).then(response => {
this.$message({ this.tableData = response.data.filter(item => {
message: '请选择时间',
type: 'warning'
})
return false
}
await this.urlOptions.getDataListURL(this.listQuery).then(res => {
res.data.forEach((ele, index) => {
if (ele.det === false) {
res.data[index].lineName = '合计'
this.remark = res.data[index].remark
res.data[index].dailyOutputTrend = res.data[index].dailyOutputTrend != 0 ? this.multipliedByHundred(res.data[index].dailyOutputTrend) + '%' : res.data[index].dailyOutputTrend == 0 ? 0 : undefined
res.data[index].originalGlassStatisticsTrend = res.data[index].originalGlassStatisticsTrend != 0 ? this.multipliedByHundred(res.data[index].originalGlassStatisticsTrend) + '%' : res.data[index].originalGlassStatisticsTrend == 0 ? 0 : undefined
res.data[index].actualProductTrend = res.data[index].actualProductTrend != 0 ? this.multipliedByHundred(res.data[index].actualProductTrend) + '%' : res.data[index].actualProductTrend == 0 ? 0 : undefined
res.data[index].originalGlassPassTrend = res.data[index].originalGlassPassTrend != 0 ? this.multipliedByHundred(res.data[index].originalGlassPassTrend) + '%' : res.data[index].originalGlassPassTrend == 0 ? 0 : undefined
}
})
res.data.forEach(item => {
this.proLineList.forEach(it => { this.proLineList.forEach(it => {
if (item.lineId === it.id) { if (item.lineId === it.id) {
console.log(item) item.dailyOutputTrend = item.dailyOutputTrend ? parseFloat((item.dailyOutputTrend * 100).toFixed(2)) + '%' : null
item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
item.actualProductTrend = item.actualProductTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
item.originalGlassPassTrend = item.originalGlassPassTrend ? parseFloat((item.originalGlassStatisticsTrend * 100).toFixed(2)) + '%' : null
item.lineName = it.name item.lineName = it.name
item.dailyOutputTrend = item.dailyOutputTrend != 0 ? this.multipliedByHundred(item.dailyOutputTrend) + '%' : item.dailyOutputTrend == 0 ? 0 : undefined
item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend != 0 ? this.multipliedByHundred(item.originalGlassStatisticsTrend) + '%' : item.originalGlassStatisticsTrend == 0 ? 0 : undefined
item.actualProductTrend = item.actualProductTrend != 0 ? this.multipliedByHundred(item.actualProductTrend) + '%' : item.actualProductTrend == 0 ? 0 : undefined
item.originalGlassPassTrend = item.originalGlassPassTrend != 0 ? this.multipliedByHundred(item.originalGlassPassTrend) + '%' : item.originalGlassPassTrend == 0 ? 0 : undefined
} }
}) })
}) if (item.det === false) {
this.tableData = res.data this.all = {
id: item.id,
remark: item.remark
}
}
return item.det === true
});
this.listQuery.total = response.data.length; this.listQuery.total = response.data.length;
this.dataListLoading = false; this.dataListLoading = false;
}); });
@ -172,32 +139,16 @@ export default {
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
// //
var xlsxParam = { raw: true }; let params = { ...this.listQuery };
/* 从表生成工作簿对象 */ params.pageNo = undefined;
var wb = XLSX.utils.table_to_book( params.pageSize = undefined;
document.querySelector("#exportTable"), this.$modal.confirm('是否确认导出所有数据项?').then(() => {
xlsxParam this.exportLoading = true;
); return this.urlOptions.exportURL(params);
/* 获取二进制字符串作为输出 */ }).then(response => {
var wbout = XLSX.write(wb, { this.$download.excel(response, '原片生产周报.xls');
bookType: "xlsx", this.exportLoading = false;
bookSST: true, }).catch(() => { });
type: "array",
});
try {
FileSaver.saveAs(
//Blob
//Blob JavaScript
//File Blob blob 使
// Blob
new Blob([wbout], { type: "application/octet-stream" }),
//
"许昌安彩年原片生产汇总.xlsx"
);
} catch (e) {
if (typeof console !== "undefined") console.log(e, wbout);
}
return wbout;
} }
}, },
}; };

View File

@ -1,13 +1,13 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-12-12 13:45:25 * @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-03-18 15:24:10 * @LastEditTime: 2024-03-13 15:28:18
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :inline="true" :model="listQuery" class="blueTip"> <el-form :inline="true" :model="listQuery" class="demo-form-inline">
<el-form-item label="日" prop="reportTime"> <el-form-item label="日" prop="reportTime">
<el-date-picker clearable v-model="reportTime" @change="changeTime" type="date" placeholder="选择日期"> <el-date-picker clearable v-model="reportTime" @change="changeTime" type="date" placeholder="选择日期">
</el-date-picker> </el-date-picker>
@ -17,11 +17,10 @@
@click="handleExport">导出</el-button> @click="handleExport">导出</el-button>
</el-form> </el-form>
<el-row style="float: right; margin-bottom: 5px"> <el-row style="float: right; margin-bottom: 5px">
<el-button v-if="!isSave" size="small" @click="editDataList()">编辑</el-button> <el-button size="small" @click="editDataList()">编辑</el-button>
<el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button> <el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
</el-row> </el-row>
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{ <el-table :data="list" style="width: 100%" :header-cell-style="{
background: '#F2F4F9', background: '#F2F4F9',
color: '#606266' color: '#606266'
}"> }">
@ -47,7 +46,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="inputTrend" label="增减" align="center"> <el-table-column prop="inputTrend" label="增减" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="!disabled"></el-input> <el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputTrend ? parseFloat((scope.row.inputTrend * 100).toFixed(2)) + '%' : <span v-else>{{ scope.row.inputTrend ? parseFloat((scope.row.inputTrend * 100).toFixed(2)) + '%' :
undefined}} </span> undefined}} </span>
</template> </template>
@ -70,7 +69,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="goodProductTrend" label="增减" align="center"> <el-table-column prop="goodProductTrend" label="增减" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="!disabled"> <el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductTrend ? parseFloat((scope.row.goodProductTrend * 100).toFixed(2)) + <span v-else>{{ scope.row.goodProductTrend ? parseFloat((scope.row.goodProductTrend * 100).toFixed(2)) +
'%' : undefined }} </span> '%' : undefined }} </span>
@ -81,56 +80,42 @@
<el-table-column prop="missCheckNow" label="今日" align="center"> <el-table-column prop="missCheckNow" label="今日" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input> <el-input v-if="!disabled" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckNow ? parseFloat((scope.row.missCheckNow * <span v-else>{{ scope.row.missCheckNow }} </span>
100).toFixed(2)) +
'%' : undefined }}
</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="missCheckHis" label="昨日" align="center"> <el-table-column prop="missCheckHis" label="昨日" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input> <el-input v-if="!disabled" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckHis ? parseFloat((scope.row.missCheckHis * <span v-else>{{ scope.row.missCheckHis }} </span>
100).toFixed(2)) +
'%' : undefined }}
</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="missCheckTrend" label="增减" align="center"> <el-table-column prop="missCheckTrend" label="增减" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="!disabled"> <el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.missCheckTrend ? parseFloat((scope.row.missCheckTrend * <span v-else>{{ scope.row.missCheckTrend ? parseFloat((scope.row.missCheckTrend * 100).toFixed(2)) + '%' :
100).toFixed(2)) + undefined }} </span>
'%' : undefined }}
</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column label="综合良品率" align="center"> <el-table-column label="综合良品率" align="center">
<el-table-column prop="goodProductPassNow" label="今日" align="center"> <el-table-column prop="goodProductPassNow" label="今日" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.goodProductPassNow" :disabled="!disabled"> <el-input v-if="!disabled" v-model="scope.row.goodProductPassNow" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductPassNow ? parseFloat((scope.row.goodProductPassNow * <span v-else>{{ scope.row.goodProductPassNow }} </span>
100).toFixed(2)) +
'%' : undefined }}
</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="goodProductPassHis" label="昨日" align="center"> <el-table-column prop="goodProductPassHis" label="昨日" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.goodProductPassHis" :disabled="!disabled"> <el-input v-if="!disabled" v-model="scope.row.goodProductPassHis" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductPassHis ? parseFloat((scope.row.goodProductPassHis * <span v-else>{{ scope.row.goodProductPassHis }} </span>
100).toFixed(2)) +
'%' : undefined }}
</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="goodProductPassTrend" label="增减" align="center"> <el-table-column prop="goodProductPassTrend" label="增减" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="!disabled"> <el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductPassTrend ? parseFloat((scope.row.goodProductPassTrend * <span v-else>{{ scope.row.goodProductPassTrend ? parseFloat((scope.row.goodProductPassTrend *
100).toFixed(2)) + 100).toFixed(2)) +
@ -140,16 +125,12 @@
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<!-- <div style="height: 50px;" class="remark" slot="append"> <div style="height: 50px;" class="remark" slot="append">
<el-input placeholder="备注" v-if="!disabled" v-model="remark" :disabled="disabled"> <el-input placeholder="备注" v-if="!disabled" v-model="remark" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ remark ? remark : '请输入备注' }} </span> <span v-else>{{ remark }} </span>
</div> -->
</el-table>
<div style="height: 50px;" class="remark" >
<el-input placeholder="备注" v-model="remark" :disabled="disabled">
</el-input>
</div> </div>
</el-table>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<!-- <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" /> --> <!-- <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" /> -->
@ -176,8 +157,6 @@ import {
} from '@/api/report/production'; } from '@/api/report/production';
// import Editor from '@/components/Editor'; // import Editor from '@/components/Editor';
import moment from 'moment'; import moment from 'moment';
import FileSaver from 'file-saver'
import * as XLSX from 'xlsx'
// import DialogForm from './dialogForm.vue'; // import DialogForm from './dialogForm.vue';
import { getCorePLList } from '@/api/base/coreProductionLine'; import { getCorePLList } from '@/api/base/coreProductionLine';
// import basicPageMixin from '@/mixins/lb/basicPageMixin'; // import basicPageMixin from '@/mixins/lb/basicPageMixin';
@ -453,10 +432,6 @@ export default {
this.getDict() this.getDict()
}, },
methods: { methods: {
handleReturn() {
this.disabled = true
this.isSave = false
},
format(shijianchuo) { format(shijianchuo) {
//shijianchuoparseInt //shijianchuoparseInt
var time = moment(new Date(shijianchuo)).format('YYYY-MM-DD HH:mm:ss') var time = moment(new Date(shijianchuo)).format('YYYY-MM-DD HH:mm:ss')
@ -482,40 +457,23 @@ export default {
// let time = this.format(val.setHours(7, 0, 0)) // let time = this.format(val.setHours(7, 0, 0))
this.listQuery.reportTime[0] = this.format(val.setHours(7, 0, 1)) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000 this.listQuery.reportTime[0] = this.format(val.setHours(7, 0, 1)) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.listQuery.reportTime[1] = this.format(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000 this.listQuery.reportTime[1] = this.format(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
this.timeTips = this.listQuery.reportTime[0] + ' - ' + this.listQuery.reportTime[1] console.log(this.listQuery.reportTime);
// console.log(this.listQuery.reportTime);
} else { } else {
this.listQuery.reportTime = [] this.listQuery.reportTime = []
} }
}, },
handleExport() { handleExport() {
// //
var xlsxParam = { raw: true }; let params = { ...this.listQuery };
/* 从表生成工作簿对象 */ params.pageNo = undefined;
var wb = XLSX.utils.table_to_book( params.pageSize = undefined;
document.querySelector("#exportTable"), this.$modal.confirm('是否确认导出所有数据项?').then(() => {
xlsxParam this.exportLoading = true;
); return this.urlOptions.exportURL(params);
/* 获取二进制字符串作为输出 */ }).then(response => {
var wbout = XLSX.write(wb, { this.$download.excel(response, '成品生产月报.xls');
bookType: "xlsx", this.exportLoading = false;
bookSST: true, }).catch(() => { });
type: "array",
});
try {
FileSaver.saveAs(
//Blob
//Blob JavaScript
//File Blob blob 使
// Blob
new Blob([wbout], { type: "application/octet-stream" }),
//
"许昌安彩月成品生产汇总.xlsx"
);
} catch (e) {
if (typeof console !== "undefined") console.log(e, wbout);
}
return wbout;
}, },
// timeSelect() { // timeSelect() {
// // switch (this.queryParams.timeDim) { // // switch (this.queryParams.timeDim) {
@ -562,7 +520,6 @@ export default {
editDataList() { editDataList() {
this.disabled = false this.disabled = false
this.isSave = true this.isSave = true
this.getDataList()
}, },
async saveDataList() { async saveDataList() {
let obj = {} let obj = {}
@ -606,19 +563,14 @@ export default {
// this.listQuery.reportTime[0] = this.transformTime(this.monthValue[0]) // this.listQuery.reportTime[0] = this.transformTime(this.monthValue[0])
// // this.queryParams.startTime = this.monthValue[0] // // this.queryParams.startTime = this.monthValue[0]
// this.listQuery.reportTime[1] = this.transformTime(this.monthValue[1]) // this.listQuery.reportTime[1] = this.transformTime(this.monthValue[1])
// this.timeTips = moment(new Date()).format('YYYY-MM-DD') + ' - ' + moment(new Date().setHours(7, 0, 0) + 24 * 60 * 60 * 1000).format('YYYY-MM-DD') this.timeTips = moment(new Date()).format('YYYY-MM-DD') + ' - ' + moment(new Date().setHours(7, 0, 0) + 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
// console.log(this.timeTips); // console.log(this.timeTips);
// } else { // } else {
// // this.$modal.msgError('') // // this.$modal.msgError('')
// // return false // // return false
// } // }
if (this.listQuery.reportTime.length == 0) {
this.$message({ console.log(this.listQuery);
message: '请选择时间',
type: 'warning'
})
return false
}
const res = await this.$axios({ const res = await this.$axios({
url: '/base/report-auto-production/page', url: '/base/report-auto-production/page',
@ -652,19 +604,3 @@ export default {
}, },
}; };
</script> </script>
<style scoped>
/* .blueTip { */
/* padding-bottom: 10px; */
/* } */
.blueTip::before{
display: inline-block;
content: '';
width: 4px;
height: 18px;
background: #0B58FF;
border-radius: 1px;
margin-right: 8PX;
margin-top: 8px;
}
</style>

View File

@ -1,15 +1,17 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-12-12 13:45:25 * @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-03-18 15:27:53 * @LastEditTime: 2024-03-13 15:29:17
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :inline="true" :model="dataForm" class="blueTip"> <el-form :inline="true" :model="dataForm" class="demo-form-inline">
<el-form-item label="月" prop="reportTime"> <el-form-item>
<el-date-picker v-model="reportTime" type="month" size="small" @change="changeTime" placeholder="选择月"> <el-date-picker v-model="monthValue" type="monthrange" range-separator="" start-placeholder="开始日期"
end-placeholder="结束日期" clearable :picker-options="pickerOptions" size="small" style='width:350px;'
@change="timeSelect">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-button type="primary" @click="getDataList()">查询</el-button> <el-button type="primary" @click="getDataList()">查询</el-button>
@ -17,11 +19,10 @@
@click="handleExport">导出</el-button> @click="handleExport">导出</el-button>
</el-form> </el-form>
<el-row style="float: right; margin-bottom: 5px"> <el-row style="float: right; margin-bottom: 5px">
<el-button v-if="!isSave" size="small" @click="editDataList()">编辑</el-button> <el-button size="small" @click="editDataList()">编辑</el-button>
<el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button> <el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
</el-row> </el-row>
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{ <el-table :data="list" style="width: 100%" :header-cell-style="{
background: '#F2F4F9', background: '#F2F4F9',
color: '#606266' color: '#606266'
}"> }">
@ -47,7 +48,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="inputTrend" label="增减" align="center"> <el-table-column prop="inputTrend" label="增减" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="!disabled"></el-input> <el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputTrend ? parseFloat((scope.row.inputTrend * <span v-else>{{ scope.row.inputTrend ? parseFloat((scope.row.inputTrend *
100).toFixed(2)) + '%' : undefined }} </span> 100).toFixed(2)) + '%' : undefined }} </span>
</template> </template>
@ -70,7 +71,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="goodProductTrend" label="增减" align="center"> <el-table-column prop="goodProductTrend" label="增减" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="!disabled"> <el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductTrend ? parseFloat((scope.row.goodProductTrend * <span v-else>{{ scope.row.goodProductTrend ? parseFloat((scope.row.goodProductTrend *
100).toFixed(2)) + '%' : undefined }} </span> 100).toFixed(2)) + '%' : undefined }} </span>
@ -78,78 +79,59 @@
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column label="原片漏检率" align="center"> <el-table-column label="原片漏检率" align="center">
<el-table-column prop="missCheckNow" label="今日" align="center"> <el-table-column prop="missCheckNow" label="本月" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input> <el-input v-if="!disabled" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckNow ? parseFloat((scope.row.missCheckNow * <span v-else>{{ scope.row.missCheckNow }} </span>
100).toFixed(2)) +
'%' : undefined }}
</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="missCheckHis" label="昨日" align="center"> <el-table-column prop="missCheckHis" label="上月" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input> <el-input v-if="!disabled" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckHis ? parseFloat((scope.row.missCheckHis * <span v-else>{{ scope.row.missCheckHis }} </span>
100).toFixed(2)) +
'%' : undefined }}
</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="missCheckTrend" label="增减" align="center"> <el-table-column prop="missCheckTrend" label="增减" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="!disabled"> <el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.missCheckTrend ? parseFloat((scope.row.missCheckTrend * <span v-else>{{ scope.row.missCheckTrend ? parseFloat((scope.row.missCheckTrend *
100).toFixed(2)) + 100).toFixed(2)) +'%' : undefined }} </span>
'%' : undefined }}
</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column label="综合良品率" align="center"> <el-table-column label="综合良品率" align="center">
<el-table-column prop="goodProductPassNow" label="今日" align="center"> <el-table-column prop="goodProductPassNow" label="本月" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.goodProductPassNow" :disabled="!disabled"> <el-input v-if="!disabled" v-model="scope.row.goodProductPassNow" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductPassNow ? parseFloat((scope.row.goodProductPassNow * <span v-else>{{ scope.row.goodProductPassNow }} </span>
100).toFixed(2)) +
'%' : undefined }}
</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="goodProductPassHis" label="昨日" align="center"> <el-table-column prop="goodProductPassHis" label="上月" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.goodProductPassHis" :disabled="!disabled"> <el-input v-if="!disabled" v-model="scope.row.goodProductPassHis" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductPassHis ? parseFloat((scope.row.goodProductPassHis * <span v-else>{{ scope.row.goodProductPassHis }} </span>
100).toFixed(2)) +
'%' : undefined }}
</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="goodProductPassTrend" label="增减" align="center"> <el-table-column prop="goodProductPassTrend" label="增减" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="!disabled"> <el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductPassTrend ? parseFloat((scope.row.goodProductPassTrend * <span v-else>{{ scope.row.goodProductPassTrend ? parseFloat((scope.row.goodProductPassTrend *
100).toFixed(2)) + 100).toFixed(2))+ '%' :undefined }}
'%' : undefined }}
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<!-- <div style="height: 50px;" class="remark" slot="append"> <div style="height: 50px;" class="remark" slot="append">
<el-input placeholder="备注" v-if="!disabled" v-model="remark" :disabled="disabled"> <el-input placeholder="备注" v-if="!disabled" v-model="remark" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ remark }} </span> <span v-else>{{ remark }} </span>
</div> -->
</el-table>
<div style="height: 50px;" class="remark">
<el-input placeholder="备注" v-model="remark" :disabled="disabled">
</el-input>
</div> </div>
</el-table>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<!-- <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" /> --> <!-- <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" /> -->
@ -177,10 +159,8 @@ import {
// import Editor from '@/components/Editor'; // import Editor from '@/components/Editor';
import moment from 'moment'; import moment from 'moment';
// import DialogForm from './dialogForm.vue'; // import DialogForm from './dialogForm.vue';
import { parseTime } from '../../core/mixins/code-filter';
import { getCorePLList } from '@/api/base/coreProductionLine' import { getCorePLList } from '@/api/base/coreProductionLine'
import FileSaver from 'file-saver'
import * as XLSX from 'xlsx'
// import basicPageMixin from '@/mixins/lb/basicPageMixin'; // import basicPageMixin from '@/mixins/lb/basicPageMixin';
const tableProps = [ const tableProps = [
{ {
@ -418,7 +398,6 @@ export default {
// remark: undefined, // remark: undefined,
// }, // },
// //
reportTime:'',
dataForm: { dataForm: {
// workOrderIdList:undefined, // workOrderIdList:undefined,
// productionId: undefined, // productionId: undefined,
@ -432,7 +411,7 @@ export default {
}, },
created() { created() {
this.getCurrentMonthFirst() this.getCurrentMonthFirst()
// this.getCurrentMonthLast() this.getCurrentMonthLast()
// this.getProductLineList(); // this.getProductLineList();
}, },
mounted() { mounted() {
@ -456,11 +435,6 @@ export default {
this.getDict() this.getDict()
}, },
methods: { methods: {
handleReturn() {
this.disabled = true
this.isSave = false
this.getDataList()
},
async getDict() { async getDict() {
// 线 // 线
const res = await getCorePLList(); const res = await getCorePLList();
@ -468,89 +442,32 @@ export default {
}, },
handleExport() { handleExport() {
// //
var xlsxParam = { raw: true }; let params = { ...this.dataForm };
/* 从表生成工作簿对象 */ params.pageNo = undefined;
var wb = XLSX.utils.table_to_book( params.pageSize = undefined;
document.querySelector("#exportTable"), this.$modal.confirm('是否确认导出所有数据项?').then(() => {
xlsxParam this.exportLoading = true;
); return this.urlOptions.exportURL(params);
/* 获取二进制字符串作为输出 */ }).then(response => {
var wbout = XLSX.write(wb, { this.$download.excel(response, '成品生产月报.xls');
bookType: "xlsx", this.exportLoading = false;
bookSST: true, }).catch(() => { });
type: "array",
});
try {
FileSaver.saveAs(
//Blob
//Blob JavaScript
//File Blob blob 使
// Blob
new Blob([wbout], { type: "application/octet-stream" }),
//
"许昌安彩月成品生产汇总.xlsx"
);
} catch (e) {
if (typeof console !== "undefined") console.log(e, wbout);
}
return wbout;
}, },
getCurrentMonthFirst() { getCurrentMonthFirst() {
const date = new Date(); const date = new Date();
date.setDate(1); date.setDate(1)
this.reportTime = date // date.setHours(7, 0, 1)
// console.log(date) this.monthValue[0] = moment(date).format('YYYY-MM-DD')
this.changeTime(date) console.log(date)
// console.log(date.valueOf()); // console.log(date.valueOf());
}, },
changeTime(val) { getCurrentMonthLast() {
console.log(val) const date = new Date();
if (val) { const currentMonth = date.getMonth();
const timeStamp = val.getMonth(); // const nextMonth = currentMonth + 1;
const fullyear = val.getFullYear() const nextMonthFirstDay = new Date(date.getFullYear(), nextMonth, 1);
let days = 0 const oneDay = 24 * 60 * 60 * 1000;
switch (timeStamp) { this.monthValue[1] = new Date(nextMonthFirstDay - oneDay)
case 0:
case 2:
case 4:
case 6:
case 7:
case 9:
case 11:
days = 31
break
case 3:
case 4:
case 8:
case 10:
days = 30
break
case 1:
if ((fullyear % 400 === 0) || (fullyear % 4 === 0 && fullyear % 100 !== 0)) {
days = 29
} else {
days = 28
}
break
}
this.startTimeStamp = this.timeFun(new Date(fullyear, timeStamp, 1, 7, 0, 1).getTime()); //
this.endTimeStamp = this.timeFun(new Date(fullyear, timeStamp, days, 7, 0, 0).getTime()); //
console.log(this.startTimeStamp, this.endTimeStamp)
this.timeTips = this.startTimeStamp + '-' + this.endTimeStamp
this.dataForm.reportTime[0] = parseTime(new Date(fullyear, timeStamp, 1, 7, 0, 1).getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.dataForm.reportTime[1] = parseTime(new Date(fullyear, timeStamp, days, 7, 0, 0).getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
} else {
this.dataForm.reportTime = []
}
},
//yy-mm-dd hh:mm:ss
timeFun(unixtimestamp) {
var unixtimestamp = new Date(unixtimestamp);
var year = 1900 + unixtimestamp.getYear();
var month = "0" + (unixtimestamp.getMonth() + 1);
var date = "0" + unixtimestamp.getDate();
return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length)
}, },
timeSelect() { timeSelect() {
// switch (this.queryParams.timeDim) { // switch (this.queryParams.timeDim) {
@ -649,13 +566,7 @@ export default {
// this.$modal.msgError('') // this.$modal.msgError('')
// return false // return false
} }
if (this.dataForm.reportTime.length == 0) {
this.$message({
message: '请选择时间',
type: 'warning'
})
return false
}
console.log(this.dataForm); console.log(this.dataForm);
const res = await this.$axios({ const res = await this.$axios({
url: '/base/report-auto-production/page', url: '/base/report-auto-production/page',
@ -690,19 +601,3 @@ export default {
}, },
}; };
</script> </script>
<style scoped>
/* .blueTip { */
/* padding-bottom: 10px; */
/* } */
.blueTip::before{
display: inline-block;
content: '';
width: 4px;
height: 18px;
background: #0B58FF;
border-radius: 1px;
margin-right: 8PX;
margin-top: 8px;
}
</style>

View File

@ -1,13 +1,13 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-12-12 13:45:25 * @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-03-18 15:26:52 * @LastEditTime: 2024-03-14 13:46:39
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :inline="true" :model="dataForm" class="blueTip"> <el-form :inline="true" :model="dataForm" class="demo-form-inline">
<el-form-item> <el-form-item>
<el-date-picker clearable v-model="reportTime" @change="changeTime" type="date" placeholder="选择日期"> <el-date-picker clearable v-model="reportTime" @change="changeTime" type="date" placeholder="选择日期">
</el-date-picker> </el-date-picker>
@ -17,11 +17,10 @@
<el-button v-if="isSave" type="success" @click="saveDataList()">保存</el-button> --> <el-button v-if="isSave" type="success" @click="saveDataList()">保存</el-button> -->
</el-form> </el-form>
<el-row style="float: right; margin-bottom: 5px"> <el-row style="float: right; margin-bottom: 5px">
<el-button v-if="!isSave" size="small" @click="editDataList()">编辑</el-button> <el-button size="small" @click="editDataList()">编辑</el-button>
<el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button> <el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
</el-row> </el-row>
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{ <el-table :data="list" style="width: 100%" :header-cell-style="{
background: '#F2F4F9', background: '#F2F4F9',
color: '#606266' color: '#606266'
}"> }">
@ -40,13 +39,13 @@
</el-table-column> </el-table-column>
<el-table-column label="规格" align="center"> <el-table-column label="规格" align="center">
<el-table-column label="成品" align="center"> <el-table-column label="成品" align="center">
<!-- <el-table-column :show-header="false"> --> <el-table-column :show-header="false">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.productionGlassSize" :disabled="disabled"></el-input> <el-input v-if="!disabled" v-model="scope.row.productionL" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.productionGlassSize }} </span> <span v-else>{{ scope.row.productionL }} </span>
</template> </template>
<!-- </el-table-column> --> </el-table-column>
<!-- <el-table-column :show-header="false"> <el-table-column :show-header="false">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.productionW" :disabled="disabled"></el-input> <el-input v-if="!disabled" v-model="scope.row.productionW" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.productionW }} </span> <span v-else>{{ scope.row.productionW }} </span>
@ -57,25 +56,25 @@
<el-input v-if="!disabled" v-model="scope.row.productionH" :disabled="disabled"></el-input> <el-input v-if="!disabled" v-model="scope.row.productionH" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.productionH }} </span> <span v-else>{{ scope.row.productionH }} </span>
</template> </template>
</el-table-column> -->
</el-table-column> </el-table-column>
<el-table-column prop="originalGlassSize" label="原片" align="center"> </el-table-column>
<!-- <el-table-column prop="originalGlassSize"> --> <el-table-column label="原片" align="center">
<el-table-column prop="originalGlassSize">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.originalGlassSize" :disabled="disabled"> <el-input v-if="!disabled" v-model="scope.row.originalGlassSize" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.originalGlassSize }} </span> <span v-else>{{ scope.row.originalGlassSize }} </span>
</template> </template>
<!-- </el-table-column> --> </el-table-column>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<!-- <el-table-column label="完成良品产量"> --> <!-- <el-table-column label="完成良品产量"> -->
<el-table-column prop="customerName" align="center" label="用户"> <el-table-column prop="customerId" align="center" label="用户">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.customerName" :disabled="disabled"> <el-input v-if="!disabled" v-model="scope.row.customerId" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.customerName }} </span> <span v-else>{{ scope.row.customerId }} </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="packageType" align="center" label="包装形式"> <el-table-column prop="packageType" align="center" label="包装形式">
@ -159,16 +158,12 @@
</el-table-column> </el-table-column>
<!-- </el-table-column> --> <!-- </el-table-column> -->
<!-- <div style="height: 50px;" class="remark" slot="append"> <div style="height: 50px;" class="remark" slot="append">
<el-input placeholder="备注" v-if="!disabled" v-model="remark" :disabled="disabled"> <el-input placeholder="备注" v-if="!disabled" v-model="remark" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ remark }} </span> <span v-else>{{ remark }} </span>
</div> -->
</el-table>
<div style="height: 50px;" class="remark">
<el-input placeholder="备注" v-model="remark" :disabled="disabled">
</el-input>
</div> </div>
</el-table>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<!-- <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" /> --> <!-- <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" /> -->
@ -196,7 +191,6 @@ import {
} from '@/api/report/production'; } from '@/api/report/production';
// import Editor from '@/components/Editor'; // import Editor from '@/components/Editor';
import moment from 'moment'; import moment from 'moment';
// import DialogForm from './dialogForm.vue'; // import DialogForm from './dialogForm.vue';
import { getCorePLList } from '@/api/base/coreProductionLine' import { getCorePLList } from '@/api/base/coreProductionLine'
// import basicPageMixin from '@/mixins/lb/basicPageMixin'; // import basicPageMixin from '@/mixins/lb/basicPageMixin';
@ -459,11 +453,6 @@ export default {
this.getDict() this.getDict()
}, },
methods: { methods: {
handleReturn() {
this.disabled = true
this.isSave = false
this.getDataList()
},
format(shijianchuo) { format(shijianchuo) {
//shijianchuoparseInt //shijianchuoparseInt
var time = moment(new Date(shijianchuo)).format('YYYY-MM-DD HH:mm:ss') var time = moment(new Date(shijianchuo)).format('YYYY-MM-DD HH:mm:ss')
@ -573,19 +562,11 @@ export default {
async getDataList() { async getDataList() {
this.timeTips = moment(new Date()).format('YYYY-MM-DD') + ' - ' + moment(new Date().setHours(7, 0, 0) + 24 * 60 * 60 * 1000).format('YYYY-MM-DD') this.timeTips = moment(new Date()).format('YYYY-MM-DD') + ' - ' + moment(new Date().setHours(7, 0, 0) + 24 * 60 * 60 * 1000).format('YYYY-MM-DD')
console.log(this.dataForm); console.log(this.dataForm);
if (this.dataForm.reportTime.length == 0) {
this.$message({
message: '请选择时间',
type: 'warning'
})
return false
}
const res = await this.$axios({ const res = await this.$axios({
url: 'base/report-auto-delive/listPlus', url: 'base/report-auto-delive/listPlus',
method: 'get', method: 'get',
params: this.dataForm params: this.dataForm
}) })
console.log(res) console.log(res)
// let sum = undefined // let sum = undefined
// res.data.list.forEach((ele, index) => { // res.data.list.forEach((ele, index) => {
@ -613,19 +594,3 @@ export default {
}, },
}; };
</script> </script>
<style scoped>
/* .blueTip { */
/* padding-bottom: 10px; */
/* } */
.blueTip::before{
display: inline-block;
content: '';
width: 4px;
height: 18px;
background: #0B58FF;
border-radius: 1px;
margin-right: 8PX;
margin-top: 8px;
}
</style>

View File

@ -1,13 +1,13 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-12-12 13:45:25 * @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-03-18 15:25:48 * @LastEditTime: 2024-03-13 15:29:26
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :inline="true" :model="dataForm" class="blueTip"> <el-form :inline="true" :model="dataForm" class="demo-form-inline">
<el-form-item> <el-form-item>
<el-date-picker v-model="reportTime" type="week" size="small" @change="changeTime" <el-date-picker v-model="reportTime" type="week" size="small" @change="changeTime"
:picker-options="{firstDayOfWeek: 4}" :format="'yyyy 第 WW 周' + '\u3000' + startTimeStamp + '-' + endTimeStamp" :picker-options="{firstDayOfWeek: 4}" :format="'yyyy 第 WW 周' + '\u3000' + startTimeStamp + '-' + endTimeStamp"
@ -20,11 +20,10 @@
@click="handleExport">导出</el-button> @click="handleExport">导出</el-button>
</el-form> </el-form>
<el-row style="float: right; margin-bottom: 5px"> <el-row style="float: right; margin-bottom: 5px">
<el-button v-if="!isSave" size="small" @click="editDataList()">编辑</el-button> <el-button size="small" @click="editDataList()">编辑</el-button>
<el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button> <el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
</el-row> </el-row>
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{ <el-table :data="list" style="width: 100%" :header-cell-style="{
background: '#F2F4F9', background: '#F2F4F9',
color: '#606266' color: '#606266'
}"> }">
@ -50,7 +49,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="inputTrend" label="增减" align="center"> <el-table-column prop="inputTrend" label="增减" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="!disabled"></el-input> <el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputTrend ? parseFloat((scope.row.inputTrend * <span v-else>{{ scope.row.inputTrend ? parseFloat((scope.row.inputTrend *
100).toFixed(2)) + '%' : undefined }} </span> 100).toFixed(2)) + '%' : undefined }} </span>
</template> </template>
@ -73,7 +72,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="goodProductTrend" label="增减" align="center"> <el-table-column prop="goodProductTrend" label="增减" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="!disabled"> <el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductTrend ? parseFloat((scope.row.goodProductTrend * <span v-else>{{ scope.row.goodProductTrend ? parseFloat((scope.row.goodProductTrend *
100).toFixed(2)) + '%' : undefined }} </span> 100).toFixed(2)) + '%' : undefined }} </span>
@ -81,78 +80,59 @@
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column label="原片漏检率" align="center"> <el-table-column label="原片漏检率" align="center">
<el-table-column prop="missCheckNow" label="今日" align="center"> <el-table-column prop="missCheckNow" label="本周" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input> <el-input v-if="!disabled" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckNow ? parseFloat((scope.row.missCheckNow * <span v-else>{{ scope.row.missCheckNow }} </span>
100).toFixed(2)) +
'%' : undefined }}
</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="missCheckHis" label="昨日" align="center"> <el-table-column prop="missCheckHis" label="上周" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input> <el-input v-if="!disabled" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckHis ? parseFloat((scope.row.missCheckHis * <span v-else>{{ scope.row.missCheckHis }} </span>
100).toFixed(2)) +
'%' : undefined }}
</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="missCheckTrend" label="增减" align="center"> <el-table-column prop="missCheckTrend" label="增减" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="!disabled"> <el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.missCheckTrend ? parseFloat((scope.row.missCheckTrend * <span v-else>{{ scope.row.missCheckTrend ? parseFloat((scope.row.missCheckTrend *
100).toFixed(2)) + 100).toFixed(2)) + '%' : undefined }} </span>
'%' : undefined }}
</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column label="综合良品率" align="center"> <el-table-column label="综合良品率" align="center">
<el-table-column prop="goodProductPassNow" label="今日" align="center"> <el-table-column prop="goodProductPassNow" label="本周" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.goodProductPassNow" :disabled="!disabled"> <el-input v-if="!disabled" v-model="scope.row.goodProductPassNow" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductPassNow ? parseFloat((scope.row.goodProductPassNow * <span v-else>{{ scope.row.goodProductPassNow }} </span>
100).toFixed(2)) +
'%' : undefined }}
</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="goodProductPassHis" label="昨日" align="center"> <el-table-column prop="goodProductPassHis" label="上周" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.goodProductPassHis" :disabled="!disabled"> <el-input v-if="!disabled" v-model="scope.row.goodProductPassHis" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductPassHis ? parseFloat((scope.row.goodProductPassHis * <span v-else>{{ scope.row.goodProductPassHis }} </span>
100).toFixed(2)) +
'%' : undefined }}
</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="goodProductPassTrend" label="增减" align="center"> <el-table-column prop="goodProductPassTrend" label="增减" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="!disabled"> <el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductPassTrend ? parseFloat((scope.row.goodProductPassTrend * <span v-else>{{ scope.row.goodProductPassTrend ? parseFloat((scope.row.goodProductPassTrend *
100).toFixed(2)) + 100).toFixed(2)) + '%' :undefined }}
'%' : undefined }}
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<!-- <div style="height: 50px;" class="remark" slot="append"> <div style="height: 50px;" class="remark" slot="append">
<el-input placeholder="备注" v-if="!disabled" v-model="remark" :disabled="disabled"> <el-input placeholder="备注" v-if="!disabled" v-model="remark" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ remark }} </span> <span v-else>{{ remark }} </span>
</div> -->
</el-table>
<div style="height: 50px;" class="remark">
<el-input placeholder="备注" v-model="remark" :disabled="disabled">
</el-input>
</div> </div>
</el-table>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<!-- <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" /> --> <!-- <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" /> -->
@ -182,8 +162,7 @@ import moment from 'moment';
// import DialogForm from './dialogForm.vue'; // import DialogForm from './dialogForm.vue';
import { getCorePLList } from '@/api/base/coreProductionLine' import { getCorePLList } from '@/api/base/coreProductionLine'
import { parseTime } from '../../core/mixins/code-filter'; import { parseTime } from '../../core/mixins/code-filter';
import FileSaver from 'file-saver'
import * as XLSX from 'xlsx'
// import basicPageMixin from '@/mixins/lb/basicPageMixin'; // import basicPageMixin from '@/mixins/lb/basicPageMixin';
const tableProps = [ const tableProps = [
{ {
@ -398,11 +377,6 @@ export default {
this.getDict() this.getDict()
}, },
methods: { methods: {
handleReturn() {
this.disabled = true
this.isSave = false
this.getDataList()
},
async getDict() { async getDict() {
// 线 // 线
const res = await getCorePLList() const res = await getCorePLList()
@ -425,8 +399,6 @@ export default {
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000 this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000 this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); // // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
// this.changeTime(reportTime) // this.changeTime(reportTime)
} else if (weekday[this.reportTime.getDay()] === 'Tuesday') { } else if (weekday[this.reportTime.getDay()] === 'Tuesday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 5 * 24 * 60 * 60 * 1000) this.startTimeStamp = this.timeFun(new Date().getTime() - 5 * 24 * 60 * 60 * 1000)
@ -434,8 +406,6 @@ export default {
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000 this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000 this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); // // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
// this.changeTime(reportTime) // this.changeTime(reportTime)
} else if (weekday[this.reportTime.getDay()] === 'Wednesday') { } else if (weekday[this.reportTime.getDay()] === 'Wednesday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 6 * 24 * 60 * 60 * 1000) this.startTimeStamp = this.timeFun(new Date().getTime() - 6 * 24 * 60 * 60 * 1000)
@ -443,8 +413,6 @@ export default {
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000 this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000 this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); // // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
// this.changeTime(reportTime) // this.changeTime(reportTime)
} else if (weekday[this.reportTime.getDay()] === 'Thursday') { } else if (weekday[this.reportTime.getDay()] === 'Thursday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 7 * 24 * 60 * 60 * 1000) this.startTimeStamp = this.timeFun(new Date().getTime() - 7 * 24 * 60 * 60 * 1000)
@ -452,8 +420,6 @@ export default {
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000 this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000 this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); // // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
// this.changeTime(reportTime) // this.changeTime(reportTime)
} else if (weekday[this.reportTime.getDay()] === 'Friday') { } else if (weekday[this.reportTime.getDay()] === 'Friday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 8 * 24 * 60 * 60 * 1000) this.startTimeStamp = this.timeFun(new Date().getTime() - 8 * 24 * 60 * 60 * 1000)
@ -461,8 +427,6 @@ export default {
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000 this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000 this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); // // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
// this.changeTime(reportTime) // this.changeTime(reportTime)
} else if (weekday[this.reportTime.getDay()] === 'Saturday') { } else if (weekday[this.reportTime.getDay()] === 'Saturday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 9 * 24 * 60 * 60 * 1000) this.startTimeStamp = this.timeFun(new Date().getTime() - 9 * 24 * 60 * 60 * 1000)
@ -470,8 +434,6 @@ export default {
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000 this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000 this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); // // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
// this.changeTime(reportTime) // this.changeTime(reportTime)
} else if (weekday[this.reportTime.getDay()] === 'Sunday') { } else if (weekday[this.reportTime.getDay()] === 'Sunday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 10 * 24 * 60 * 60 * 1000) this.startTimeStamp = this.timeFun(new Date().getTime() - 10 * 24 * 60 * 60 * 1000)
@ -479,39 +441,21 @@ export default {
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000 this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000 this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); // // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
// this.changeTime(reportTime) // this.changeTime(reportTime)
} }
}, },
handleExport() { handleExport() {
// //
var xlsxParam = { raw: true }; let params = { ...this.dataForm };
/* 从表生成工作簿对象 */ params.pageNo = undefined;
var wb = XLSX.utils.table_to_book( params.pageSize = undefined;
document.querySelector("#exportTable"), this.$modal.confirm('是否确认导出所有数据项?').then(() => {
xlsxParam this.exportLoading = true;
); return this.urlOptions.exportURL(params);
/* 获取二进制字符串作为输出 */ }).then(response => {
var wbout = XLSX.write(wb, { this.$download.excel(response, '成品生产周报.xls');
bookType: "xlsx", this.exportLoading = false;
bookSST: true, }).catch(() => { });
type: "array",
});
try {
FileSaver.saveAs(
//Blob
//Blob JavaScript
//File Blob blob 使
// Blob
new Blob([wbout], { type: "application/octet-stream" }),
//
"许昌安彩周成品生产汇总.xlsx"
);
} catch (e) {
if (typeof console !== "undefined") console.log(e, wbout);
}
return wbout;
}, },
startWeek() { startWeek() {
// console.log(this.weekValue1); // console.log(this.weekValue1);
@ -588,8 +532,7 @@ export default {
this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 6); // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 6); //
console.log(this.startTimeStamp, this.endTimeStamp) console.log(this.startTimeStamp, this.endTimeStamp)
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000 this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
} else { } else {
this.dataForm.reportTime = [] this.dataForm.reportTime = []
} }
@ -608,14 +551,8 @@ export default {
this.dataForm.reportTime[0] = moment(this.weekValue1).day(0).format('YYYY-MM-DD') + ' 07:00:01' this.dataForm.reportTime[0] = moment(this.weekValue1).day(0).format('YYYY-MM-DD') + ' 07:00:01'
// this.queryParams.startTime = this.monthValue[0] // this.queryParams.startTime = this.monthValue[0]
this.dataForm.reportTime[1] = moment(this.weekValue2).day(6).format('YYYY-MM-DD') + ' 07:00:00' this.dataForm.reportTime[1] = moment(this.weekValue2).day(6).format('YYYY-MM-DD') + ' 07:00:00'
this.timeTips = moment(this.weekValue1).day(0).format('YYYY-MM-DD') + ' - ' + moment(this.weekValue2).day(0).format('YYYY-MM-DD')
} else { } else {
}
if (this.dataForm.reportTime.length == 0) {
this.$message({
message: '请选择时间',
type: 'warning'
})
return false
} }
this.loading = true; this.loading = true;
// //
@ -652,19 +589,3 @@ export default {
}, },
}; };
</script> </script>
<style scoped>
/* .blueTip { */
/* padding-bottom: 10px; */
/* } */
.blueTip::before{
display: inline-block;
content: '';
width: 4px;
height: 18px;
background: #0B58FF;
border-radius: 1px;
margin-right: 8PX;
margin-top: 8px;
}
</style>

View File

@ -1,13 +1,13 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-12-12 13:45:25 * @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-03-18 15:25:54 * @LastEditTime: 2024-03-13 15:29:35
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :inline="true" :model="dataForm" class="blueTip"> <el-form :inline="true" :model="dataForm" class="demo-form-inline">
<el-form-item> <el-form-item>
<el-date-picker v-model="reportTime" type="year" size="small" @change="changeTime" <el-date-picker v-model="reportTime" type="year" size="small" @change="changeTime"
:picker-options="{firstDayOfWeek: 1}" :format="'yyyy 年' + '\u3000' + startTimeStamp + '-' + endTimeStamp" :picker-options="{firstDayOfWeek: 1}" :format="'yyyy 年' + '\u3000' + startTimeStamp + '-' + endTimeStamp"
@ -21,11 +21,10 @@
<el-button v-if="isSave" type="success" @click="saveDataList()">保存</el-button> --> <el-button v-if="isSave" type="success" @click="saveDataList()">保存</el-button> -->
</el-form> </el-form>
<el-row style="float: right; margin-bottom: 5px"> <el-row style="float: right; margin-bottom: 5px">
<el-button v-if="!isSave" size="small" @click="editDataList()">编辑</el-button> <el-button size="small" @click="editDataList()">编辑</el-button>
<el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button> <el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
</el-row> </el-row>
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{ <el-table :data="list" style="width: 100%" :header-cell-style="{
background: '#F2F4F9', background: '#F2F4F9',
color: '#606266' color: '#606266'
}"> }">
@ -52,7 +51,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="inputTrend" label="增减" align="center"> <el-table-column prop="inputTrend" label="增减" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="!disabled"></el-input> <el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputTrend ? parseFloat((scope.row.inputTrend * <span v-else>{{ scope.row.inputTrend ? parseFloat((scope.row.inputTrend *
100).toFixed(2)) + '%' : undefined }} </span> 100).toFixed(2)) + '%' : undefined }} </span>
</template> </template>
@ -75,7 +74,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="goodProductTrend" label="增减" align="center"> <el-table-column prop="goodProductTrend" label="增减" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="!disabled"> <el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductTrend ? parseFloat((scope.row.goodProductTrend * <span v-else>{{ scope.row.goodProductTrend ? parseFloat((scope.row.goodProductTrend *
100).toFixed(2)) + '%' : undefined }} </span> 100).toFixed(2)) + '%' : undefined }} </span>
@ -83,78 +82,60 @@
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column label="原片漏检率" align="center"> <el-table-column label="原片漏检率" align="center">
<el-table-column prop="missCheckNow" label="今" align="center"> <el-table-column prop="missCheckNow" label="今" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input> <el-input v-if="!disabled" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckNow ? parseFloat((scope.row.missCheckNow * <span v-else>{{ scope.row.missCheckNow }} </span>
100).toFixed(2)) +
'%' : undefined }}
</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="missCheckHis" label="昨日" align="center"> <el-table-column prop="missCheckHis" label="去年" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input> <el-input v-if="!disabled" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckHis ? parseFloat((scope.row.missCheckHis * <span v-else>{{ scope.row.missCheckHis }} </span>
100).toFixed(2)) +
'%' : undefined }}
</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="missCheckTrend" label="增减" align="center"> <el-table-column prop="missCheckTrend" label="增减" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="!disabled"> <el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.missCheckTrend ? parseFloat((scope.row.missCheckTrend * <span v-else>{{ scope.row.missCheckTrend ? parseFloat((scope.row.missCheckTrend *
100).toFixed(2)) + 100).toFixed(2)) + '%' : undefined }}
'%' : undefined }}
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column label="综合良品率" align="center"> <el-table-column label="综合良品率" align="center">
<el-table-column prop="goodProductPassNow" label="今" align="center"> <el-table-column prop="goodProductPassNow" label="今" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.goodProductPassNow" :disabled="!disabled"> <el-input v-if="!disabled" v-model="scope.row.goodProductPassNow" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductPassNow ? parseFloat((scope.row.goodProductPassNow * <span v-else>{{ scope.row.goodProductPassNow }} </span>
100).toFixed(2)) +
'%' : undefined }}
</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="goodProductPassHis" label="昨日" align="center"> <el-table-column prop="goodProductPassHis" label="去年" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.goodProductPassHis" :disabled="!disabled"> <el-input v-if="!disabled" v-model="scope.row.goodProductPassHis" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductPassHis ? parseFloat((scope.row.goodProductPassHis * <span v-else>{{ scope.row.goodProductPassHis }} </span>
100).toFixed(2)) +
'%' : undefined }}
</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="goodProductPassTrend" label="增减" align="center"> <el-table-column prop="goodProductPassTrend" label="增减" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="!disabled"> <el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductPassTrend ? parseFloat((scope.row.goodProductPassTrend * <span v-else>{{ scope.row.goodProductPassTrend ? parseFloat((scope.row.goodProductPassTrend *
100).toFixed(2)) + 100).toFixed(2)) + '%' : undefined }}
'%' : undefined }}
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<!-- <div style="height: 50px;" class="remark" slot="append"> <div style="height: 50px;" class="remark" slot="append">
<el-input placeholder="备注" v-if="!disabled" v-model="remark" :disabled="disabled"> <el-input placeholder="备注" v-if="!disabled" v-model="remark" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ remark }} </span> <span v-else>{{ remark }} </span>
</div> -->
</el-table>
<div style="height: 50px;" class="remark">
<el-input placeholder="备注" v-model="remark" :disabled="disabled">
</el-input>
</div> </div>
</el-table>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<!-- <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" /> --> <!-- <SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" /> -->
@ -184,8 +165,7 @@ import moment from 'moment';
// import DialogForm from './dialogForm.vue'; // import DialogForm from './dialogForm.vue';
import { parseTime } from '../../core/mixins/code-filter'; import { parseTime } from '../../core/mixins/code-filter';
import { getCorePLList } from '@/api/base/coreProductionLine' import { getCorePLList } from '@/api/base/coreProductionLine'
import FileSaver from 'file-saver'
import * as XLSX from 'xlsx'
const tableProps = [ const tableProps = [
{ {
// width: 128, // width: 128,
@ -398,11 +378,6 @@ export default {
this.getDict() this.getDict()
}, },
methods: { methods: {
handleReturn() {
this.disabled = true
this.isSave = false
this.getDataList()
},
async getDict() { async getDict() {
// 线 // 线
const res = await getCorePLList() const res = await getCorePLList()
@ -420,32 +395,16 @@ export default {
}, },
handleExport() { handleExport() {
// //
var xlsxParam = { raw: true }; let params = { ...this.dataForm };
/* 从表生成工作簿对象 */ params.pageNo = undefined;
var wb = XLSX.utils.table_to_book( params.pageSize = undefined;
document.querySelector("#exportTable"), this.$modal.confirm('是否确认导出所有数据项?').then(() => {
xlsxParam this.exportLoading = true;
); return this.urlOptions.exportURL(params);
/* 获取二进制字符串作为输出 */ }).then(response => {
var wbout = XLSX.write(wb, { this.$download.excel(response, '成品生产月报.xls');
bookType: "xlsx", this.exportLoading = false;
bookSST: true, }).catch(() => { });
type: "array",
});
try {
FileSaver.saveAs(
//Blob
//Blob JavaScript
//File Blob blob 使
// Blob
new Blob([wbout], { type: "application/octet-stream" }),
//
"许昌安彩年成品生产汇总.xlsx"
);
} catch (e) {
if (typeof console !== "undefined") console.log(e, wbout);
}
return wbout;
}, },
// startYear() { // startYear() {
// if (this.yearValue2 && this.yearValue2 < this.yearValue1) { // if (this.yearValue2 && this.yearValue2 < this.yearValue1) {
@ -547,13 +506,6 @@ export default {
// this.dataForm.reportTime[0] = this.transformYear(this.yearValue1) // this.dataForm.reportTime[0] = this.transformYear(this.yearValue1)
// this.dataForm.reportTime[1] = this.transformYear(this.yearValue2) // this.dataForm.reportTime[1] = this.transformYear(this.yearValue2)
} }
}
if (this.dataForm.reportTime.length == 0) {
this.$message({
message: '请选择时间',
type: 'warning'
})
return false
} }
this.loading = true; this.loading = true;
// //
@ -590,19 +542,3 @@ export default {
}, },
}; };
</script> </script>
<style scoped>
/* .blueTip { */
/* padding-bottom: 10px; */
/* } */
.blueTip::before{
display: inline-block;
content: '';
width: 4px;
height: 18px;
background: #0B58FF;
border-radius: 1px;
margin-right: 8PX;
margin-top: 8px;
}
</style>

View File

@ -251,8 +251,7 @@ export default {
select: true, select: true,
label: '负责人', label: '负责人',
prop: 'responsiblePeopleId', prop: 'responsiblePeopleId',
url: '/base/core-worker/workerList', url: '/base/core-worker/listAll',
// url: '/base/core-worker/listAll',
}, },
], ],
[ [

View File

@ -244,8 +244,7 @@ export default {
select: true, select: true,
label: '负责人', label: '负责人',
prop: 'responsiblePeopleId', prop: 'responsiblePeopleId',
url: '/base/core-worker/workerList', url: '/base/core-worker/listAll',
// url: '/base/core-worker/listAll',
}, },
], ],
[{ input: true, label: '备注', prop: 'remark' }], [{ input: true, label: '备注', prop: 'remark' }],

View File

@ -120,6 +120,7 @@ import {
createEquipment, createEquipment,
updateEquipment, updateEquipment,
deleteEquipment, deleteEquipment,
getEquipment,
getEquipmentPage, getEquipmentPage,
exportEquipmentExcel, exportEquipmentExcel,
} from '@/api/base/equipment'; } from '@/api/base/equipment';
@ -243,7 +244,7 @@ export default {
select: true, select: true,
label: '负责人', label: '负责人',
prop: 'responsiblePeopleId', prop: 'responsiblePeopleId',
url: '/base/core-worker/workerList', url: '/base/core-worker/listAll',
}, },
], ],
[{ input: true, label: '备注', prop: 'remark' }], [{ input: true, label: '备注', prop: 'remark' }],

View File

@ -164,10 +164,7 @@ export default {
})) }))
); );
} }
const workerlist = await this.$axios( const workerlist = await this.$axios('/base/core-worker/listAll');
// '/base/core-worker/listAll'
'/base/core-worker/workerList'
);
if (workerlist.code == 0) { if (workerlist.code == 0) {
inspectorList = inspectorList.concat( inspectorList = inspectorList.concat(
workerlist.data.map((item) => ({ workerlist.data.map((item) => ({

View File

@ -555,10 +555,7 @@ export default {
})) }))
); );
} }
const workerlist = await this.$axios( const workerlist = await this.$axios('/base/core-worker/listAll');
'/base/core-worker/workerList'
// '/base/core-worker/listAll'
);
if (workerlist.code == 0) { if (workerlist.code == 0) {
inspectorList = inspectorList.concat( inspectorList = inspectorList.concat(
workerlist.data.map((item) => ({ workerlist.data.map((item) => ({

View File

@ -356,8 +356,7 @@ export default {
async getRpList() { async getRpList() {
this.formLoading = true; this.formLoading = true;
const { code, data } = await this.$axios( const { code, data } = await this.$axios(
'/base/core-worker/workerList' '/base/core-worker/listAll'
// '/base/core-worker/listAll'
); );
// debugger; // debugger;
if (code == 0) { if (code == 0) {

View File

@ -182,10 +182,7 @@ export default {
async getRpList() { async getRpList() {
this.formLoading = true; this.formLoading = true;
const { code, data } = await this.$axios( const { code, data } = await this.$axios('/base/core-worker/listAll');
'/base/core-worker/workerList'
// '/base/core-worker/listAll'
);
// debugger; // debugger;
if (code == 0) { if (code == 0) {
this.rpList = data; this.rpList = data;

View File

@ -390,8 +390,7 @@ export default {
const urls = [ const urls = [
'/base/core-production-line/listAll', '/base/core-production-line/listAll',
'/base/core-department/listAll', '/base/core-department/listAll',
'/base/core-worker/workerList', '/base/core-worker/listAll',
// '/base/core-worker/listAll',
]; ];
let res; let res;
switch (source) { switch (source) {

View File

@ -639,8 +639,7 @@ export default {
); );
/** worker */ /** worker */
const workerList = await this.$axios({ const workerList = await this.$axios({
url: '/base/core-worker/workerList', url: '/base/core-worker/listAll',
// url: '/base/core-worker/listAll',
}); });
list = list.concat( list = list.concat(
(workerList.data || []).map((item) => ({ (workerList.data || []).map((item) => ({

View File

@ -326,8 +326,7 @@ export default {
const urls = [ const urls = [
'/base/core-production-line/listAll', '/base/core-production-line/listAll',
'/base/core-department/listAll', '/base/core-department/listAll',
'/base/core-worker/workerList', '/base/core-worker/listAll',
// '/base/core-worker/listAll',
]; ];
let res; let res;
switch (source) { switch (source) {

View File

@ -598,8 +598,7 @@ export default {
const urls = [ const urls = [
'/base/core-production-line/listAll', '/base/core-production-line/listAll',
'/base/core-department/listAll', '/base/core-department/listAll',
'/base/core-worker/workerList', '/base/core-worker/listAll',
// '/base/core-worker/listAll',
]; ];
let res; let res;
switch (source) { switch (source) {