Merge branch 'master' of https://e.coding.net/ctcdevteam/ehs/ehs_web
This commit is contained in:
commit
a9cb7c918b
|
@ -0,0 +1,64 @@
|
|||
import config from "@/config"
|
||||
import http from "@/utils/request"
|
||||
/*公告视频接口*/
|
||||
export default {
|
||||
article: {
|
||||
list: {
|
||||
name: "获取列表",
|
||||
req: async function(data){
|
||||
return await http.get(
|
||||
`${config.API_URL}/cms/article/`,
|
||||
data
|
||||
);
|
||||
}
|
||||
},
|
||||
item: {
|
||||
name: "获取详情",
|
||||
req: async function(id){
|
||||
return await http.get(
|
||||
`${config.API_URL}/cms/article/${id}/`
|
||||
);
|
||||
}
|
||||
},
|
||||
cquery: {
|
||||
name: "复杂查询",
|
||||
req: async function(data){
|
||||
return await http.post(
|
||||
`${config.API_URL}/cms/article/cquery/`,
|
||||
data);
|
||||
}
|
||||
},
|
||||
update: {
|
||||
name: "编辑更新",
|
||||
req: async function(id, data){
|
||||
return await http.put(
|
||||
`${config.API_URL}/cms/article/${id}/`,
|
||||
data);
|
||||
}
|
||||
},
|
||||
create: {
|
||||
name: "新增",
|
||||
req: async function(data){
|
||||
return await http.post(
|
||||
`${config.API_URL}/cms/article/`,
|
||||
data);
|
||||
}
|
||||
},
|
||||
delete: {
|
||||
name: "删除",
|
||||
req: async function(id){
|
||||
return await http.delete(
|
||||
`${config.API_URL}/cms/article/${id}/`);
|
||||
}
|
||||
},
|
||||
toggle_top: {
|
||||
name: "文章置顶/取消",
|
||||
req: async function(id, data){
|
||||
return await http.put(
|
||||
`${config.API_URL}/cms/article/${id}/toggle_top/`,
|
||||
data);
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
}
|
|
@ -27,7 +27,15 @@
|
|||
option: {
|
||||
deep:true,
|
||||
handler (v) {
|
||||
unwarp(this.myChart).setOption(v);
|
||||
let that = this;
|
||||
if(that.myChart!==null){
|
||||
that.myChart.setOption(v);
|
||||
}else{
|
||||
let myChart = echarts.init(that.$refs.scEcharts, 'T');
|
||||
myChart.setOption(v);
|
||||
that.myChart = myChart;
|
||||
}
|
||||
// unwarp(this.myChart).setOption(v);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -92,6 +92,7 @@ export default {
|
|||
tableName: { type: String, default: "" },
|
||||
apiObj: { type: Object, default: () => { } },
|
||||
params: { type: Object, default: () => ({}) },
|
||||
query: { type: Object, default: () => ({}) },
|
||||
data: { type: Object, default: () => { } },
|
||||
height: { type: [String, Number], default: "100%" },
|
||||
size: { type: String, default: "default" },
|
||||
|
@ -123,9 +124,16 @@ export default {
|
|||
this.total = this.tableData.length;
|
||||
},
|
||||
apiObj() {
|
||||
// this.tableParams = this.params;
|
||||
this.tableParams = this.params;
|
||||
this.refresh();
|
||||
},
|
||||
// query 暂时不监听手动调用
|
||||
// query: {
|
||||
// handler() {
|
||||
// this.refresh();
|
||||
// },
|
||||
// deep: true
|
||||
// }
|
||||
},
|
||||
computed: {
|
||||
_height() {
|
||||
|
@ -210,7 +218,7 @@ export default {
|
|||
// delete reqData[config.request.page]
|
||||
// delete reqData[config.request.pageSize]
|
||||
}
|
||||
var c = Object.assign({}, this.tableParams, reqData)
|
||||
var c = Object.assign({}, this.query, this.tableParams, reqData)
|
||||
try {
|
||||
if (this.apiObj) {
|
||||
var res = await this.apiObj.req(c);
|
||||
|
|
|
@ -75,7 +75,7 @@ const props = defineProps({
|
|||
edit: { type: Boolean, default: true },
|
||||
hidePagination: { type: Boolean, default: false },
|
||||
tableWidth: { type: Number, default: 600 },
|
||||
tableHeight: { type: Number, default: 400 },
|
||||
tableHeight: { type: Number, default: 300 },
|
||||
apiObj: { type: Object, default: null },
|
||||
params: { type: Object, default: () => {} },
|
||||
label: { type: [String, Number, Array], default: "" },
|
||||
|
@ -126,7 +126,7 @@ onMounted(() => {
|
|||
selectLabel.value = selectedOption
|
||||
? selectedOption[props.labelField]
|
||||
: "";
|
||||
} else {
|
||||
} else if (props.obj) {
|
||||
selectLabel.value = props.obj[props.labelField];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -142,6 +142,15 @@ const routes = [
|
|||
},
|
||||
component: "home/event",
|
||||
},
|
||||
{
|
||||
name: "articles",
|
||||
path: "/articles",
|
||||
meta: {
|
||||
title: "公告视频",
|
||||
perms: ["articles"],
|
||||
},
|
||||
component: "home/articles",
|
||||
},
|
||||
],
|
||||
},
|
||||
//审批
|
||||
|
@ -3350,6 +3359,17 @@ const routes = [
|
|||
},
|
||||
component: "statistics/statistics_inm.vue",
|
||||
},
|
||||
//返工统计——光芯
|
||||
{
|
||||
path: "/rework_gx",
|
||||
name: "rework_gx",
|
||||
meta: {
|
||||
title: "返工统计",
|
||||
icon: "el-icon-trend-charts",
|
||||
perms: ["rework_gx"],
|
||||
},
|
||||
component: "statistics/rework_gx.vue",
|
||||
},
|
||||
//过程检验统计——光芯
|
||||
{
|
||||
path: "/process_check_gx",
|
||||
|
@ -3372,6 +3392,17 @@ const routes = [
|
|||
},
|
||||
component: "statistics/good_check_gx.vue",
|
||||
},
|
||||
//成品检验记录——光芯
|
||||
{
|
||||
path: "/check_record_gx",
|
||||
name: "check_record_gx",
|
||||
meta: {
|
||||
title: "成品检验记录",
|
||||
icon: "el-icon-trend-charts",
|
||||
perms: ["check_record_gx"],
|
||||
},
|
||||
component: "statistics/check_record_gx.vue",
|
||||
},
|
||||
//扫边车间数据汇总——光芯
|
||||
// {
|
||||
// path: "/statistics_saobian",
|
||||
|
|
|
@ -3,7 +3,7 @@ import ElementPlus from "element-plus";
|
|||
import "element-plus/dist/index.css";
|
||||
import "element-plus/theme-chalk/display.css";
|
||||
import scui from "./scui";
|
||||
import xui from "./xui";
|
||||
import xtui from "./xtui";
|
||||
import i18n from "./locales";
|
||||
import router from "./router";
|
||||
import store from "./store";
|
||||
|
@ -26,7 +26,7 @@ app.use(ElementPlus);
|
|||
app.use(Cesium);
|
||||
app.use(i18n);
|
||||
app.use(scui);
|
||||
app.use(xui);
|
||||
app.use(xtui);
|
||||
app.use(preventReClick);
|
||||
app.use(Print);
|
||||
app.use(Xlsx);
|
||||
|
|
|
@ -173,6 +173,7 @@ tool.dateFormat = function (date, fmt='yyyy-MM-dd hh:mm:ss') {
|
|||
}
|
||||
return fmt;
|
||||
}
|
||||
// YYYY-MM-DD hh:mm:ss
|
||||
tool.dateFormat1 = function (date) {
|
||||
date = new Date(date);
|
||||
let newDate = '';
|
||||
|
@ -190,7 +191,7 @@ tool.dateFormat1 = function (date) {
|
|||
newDate = year+'-'+month+'-'+day+' '+hour+':'+minute+':'+second;
|
||||
return newDate;
|
||||
}
|
||||
// 格式化某一天
|
||||
// YYYY-MM-DD 格式化某一天
|
||||
tool.dateFormat2 = function (date) {
|
||||
date = new Date(date);
|
||||
let newDate = '';
|
||||
|
@ -203,7 +204,7 @@ tool.dateFormat2 = function (date) {
|
|||
return newDate;
|
||||
}
|
||||
// 格式化某一月
|
||||
tool.dateFormat2 = function (date) {
|
||||
tool.monthFormat = function (date) {
|
||||
date = new Date(date);
|
||||
let first = '';
|
||||
let lastDate = '',year2 = '',month2 = '';
|
||||
|
|
|
@ -91,7 +91,8 @@ export default {
|
|||
mounted(){
|
||||
let that = this;
|
||||
let host = window.location.host;
|
||||
let jsUrl = host.indexOf('localhost')>-1?'http://222.222.144.147:6013/jsmap/jsmap.js':host+'/jsmap/jsmap.js';
|
||||
let jsUrl = host.indexOf('localhost')>-1?'http://222.222.144.147:6013/jsmap/jsmap.js':window.location.protocol + "//" + host+'/jsmap/jsmap.js';
|
||||
console.log(jsUrl)
|
||||
that.loadScript('mapId',jsUrl, () => {
|
||||
that.canUseMap = true;
|
||||
})
|
||||
|
|
|
@ -154,7 +154,7 @@ export default {
|
|||
this.getArea();
|
||||
let that = this;
|
||||
let host = window.location.host;
|
||||
let jsUrl = host.indexOf('localhost') > -1 ? 'http://222.222.144.147:6013/jsmap/jsmap.js' : host + '/jsmap/jsmap.js';
|
||||
let jsUrl = host.indexOf('localhost') > -1 ? 'http://222.222.144.147:6013/jsmap/jsmap.js' : window.location.protocol + "//" + host+'/jsmap/jsmap.js';
|
||||
that.loadScript('mapId', jsUrl, () => {
|
||||
that.canUseMap = true;
|
||||
})
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -17,6 +17,16 @@
|
|||
<el-option v-for="item in stateOptions" :key="item.value" :label="item.label" :value="item.value"
|
||||
@change="handleQuery"></el-option>
|
||||
</el-select> -->
|
||||
<el-select
|
||||
v-model="query.is_deleted"
|
||||
placeholder="筛选"
|
||||
@change="handleQuery"
|
||||
clearable
|
||||
style="margin-left: 2px"
|
||||
>
|
||||
<el-option label="在用" :value="false"></el-option>
|
||||
<el-option label="已删" :value="true"></el-option>
|
||||
</el-select>
|
||||
<el-input v-model="query.search" placeholder="设备名称/编号" clearable style="width:200px"></el-input>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
|
||||
</div>
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
<el-input v-model="form.model" placeholder="规格型号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-col :md="8" :sm="24">
|
||||
<el-form-item label="设备状态">
|
||||
<el-select style="width: 100%" v-model="form.state" placeholder="请选择">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
|
||||
|
@ -61,13 +61,18 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-col :md="8" :sm="24">
|
||||
<el-form-item label="设备分类">
|
||||
<el-select v-model="form.cate" placeholder="所属大类" clearable style="width: 100%">
|
||||
<el-option v-for="item in cateOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="8" :sm="24">
|
||||
<el-form-item label="是否删除">
|
||||
<el-switch v-model="form.is_deleted" style="--el-switch-on-color: #FF0000;"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider v-if="form.type == 50"/>
|
||||
<el-row v-if="form.type == 50">
|
||||
|
|
|
@ -17,6 +17,16 @@
|
|||
<el-option v-for="item in stateOptions" :key="item.value" :label="item.label" :value="item.value"
|
||||
@change="handleQuery"></el-option>
|
||||
</el-select> -->
|
||||
<el-select
|
||||
v-model="query.is_deleted"
|
||||
placeholder="筛选"
|
||||
@change="handleQuery"
|
||||
clearable
|
||||
style="margin-left: 2px"
|
||||
>
|
||||
<el-option label="在用" :value="false"></el-option>
|
||||
<el-option label="已删" :value="true"></el-option>
|
||||
</el-select>
|
||||
<el-input v-model="query.search" placeholder="设备名称/编号" clearable style="width:200px"></el-input>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
|
||||
</div>
|
||||
|
|
|
@ -17,6 +17,16 @@
|
|||
<el-option v-for="item in stateOptions" :key="item.value" :label="item.label" :value="item.value"
|
||||
@change="handleQuery"></el-option>
|
||||
</el-select> -->
|
||||
<el-select
|
||||
v-model="query.is_deleted"
|
||||
placeholder="筛选"
|
||||
@change="handleQuery"
|
||||
clearable
|
||||
style="margin-left: 2px"
|
||||
>
|
||||
<el-option label="在用" :value="false"></el-option>
|
||||
<el-option label="已删" :value="true"></el-option>
|
||||
</el-select>
|
||||
<el-input v-model="query.search" placeholder="设备名称/编号" clearable style="width:200px"></el-input>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
|
||||
</div>
|
||||
|
|
|
@ -5,7 +5,17 @@
|
|||
<el-button type="primary" icon="el-icon-plus" @click="add" v-auth="'equipment.create'">新增</el-button>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<el-input v-model="query.search" placeholder="名称" clearable style="margin-right: 5px;"></el-input>
|
||||
<el-select
|
||||
v-model="query.is_deleted"
|
||||
placeholder="筛选"
|
||||
@change="handleQuery"
|
||||
clearable
|
||||
style="margin-left: 2px"
|
||||
>
|
||||
<el-option label="在用" :value="false"></el-option>
|
||||
<el-option label="已删" :value="true"></el-option>
|
||||
</el-select>
|
||||
<el-input v-model="query.search" placeholder="设备名称/编号" clearable style="margin-right: 5px;"></el-input>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
|
||||
</div>
|
||||
</el-header>
|
||||
|
|
|
@ -17,6 +17,16 @@
|
|||
<el-option v-for="item in stateOptions" :key="item.value" :label="item.label" :value="item.value"
|
||||
@change="handleQuery"></el-option>
|
||||
</el-select> -->
|
||||
<el-select
|
||||
v-model="query.is_deleted"
|
||||
placeholder="筛选"
|
||||
@change="handleQuery"
|
||||
clearable
|
||||
style="margin-left: 2px"
|
||||
>
|
||||
<el-option label="在用" :value="false"></el-option>
|
||||
<el-option label="已删" :value="true"></el-option>
|
||||
</el-select>
|
||||
<el-input v-model="query.search" placeholder="设备名称/编号" clearable style="width:200px"></el-input>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,269 @@
|
|||
<template>
|
||||
<el-container>
|
||||
<el-header>
|
||||
<div class="left-panel">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="add"
|
||||
v-auth="'material.create'"
|
||||
>新增</el-button
|
||||
>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
placeholder="名称"
|
||||
clearable
|
||||
></el-input>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="handleQuery"
|
||||
></el-button>
|
||||
</div>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<scTable
|
||||
ref="table"
|
||||
:apiObj="apiObj"
|
||||
row-key="id"
|
||||
stripe
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="名称" prop="title" min-width="60">
|
||||
</el-table-column>
|
||||
<el-table-column label="内容" prop="content" min-width="120">
|
||||
</el-table-column>
|
||||
<el-table-column label="图片" prop="poster" min-width="60">
|
||||
</el-table-column>
|
||||
<el-table-column label="地址" prop="video" min-width="60">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
fixed="right"
|
||||
align="center"
|
||||
width="120"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-link type="success" @click="toggle_top(scope.row)">
|
||||
置顶
|
||||
</el-link>
|
||||
<!-- <el-divider direction="vertical" /> -->
|
||||
<el-link type="primary" @click="table_edit(scope.row)" style="margin: 0 5px;">
|
||||
编辑
|
||||
</el-link>
|
||||
<el-link type="danger" @click="table_del(scope.row)">
|
||||
删除
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
<el-dialog
|
||||
title="新增"
|
||||
width="600px"
|
||||
v-model="saveDialog"
|
||||
>
|
||||
<el-form :model="form" label-width="80px" :rules="rules" ref="dialogForm">
|
||||
<el-row>
|
||||
<el-col>
|
||||
<el-form-item label="类型">
|
||||
<el-select
|
||||
v-model="addType"
|
||||
placeholder="类型"
|
||||
style="width: 100%"
|
||||
:disabled="showType =='edit' "
|
||||
>
|
||||
<el-option label="公告" :value="'articles'"></el-option>
|
||||
<el-option label="视频" :value="'video'"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col>
|
||||
<el-form-item label="名称" prop="title">
|
||||
<el-input v-model="form.title" placeholder="请输入名称" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-if="addType == 'articles'">
|
||||
<el-form-item label="公告内容">
|
||||
<el-input type="textarea" :rows="3" v-model="form.content" placeholder="公告内容" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-if="addType == 'articles'">
|
||||
<el-form-item label="公告照片">
|
||||
<sc-upload v-model="form.poster" :modelValue="form.poster" title="公告照片"></sc-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-if="addType == 'video'">
|
||||
<el-form-item label="视频文件">
|
||||
<sc-upload-file
|
||||
v-model="form.video"
|
||||
:multiple="false"
|
||||
:limit="1"
|
||||
>
|
||||
<el-button type="primary" icon="el-icon-upload">上传</el-button>
|
||||
</sc-upload-file>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="saveDialog = false">取消</el-button>
|
||||
<el-button type="primary" :loading="isSaveing" @click="confirm()">确定</el-button >
|
||||
</template>
|
||||
</el-dialog>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ElLoading } from "element-plus";
|
||||
const defaultForm = {
|
||||
id: "",
|
||||
title: "",
|
||||
content: "",
|
||||
video: "",
|
||||
poster: ""
|
||||
}
|
||||
export default {
|
||||
name: "articles",
|
||||
data() {
|
||||
return {
|
||||
showType:'add',
|
||||
form:defaultForm,
|
||||
saveDialog: false,
|
||||
apiObj: this.$API.cms.article.list,
|
||||
addType:'articles',
|
||||
materialId: "",
|
||||
materialName: "",
|
||||
showHidden: false,
|
||||
query:{
|
||||
search: "",
|
||||
},
|
||||
rules:{
|
||||
title: [{required: true,message: "请输入名称",trigger: "blur"}]
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
rowClick(row) {
|
||||
console.log("rowClick", row);
|
||||
this.materialId = row.id;
|
||||
this.materialName = row.full_name;
|
||||
this.$emit("choseChange", row.id);
|
||||
},
|
||||
//添加
|
||||
add() {
|
||||
this.saveDialog = true;
|
||||
this.showType = "add";
|
||||
this.addType = "articles";
|
||||
this.form = Object.assign({}, defaultForm);
|
||||
},
|
||||
//编辑
|
||||
table_edit(row) {
|
||||
this.form = Object.assign({}, row);
|
||||
if(this.form.video!==''){
|
||||
this.addType = "video";
|
||||
}else{
|
||||
this.addType = "articles";
|
||||
}
|
||||
this.saveDialog = true;
|
||||
this.showType = "edit";
|
||||
},
|
||||
toggle_top(row) {
|
||||
let that = this;
|
||||
that.$API.cms.article.toggle_top.req(row.id).then((res) => {
|
||||
that.$message.success("操作成功");
|
||||
that.$refs.table.refresh();
|
||||
}).catch((err) => {
|
||||
});
|
||||
},
|
||||
//删除
|
||||
async table_del(row) {
|
||||
let that = this;
|
||||
that.$confirm(`确定删除吗?`, "提示", {
|
||||
type: "warning",
|
||||
}).then(() => {
|
||||
that.$API.cms.article.delete.req(row.id).then((res) => {
|
||||
that.$message.success("删除成功");
|
||||
that.$refs.table.refresh();
|
||||
return res;
|
||||
}).catch((err) => {
|
||||
return err;
|
||||
});
|
||||
}).catch(() => {});
|
||||
},
|
||||
confirm(){
|
||||
let that = this;
|
||||
that.$refs.dialogForm.validate((valid) => {
|
||||
if (valid) {
|
||||
that.isSaveing = true;
|
||||
if(that.showType == 'add'){
|
||||
that.$API.cms.article.create.req(that.form).then((res) => {
|
||||
that.$message.success("操作成功");
|
||||
that.$refs.table.refresh();
|
||||
that.saveDialog = false;
|
||||
that.isSaveing = false;
|
||||
}).catch((err) => {
|
||||
that.isSaveing = false;
|
||||
return err;
|
||||
});
|
||||
}else{
|
||||
that.$API.cms.article.update.req(that.form.id,that.form).then((res) => {
|
||||
that.$message.success("操作成功");
|
||||
that.$refs.table.refresh();
|
||||
that.saveDialog = false;
|
||||
that.isSaveing = false;
|
||||
}).catch((err) => {
|
||||
that.isSaveing = false;
|
||||
return err;
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
//本地更新数据
|
||||
handleSaveSuccess(data, mode) {
|
||||
if (mode == "add") {
|
||||
this.$refs.table.refresh();
|
||||
} else if (mode == "edit") {
|
||||
this.$refs.table.refresh();
|
||||
}
|
||||
},
|
||||
handleQuery() {
|
||||
this.$refs.table.queryData(this.query);
|
||||
},
|
||||
resetQuery() {
|
||||
this.query = {};
|
||||
},
|
||||
upSuccess(res, close) {
|
||||
close();
|
||||
const loading = ElLoading.service({
|
||||
fullscreen: true,
|
||||
text: "解析中...请稍等",
|
||||
});
|
||||
this.$API.mtm.material.daoru
|
||||
.req({ path: res.path })
|
||||
.then((res) => {
|
||||
loading.close();
|
||||
this.$message.success("导入成功");
|
||||
this.$refs.table.queryData(this.query);
|
||||
})
|
||||
.catch((err) => {
|
||||
loading.close();
|
||||
});
|
||||
},
|
||||
hiddenChange(val) {
|
||||
if (val) {
|
||||
this.query.is_hidden = "";
|
||||
} else {
|
||||
this.query.is_hidden = false;
|
||||
}
|
||||
this.$refs.table.queryData(this.query);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
|
@ -38,6 +38,7 @@
|
|||
<el-table-column label="物料名" prop="material_name" show-overflow-tooltip> </el-table-column>
|
||||
<el-table-column label="总数" prop="count"> </el-table-column>
|
||||
<el-table-column label="抽检数" prop="count_sampling"> </el-table-column>
|
||||
<el-table-column label="抽检合格数" prop="count_sampling_ok"> </el-table-column>
|
||||
<el-table-column label="合格数" prop="count_ok"> </el-table-column>
|
||||
<el-table-column label="不合格数" prop="count_notok"> </el-table-column>
|
||||
<el-table-column label="操作" fixed="right" width="150">
|
||||
|
@ -86,7 +87,7 @@
|
|||
v-if="dialog.check"
|
||||
:materialCate="materialCate"
|
||||
:ftestWork="ftestWork"
|
||||
@closed="dialog.check = false"
|
||||
@closed="handleCheckClose"
|
||||
>
|
||||
</check-dialog>
|
||||
</el-container>
|
||||
|
@ -169,6 +170,10 @@ export default {
|
|||
handleQuery() {
|
||||
this.$refs.table.queryData(this.query);
|
||||
},
|
||||
handleCheckClose() {
|
||||
this.dialog.check = false;
|
||||
this.$refs.table.refresh();
|
||||
},
|
||||
resetQuery() {
|
||||
this.query = {};
|
||||
},
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
workObj.count_sampling
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="配棒管批次号" v-if=" workObj.mb_&&workObj.mb_.assemb">
|
||||
<span v-for="item in workObj.mb_.assemb" :key="item.id">{{item.batch}}、</span>
|
||||
<span v-for="item in workObj.mb_.assemb" :key="item.id">{{item.batch}}; </span>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-button
|
||||
|
@ -87,7 +87,7 @@
|
|||
</el-input-number>
|
||||
</template>
|
||||
<!-- 整数 -->
|
||||
<template v-else-if="ftestitems[$index].field_type == 'input_int'" #default="scope">
|
||||
<template v-else-if="ftestitems[$index].field_type == 'input-int'" #default="scope">
|
||||
<el-input-number
|
||||
v-model="scope.row.ftestitems[$index].test_val_json"
|
||||
:precision="0"
|
||||
|
@ -99,7 +99,7 @@
|
|||
</el-input-number>
|
||||
</template>
|
||||
<!-- 文本 -->
|
||||
<template v-else-if="ftestitems[$index].field_type == 'input_text'" #default="scope">
|
||||
<template v-else-if="ftestitems[$index].field_type == 'input-text'" #default="scope">
|
||||
<el-input
|
||||
v-model="scope.row.ftestitems[$index].test_val_json"
|
||||
:disabled="!scope.row.isEdit"
|
||||
|
@ -107,7 +107,7 @@
|
|||
</el-input>
|
||||
</template>
|
||||
<!-- 单选 -->
|
||||
<template v-else-if="ftestitems[$index].field_type == 'select'" #default="scope">
|
||||
<template v-else-if="ftestitems[$index].field_type == 'select-text'" #default="scope">
|
||||
<el-select
|
||||
v-model="scope.row.ftestitems[$index].test_val_json"
|
||||
clearable
|
||||
|
@ -124,7 +124,7 @@
|
|||
</el-select>
|
||||
</template>
|
||||
<!-- 多选 -->
|
||||
<template v-else-if="ftestitems[$index].field_type == 'selects'" #default="scope">
|
||||
<template v-else-if="ftestitems[$index].field_type == 'selects-text'" #default="scope">
|
||||
<el-select
|
||||
v-model="scope.row.ftestitems[$index].test_val_json"
|
||||
clearable
|
||||
|
@ -164,24 +164,20 @@
|
|||
<el-table-column
|
||||
prop="test_user"
|
||||
label="检验人"
|
||||
width="120"
|
||||
width="160"
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-select
|
||||
<xtSelect
|
||||
:apiObj="apiUserObj"
|
||||
:params="apiUserParams"
|
||||
v-model="scope.row.test_user"
|
||||
placeholder="检验人"
|
||||
clearable
|
||||
filterable
|
||||
:disabled="!scope.row.isEdit"
|
||||
v-model:label="scope.row.test_user_name"
|
||||
:edit="scope.row.isEdit"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in userList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
<el-table-column label="账号" prop="username"></el-table-column>
|
||||
<el-table-column label="名称" prop="name"></el-table-column>
|
||||
</xtSelect>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="val" label="备注">
|
||||
|
@ -215,7 +211,7 @@
|
|||
>
|
||||
<el-link
|
||||
type="danger"
|
||||
@click="delCheck(scope.row.id)"
|
||||
@click="delCheck(scope.row, scope.$index)"
|
||||
style="margin-left: 2px"
|
||||
>删除</el-link
|
||||
>
|
||||
|
@ -266,6 +262,8 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
apiUserObj: this.$API.system.user.list,
|
||||
apiUserParams: {posts__code__contains: "check"},
|
||||
addTemplate: {
|
||||
ftestitems: [{ test_val_json: "", check_val: "", testitem: "" ,choices:[],field_type:'',name:''}],
|
||||
test_date: "", //work获取
|
||||
|
@ -306,7 +304,6 @@ export default {
|
|||
|
||||
let tags = that.materialCate;
|
||||
that.getTestItem(tags, that.ftestWork);
|
||||
that.getUserList(that.ftestWork);
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
|
@ -335,15 +332,6 @@ export default {
|
|||
|
||||
});
|
||||
},
|
||||
//获取员工
|
||||
getUserList() {
|
||||
let that = this;
|
||||
this.$API.system.user.list
|
||||
.req({ page: 0, posts__code__contains: "check" })
|
||||
.then((res) => {
|
||||
that.userList = res;
|
||||
});
|
||||
},
|
||||
table_edit(row) {
|
||||
this.dialog.worksave = true;
|
||||
this.$nextTick(() => {
|
||||
|
@ -381,17 +369,22 @@ export default {
|
|||
});
|
||||
},
|
||||
//删除
|
||||
delCheck(id) {
|
||||
delCheck(row, index) {
|
||||
if (row.id == undefined) {
|
||||
this.formTableData.splice(index, 1);
|
||||
return
|
||||
}
|
||||
let that = this;
|
||||
that.$confirm(`确定删除吗?`, "提示", {
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
that.$API.qm.ftest.delete
|
||||
.req(id)
|
||||
.req(row.id)
|
||||
.then((res) => {
|
||||
that.$message.success("删除成功");
|
||||
that.getCheckList(that.ftestWork);
|
||||
this.getFtestWork();
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
|
@ -400,9 +393,14 @@ export default {
|
|||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
getFtestWork() {
|
||||
let that = this;
|
||||
that.$API.qm.ftestwork.item.req(that.ftestWork).then((res) => {
|
||||
that.workObj = res;
|
||||
});
|
||||
},
|
||||
saveCheck(row) {
|
||||
let that = this;
|
||||
console.log(row);
|
||||
let index = this.formTableData.findIndex(
|
||||
(item) => item.id == row.id
|
||||
);
|
||||
|
@ -413,6 +411,7 @@ export default {
|
|||
.then((res) => {
|
||||
that.formTableData[index].isEdit = false;
|
||||
that.$message.success("操作成功");
|
||||
this.getFtestWork();
|
||||
})
|
||||
.catch((err) => {
|
||||
return err;
|
||||
|
@ -424,6 +423,7 @@ export default {
|
|||
that.formTableData[index].isEdit = false;
|
||||
that.$message.success("操作成功");
|
||||
that.getCheckList(that.ftestWork);
|
||||
this.getFtestWork();
|
||||
})
|
||||
.catch((err) => {
|
||||
return err;
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
clearable
|
||||
style="width: 100%"
|
||||
@change="handleChange"
|
||||
disabled="mode != 'add'"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
|
@ -52,16 +53,7 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="抽检数量">
|
||||
<el-input-number
|
||||
controls-position="right"
|
||||
v-model="form.count_sampling"
|
||||
style="width: 100%"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-col :md="12" :sm="24" v-if="form.type2 == 10">
|
||||
<el-form-item label="合格数量">
|
||||
<el-input-number
|
||||
controls-position="right"
|
||||
|
@ -71,7 +63,7 @@
|
|||
></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-col :md="12" :sm="24" v-if="form.type2 == 10">
|
||||
<el-form-item label="不合格数量">
|
||||
<el-input-number
|
||||
controls-position="right"
|
||||
|
@ -83,20 +75,15 @@
|
|||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="检验人" prop="test_user">
|
||||
<el-select
|
||||
<xtSelect
|
||||
:apiObj="apiUserObj"
|
||||
v-model="form.test_user"
|
||||
placeholder="检验人"
|
||||
clearable
|
||||
filterable
|
||||
v-model:label="form.test_user_name"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in userList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
<el-table-column label="账号" prop="username"></el-table-column>
|
||||
<el-table-column label="名称" prop="name"></el-table-column>
|
||||
</xtSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -116,6 +103,7 @@ export default {
|
|||
emits: ["success", "closed"],
|
||||
data() {
|
||||
return {
|
||||
apiUserObj: this.$API.system.user.list,
|
||||
loading: false,
|
||||
form: {
|
||||
type:'prod',
|
||||
|
|
|
@ -127,6 +127,32 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="检验设备">
|
||||
<el-select
|
||||
v-model="form.equipment"
|
||||
placeholder="检验设备"
|
||||
clearable
|
||||
filterable
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in eqOptions"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.id"
|
||||
>
|
||||
<span style="float:left">{{item.name}}</span>
|
||||
<span style="float:right">{{item.number}}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.note" placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider style="margin-top:0"></el-divider>
|
||||
<el-row v-if="mode=='sizeAdd'||mode=='sizeEdit'||mode=='sizeShow'">
|
||||
|
@ -482,6 +508,7 @@ export default {
|
|||
visible: false,
|
||||
isSaveing: false,
|
||||
options: [],
|
||||
eqOptions: [],
|
||||
userList:[],
|
||||
shiftOtions:[],
|
||||
selectionFilters: [],
|
||||
|
@ -491,6 +518,7 @@ export default {
|
|||
mounted() {
|
||||
this.getUsers();
|
||||
this.getShift();
|
||||
this.geteEqOptions();
|
||||
},
|
||||
methods: {
|
||||
//显示
|
||||
|
@ -515,6 +543,12 @@ export default {
|
|||
that.userList = res;
|
||||
});
|
||||
},
|
||||
geteEqOptions(){
|
||||
let that = this;
|
||||
that.$API.system.user.list.req({ page: 0, type:20 }).then((res) => {
|
||||
that.eqOptions = res;
|
||||
});
|
||||
},
|
||||
handleCheckChange(){
|
||||
this.form.count_ok = this.form.count-this.form.count_notok;
|
||||
},
|
||||
|
|
|
@ -0,0 +1,248 @@
|
|||
<template>
|
||||
<el-container>
|
||||
<el-header>
|
||||
<div class="right-panel">
|
||||
<!-- 检验类型 -->
|
||||
<el-select
|
||||
v-model="query.process_name"
|
||||
placeholder="检验类型"
|
||||
@change="handleQuery">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.name"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-input
|
||||
v-model="query.batch"
|
||||
placeholder="批次号"
|
||||
clearable
|
||||
style="width: 150px"
|
||||
></el-input>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="handleQuery"
|
||||
></el-button>
|
||||
</div>
|
||||
<el-button @click="handleExport" type="primary">导出</el-button>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<scTable
|
||||
ref="table"
|
||||
:apiObj="apiObj"
|
||||
row-key="id"
|
||||
:query="query"
|
||||
id="exportDiv"
|
||||
stripe
|
||||
hideDo
|
||||
hidePagination
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="物料名" prop="material_name"></el-table-column>
|
||||
<el-table-column label="检验类型" width="80">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.type2 == 20" type="success">全检</el-tag>
|
||||
<el-tag v-else-if="scope.row.type2 == 10" type="primary">抽检</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="批次号" prop="batch"></el-table-column>
|
||||
<el-table-column label="检验日期" prop="test_date"></el-table-column>
|
||||
<el-table-column label="检验数">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.type2 == 10">{{ scope.row.count_sampling }}</span>
|
||||
<span v-else>{{ scope.row.count }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合格数">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.type2 == 10">{{ scope.row.count_sampling_ok }}</span>
|
||||
<span v-else>{{ scope.row.count_ok }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="B类合格" align="center" v-if="query.process_name == '一次超洗'">
|
||||
<el-table-column label="准合格" prop="count_n_zhg"></el-table-column>
|
||||
<el-table-column label="圆度准合格" prop="count_n_yz"></el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="B类合格" align="center" v-else>
|
||||
<el-table-column label="浅水纹" prop="count_n_qsw"></el-table-column>
|
||||
<el-table-column label="小崩边" prop="count_n_xbb"></el-table-column>
|
||||
<el-table-column label="浅划麻" prop="count_n_qhm"></el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="不合格数" align="center" v-if="query.process_name == '一次超洗'">
|
||||
<el-table-column label="黑圈内径">
|
||||
<template #default="scope">
|
||||
{{ scope.row.count_notok_json.count_n_hqnj }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="黑圈内径圆度">
|
||||
<template #default="scope">
|
||||
{{ scope.row.count_notok_json.count_n_hqnjyd }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="黑圈外径">
|
||||
<template #default="scope">
|
||||
{{ scope.row.count_notok_json.count_n_hqwj }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="黑圈外径圆度">
|
||||
<template #default="scope">
|
||||
{{ scope.row.count_notok_json.count_n_hqwjyd }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="产品外径">
|
||||
<template #default="scope">
|
||||
{{ scope.row.count_notok_json.count_n_wj }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="产品圆度">
|
||||
<template #default="scope">
|
||||
{{ scope.row.count_notok_json.count_n_yd }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="产品同心度">
|
||||
<template #default="scope">
|
||||
{{ scope.row.count_notok_json.count_n_txd }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="厚度">
|
||||
<template #default="scope">
|
||||
{{ scope.row.count_notok_json.count_n_hd }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="其他">
|
||||
<template #default="scope">
|
||||
{{ scope.row.count_notok_json.count_n_qt }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合计" prop="count_notok"></el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="不合格数" align="center" v-else>
|
||||
<el-table-column label="返修">
|
||||
<template #default="scope">
|
||||
{{ scope.row.count_notok_json.count_n_fx }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="脏">
|
||||
<template #default="scope">
|
||||
{{ scope.row.count_notok_json.count_n_z }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="气泡">
|
||||
<template #default="scope">
|
||||
{{ scope.row.count_notok_json.count_n_qp }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="黑圈变形">
|
||||
<template #default="scope">
|
||||
{{ scope.row.count_notok_json.count_n_hqbx }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="双面划麻">
|
||||
<template #default="scope">
|
||||
{{ scope.row.count_notok_json.count_n_md }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="重水纹">
|
||||
<template #default="scope">
|
||||
{{ scope.row.count_notok_json.count_n_swen }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="棕边/点">
|
||||
<template #default="scope">
|
||||
{{ scope.row.count_notok_json.count_n_zb }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="倒角">
|
||||
<template #default="scope">
|
||||
{{ scope.row.count_notok_json.count_n_dj }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="大崩">
|
||||
<template #default="scope">
|
||||
{{ scope.row.count_notok_json.count_n_bb }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="棕圈">
|
||||
<template #default="scope">
|
||||
{{ scope.row.count_notok_json.count_n_zq }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="蓝圈">
|
||||
<template #default="scope">
|
||||
{{ scope.row.count_notok_json.count_n_lq }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="破损">
|
||||
<template #default="scope">
|
||||
{{ scope.row.count_notok_json.count_n_ps }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="漏光">
|
||||
<template #default="scope">
|
||||
{{ scope.row.count_notok_json.count_n_lg }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="尺寸小">
|
||||
<template #default="scope">
|
||||
{{ scope.row.count_notok_json.count_n_ccx }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="其他">
|
||||
<template #default="scope">
|
||||
{{ scope.row.count_notok_json.count_n_qt }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="合计" prop="count_notok"></el-table-column>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "chart",
|
||||
|
||||
data() {
|
||||
return {
|
||||
query:{
|
||||
process_name:'一次超洗',
|
||||
},
|
||||
currentDate: "",
|
||||
tableData: [],
|
||||
options:[
|
||||
{name:'外观',value:'一次超洗'},
|
||||
{name:'尺寸',value:'二次超洗'}
|
||||
],
|
||||
userOptions:[],
|
||||
shiftOptions:[],
|
||||
apiObj : this.$API.qm.ftestwork.list
|
||||
};
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
// processChange(){
|
||||
// this.$refs.table.queryData(this.query);
|
||||
// },
|
||||
handleQuery() {
|
||||
this.$refs.table.queryData(this.query);
|
||||
},
|
||||
handleExport() {
|
||||
this.exportLoading = true;
|
||||
this.$XLSX("#exportDiv", "成品检验统计");
|
||||
this.exportLoading = false;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.tables {
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
right: 6px;
|
||||
z-index: 10;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,148 @@
|
|||
<template>
|
||||
<el-container>
|
||||
<el-header>
|
||||
<div class="right-panel">
|
||||
<el-select
|
||||
v-model="query.mgroup"
|
||||
placeholder="工段"
|
||||
@change="handleQuery">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-date-picker
|
||||
v-model="query.handle_date"
|
||||
type="date"
|
||||
placeholder="处理日期"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 160px"
|
||||
>
|
||||
</el-date-picker>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="handleQuery"
|
||||
></el-button>
|
||||
</div>
|
||||
<el-button @click="handleExport" type="primary">导出</el-button>
|
||||
</el-header>
|
||||
<el-main class="nopadding">
|
||||
<scTable
|
||||
ref="table"
|
||||
:apiObj="apiObj"
|
||||
row-key="id"
|
||||
:params="params"
|
||||
:query="query"
|
||||
>
|
||||
<el-table-column
|
||||
label="#"
|
||||
type="index"
|
||||
width="50"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="工艺路线"
|
||||
prop="material_out_name"
|
||||
min-width="130"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="生产设备"
|
||||
prop="equipment_name"
|
||||
min-width="150"
|
||||
></el-table-column>
|
||||
<el-table-column label="进度" prop="belong_dept_name" v-if="mgroupName=='黑化'||mgroupName=='退火'">
|
||||
<template #default="scope">
|
||||
<el-progress id="progressbwlq" :percentage="customMethod(scope.row,1)" :stroke-width="20" :color="customMethod(scope.row,2)" :text-inside="true"><span>{{customMethod(scope.row,3)}}</span></el-progress>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="部门/工段"
|
||||
prop="belong_dept_name"
|
||||
>
|
||||
<template #default="scope">
|
||||
{{scope.row.belong_dept_name}}/{{scope.row.mgroup_name}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="处理人"
|
||||
prop="handle_user_name"
|
||||
width="80"
|
||||
></el-table-column>
|
||||
<el-table-column label="保温剩余时间" v-if="mgroupName=='黑化'||mgroupName=='退火'">
|
||||
<template #default="scope">
|
||||
{{ getRemaTime(scope.row) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="开始时间"
|
||||
prop="work_start_time"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="结束时间"
|
||||
prop="work_end_time"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="提交时间"
|
||||
prop="submit_time"
|
||||
></el-table-column>
|
||||
</scTable>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "chart",
|
||||
|
||||
data() {
|
||||
return {
|
||||
params:{
|
||||
wm_in_state:30,
|
||||
mlog_submit_time_isnull:0,
|
||||
},
|
||||
query:{
|
||||
mgroup:'',
|
||||
handle_date:'',
|
||||
},
|
||||
currentDate: "",
|
||||
tableData: [],
|
||||
options:[],
|
||||
apiObj : this.$API.wpm.mlog.list
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getMgroupOptions();
|
||||
},
|
||||
methods: {
|
||||
getMgroupOptions(){
|
||||
let that = this;
|
||||
that.$API.mtm.mgroup.list.req({page:0}).then(res=>{
|
||||
that.options = res;
|
||||
})
|
||||
},
|
||||
// processChange(){
|
||||
// this.$refs.table.queryData(this.query);
|
||||
// },
|
||||
handleQuery() {
|
||||
this.$refs.table.queryData(this.query);
|
||||
},
|
||||
handleExport() {
|
||||
this.exportLoading = true;
|
||||
this.$XLSX("#exportDiv", "成品检验统计");
|
||||
this.exportLoading = false;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.tables {
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
right: 6px;
|
||||
z-index: 10;
|
||||
}
|
||||
</style>
|
|
@ -55,9 +55,8 @@
|
|||
clearable
|
||||
style="margin-left: 2px"
|
||||
>
|
||||
<el-option label="全部" value=""></el-option>
|
||||
<el-option label="在用" :value="deletedIs"></el-option>
|
||||
<el-option label="已删" :value="isDeleted"></el-option>
|
||||
<el-option label="在用" :value="false"></el-option>
|
||||
<el-option label="已删" :value="true"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="right-panel">
|
||||
|
@ -227,7 +226,7 @@
|
|||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否删除">
|
||||
<el-switch active-color="#f56c6c" v-model="addForm.is_deleted" />
|
||||
<el-switch v-model="addForm.is_deleted" style="--el-switch-on-color: #FF0000;"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
|
|
|
@ -399,7 +399,7 @@
|
|||
:loading="mlogHandleLoading"
|
||||
>撤回
|
||||
</el-button>
|
||||
<el-button
|
||||
<!-- <el-button
|
||||
link
|
||||
type="success"
|
||||
@click="
|
||||
|
@ -407,7 +407,7 @@
|
|||
"
|
||||
>
|
||||
日志记录
|
||||
</el-button>
|
||||
</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
|
|
|
@ -223,13 +223,13 @@
|
|||
:loading="mlogHandleLoading"
|
||||
>撤回
|
||||
</el-button>
|
||||
<el-button
|
||||
<!-- <el-button
|
||||
link
|
||||
type="success"
|
||||
@click="table_show(scope.row)"
|
||||
>
|
||||
日志记录
|
||||
</el-button>
|
||||
</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
|
|
|
@ -369,7 +369,7 @@
|
|||
:loading="mlogHandleLoading"
|
||||
>撤回
|
||||
</el-button>
|
||||
<el-button
|
||||
<!-- <el-button
|
||||
link
|
||||
type="success"
|
||||
@click="
|
||||
|
@ -377,7 +377,7 @@
|
|||
"
|
||||
>
|
||||
日志记录
|
||||
</el-button>
|
||||
</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
|
|
|
@ -10,17 +10,28 @@
|
|||
style="width: 850px;padding-left:10px; height: 50px;background-color: rgb(204,51,0);color:white;font-size: 30px;line-height: 50px">
|
||||
(when low carbon cement technology breakthroughs)
|
||||
</div>
|
||||
<!-- 柱状图 -->
|
||||
|
||||
<div id="main" style="width: 1200px; height: 600px;border: 4px solid rgb(204,51,0)"></div>
|
||||
<!-- 折线图 155 / 205-->
|
||||
<div id="mains" style="width: 1200px;height: 600px;position: absolute;top: 205px;"></div>
|
||||
</div>
|
||||
|
||||
<div id="mains" style="width: 1200px;height: 600px;position: absolute;top: 205px;"></div>
|
||||
<div id="main1" style="width: 1200px;height: 600px;position: absolute;top: 205px;"></div>
|
||||
<div id="main2" style="width: 1200px;height: 600px;position: absolute;top: 205px;"></div>
|
||||
</div>
|
||||
<div style="position: relative;">
|
||||
<div id="title"
|
||||
style="width: 600px;padding-left:10px; height: 50px;background-color: rgb(204,51,0);color:white;font-size: 30px;line-height: 50px">
|
||||
水泥行业碳排放强度趋势图
|
||||
</div>
|
||||
<div class="yAxisText">碳排放强度(kg CO2/吨水泥)</div>
|
||||
<div class="yearText">{{ currentYear }}</div>
|
||||
<div id="mainLine" style="width: 700px;height: 600px;border: 4px solid rgb(204,51,0);padding-left: 20px;"></div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-main>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { stack } from "d3";
|
||||
import * as echarts from "echarts";
|
||||
const updateFrequency = 2000;
|
||||
const dimension = 0;
|
||||
|
@ -43,299 +54,500 @@ const years = [2021, 2025, 2030, 2040, 2050, 2060];
|
|||
export default {
|
||||
name: "chart",
|
||||
data() {
|
||||
return {};
|
||||
return {
|
||||
timeInterval:null,
|
||||
currentYear: 2021,
|
||||
currentIndex: 0,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
//柱状
|
||||
var chartDom = document.getElementById("main");
|
||||
var myChart = echarts.init(chartDom);
|
||||
var option;
|
||||
let startIndex = 0;
|
||||
let data1 = [
|
||||
["Income", "Life Expectancy", "Population", "Country", "Year"],
|
||||
[0, 34.05, 0, "Low carbon cement", 2021],
|
||||
[0, 39, 0, "Alternative Fuel", 2021],
|
||||
[0, 32, 0, "Clean Energy Electricity", 2021],
|
||||
[0, 32.2, 0, "Energy Efficiencylmprovement Technology", 2021],
|
||||
[0, 36.57, 0, "CCUS", 2021],
|
||||
this.intiLineChart();
|
||||
this.intiLine();
|
||||
this.intiBar();
|
||||
},
|
||||
methods: {
|
||||
intiBar(){
|
||||
//柱状
|
||||
var chartDom = document.getElementById("main");
|
||||
var myChart = echarts.init(chartDom);
|
||||
var option;
|
||||
let startIndex = 0;
|
||||
let data1 = [
|
||||
["Income", "Life Expectancy", "Population", "Country", "Year"],
|
||||
[0, 34.05, 0, "Low carbon cement", 2021],
|
||||
[0, 39, 0, "Alternative Fuel", 2021],
|
||||
[0, 32, 0, "Clean Energy Electricity", 2021],
|
||||
[0, 32.2, 0, "Energy Efficiencylmprovement Technology", 2021],
|
||||
[0, 36.57, 0, "CCUS", 2021],
|
||||
|
||||
[6, 34.05, 6, "Low carbon cement", 2025],
|
||||
[14, 39, 14, "Alternative Fuel", 2025],
|
||||
[6, 32, 6, "Clean Energy Electricity", 2025],
|
||||
[8, 32.2, 8, "Energy Efficiencylmprovement Technology", 2025],
|
||||
[4, 36.5, 4, "CCUS", 2025],
|
||||
[6, 34.05, 6, "Low carbon cement", 2025],
|
||||
[14, 39, 14, "Alternative Fuel", 2025],
|
||||
[6, 32, 6, "Clean Energy Electricity", 2025],
|
||||
[8, 32.2, 8, "Energy Efficiencylmprovement Technology", 2025],
|
||||
[4, 36.5, 4, "CCUS", 2025],
|
||||
|
||||
[33, 34.05, 33, "Low carbon cement", 2030],
|
||||
[26, 39, 26, "Alternative Fuel", 2030],
|
||||
[10, 32, 10, "Clean Energy Electricity", 2030],
|
||||
[18, 32.2, 18, "Energy Efficiencylmprovement Technology", 2030],
|
||||
[9, 36.57, 9, "CCUS", 2030],
|
||||
[33, 34.05, 33, "Low carbon cement", 2030],
|
||||
[26, 39, 26, "Alternative Fuel", 2030],
|
||||
[10, 32, 10, "Clean Energy Electricity", 2030],
|
||||
[18, 32.2, 18, "Energy Efficiencylmprovement Technology", 2030],
|
||||
[9, 36.57, 9, "CCUS", 2030],
|
||||
|
||||
[78, 34.05, 78, "Low carbon cement", 2040],
|
||||
[68, 39, 68, "Alternative Fuel", 2040],
|
||||
[17, 32, 17, "Clean Energy Electricity", 2040],
|
||||
[18, 32.2, 18, "Energy Efficiencylmprovement Technology", 2040],
|
||||
[19, 36.57, 19, "CCUS", 2040],
|
||||
[78, 34.05, 78, "Low carbon cement", 2040],
|
||||
[68, 39, 68, "Alternative Fuel", 2040],
|
||||
[17, 32, 17, "Clean Energy Electricity", 2040],
|
||||
[18, 32.2, 18, "Energy Efficiencylmprovement Technology", 2040],
|
||||
[19, 36.57, 19, "CCUS", 2040],
|
||||
|
||||
[118, 34.05, 118, "Low carbon cement", 2050],
|
||||
[111, 39, 111, "Alternative Fuel", 2050],
|
||||
[23, 32, 23, "Clean Energy Electricity", 2050],
|
||||
[16, 32.2, 16, "Energy Efficiencylmprovement Technology", 2050],
|
||||
[57, 36.57, 57, "CCUS", 2050],
|
||||
[118, 34.05, 118, "Low carbon cement", 2050],
|
||||
[111, 39, 111, "Alternative Fuel", 2050],
|
||||
[23, 32, 23, "Clean Energy Electricity", 2050],
|
||||
[16, 32.2, 16, "Energy Efficiencylmprovement Technology", 2050],
|
||||
[57, 36.57, 57, "CCUS", 2050],
|
||||
|
||||
[118, 34.05, 118, "Low carbon cement", 2060],
|
||||
[177, 39, 117, "Alternative Fuel", 2060],
|
||||
[26, 32, 26, "Clean Energy Electricity", 2060],
|
||||
[16, 32.2, 16, "Energy Efficiencylmprovement Technology", 2060],
|
||||
[254, 36.57, 254, "CCUS", 2060],
|
||||
];
|
||||
let data = [
|
||||
["Income", "Life Expectancy", "Population", "Country", "Year"],
|
||||
[0, 34.05, 0, "Low carbon cement", 2021],
|
||||
[0, 39, 0, "Alternative Fuel", 2021],
|
||||
[0, 32, 0, "Clean Energy Electricity", 2021],
|
||||
[0, 32.2, 0, "Energy Efficiencylmprovement Technology", 2021],
|
||||
[0, 36.57, 0, "CCUS", 2021],
|
||||
[118, 34.05, 118, "Low carbon cement", 2060],
|
||||
[177, 39, 117, "Alternative Fuel", 2060],
|
||||
[26, 32, 26, "Clean Energy Electricity", 2060],
|
||||
[16, 32.2, 16, "Energy Efficiencylmprovement Technology", 2060],
|
||||
[254, 36.57, 254, "CCUS", 2060],
|
||||
];
|
||||
let data = [
|
||||
["Income", "Life Expectancy", "Population", "Country", "Year"],
|
||||
[0, 34.05, 0, "Low carbon cement", 2021],
|
||||
[0, 39, 0, "Alternative Fuel", 2021],
|
||||
[0, 32, 0, "Clean Energy Electricity", 2021],
|
||||
[0, 32.2, 0, "Energy Efficiencylmprovement Technology", 2021],
|
||||
[0, 36.57, 0, "CCUS", 2021],
|
||||
|
||||
[6, 34.05, 6, "Low carbon cement", 2025],
|
||||
[14, 39, 14, "Alternative Fuel", 2025],
|
||||
[6, 32, 6, "Clean Energy Electricity", 2025],
|
||||
[8, 32.2, 8, "Energy Efficiencylmprovement Technology", 2025],
|
||||
[3, 36.5, 4, "CCUS", 2025],
|
||||
[6, 34.05, 6, "Low carbon cement", 2025],
|
||||
[14, 39, 14, "Alternative Fuel", 2025],
|
||||
[6, 32, 6, "Clean Energy Electricity", 2025],
|
||||
[8, 32.2, 8, "Energy Efficiencylmprovement Technology", 2025],
|
||||
[3, 36.5, 4, "CCUS", 2025],
|
||||
|
||||
[33, 34.05, 33, "Low carbon cement", 2030],
|
||||
[26, 39, 26, "Alternative Fuel", 2030],
|
||||
[10, 32, 10, "Clean Energy Electricity", 2030],
|
||||
[18, 32.2, 18, "Energy Efficiencylmprovement Technology", 2030],
|
||||
[7, 36.57, 9, "CCUS", 2030],
|
||||
[33, 34.05, 33, "Low carbon cement", 2030],
|
||||
[26, 39, 26, "Alternative Fuel", 2030],
|
||||
[10, 32, 10, "Clean Energy Electricity", 2030],
|
||||
[18, 32.2, 18, "Energy Efficiencylmprovement Technology", 2030],
|
||||
[7, 36.57, 9, "CCUS", 2030],
|
||||
|
||||
[118, 34.05, 78, "Low carbon cement", 2040],
|
||||
[68, 39, 68, "Alternative Fuel", 2040],
|
||||
[17, 32, 17, "Clean Energy Electricity", 2040],
|
||||
[18, 32.2, 18, "Energy Efficiencylmprovement Technology", 2040],
|
||||
[14, 36.57, 19, "CCUS", 2040],
|
||||
[118, 34.05, 78, "Low carbon cement", 2040],
|
||||
[68, 39, 68, "Alternative Fuel", 2040],
|
||||
[17, 32, 17, "Clean Energy Electricity", 2040],
|
||||
[18, 32.2, 18, "Energy Efficiencylmprovement Technology", 2040],
|
||||
[14, 36.57, 19, "CCUS", 2040],
|
||||
|
||||
[157, 34.05, 118, "Low carbon cement", 2050],
|
||||
[111, 39, 111, "Alternative Fuel", 2050],
|
||||
[23, 32, 23, "Clean Energy Electricity", 2050],
|
||||
[16, 32.2, 16, "Energy Efficiencylmprovement Technology", 2050],
|
||||
[41, 36.57, 57, "CCUS", 2050],
|
||||
[157, 34.05, 118, "Low carbon cement", 2050],
|
||||
[111, 39, 111, "Alternative Fuel", 2050],
|
||||
[23, 32, 23, "Clean Energy Electricity", 2050],
|
||||
[16, 32.2, 16, "Energy Efficiencylmprovement Technology", 2050],
|
||||
[41, 36.57, 57, "CCUS", 2050],
|
||||
|
||||
[196, 34.05, 118, "Low carbon cement", 2060],
|
||||
[177, 39, 117, "Alternative Fuel", 2060],
|
||||
[26, 32, 26, "Clean Energy Electricity", 2060],
|
||||
[16, 32.2, 16, "Energy Efficiencylmprovement Technology", 2060],
|
||||
[184, 36.57, 254, "CCUS", 2060],
|
||||
];
|
||||
let startYear = years[startIndex];
|
||||
option = {
|
||||
grid: {
|
||||
top: 50,
|
||||
bottom: 30,
|
||||
left: 300,
|
||||
right: 80,
|
||||
},
|
||||
xAxis: {
|
||||
max: "dataMax",
|
||||
// max: "13",
|
||||
// min: "0.0008",
|
||||
position: "top",
|
||||
axisLabel: {
|
||||
// show: false,
|
||||
formatter: function (n) {
|
||||
return Math.round(n) + "";
|
||||
},
|
||||
[196, 34.05, 118, "Low carbon cement", 2060],
|
||||
[177, 39, 117, "Alternative Fuel", 2060],
|
||||
[26, 32, 26, "Clean Energy Electricity", 2060],
|
||||
[16, 32.2, 16, "Energy Efficiencylmprovement Technology", 2060],
|
||||
[184, 36.57, 254, "CCUS", 2060],
|
||||
];
|
||||
let startYear = years[startIndex];
|
||||
option = {
|
||||
grid: {
|
||||
top: 50,
|
||||
bottom: 30,
|
||||
left: 300,
|
||||
right: 80,
|
||||
},
|
||||
},
|
||||
dataset: {
|
||||
source: data.slice(1).filter(function (d) {
|
||||
return d[4] === startYear;
|
||||
}),
|
||||
},
|
||||
yAxis: {
|
||||
type: "category",
|
||||
inverse: true,
|
||||
max: 10,
|
||||
axisLabel: {
|
||||
show: true,
|
||||
fontSize: 14,
|
||||
// formatter: function (value) {
|
||||
// },
|
||||
rich: {
|
||||
flag: {
|
||||
fontSize: 25,
|
||||
padding: 5,
|
||||
xAxis: {
|
||||
max: "dataMax",
|
||||
position: "top",
|
||||
axisLabel: {
|
||||
formatter: function (n) {
|
||||
return Math.round(n) + "";
|
||||
},
|
||||
},
|
||||
},
|
||||
animationDuration: 300,
|
||||
animationDurationUpdate: 300,
|
||||
},
|
||||
series: [
|
||||
{
|
||||
realtimeSort: true,
|
||||
seriesLayoutBy: "column",
|
||||
type: "bar",
|
||||
itemStyle: {
|
||||
color: function (param) {
|
||||
return countryColors[param.value[3]] || "#5470c6";
|
||||
},
|
||||
},
|
||||
encode: {
|
||||
x: dimension,
|
||||
y: 3,
|
||||
},
|
||||
label: {
|
||||
dataset: {
|
||||
source: data.slice(1).filter(function (d) {
|
||||
return d[4] === startYear;
|
||||
}),
|
||||
},
|
||||
yAxis: {
|
||||
type: "category",
|
||||
inverse: true,
|
||||
max: 10,
|
||||
axisLabel: {
|
||||
show: true,
|
||||
precision: 1,
|
||||
position: "right",
|
||||
valueAnimation: true,
|
||||
fontFamily: "monospace",
|
||||
},
|
||||
},
|
||||
],
|
||||
animationDuration: 0,
|
||||
animationDurationUpdate: updateFrequency,
|
||||
animationEasing: "linear",
|
||||
animationEasingUpdate: "linear",
|
||||
graphic: {
|
||||
elements: [
|
||||
{
|
||||
type: "text",
|
||||
left: "center",
|
||||
bottom: 60,
|
||||
style: {
|
||||
text: startYear,
|
||||
font: "bolder 80px monospace",
|
||||
fill: "#d6000f",
|
||||
fontSize: 14,
|
||||
rich: {
|
||||
flag: {
|
||||
fontSize: 25,
|
||||
padding: 5,
|
||||
},
|
||||
},
|
||||
},
|
||||
animationDuration: 300,
|
||||
animationDurationUpdate: 300,
|
||||
},
|
||||
series: [
|
||||
{
|
||||
realtimeSort: true,
|
||||
seriesLayoutBy: "column",
|
||||
type: "bar",
|
||||
itemStyle: {
|
||||
color: function (param) {
|
||||
return countryColors[param.value[3]] || "#5470c6";
|
||||
},
|
||||
},
|
||||
encode: {
|
||||
x: dimension,
|
||||
y: 3,
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
precision: 1,
|
||||
position: "right",
|
||||
valueAnimation: true,
|
||||
fontFamily: "monospace",
|
||||
},
|
||||
z: 100,
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
myChart.setOption(option);
|
||||
for (let i = startIndex; i < years.length - 1; ++i) {
|
||||
(function (i) {
|
||||
setTimeout(function () {
|
||||
updateYear(years[i + 1]);
|
||||
}, (i - startIndex) * updateFrequency);
|
||||
})(i);
|
||||
}
|
||||
function updateYear(year) {
|
||||
let source = data.slice(1).filter(function (d) {
|
||||
return d[4] === year;
|
||||
});
|
||||
option.series[0].data = source;
|
||||
option.graphic.elements[0].style.text = year;
|
||||
myChart.setOption(option);
|
||||
}
|
||||
//折线
|
||||
let countries = ["CementCO:Emissions"];
|
||||
let datasetWithFilters = [];
|
||||
let seriesList = [];
|
||||
let _rawData1 = [
|
||||
["Income", "Country", "Year"],
|
||||
[575, "CementCO:Emissions", 2021],
|
||||
[558, "CementCO:Emissions", 2025],
|
||||
[520, "CementCO:Emissions", 2030],
|
||||
[420, "CementCO:Emissions", 2040],
|
||||
[296, "CementCO:Emissions", 2050],
|
||||
[31, "CementCO:Emissions", 2060],
|
||||
];
|
||||
let _rawData = [
|
||||
["Income", "Country", "Year"],
|
||||
[575, "CementCO:Emissions", 2021],
|
||||
[559, "CementCO:Emissions", 2025],
|
||||
[523, "CementCO:Emissions", 2030],
|
||||
[386, "CementCO:Emissions", 2040],
|
||||
[272, "CementCO:Emissions", 2050],
|
||||
[23, "CementCO:Emissions", 2060],
|
||||
];
|
||||
var chartDoms = document.getElementById("mains");
|
||||
var myCharts = echarts.init(chartDoms);
|
||||
datasetWithFilters.push({
|
||||
id: "dataset_CementCO:Emissions",
|
||||
fromDatasetId: "dataset_raw",
|
||||
transform: {
|
||||
type: "filter",
|
||||
config: {
|
||||
and: [
|
||||
{ dimension: "Year", gte: 1950 },
|
||||
{ dimension: "Country", "=": "CementCO:Emissions" },
|
||||
animationDuration: 0,
|
||||
animationDurationUpdate: updateFrequency,
|
||||
animationEasing: "linear",
|
||||
animationEasingUpdate: "linear",
|
||||
graphic: {
|
||||
elements: [
|
||||
{
|
||||
type: "text",
|
||||
left: "center",
|
||||
bottom: 60,
|
||||
style: {
|
||||
text: startYear,
|
||||
font: "bolder 80px monospace",
|
||||
fill: "#d6000f",
|
||||
},
|
||||
z: 100,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
});
|
||||
seriesList.push({
|
||||
type: "line",
|
||||
datasetId: "dataset_CementCO:Emissions",
|
||||
showSymbol: false,
|
||||
name: "CementCO:Emissions",
|
||||
endLabel: {
|
||||
show: true,
|
||||
formatter: function (params) {
|
||||
return params.value[1] + ": " + params.value[0];
|
||||
};
|
||||
// myChart.setOption(option);
|
||||
for (let i = startIndex; i < years.length - 1; ++i) {
|
||||
(function (i) {
|
||||
setTimeout(function () {
|
||||
updateYear(years[i + 1]);
|
||||
}, (i - startIndex) * updateFrequency);
|
||||
})(i);
|
||||
}
|
||||
function updateYear(year) {
|
||||
let source = data.slice(1).filter(function (d) {
|
||||
return d[4] === year;
|
||||
});
|
||||
option.series[0].data = source;
|
||||
option.graphic.elements[0].style.text = year;
|
||||
myChart.setOption(option);
|
||||
}
|
||||
},
|
||||
intiLine(){
|
||||
//折线
|
||||
let countries = ["CementCO:Emissions"];
|
||||
let datasetWithFilters = [];
|
||||
let seriesList = [];
|
||||
let _rawData1 = [
|
||||
["Income", "Country", "Year"],
|
||||
[575, "CementCO:Emissions", 2021],
|
||||
[558, "CementCO:Emissions", 2025],
|
||||
[520, "CementCO:Emissions", 2030],
|
||||
[420, "CementCO:Emissions", 2040],
|
||||
[296, "CementCO:Emissions", 2050],
|
||||
[31, "CementCO:Emissions", 2060],
|
||||
];
|
||||
let _rawData = [
|
||||
["Income", "Country", "Year"],
|
||||
[575, "CementCO:Emissions", 2021],
|
||||
[559, "CementCO:Emissions", 2025],
|
||||
[523, "CementCO:Emissions", 2030],
|
||||
[386, "CementCO:Emissions", 2040],
|
||||
[272, "CementCO:Emissions", 2050],
|
||||
[23, "CementCO:Emissions", 2060],
|
||||
];
|
||||
var chartDoms = document.getElementById("mains");
|
||||
var myCharts = echarts.init(chartDoms);
|
||||
datasetWithFilters.push({
|
||||
id: "dataset_CementCO:Emissions",
|
||||
fromDatasetId: "dataset_raw",
|
||||
transform: {
|
||||
type: "filter",
|
||||
config: {
|
||||
and: [
|
||||
{ dimension: "Year", gte: 1950 },
|
||||
{ dimension: "Country", "=": "CementCO:Emissions" },
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
lineStyle: {
|
||||
width: 5,
|
||||
},
|
||||
emphasis: {
|
||||
focus: "series",
|
||||
},
|
||||
color: "#000000",
|
||||
encode: {
|
||||
x: "Year",
|
||||
y: "Income",
|
||||
label: ["Country", "Income"],
|
||||
itemName: "Year",
|
||||
tooltip: ["Income"],
|
||||
},
|
||||
});
|
||||
let options = {
|
||||
animationDuration: 10000,
|
||||
dataset: [
|
||||
{
|
||||
id: "dataset_raw",
|
||||
source: _rawData,
|
||||
});
|
||||
seriesList.push({
|
||||
type: "line",
|
||||
datasetId: "dataset_CementCO:Emissions",
|
||||
showSymbol: false,
|
||||
name: "CementCO:Emissions",
|
||||
// areaStyle: {},//面性
|
||||
endLabel: {
|
||||
show: true,
|
||||
formatter: function (params) {
|
||||
return params.value[1] + ": " + params.value[0];
|
||||
},
|
||||
},
|
||||
...datasetWithFilters,
|
||||
],
|
||||
lineStyle: {
|
||||
width: 5,
|
||||
},
|
||||
emphasis: {
|
||||
focus: "series",
|
||||
},
|
||||
color: "#000000",
|
||||
encode: {
|
||||
x: "Year",
|
||||
y: "Income",
|
||||
label: ["Country", "Income"],
|
||||
itemName: "Year",
|
||||
tooltip: ["Income"],
|
||||
},
|
||||
});
|
||||
let options = {
|
||||
animationDuration: 10000,
|
||||
dataset: [
|
||||
{
|
||||
id: "dataset_raw",
|
||||
source: _rawData,
|
||||
},
|
||||
...datasetWithFilters,
|
||||
],
|
||||
|
||||
xAxis: {
|
||||
type: "category",
|
||||
nameLocation: "middle",
|
||||
axisTick: {
|
||||
show: false,
|
||||
xAxis: {
|
||||
type: "category",
|
||||
nameLocation: "middle",
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
axisLine: {
|
||||
show: false,
|
||||
},
|
||||
axisLabel: {
|
||||
show: false,
|
||||
},
|
||||
splitLine: {
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
axisLine: {
|
||||
show: false,
|
||||
},
|
||||
axisLabel: {
|
||||
show: false,
|
||||
},
|
||||
splitLine: {
|
||||
show: false,
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
type:"value",
|
||||
position: "right",
|
||||
offset:10,
|
||||
// axisLabel:{
|
||||
// align:"left",
|
||||
yAxis: {
|
||||
type:"value",
|
||||
position: "right",
|
||||
offset:10,
|
||||
// axisLabel:{
|
||||
// align:"left",
|
||||
|
||||
// },
|
||||
name: "",
|
||||
},
|
||||
grid: {
|
||||
top:70,
|
||||
left: 300,
|
||||
},
|
||||
series: seriesList,
|
||||
};
|
||||
myCharts.setOption(options);
|
||||
},
|
||||
|
||||
intiLineChart(){
|
||||
let that = this;
|
||||
let i=0;
|
||||
let years = [2021,2025,2030,2040,2050,2060];
|
||||
that.timeInterval=setInterval(function () {
|
||||
that.currentYear = years[that.currentIndex];
|
||||
if(that.currentIndex < 6){
|
||||
that.currentIndex++;
|
||||
}else{
|
||||
that.currentYear = 2060
|
||||
}
|
||||
},1500)
|
||||
let chartLineDom = document.getElementById('mainLine');
|
||||
let myLineChart = echarts.init(chartLineDom);
|
||||
const lineItems = [
|
||||
'吨水泥碳排放',
|
||||
'碳捕集',
|
||||
'清洁能源电力',
|
||||
'能效提升',
|
||||
'替代燃料',
|
||||
'低碳水泥'
|
||||
];
|
||||
let colors= ['rgb(43,140,190)', 'rgb(78,179,211)', 'rgb(123,204,196)', 'rgb(204,235,197)', 'rgb(224,243,219)', 'rgb(247,252,240)'];
|
||||
let datasetWithFilters = [],seriesList =[];
|
||||
lineItems.forEach((item,index) => {
|
||||
var datasetId = 'dataset_' + item;
|
||||
datasetWithFilters.push({
|
||||
id: datasetId,
|
||||
fromDatasetId: 'dataset_raw',
|
||||
transform: {
|
||||
type: 'filter',
|
||||
config: {
|
||||
and: [
|
||||
{ dimension: 'Year', gte: 2020 },
|
||||
{ dimension: 'Country', '=': item }
|
||||
]
|
||||
}
|
||||
}
|
||||
})
|
||||
seriesList.push({
|
||||
type: 'line',
|
||||
stack: 'Total',
|
||||
datasetId: datasetId,
|
||||
showSymbol: false,
|
||||
name: item,
|
||||
areaStyle: {
|
||||
color:colors[index]
|
||||
},
|
||||
lineStyle:{
|
||||
color:colors[index]
|
||||
},
|
||||
// endLabel: {
|
||||
// show: true,
|
||||
// formatter: function (params) {
|
||||
// return params.value[3] + ': ' + params.value[0];
|
||||
// }
|
||||
// },
|
||||
labelLayout: {
|
||||
moveOverlap: 'shiftY'
|
||||
},
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
},
|
||||
encode: {
|
||||
x: 'Year',
|
||||
y: 'Income',
|
||||
label: ['Country', 'Income'],
|
||||
itemName: 'Year',
|
||||
tooltip: ['Income']
|
||||
},
|
||||
});
|
||||
})
|
||||
let _rawData = [
|
||||
["Income", "Country", "Year"],
|
||||
[573, "吨水泥碳排放", 2021],
|
||||
[550, "吨水泥碳排放", 2025],
|
||||
[520, "吨水泥碳排放", 2030],
|
||||
[420, "吨水泥碳排放", 2040],
|
||||
[296, "吨水泥碳排放", 2050],
|
||||
[31, "吨水泥碳排放", 2060],
|
||||
[0, "碳捕集", 2021],
|
||||
[6, "碳捕集", 2025],
|
||||
[10, "碳捕集", 2030],
|
||||
[27, "碳捕集", 2040],
|
||||
[79, "碳捕集", 2050],
|
||||
[260, "碳捕集", 2060],
|
||||
[0, "清洁能源电力", 2021],
|
||||
[1, "清洁能源电力", 2025],
|
||||
[4, "清洁能源电力", 2030],
|
||||
[10, "清洁能源电力", 2040],
|
||||
[15, "清洁能源电力", 2050],
|
||||
[20, "清洁能源电力", 2060],
|
||||
[0, "能效提升", 2021],
|
||||
[6, "能效提升", 2025],
|
||||
[15, "能效提升", 2030],
|
||||
[15, "能效提升", 2040],
|
||||
[15, "能效提升", 2050],
|
||||
[15, "能效提升", 2060],
|
||||
[0, "替代燃料", 2021],
|
||||
[18, "替代燃料", 2025],
|
||||
[32, "替代燃料", 2030],
|
||||
[72, "替代燃料", 2040],
|
||||
[90, "替代燃料", 2050],
|
||||
[163, "替代燃料", 2060],
|
||||
[0, "低碳水泥", 2021],
|
||||
[5, "低碳水泥", 2025],
|
||||
[10, "低碳水泥", 2030],
|
||||
[50, "低碳水泥", 2040],
|
||||
[100, "低碳水泥", 2050],
|
||||
[105, "低碳水泥", 2060],
|
||||
];
|
||||
let lineOptions = {
|
||||
color:colors,
|
||||
animationDuration: 10000,
|
||||
legend:{
|
||||
// type: 'plain',
|
||||
icon:'rect',
|
||||
top:'95%'
|
||||
|
||||
},
|
||||
dataset: [
|
||||
{
|
||||
id: "dataset_raw",
|
||||
source: _rawData,
|
||||
},
|
||||
...datasetWithFilters,
|
||||
],
|
||||
tooltip: {
|
||||
order: 'valueDesc',
|
||||
trigger: 'axis'
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
nameLocation: 'middle',
|
||||
boundaryGap: false,
|
||||
},
|
||||
yAxis: {
|
||||
max: '600', //取最大值为最大刻度
|
||||
// name: '碳排放强度(kg CO2/吨水泥)'
|
||||
},
|
||||
|
||||
// graphic: {
|
||||
// elements: [
|
||||
// {
|
||||
// type: "text",
|
||||
// left: "center",
|
||||
// bottom: 60,
|
||||
// style: {
|
||||
// text: startYear,
|
||||
// font: "bolder 80px monospace",
|
||||
// fill: "#d6000f",
|
||||
// },
|
||||
// z: 100,
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
name: "",
|
||||
},
|
||||
grid: {
|
||||
top:70,
|
||||
left: 300,
|
||||
},
|
||||
series: seriesList,
|
||||
};
|
||||
myCharts.setOption(options);
|
||||
},
|
||||
series: seriesList
|
||||
}
|
||||
myLineChart.setOption(lineOptions);
|
||||
// for (let i = startIndex; i < years.length - 1; ++i) {
|
||||
// (function (i) {
|
||||
// setTimeout(function () {
|
||||
// updateYear(years[i + 1]);
|
||||
// }, (i - startIndex) * updateFrequency);
|
||||
// })(i);
|
||||
// }
|
||||
// function updateYear(year) {
|
||||
// lineOptions.graphic.elements[0].style.text = year;
|
||||
// myLineChart.setOption(lineOptions);
|
||||
// }
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.yAxisText{
|
||||
position: absolute;
|
||||
left: -78px;
|
||||
top: 295px;
|
||||
transform: rotateZ(-90deg);
|
||||
font-size: 14px;
|
||||
color: #666666;
|
||||
}
|
||||
.yearText{
|
||||
position: absolute;
|
||||
left: 286px;
|
||||
bottom: 100px;
|
||||
color: red;
|
||||
width: 100px;
|
||||
height: 50px;
|
||||
z-index: 9999;
|
||||
font-size: 50px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -135,7 +135,257 @@
|
|||
</el-col>
|
||||
</el-row>
|
||||
<el-divider style="margin-top:0"></el-divider>
|
||||
<el-row>
|
||||
<!-- 尺寸检验 -->
|
||||
<el-row v-if="mgroupName=='size'">
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="黑圈内径">
|
||||
<el-input-number
|
||||
controls-position="right"
|
||||
v-model="count_notok_json.count_n_hqnj"
|
||||
style="width: 100%"
|
||||
precision="0"
|
||||
@change="handleCountChange"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="黑圈内径圆度">
|
||||
<el-input-number
|
||||
controls-position="right"
|
||||
v-model="count_notok_json.count_n_hqnjyd"
|
||||
style="width: 100%"
|
||||
precision="0"
|
||||
@change="handleCountChange"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="黑圈外径">
|
||||
<el-input-number
|
||||
controls-position="right"
|
||||
v-model="count_notok_json.count_n_hqwj"
|
||||
style="width: 100%"
|
||||
precision="0"
|
||||
@change="handleCountChange"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="黑圈外径圆度">
|
||||
<el-input-number
|
||||
controls-position="right"
|
||||
v-model="count_notok_json.count_n_hqwjyd"
|
||||
style="width: 100%"
|
||||
precision="0"
|
||||
@change="handleCountChange"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="产品外径">
|
||||
<el-input-number
|
||||
controls-position="right"
|
||||
v-model="count_notok_json.count_n_wj"
|
||||
style="width: 100%"
|
||||
precision="0"
|
||||
@change="handleCountChange"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="产品圆度">
|
||||
<el-input-number
|
||||
controls-position="right"
|
||||
v-model="count_notok_json.count_n_yd"
|
||||
style="width: 100%"
|
||||
precision="0"
|
||||
@change="handleCountChange"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="产品同心度">
|
||||
<el-input-number
|
||||
controls-position="right"
|
||||
v-model="count_notok_json.count_n_txd"
|
||||
style="width: 100%"
|
||||
precision="0"
|
||||
@change="handleCountChange"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="厚度">
|
||||
<el-input-number
|
||||
controls-position="right"
|
||||
v-model="count_notok_json.count_n_hd"
|
||||
style="width: 100%"
|
||||
precision="0"
|
||||
@change="handleCountChange"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="准合格">
|
||||
<el-input-number
|
||||
controls-position="right"
|
||||
v-model="count_notok_json.count_n_zhg"
|
||||
style="width: 100%"
|
||||
precision="0"
|
||||
@change="handleCountChange"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="圆准">
|
||||
<el-input-number
|
||||
controls-position="right"
|
||||
v-model="count_notok_json.count_n_yz"
|
||||
style="width: 100%"
|
||||
precision="0"
|
||||
@change="handleCountChange"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- 外观检验 -->
|
||||
<el-row v-else-if="mgroupName=='facade'">
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="脏">
|
||||
<el-input-number
|
||||
controls-position="right"
|
||||
v-model="count_notok_json.count_n_z"
|
||||
style="width: 100%"
|
||||
precision="0"
|
||||
@change="handleCountChange"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="气泡">
|
||||
<el-input-number
|
||||
controls-position="right"
|
||||
v-model="count_notok_json.count_n_qp"
|
||||
style="width: 100%"
|
||||
precision="0"
|
||||
@change="handleCountChange"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="水纹">
|
||||
<el-input-number
|
||||
controls-position="right"
|
||||
v-model="count_notok_json.count_n_swen"
|
||||
style="width: 100%"
|
||||
precision="0"
|
||||
@change="handleCountChange"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="崩边">
|
||||
<el-input-number
|
||||
controls-position="right"
|
||||
v-model="count_notok_json.count_n_bb"
|
||||
style="width: 100%"
|
||||
precision="0"
|
||||
@change="handleCountChange"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="棕边">
|
||||
<el-input-number
|
||||
controls-position="right"
|
||||
v-model="count_notok_json.count_n_zb"
|
||||
style="width: 100%"
|
||||
precision="0"
|
||||
@change="handleCountChange"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="棕圈">
|
||||
<el-input-number
|
||||
controls-position="right"
|
||||
v-model="count_notok_json.count_n_zq"
|
||||
style="width: 100%"
|
||||
precision="0"
|
||||
@change="handleCountChange"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="划伤">
|
||||
<el-input-number
|
||||
controls-position="right"
|
||||
v-model="count_notok_json.count_n_hs"
|
||||
style="width: 100%"
|
||||
precision="0"
|
||||
@change="handleCountChange"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="麻点">
|
||||
<el-input-number
|
||||
controls-position="right"
|
||||
v-model="count_notok_json.count_n_md"
|
||||
style="width: 100%"
|
||||
precision="0"
|
||||
@change="handleCountChange"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="黑圈变形">
|
||||
<el-input-number
|
||||
controls-position="right"
|
||||
v-model="count_notok_json.count_n_hqbx"
|
||||
style="width: 100%"
|
||||
precision="0"
|
||||
@change="handleCountChange"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="倒角">
|
||||
<el-input-number
|
||||
controls-position="right"
|
||||
v-model="count_notok_json.count_n_dj"
|
||||
style="width: 100%"
|
||||
precision="0"
|
||||
|
||||
@change="handleCountChange"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="破损">
|
||||
<el-input-number
|
||||
controls-position="right"
|
||||
v-model="count_notok_json.count_n_ps"
|
||||
style="width: 100%"
|
||||
precision="0"
|
||||
@change="handleCountChange"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="蓝圈">
|
||||
<el-input-number
|
||||
controls-position="right"
|
||||
v-model="count_notok_json.count_n_lq"
|
||||
style="width: 100%"
|
||||
precision="0"
|
||||
@change="handleCountChange"
|
||||
></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- 过程检验 -->
|
||||
<el-row v-else>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="厚度">
|
||||
<el-input-number
|
||||
|
@ -288,6 +538,10 @@ export default {
|
|||
type: String,
|
||||
default: "",
|
||||
},
|
||||
mgroupName:{
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
itemObj:{
|
||||
type: Object,
|
||||
default: null,
|
||||
|
|
|
@ -113,69 +113,83 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="24">
|
||||
<el-form-item label="处理备注">
|
||||
<el-input v-model="form.note" placeholder="处理备注"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-form-item label="交接物料">
|
||||
<el-button type="primary" @click="addMaterial" v-if="mode!=='show'">手动添加</el-button>
|
||||
<scan-dialog ref="scanDialog" @closed="scanClose"> </scan-dialog>
|
||||
<!-- <el-button type="primary" @click="scanCode" v-if="mode!=='show'">扫码添加</el-button> -->
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row v-show="addShow">
|
||||
<el-col>
|
||||
<el-form-item label="交接物料">
|
||||
<el-select
|
||||
v-model="selectItems"
|
||||
placeholder="交接物料"
|
||||
filterable
|
||||
multiple
|
||||
clearable
|
||||
@change="materialChange"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in materialOptions"
|
||||
:key="item.id"
|
||||
:label="item.batch"
|
||||
:value="item.id"
|
||||
>
|
||||
<span>{{ item.batch }}</span>
|
||||
<div style="float: right">
|
||||
<span>{{ item.count }}</span>
|
||||
<span v-if="item.notok_sign_name !== null" style="color: #aaaaaa">
|
||||
({{ item.notok_sign_name }})
|
||||
</span>
|
||||
</div>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-for="(listItem,$index) in form.handoverb" :key="listItem">
|
||||
<el-col :span="10">
|
||||
<el-form-item label="交接物料">
|
||||
<el-select
|
||||
v-if="mode!=='show'"
|
||||
v-model="listItem.wm"
|
||||
placeholder="交接物料"
|
||||
filterable
|
||||
clearable
|
||||
@change="materialChange($index)"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in materialOptions"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.id"
|
||||
>
|
||||
<span>{{ item.batch }}</span>
|
||||
<div style="float: right">
|
||||
<span>{{ item.count }}</span>
|
||||
<span v-if="item.notok_sign_name !== null" style="color: #aaaaaa">
|
||||
({{ item.notok_sign_name }})
|
||||
</span>
|
||||
</div>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-input v-else v-model="listItem.batch" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="总数量">
|
||||
<span>{{ listItem.counts }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-form-item label="交接数量">
|
||||
<el-input-number
|
||||
v-model="listItem.count"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
step="1"
|
||||
:max="listItem.counts"
|
||||
:disabled="mode==='show'"
|
||||
:step-strictly="true"
|
||||
style="width: 100%"
|
||||
placeholder="交接数量"
|
||||
>
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="2" v-if="mode!=='show'">
|
||||
<el-button type="danger" icon="el-icon-delete" @click="delMaterial($index)"></el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="交接物料">
|
||||
<el-input v-model="listItem.batch" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item label="总数量">
|
||||
<span>{{ listItem.count_cando }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-form-item label="交接数量">
|
||||
<el-input-number
|
||||
v-model="listItem.count"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
step="1"
|
||||
:max="listItem.count_cando"
|
||||
:disabled="mode==='show'"
|
||||
:step-strictly="true"
|
||||
style="width: 100%"
|
||||
placeholder="交接数量"
|
||||
@change="countChange"
|
||||
>
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="2" v-if="mode!=='show'">
|
||||
<el-button type="danger" icon="el-icon-delete" @click="delMaterial($index)"></el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<div class="total-count">总计:{{ totalCount }}</div>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-footer v-if="mode!=='show'">
|
||||
<el-button type="primary" v-loading="isSaveing" @click="submit">确定</el-button>
|
||||
|
@ -206,6 +220,7 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
selectItems:[],
|
||||
yseorno: ["是", "否"],
|
||||
loading: false,
|
||||
mode: "add",
|
||||
|
@ -273,12 +288,17 @@ export default {
|
|||
},
|
||||
],
|
||||
},
|
||||
listParams:{
|
||||
|
||||
},
|
||||
totalCount: 0,
|
||||
deptID:'',
|
||||
userList: [],
|
||||
userList2: [],
|
||||
deptOptions:[],
|
||||
mgroupOptions: [],
|
||||
materialOptions: [],
|
||||
addShow: false,
|
||||
visible: false,
|
||||
scanVisible:false,
|
||||
isSaveing: false,
|
||||
|
@ -347,51 +367,32 @@ export default {
|
|||
count_xtest__isnull:1
|
||||
};
|
||||
if(that.mgroupName=="size"){
|
||||
that.$API.system.dept.list.req({name__contains:'尺寸',page:0}).then((res) => {
|
||||
if(res.length>0){
|
||||
req.belong_dept=res[0].id;
|
||||
this.$API.wpm.wmaterial.list.req(req).then((res) => {
|
||||
let arr = [];
|
||||
res.forEach(item=>{
|
||||
let obj = {};
|
||||
Object.assign(obj,item);
|
||||
obj.label = item.batch;
|
||||
arr.push(obj);
|
||||
})
|
||||
that.materialOptions = arr;
|
||||
});
|
||||
}
|
||||
})
|
||||
}else if(that.mgroupName=="facade"){
|
||||
that.$API.system.dept.list.req({name__contains:'外观',page:0}).then((res) => {
|
||||
if(res.length>0){
|
||||
req.belong_dept=res[0].id;
|
||||
this.$API.wpm.wmaterial.list.req(req).then((res) => {
|
||||
let arr = [];
|
||||
res.forEach(item=>{
|
||||
let obj = {};
|
||||
Object.assign(obj,item);
|
||||
obj.label = item.batch;
|
||||
arr.push(obj);
|
||||
})
|
||||
that.materialOptions = arr;
|
||||
});
|
||||
}
|
||||
})
|
||||
}else{
|
||||
req.mgroupx = that.mgroupId;
|
||||
this.$API.wpm.wmaterial.list.req(req).then((res) => {
|
||||
let arr = [];
|
||||
res.forEach(item=>{
|
||||
let obj = {};
|
||||
Object.assign(obj,item);
|
||||
obj.label = item.batch;
|
||||
arr.push(obj);
|
||||
that.$API.system.dept.list.req({name__contains:'尺寸',page:0}).then((res) => {
|
||||
if(res.length>0){
|
||||
req.belong_dept=res[0].id;
|
||||
that.listParams = req;
|
||||
this.$API.wpm.wmaterial.list.req(req).then((res) => {
|
||||
that.materialOptions = res;
|
||||
});
|
||||
}
|
||||
})
|
||||
that.materialOptions = arr;
|
||||
});
|
||||
}
|
||||
|
||||
}else if(that.mgroupName=="facade"){
|
||||
that.$API.system.dept.list.req({name__contains:'外观',page:0}).then((res) => {
|
||||
if(res.length>0){
|
||||
req.belong_dept=res[0].id;
|
||||
that.listParams = req;
|
||||
this.$API.wpm.wmaterial.list.req(req).then((res) => {
|
||||
that.materialOptions = res;
|
||||
});
|
||||
}
|
||||
})
|
||||
}else{
|
||||
req.mgroupx = that.mgroupId;
|
||||
that.listParams = req;
|
||||
this.$API.wpm.wmaterial.list.req(req).then((res) => {
|
||||
that.materialOptions = res;
|
||||
});
|
||||
}
|
||||
},
|
||||
//获取车间不合格物料
|
||||
getMaterialNotok() {
|
||||
|
@ -402,15 +403,9 @@ export default {
|
|||
notok_sign__isnull : 0,
|
||||
count_xtest__isnull:1
|
||||
};
|
||||
that.listParams = req;
|
||||
this.$API.wpm.wmaterial.list.req(req).then((res) => {
|
||||
let arr = [];
|
||||
res.forEach(item=>{
|
||||
let obj = {};
|
||||
Object.assign(obj,item);
|
||||
obj.label = item.batch+'('+item.notok_sign_name+')';
|
||||
arr.push(obj);
|
||||
})
|
||||
that.materialOptions = arr;
|
||||
that.materialOptions = res;
|
||||
});
|
||||
},
|
||||
//获取交送工段人员
|
||||
|
@ -424,9 +419,9 @@ export default {
|
|||
getCkUserList() {
|
||||
let that = this;
|
||||
this.$API.system.user.list.req({ page: 0, posts__code: "inm&check" })
|
||||
.then((res) => {
|
||||
that.userList2 = res;
|
||||
});
|
||||
.then((res) => {
|
||||
that.userList2 = res;
|
||||
});
|
||||
},
|
||||
//获取接收工段人员
|
||||
getUserList2() {
|
||||
|
@ -451,10 +446,11 @@ export default {
|
|||
});
|
||||
},
|
||||
addMaterial(){
|
||||
this.form.handoverb.push({wm:'',count:'',counts:null});
|
||||
this.addShow = true;
|
||||
},
|
||||
delMaterial(index){
|
||||
this.form.handoverb.splice(index,1);
|
||||
this.countChange();
|
||||
},
|
||||
//显示
|
||||
open(mode = "add") {
|
||||
|
@ -462,14 +458,29 @@ export default {
|
|||
this.visible = true;
|
||||
return this;
|
||||
},
|
||||
materialChange(index) {
|
||||
let val = this.form.handoverb[index].wm;
|
||||
let data = this.materialOptions.filter((item) => {
|
||||
return item.id == val;
|
||||
materialChange() {
|
||||
let that = this;
|
||||
let totalCount = 0;
|
||||
let data = that.materialOptions.filter((item) => {
|
||||
return that.selectItems.indexOf(item.id)>-1;
|
||||
});
|
||||
this.form.handoverb[index].batch = data[0].batch;
|
||||
this.form.handoverb[index].counts = data[0].count;
|
||||
this.form.handoverb[index].count = data[0].count;
|
||||
data.forEach(item=>{
|
||||
item.wm = item.id;
|
||||
item.count = item.count_cando;
|
||||
totalCount += item.count_cando;
|
||||
})
|
||||
that.totalCount = totalCount;
|
||||
that.form.handoverb = data;
|
||||
},
|
||||
countChange(){
|
||||
let that = this;
|
||||
let totalCount = 0;
|
||||
if(this.form.handoverb.length>0){
|
||||
this.form.handoverb.forEach(item=>{
|
||||
totalCount += item.count;
|
||||
})
|
||||
that.totalCount = totalCount;
|
||||
}
|
||||
},
|
||||
//提交
|
||||
submit() {
|
||||
|
@ -532,9 +543,6 @@ export default {
|
|||
scanCode(){
|
||||
let that = this;
|
||||
that.scanVisible = true;
|
||||
// that.$nextTick(() => {
|
||||
// that.$refs.scanDialog.open();
|
||||
// });
|
||||
},
|
||||
scanClose(data){
|
||||
if(data==''||data==undefined||data==null){
|
||||
|
@ -544,17 +552,14 @@ export default {
|
|||
let id = data.split('#')[1];
|
||||
console.log('id',id);
|
||||
this.$API.cm.labelmat.item.req(id).then((res) => {
|
||||
// console.log('res',res);
|
||||
let arr = that.form.handoverb.filter((item) => {
|
||||
return item.batch == res.batch;
|
||||
})
|
||||
// console.log('arr',arr);
|
||||
if(arr.length>0){
|
||||
that.$message.error("该批次已存在")
|
||||
}else{
|
||||
that.materialOptions.forEach((item) => {
|
||||
if(item.batch == res.batch){
|
||||
// let arr = that.form.handoverb
|
||||
let obj = {};
|
||||
obj.wm = item.id;
|
||||
obj.batch = item.batch;
|
||||
|
@ -577,4 +582,10 @@ export default {
|
|||
margin-bottom: 10px;
|
||||
font-weight: 600;
|
||||
}
|
||||
.total-count{
|
||||
width: 100%;
|
||||
text-align: right;
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -107,7 +107,6 @@
|
|||
fixed="right"
|
||||
align="center"
|
||||
width="120"
|
||||
|
||||
>
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
|
@ -115,14 +114,15 @@
|
|||
@click="table_Check(scope.row)"
|
||||
v-auth="'ftestwork.create'"
|
||||
type="primary"
|
||||
v-if="mgroupName!=='size'&&mgroupName!=='facade'&&scope.row.notok_sign_name == null"
|
||||
v-if="scope.row.notok_sign_name == null"
|
||||
>检验
|
||||
</el-button>
|
||||
<!-- v-if="mgroupName!=='size'&&mgroupName!=='facade'&&scope.row.notok_sign_name == null" -->
|
||||
<el-button
|
||||
link size="small"
|
||||
type="warning"
|
||||
@click="tableCheckList(scope.row)"
|
||||
v-if="mgroupName!=='size'&&mgroupName!=='facade'&&scope.row.notok_sign_name == null"
|
||||
v-if="scope.row.notok_sign_name == null"
|
||||
>检验记录
|
||||
</el-button>
|
||||
<el-button @click="printMaterial(scope.row)" type="text">物料标签</el-button>
|
||||
|
@ -142,6 +142,7 @@
|
|||
v-if="dialog.save"
|
||||
ref="saveDialog"
|
||||
:mgroup="mgroupId"
|
||||
:mgroupName="mgroupName"
|
||||
:itemObj = "checkItem"
|
||||
@success="handleSaveSuccess"
|
||||
@closed="dialog.save = false"
|
||||
|
@ -251,10 +252,12 @@ export default {
|
|||
},
|
||||
mounted() {
|
||||
let that = this;
|
||||
console.log(that.mgroupName);
|
||||
if(that.mgroupName=="size"){
|
||||
// that.params.material__process__name = "一次超洗";
|
||||
that.$API.system.dept.list.req({name__contains:'尺寸',page:0}).then((res) => {
|
||||
if(res.length>0){
|
||||
that.params.mgroupx = null;
|
||||
that.params.belong_dept=res[0].id;
|
||||
}
|
||||
that.apiObj = that.$API.wpm.wmaterial.list;
|
||||
|
@ -263,6 +266,7 @@ export default {
|
|||
// that.params.material__process__name = "二次超洗";
|
||||
that.$API.system.dept.list.req({name__contains:'外观',page:0}).then((res) => {
|
||||
if(res.length>0){
|
||||
that.params.mgroupx = null;
|
||||
that.params.belong_dept=res[0].id;
|
||||
}
|
||||
that.apiObj = that.$API.wpm.wmaterial.list;
|
||||
|
@ -279,7 +283,7 @@ export default {
|
|||
that.$TOOL.data.set('gx_deptID',res[0].belong_dept)
|
||||
that.process = res[0].process;
|
||||
that.params.mgroupx = res[0].id;
|
||||
that.params.belong_dept = res[0].belong_dept;
|
||||
// that.params.belong_dept = res[0].belong_dept;
|
||||
that.apiObj = that.$API.wpm.wmaterial.list;
|
||||
});
|
||||
}
|
||||
|
|
|
@ -27,6 +27,18 @@
|
|||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="可用批" v-if="mgroupName!='切片'">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
size="small"
|
||||
type="primary"
|
||||
v-if="scope.row.state == 20"
|
||||
@click="viewBatches(scope.row)">
|
||||
查看
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" width="90">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
|
@ -60,6 +72,27 @@
|
|||
@closed="detailClose"
|
||||
>
|
||||
</deliver-drawer>
|
||||
<el-dialog v-model="dialogVisible">
|
||||
<scTable hidePagination hideDo :apiObj="m_apiObj" :query="m_query" ref="mTable">
|
||||
<el-table-column
|
||||
label="物料名称"
|
||||
prop="material_name"
|
||||
min-width="150"
|
||||
>
|
||||
<template #default="scope">
|
||||
{{ scope.row.material_name }}
|
||||
<span v-if="scope.row.material_origin != null"
|
||||
>({{ scope.row.material_origin_name }})</span
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="批次号"
|
||||
prop="batch"
|
||||
min-width="120"
|
||||
></el-table-column>
|
||||
</scTable>
|
||||
</el-dialog>
|
||||
</el-container>
|
||||
</template>
|
||||
<script>
|
||||
|
@ -77,6 +110,9 @@ export default {
|
|||
name: "mtask",
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
m_apiObj: null,
|
||||
m_query: null,
|
||||
apiObj: null,
|
||||
params: { mgroup: "",state:20 },
|
||||
query: {},
|
||||
|
@ -123,6 +159,14 @@ export default {
|
|||
});
|
||||
},
|
||||
methods: {
|
||||
viewBatches(row){
|
||||
this.dialogVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.m_query = {mtaskx: row.id};
|
||||
this.m_apiObj = this.$API.wpm.wmaterial.list;
|
||||
this.$refs.mTable.queryData(this.m_query);
|
||||
});
|
||||
},
|
||||
elTagType(state) {
|
||||
return this.type_[state];
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue