This commit is contained in:
朱文强 2022-09-01 15:46:47 +08:00
parent a37f8688f6
commit f09b3b18d9
37 changed files with 2229 additions and 1964 deletions

2
src/icons/svg/导出.svg Normal file
View File

@ -0,0 +1,2 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1661306877921" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8730" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css">@font-face { font-family: feedback-iconfont; src: url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff2?t=1630033759944") format("woff2"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff?t=1630033759944") format("woff"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.ttf?t=1630033759944") format("truetype"); }
</style></defs><path d="M469.333333 162.133333h85.333334v469.333334c0 12.8-8.533333 21.333333-21.333334 21.333333h-42.666666c-12.8 0-21.333333-8.533333-21.333334-21.333333v-469.333334z" fill="white" p-id="8731"></path><path d="M315.733333 392.533333L285.866667 362.666667c-8.533333-8.533333-8.533333-21.333333 0-29.866667l211.2-211.2c8.533333-8.533333 21.333333-8.533333 29.866666 0l44.8 44.8-226.133333 226.133333c-8.533333 8.533333-21.333333 8.533333-29.866667 0z" fill="white" p-id="8732"></path><path d="M452.266667 166.4l44.8-44.8c8.533333-8.533333 21.333333-8.533333 29.866666 0l211.2 211.2c8.533333 8.533333 8.533333 21.333333 0 29.866667l-29.866666 29.866666c-8.533333 8.533333-21.333333 8.533333-29.866667 0L452.266667 166.4zM896 503.466667h-42.666667c-12.8 0-21.333333 8.533333-21.333333 21.333333v277.333333c0 12.8-8.533333 21.333333-21.333333 21.333334H213.333333c-12.8 0-21.333333-8.533333-21.333333-21.333334v-277.333333c0-12.8-8.533333-21.333333-21.333333-21.333333H128c-12.8 0-21.333333 8.533333-21.333333 21.333333v362.666667c0 12.8 8.533333 21.333333 21.333333 21.333333h768c12.8 0 21.333333-8.533333 21.333333-21.333333v-362.666667c0-12.8-8.533333-21.333333-21.333333-21.333333z" fill="white" p-id="8733"></path><path d="M277.333333 588.8H149.333333v-85.333333h128c12.8 0 21.333333 8.533333 21.333334 21.333333v42.666667c0 10.666667-8.533333 21.333333-21.333334 21.333333zM874.666667 588.8h-128c-12.8 0-21.333333-8.533333-21.333334-21.333333v-42.666667c0-12.8 8.533333-21.333333 21.333334-21.333333h128v85.333333z" fill="white" p-id="8734"></path></svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -0,0 +1,2 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1661304224063" class="icon" viewBox="0 0 1242 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7775" xmlns:xlink="http://www.w3.org/1999/xlink" width="242.578125" height="200"><defs><style type="text/css">@font-face { font-family: feedback-iconfont; src: url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff2?t=1630033759944") format("woff2"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff?t=1630033759944") format("woff"), url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.ttf?t=1630033759944") format("truetype"); }
</style></defs><path d="M1233.869891 472.860158l-145.482642 149.439425c-11.964829 11.82311-31.370828 11.82311-43.335657 0l-144.522735-149.439425c-17.176294-20.498178-5.698977-27.79763 6.265852-39.637747l132.329267 0C1002.611595 231.621095 829.034659 78.763417 620.001619 78.763417c-161.610219 0-302.183729 91.319684-374.541465 225.916449l-72.189563-29.33386C257.417424 111.795187 425.728098 0 620.001619 0c251.934093 0 460.097926 187.952871 497.475733 433.222411l110.119129 0C1239.568868 445.062528 1245.834719 461.0276 1233.869891 472.860158L1233.869891 472.860158zM196.595582 441.08307l145.482642 149.431867c11.964829 11.834448 5.698977 27.812747-6.27341 39.639636l-125.967047 0c50.619993 181.806063 214.962546 315.070673 410.163851 315.070673 148.545654 0 279.229095-77.227187 355.594633-194.218723l72.918942 29.628635c-88.817879 145.858669-247.261159 243.364842-428.513575 243.364842-238.244077 0-436.986457-168.172734-489.526265-393.845427l-115.470423 0c-11.972387-11.826889-23.444035-19.132011-6.267741-39.639636l144.524625-149.431867C165.226643 429.252401 184.630753 429.252401 196.595582 441.08307L196.595582 441.08307zM196.595582 441.08307" p-id="7776"></path></svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

96
src/mixins/basic-add.js Normal file
View File

@ -0,0 +1,96 @@
/*
* @Author: zwq
* @Date: 2022-08-24 11:19:43
* @LastEditors: zwq
* @LastEditTime: 2022-08-26 15:38:58
* @Description:
*/
export default {
data() {
/* eslint-disable */
return {
urlOptions: {
submitURL: '',
infoURL: '',
getOption: false,
optionArrUrl: [],
optionArr: {}
},
visible: false,
setData:false
}
},
created() {
},
activated() {
},
methods: {
init(id) {
this.dataForm.id = id || "";
this.visible = true;
if (this.urlOptions.getOption) {
this.getArr()
}
this.$nextTick(() => {
this.$refs["dataForm"].resetFields();
if (this.dataForm.id) {
this.$http
.get(`${this.urlOptions.infoURL}/${this.dataForm.id}`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.dataForm = res.data;
if(this.setData){
this.setDataForm()
}
})
.catch(() => { });
}
});
},
getArr() {
this.urlOptions.optionArrUrl.forEach((item, index) => {
this.$http
.get(item, {
params: {
page: 1,
limit: 500,
},
})
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.$set(this.urlOptions.optionArr, `arr${index}`, res.data.list)
})
.catch(() => {
});
});
},
// 表单提交
dataFormSubmit() {
this.$refs["dataForm"].validate((valid) => {
if (!valid) {
return false;
}
this.$http[!this.dataForm.id ? "post" : "put"](this.urlOptions.submitURL, this.dataForm)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.$message({
message: this.$t("prompt.success"),
type: "success",
duration: 500,
onClose: () => {
this.visible = false;
this.$emit("refreshDataList");
},
});
})
.catch(() => { });
});
},
}
}

156
src/mixins/basic-page.js Normal file
View File

@ -0,0 +1,156 @@
/*
* @Author: zwq
* @Date: 2022-08-24 11:19:43
* @LastEditors: zwq
* @LastEditTime: 2022-08-24 14:06:58
* @Description:
*/
export default {
data () {
/* eslint-disable */
return {
urlOptions: {
getDataListURL: '',
deleteURL: '',
statusUrl: '',
exportUrl: ''
},
dataForm: {
paramKey: "",
},
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
addOrUpdateVisible: false,
}
},
created () {
},
activated() {
this.getDataList();
},
methods: {
// 获取数据列表
getDataList() {
this.dataListLoading = true;
this.$http
.get(this.urlOptions.getDataListURL, {
params: {
page: this.pageIndex,
limit: this.pageSize,
code: this.dataForm.paramKey,
name: this.dataForm.paramKey,
},
})
.then(({ data: res }) => {
this.dataListLoading = false;
if (res.code !== 0) {
this.dataList = [];
this.totalPage = 0;
return this.$message.error(res.msg);
}
this.dataList = res.data.list;
this.totalPage = res.data.total;
})
.catch(() => {
this.dataListLoading = false;
});
},
// 每页数
sizeChangeHandle(val) {
this.pageSize = val;
this.pageIndex = 1;
this.getDataList();
},
// 当前页
currentChangeHandle(val) {
this.pageIndex = val;
this.getDataList();
},
// 新增 / 修改
addOrUpdateHandle(id) {
this.addOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id);
});
},
cancel(id) {
this.$refs["popover-" + id].showPopper = false;
},
changeStatus(id) {
this.$http
.post(this.urlOptions.statusUrl, { id })
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.$refs["popover-" + id].showPopper = false;
this.$message({
message: this.$t("prompt.success"),
type: "success",
duration: 500,
onClose: () => {
this.getDataList();
},
});
})
.catch(() => {});
},
// 删除
deleteHandle(id, name) {
this.$confirm(`确定对[名称=${name}]进行删除操作?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.$http.delete(this.urlOptions.deleteURL, { data: [id] }).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.getDataList();
},
});
} else {
this.$message.error(data.msg);
}
});
})
.catch(() => {});
},
// 导出
exportHandle(name) {
this.$http
.get(this.urlOptions.exportUrl, { responseType: "blob" })
.then(({ data: res }) => {
var date = new Date();
var year = date.getFullYear();
var month = date.getMonth() + 1;
var strDate = date.getDate();
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (strDate >= 0 && strDate <= 9) {
strDate = "0" + strDate;
}
var currentdate = year + "-" + month + "-" + strDate;
const blob = new Blob([res]);
const downloadElement = document.createElement("a");
const href = window.URL.createObjectURL(blob); // 创建下载的链接
downloadElement.href = href;
downloadElement.download = `${name+currentdate}.xls`; // 下载后文件名
document.body.appendChild(downloadElement);
downloadElement.click(); // 点击下载
document.body.removeChild(downloadElement); // 下载完成移除元素
window.URL.revokeObjectURL(href);
})
.catch(() => {});
}
}
}

View File

@ -43,8 +43,8 @@ export const moduleRoutes = {
{ path: '/processFlow', component: () => import('@/views/spc-basic/processFlow'), name: 'processFlow', meta: { title: '工艺流程', isTab: true } }, { path: '/processFlow', component: () => import('@/views/spc-basic/processFlow'), name: 'processFlow', meta: { title: '工艺流程', isTab: true } },
{ path: '/siteManage', component: () => import('@/views/spc-basic/siteManage'), name: 'siteManage', meta: { title: '站点管理', isTab: true } }, { path: '/siteManage', component: () => import('@/views/spc-basic/siteManage'), name: 'siteManage', meta: { title: '站点管理', isTab: true } },
{ path: '/machineManage', component: () => import('@/views/spc-basic/machineManage'), name: 'machineManage', meta: { title: '机台管理', isTab: true } }, { path: '/machineManage', component: () => import('@/views/spc-basic/machineManage'), name: 'machineManage', meta: { title: '机台管理', isTab: true } },
{ path: '/toolsType', component: () => import('@/views/spc-basic/toolsType'), name: 'toolsType', meta: { title: '量具类型', isTab: true } }, { path: '/toolsType', component: () => import('@/views/spc-basic/toolsType'), name: 'toolsType', meta: { title: '量具管理', isTab: true } },
{ path: '/unitList', component: () => import('@/views/spc-basic/unitList'), name: 'unitList', meta: { title: '计量单位列表', isTab: true } } { path: '/unitList', component: () => import('@/views/spc-basic/unitList'), name: 'unitList', meta: { title: '计量单位管理', isTab: true } }
] ]
} }

View File

@ -65,11 +65,11 @@
</el-submenu> </el-submenu>
<el-menu-item index="toolsType" @click="$router.push({ name: 'toolsType' })"> <el-menu-item index="toolsType" @click="$router.push({ name: 'toolsType' })">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-zonghe"></use></svg> <svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-zonghe"></use></svg>
<span slot="title">量具类型</span> <span slot="title">量具管理</span>
</el-menu-item> </el-menu-item>
<el-menu-item index="unitList" @click="$router.push({ name: 'unitList' })"> <el-menu-item index="unitList" @click="$router.push({ name: 'unitList' })">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-log"></use></svg> <svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-log"></use></svg>
<span slot="title">计量单位列表</span> <span slot="title">计量单位管理</span>
</el-menu-item> </el-menu-item>
</el-submenu> </el-submenu>
<el-submenu index="spc"> <el-submenu index="spc">

View File

@ -58,7 +58,7 @@ export default {
return { return {
captchaPath: '', captchaPath: '',
dataForm: { dataForm: {
username: 'admin', username: 'admin1',
password: 'admin', password: 'admin',
uuid: '', uuid: '',
captcha: '' captcha: ''

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: zwq * @LastEditors: zwq
* @LastEditTime: 2022-08-12 15:37:44 * @LastEditTime: 2022-08-24 14:10:21
* @Description: * @Description:
--> -->
<template> <template>
@ -24,22 +24,22 @@
<el-form-item label="名称" prop="name"> <el-form-item label="名称" prop="name">
<el-input v-model="dataForm.name" placeholder="名称"></el-input> <el-input v-model="dataForm.name" placeholder="名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="描述" prop="desc"> <el-form-item label="描述" prop="descs">
<el-input v-model="dataForm.desc" placeholder="描述"></el-input> <el-input v-model="dataForm.descs" placeholder="描述"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="联系地址" prop="telephone"> <el-form-item label="联系地址" prop="address">
<el-input <el-input
v-model="dataForm.telephone" v-model="dataForm.address"
placeholder="联系地址" placeholder="联系地址"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="类型" prop="type"> <el-form-item label="类型" prop="type">
<el-radio-group v-model="dataForm.type"> <el-radio-group v-model="dataForm.type">
<el-radio :label="0">内部工厂</el-radio> <el-radio label="1">内部工厂</el-radio>
<el-radio :label="1">供应商</el-radio> <el-radio label="2">供应商</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="供应商" v-show="dataForm.type === 1" prop="supplier"> <el-form-item label="供应商" v-show="false" prop="supplier">
<el-select <el-select
v-model="dataForm.supplier" v-model="dataForm.supplier"
filterable filterable
@ -63,18 +63,23 @@
</template> </template>
<script> <script>
import basicAdd from '@/mixins/basic-add'
export default { export default {
mixins: [basicAdd],
data() { data() {
return { return {
visible: false, urlOptions: {
submitURL: '/basic/factory/',
infoURL: '/basic/factory'
},
dataForm: { dataForm: {
id: '', id: '',
code: '', code: '',
name: '', name: '',
telephone: '', address: '',
type: 0, type: 0,
supplier: '', supplier: '',
desc: '' descs: ''
}, },
supplierArr: [], supplierArr: [],
dataRule: { dataRule: {
@ -84,66 +89,6 @@ export default {
} }
}, },
methods: { methods: {
init (id) {
this.dataForm.id = id || ''
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/alarmBase/get`),
method: 'post',
data: this.$http.adornData({ id })
}).then(({ data }) => {
if (data && data.code === 0) {
this.dataForm = data.data
} else {
this.$message.error(data.msg)
}
})
} else {
this.$http({
url: this.$http.adornUrl(`/alarmBase/codeGenerator`),
method: 'post',
data: this.$http.adornData()
}).then(({ data }) => {
if (data && data.code === 0) {
this.dataForm.code = data.data
} else {
this.$message.error('编码生成失败')
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate(valid => {
if (valid) {
this.$http({
url: this.$http.adornUrl(
`/alarmBase/${!this.dataForm.id ? 'add' : 'update'}`
),
method: 'post',
data: this.$http.adornData(this.dataForm)
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
} }
} }
</script> </script>

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: zwq * @LastEditors: zwq
* @LastEditTime: 2022-08-12 15:45:19 * @LastEditTime: 2022-08-24 14:52:18
* @Description: * @Description:
--> -->
<template> <template>
@ -17,14 +17,14 @@
<el-form-item label="名称" prop="name"> <el-form-item label="名称" prop="name">
<el-input v-model="dataForm.name" placeholder="名称"></el-input> <el-input v-model="dataForm.name" placeholder="名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="站点" prop="site"> <el-form-item label="站点" prop="platformId">
<el-select <el-select
v-model="dataForm.site" v-model="dataForm.platformId"
filterable filterable
placeholder="请选择站点" placeholder="请选择站点"
> >
<el-option <el-option
v-for="item in siteArr" v-for="item in urlOptions.optionArr.arr0"
:key="item.id" :key="item.id"
:label="item.name" :label="item.name"
:value="item.id" :value="item.id"
@ -32,8 +32,8 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="描述" prop="desc"> <el-form-item label="描述" prop="remark">
<el-input v-model="dataForm.desc" placeholder="描述"></el-input> <el-input v-model="dataForm.remark" placeholder="描述"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
@ -44,17 +44,24 @@
</template> </template>
<script> <script>
import basicAdd from '@/mixins/basic-add'
export default { export default {
mixins: [basicAdd],
data() { data() {
return { return {
visible: false, urlOptions: {
submitURL: '/basic/machine/',
infoURL: '/basic/machine',
getOption: true,
optionArrUrl: ['/basic/platform/page'],
},
dataForm: { dataForm: {
id: '', id: '',
code: '', code: '',
name: '', name: '',
desc: '' platformId: '',
remark: ''
}, },
siteArr: [],
dataRule: { dataRule: {
code: [ code: [
{ required: true, message: '编码不能为空', trigger: 'blur' } { required: true, message: '编码不能为空', trigger: 'blur' }
@ -66,64 +73,6 @@
} }
}, },
methods: { methods: {
init (id) {
this.dataForm.id = id || ''
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/alarmBase/get`),
method: 'post',
data: this.$http.adornData({id})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm = data.data
} else {
this.$message.error(data.msg)
}
})
} else {
this.$http({
url: this.$http.adornUrl(`/alarmBase/codeGenerator`),
method: 'post',
data: this.$http.adornData()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.code = data.data
} else {
this.$message.error('编码生成失败')
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/alarmBase/${!this.dataForm.id ? 'add' : 'update'}`),
method: 'post',
data: this.$http.adornData(this.dataForm)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
} }
} }
</script> </script>

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: zwq * @LastEditors: zwq
* @LastEditTime: 2022-08-19 14:42:35 * @LastEditTime: 2022-08-24 15:31:22
* @Description: * @Description:
--> -->
<template> <template>
@ -16,14 +16,14 @@
<el-form-item label="名称" prop="name"> <el-form-item label="名称" prop="name">
<el-input v-model="dataForm.name" placeholder="名称"></el-input> <el-input v-model="dataForm.name" placeholder="名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="工序类型" prop="type"> <el-form-item label="工序类型" prop="workingProcedureTypeId">
<el-select <el-select
v-model="dataForm.type" v-model="dataForm.workingProcedureTypeId"
filterable filterable
placeholder="请选择工序类型" placeholder="请选择工序类型"
> >
<el-option <el-option
v-for="item in typeArr" v-for="item in urlOptions.optionArr.arr0"
:key="item.id" :key="item.id"
:label="item.name" :label="item.name"
:value="item.id" :value="item.id"
@ -40,17 +40,23 @@
</template> </template>
<script> <script>
import basicAdd from '@/mixins/basic-add'
export default { export default {
mixins: [basicAdd],
data() { data() {
return { return {
visible: false, urlOptions: {
submitURL: '/basic/workingProcedure/',
infoURL: '/basic/workingProcedure',
getOption: true,
optionArrUrl: ['/basic/workingProcedureType/page'],
},
dataForm: { dataForm: {
id: '', id: '',
code: '', code: '',
name: '', name: '',
type: '' workingProcedureTypeId: ''
}, },
typeArr: [],
dataRule: { dataRule: {
code: [ code: [
{ required: true, message: '编码不能为空', trigger: 'blur' } { required: true, message: '编码不能为空', trigger: 'blur' }
@ -62,64 +68,6 @@
} }
}, },
methods: { methods: {
init (id) {
this.dataForm.id = id || ''
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/alarmBase/get`),
method: 'post',
data: this.$http.adornData({id})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm = data.data
} else {
this.$message.error(data.msg)
}
})
} else {
this.$http({
url: this.$http.adornUrl(`/alarmBase/codeGenerator`),
method: 'post',
data: this.$http.adornData()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.code = data.data
} else {
this.$message.error('编码生成失败')
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/alarmBase/${!this.dataForm.id ? 'add' : 'update'}`),
method: 'post',
data: this.$http.adornData(this.dataForm)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
} }
} }
</script> </script>

View File

@ -2,14 +2,19 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2022-08-19 14:47:07 * @LastEditTime: 2022-08-24 16:10:47
* @Description: * @Description:
--> -->
<template> <template>
<el-dialog <el-dialog title="绑定机台" :visible.sync="visible">
title="绑定机台" <el-transfer
:visible.sync="visible"> v-model="machineArr"
<el-transfer v-model="transferValue" :data="transferData"></el-transfer> :props="{
key: 'id',
label: 'name',
}"
:data="platArr"
></el-transfer>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button> <el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">保存</el-button> <el-button type="primary" @click="dataFormSubmit()">保存</el-button>
@ -21,35 +26,75 @@
export default { export default {
data() { data() {
return { return {
dataForm: {
id: "",
},
machineArr: [],
platArr: [],
visible: false, visible: false,
processId: '', };
transferValue: [],
transferData: []
}
}, },
methods: { methods: {
setDataForm() {
if (this.dataForm.machineId) {
this.machineArr = this.dataForm.machineId.split(",");
}
},
init(id) { init(id) {
this.processId = id || '' this.dataForm.id = id || "";
this.visible = true this.visible = true;
this.getArr();
this.$nextTick(() => { this.$nextTick(() => {
if (this.processId) { if (this.dataForm.id) {
this.$http({ this.$http
url: this.$http.adornUrl(`/alarmBase/get`), .get("/basic/workingProcedure" + "/" + this.dataForm.id)
method: 'post', .then(({ data: res }) => {
data: this.$http.adornData({id}) if (res.code !== 0) {
}).then(({data}) => { return this.$message.error(res.msg);
if (data && data.code === 0) {
this.transferValue = data.data
} else {
this.$message.error(data.msg)
} }
this.dataForm = res.data;
this.setDataForm();
}) })
.catch(() => {});
} }
});
},
getArr() {
this.$http
.get("/basic/machine/page", {
params: {
page: 1,
limit: 500,
},
}) })
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.platArr = res.data.list;
})
.catch(() => {});
}, },
// //
dataFormSubmit() { dataFormSubmit() {
this.dataForm.machineId = this.machineArr.toString();
this.$http.put("/basic/workingProcedure/", this.dataForm)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
} }
} this.$message({
} message: this.$t("prompt.success"),
type: "success",
duration: 500,
onClose: () => {
this.visible = false;
this.$emit("refreshDataList");
},
});
})
.catch(() => {});
},
},
};
</script> </script>

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: zwq * @LastEditors: zwq
* @LastEditTime: 2022-08-12 15:40:35 * @LastEditTime: 2022-08-24 14:10:06
* @Description: * @Description:
--> -->
<template> <template>
@ -26,10 +26,15 @@
</template> </template>
<script> <script>
import basicAdd from '@/mixins/basic-add'
export default { export default {
mixins: [basicAdd],
data() { data() {
return { return {
visible: false, urlOptions: {
submitURL: '/basic/workingProcedureType/',
infoURL: '/basic/workingProcedureType'
},
dataForm: { dataForm: {
id: '', id: '',
code: '', code: '',
@ -46,64 +51,6 @@
} }
}, },
methods: { methods: {
init (id) {
this.dataForm.id = id || ''
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/alarmBase/get`),
method: 'post',
data: this.$http.adornData({id})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm = data.data
} else {
this.$message.error(data.msg)
}
})
} else {
this.$http({
url: this.$http.adornUrl(`/alarmBase/codeGenerator`),
method: 'post',
data: this.$http.adornData()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.code = data.data
} else {
this.$message.error('编码生成失败')
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/alarmBase/${!this.dataForm.id ? 'add' : 'update'}`),
method: 'post',
data: this.$http.adornData(this.dataForm)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
} }
} }
</script> </script>

View File

@ -2,15 +2,16 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2022-08-18 15:13:22 * @LastEditTime: 2022-08-31 10:22:30
* @Description: * @Description:
--> -->
<template> <template>
<el-dialog <el-dialog
:title="!prductId ? '新增' : '修改'" :title="!productId ? '新增' : '修改'"
:close-on-click-modal="false" :close-on-click-modal="false"
width="90%" width="90%"
:visible.sync="visible" :visible.sync="visible"
:before-close="cancle"
> >
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
@ -25,27 +26,34 @@
<one-step <one-step
v-if="oneStepVisible" v-if="oneStepVisible"
ref="oneStepRef" ref="oneStepRef"
:product-id = "productId"
@nextStep="nextStep" @nextStep="nextStep"
@setPrductId="setPrductId"
@setInspectionStage="setInspectionStage"
></one-step> ></one-step>
<two-step <two-step
v-if="twoStepVisible" v-if="twoStepVisible"
ref="twoStepRef" ref="twoStepRef"
:product-id = "productId"
@nextStep="nextStep" @nextStep="nextStep"
></two-step> ></two-step>
<three-step <three-step
v-if="threeStepVisible" v-if="threeStepVisible"
ref="threeStepRef" ref="threeStepRef"
:product-id = "productId"
@nextStep="nextStep" @nextStep="nextStep"
></three-step> ></three-step>
<four-step <four-step
v-if="fourStepVisible" v-if="fourStepVisible"
ref="fourStepRef" ref="fourStepRef"
:product-id = "productId"
:inspection-stage-arr = "inspectionStageArr"
@nextStep="nextStep" @nextStep="nextStep"
></four-step> ></four-step>
</div> </div>
</el-card> </el-card>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="visible = false">取消</el-button> <el-button @click="cancle">取消</el-button>
<el-button @click="preStep" v-show="active > 0" :disabled="submitBtn" <el-button @click="preStep" v-show="active > 0" :disabled="submitBtn"
>上一步</el-button >上一步</el-button
> >
@ -70,8 +78,9 @@ export default {
return { return {
visible: false, visible: false,
active: 0, active: 0,
prductId: '', productId: '',
dataForm: {}, dataForm: {},
inspectionStageArr: [], //
submitBtn: false, submitBtn: false,
oneStepVisible: false, oneStepVisible: false,
twoStepVisible: false, twoStepVisible: false,
@ -89,7 +98,7 @@ export default {
}, },
methods: { methods: {
init (id) { init (id) {
this.prductId = id || '' this.productId = id || ''
this.active = 0 this.active = 0
this.oneStepVisible = true this.oneStepVisible = true
this.$nextTick(() => { this.$nextTick(() => {
@ -105,7 +114,7 @@ export default {
this.submitBtn = true this.submitBtn = true
this.$http({ this.$http({
url: this.$http.adornUrl( url: this.$http.adornUrl(
`/alarmBase/${!this.prductId ? 'add' : 'update'}` `/alarmBase/${!this.productId ? 'add' : 'update'}`
), ),
method: 'post', method: 'post',
data: this.$http.adornData(this.dataForm) data: this.$http.adornData(this.dataForm)
@ -133,12 +142,35 @@ export default {
this[this.stepShowObj[this.active]] = false this[this.stepShowObj[this.active]] = false
this.active += 1 this.active += 1
this[this.stepShowObj[this.active]] = true this[this.stepShowObj[this.active]] = true
this.$nextTick(() => {
this.$refs[this.stepArr[this.active]].init()
})
}, },
preStep () { preStep () {
this[this.stepShowObj[this.active]] = false this[this.stepShowObj[this.active]] = false
this.active -= 1 this.active -= 1
this[this.stepShowObj[this.active]] = true this[this.stepShowObj[this.active]] = true
this.$nextTick(() => {
this.$refs[this.stepArr[this.active]].init()
})
},
cancle(){
this[this.stepShowObj[this.active]] = false
this.visible = false
this.$emit('refreshDataList')
},
setPrductId(id){
this.productId = id
},
setInspectionStage(arr){
this.inspectionStageArr = arr
} }
} }
} }
</script> </script>
<style>
.aui-card--fill .el-card__header {
height: 90px;
}
</style>

View File

@ -0,0 +1,312 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2022-08-31 11:25:21
* @Description:
-->
<template>
<el-dialog
:title="!fourDataForm.id ? '新增' : '修改'"
append-to-body
:visible.sync="fourVisible"
>
<el-row :gutter="10">
<el-form
:model="fourDataForm"
:rules="dataRule"
ref="fourDataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="80px"
>
<el-col :span="8">
<el-form-item label="编码" prop="code">
<el-input v-model="fourDataForm.code" placeholder="编码" readonly></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="名称" prop="name">
<el-input v-model="fourDataForm.name" placeholder="名称" readonly></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="特性类型" prop="type">
<el-select
v-model="fourDataForm.type"
:style="{ width: '100%' }"
readonly
placeholder="请选择特性类型"
>
<el-option
v-for="item in typeArr"
:key="item.value"
:label="item.name"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="缺陷等级" prop="defectLevel">
<el-select
v-model="fourDataForm.defectLevel"
:style="{ width: '100%' }"
filterable
placeholder="请选择缺陷等级"
>
<el-option
v-for="item in defectLevelArr"
:key="item.value"
:label="item.name"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="量具" prop="measureToolId">
<el-select
v-model="fourDataForm.measureToolId"
placeholder="请选择单位"
clearable
:style="{ width: '100%' }"
>
<el-option
v-for="(item, index) in measureToolArr"
:key="index"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="SPC" prop="isSpc">
<el-input v-model="fourDataForm.isSpc" placeholder="SPC"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="分析图形" prop="controlGraphName">
<el-input v-model="fourDataForm.controlGraphName" placeholder="分析图形"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="样本大小" prop="sampleSize">
<el-input-number v-model="fourDataForm.sampleSize" placeholder="样本大小"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="抽样频率" prop="samplingFrequency">
<el-input v-model="fourDataForm.samplingFrequency" placeholder="抽样频率"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="单位" prop="unitId">
<el-select
v-model="fourDataForm.unitId"
placeholder="请选择单位"
clearable
:style="{ width: '100%' }"
>
<el-option
v-for="(item, index) in unitArr"
:key="index"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="小数位数" prop="decimalPlaces">
<el-input-number v-model="fourDataForm.decimalPlaces" placeholder="小数位数"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="规格" prop="specifications">
<el-input v-model="fourDataForm.specifications" placeholder="规格"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="LSL" prop="lsl">
<el-input-number v-model="fourDataForm.lsl" placeholder="LSL"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="SL" prop="sl">
<el-input-number v-model="fourDataForm.sl" placeholder="SL"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="USL" prop="usl">
<el-input-number v-model="fourDataForm.usl" placeholder="USL"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="目标CPK" prop="targetCpk">
<el-input-number v-model="fourDataForm.targetCpk" placeholder="目标CPK"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="目标PPK" prop="targetPpk">
<el-input-number v-model="fourDataForm.targetPpk" placeholder="目标PPK"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注" prop="remark">
<el-input v-model="fourDataForm.remark" placeholder="备注"></el-input>
</el-form-item>
</el-col>
</el-form>
</el-row>
<span slot="footer" class="dialog-footer">
<el-button @click="fourVisible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
data() {
return {
fourVisible: false,
fourDataForm: {
id: "",
productId: "",
code: "",
name: "",
type: "",
defectLevel: "",
measureToolId: "",
isSpc: '',
controlGraphName: '',
sampleSize: '',
samplingFrequency: '',
unitId: "",
decimalPlaces: '',
specifications: '',
lsl: '',
sl: '',
usl: '',
targetCpk: '',
targetPpk: '',
remark: ''
},
typeArr: [
{
name: "计数",
value: 2,
},
{
name: "计量",
value: 1,
},
],
defectLevelArr: [
{
name: "致命缺陷",
value: 1,
},
{
name: "严重缺陷",
value: 2,
},
{
name: "轻微缺陷",
value: 3,
},
],
measureToolArr: [],
unitArr: [],
dataRule: {
code: [{ required: true, message: "编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "名称不能为空", trigger: "blur" }],
},
};
},
created() {
this.getArr();
},
methods: {
init(id, productId) {
this.fourDataForm.id = id || "";
this.fourDataForm.productId = productId;
this.fourVisible = true;
this.$nextTick(() => {
this.$refs["fourDataForm"].resetFields();
if (this.fourDataForm.id) {
this.$http
.get(`/basic/productFeatures/${this.fourDataForm.id}`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.fourDataForm = res.data;
})
.catch(() => {});
}
});
},
getArr() {
this.$http
.get("/basic/unit/page", {
params: {
page: 1,
limit: 500,
},
})
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.unitArr = res.data.list;
})
.catch(() => {});
this.$http
.get("/basic/measureTool/page", {
params: {
page: 1,
limit: 500,
},
})
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.measureToolArr = res.data.list;
})
.catch(() => {});
},
//
dataFormSubmit() {
this.$refs["fourDataForm"].validate((valid) => {
if (!valid) {
return false;
}
this.$http[!this.fourDataForm.id ? "post" : "put"](
"/basic/productFeatures/",
this.fourDataForm
)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.$message({
message: this.$t("prompt.success"),
type: "success",
duration: 500,
onClose: () => {
this.fourVisible = false;
this.$emit("refreshFourDataList");
},
});
})
.catch(() => {});
});
},
},
};
</script>

View File

@ -0,0 +1,171 @@
<!--
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zwq
* @LastEditTime: 2022-08-31 11:22:26
* @Description:
-->
<template>
<div>
<el-tabs @tab-click="tabClick">
<el-tab-pane label="控制矩阵">
<el-checkbox-group v-model="productFeaturesArr" @change="$forceUpdate()" size="medium">
<el-checkbox
v-for="(item, index) in productFeaturesOptions"
:key="index"
:label="item.id"
>{{ item.name }}</el-checkbox
>
</el-checkbox-group>
</el-tab-pane>
<el-tab-pane label="特性列表">
<el-table
:data="dataList"
:stripe="true"
:header-cell-style="{
background: '#eef1f6',
color: '#606266',
height: '56px',
}"
style="width: 100%;"
>
<el-table-column
type="index"
header-align="center"
align="center"
label="序号"
width="50"
>
</el-table-column>
<el-table-column prop="code" label="编号"> </el-table-column>
<el-table-column prop="name" label="名称"></el-table-column>
<el-table-column prop="type" label="特性类型">
<template slot-scope="scope">
<span>{{ scope.row.type === 2 ? "计数" : "计量" }}</span>
</template>
</el-table-column>
<el-table-column prop="defectLevel" label="缺陷等级">
<template slot-scope="scope">
<span>{{
scope.row.defectLevel === 1
? "致命缺陷"
: scope.row.defectLevel === 2
? "严重缺陷"
: "轻微缺陷"
}}</span>
</template>
</el-table-column>
<el-table-column prop="measureToolName" label="量具"></el-table-column>
<el-table-column prop="isSpc" label="SPC">
<template slot-scope="scope">
<span>{{ scope.row.isSpc === 1 ? "是" : "否" }}</span>
</template>
</el-table-column>
<el-table-column prop="controlGraphName" label="分析图形"></el-table-column>
<el-table-column prop="sampleSize" label="样本大小"></el-table-column>
<el-table-column prop="samplingFrequency" label="抽样频率"></el-table-column>
<el-table-column prop="unitName" label="单位"></el-table-column>
<el-table-column prop="decimalPlaces" label="小数位数"></el-table-column>
<el-table-column prop="specifications" label="规格"></el-table-column>
<el-table-column prop="lsl" label="LSL"></el-table-column>
<el-table-column prop="sl" label="SL"></el-table-column>
<el-table-column prop="usl" label="USL"></el-table-column>
<el-table-column prop="targetCpk" label="目标CPK"></el-table-column>
<el-table-column prop="targetPpk" label="目标PPK"></el-table-column>
<el-table-column prop="remark" label="OPC取值标签"></el-table-column>
<el-table-column prop="remark" label="备注"></el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作"
>
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">
<el-tooltip class="item" effect="dark" content="修改" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon">
<use xlink:href="#icon-编辑"></use>
</svg>
</el-tooltip>
</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
<four-add-or-update
v-if="fourAddOrUpdateVisible"
ref="fourAddOrUpdate"
@refreshFourDataList="getFourDataList"
></four-add-or-update>
</div>
</template>
<script>
import fourAddOrUpdate from "./productList-four-add";
export default {
props: {
productFeaturesOptions: {
type: Array,
default: () => {
return [];
},
},
},
data() {
return {
fourAddOrUpdateVisible: false,
dataList: [],
Id: '',
productFeaturesArr: [],
};
},
components: {
fourAddOrUpdate,
},
methods: {
init(label, productId) {
console.log(label);
this.Id = productId;
this.$nextTick(() => {
if (this.Id) {
}
});
},
tabClick(val) {
if (val.label === "特性列表") {
this.dataList = this.productFeaturesOptions.filter((item) => {
if (this.productFeaturesArr.indexOf(item.id) > -1) {
return item;
}
});
}
},
// /
addOrUpdateHandle(id) {
this.fourAddOrUpdateVisible = true;
this.$nextTick(() => {
this.$refs.fourAddOrUpdate.init(id, this.Id);
});
},
getFourDataList() {
this.$http
.post("/basic/productFeatures/getProductFeaturesByProductId", {
id: this.Id,
})
.then(({ data: res }) => {
if (res.code !== 0) {
this.productFeaturesOptions = [];
return this.$message.error(res.msg);
}
this.productFeaturesOptions = res.data;
this.tabClick()
})
.catch(() => {});
},
//
dataFormSubmit() {},
},
};
</script>

View File

@ -1,10 +1,87 @@
<!-- <!--
* @Author: zwq * @Author: zwq
* @Date: 2022-08-17 16:05:23 * @Date: 2021-11-18 14:16:25
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2022-08-17 16:20:03 * @LastEditTime: 2022-09-01 10:22:48
* @Description: * @Description:
--> -->
<template> <template>
<div>444</div> <div>
<el-tabs tab-position="left" @tab-click="tabClick">
<el-tab-pane
v-for="(item, index) in inspectionStageArr"
:key="index"
:label="inspectionStageOptions[item]"
>
<four-content
style="margin-left:10px"
v-if="inspectionStageArr.length"
ref="fourContentRef"
:product-features-options="dataList"
></four-content>
</el-tab-pane>
</el-tabs>
</div>
</template> </template>
<script>
import fourContent from "./productList-four-content";
export default {
props: {
productId: {
type: String,
},
inspectionStageArr: {
type: Array,
default: () => {
return [];
},
},
},
data() {
return {
dataList: [],
inspectionStageOptions: {
"1": "进货检验",
"2": "过程检验",
"3": "成品检验",
"4": "出货检验",
},
};
},
components: {
fourContent,
},
methods: {
init() {
this.inspectionStageArr.sort()
this.$nextTick(() => {
if (this.productId) {
this.getFourDataList();
}
});
},
getFourDataList() {
this.$http
.post("/basic/productFeatures/getProductFeaturesByProductId", {
id: this.productId,
})
.then(({ data: res }) => {
if (res.code !== 0) {
this.dataList = [];
return this.$message.error(res.msg);
}
this.dataList = res.data;
})
.catch(() => {});
},
tabClick(val){
this.$refs.fourContentRef[val.index].init(val.label, this.productId);
},
//
dataFormSubmit() {
this.$emit("nextStep");
},
},
};
</script>

View File

@ -2,18 +2,12 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2022-08-19 14:34:19 * @LastEditTime: 2022-08-31 10:07:19
* @Description: * @Description:
--> -->
<template> <template>
<el-row :gutter="10"> <el-row :gutter="10">
<el-form <el-form ref="dataForm" :model="dataForm" :rules="rules" size="medium" label-width="110px">
ref="dataForm"
:model="dataForm"
:rules="rules"
size="medium"
label-width="110px"
>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="编码" prop="code"> <el-form-item label="编码" prop="code">
<el-input <el-input
@ -35,9 +29,9 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="规格" prop="specs"> <el-form-item label="规格" prop="specifications">
<el-input <el-input
v-model="dataForm.specs" v-model="dataForm.specifications"
placeholder="请输入规格" placeholder="请输入规格"
clearable clearable
:style="{ width: '100%' }" :style="{ width: '100%' }"
@ -56,20 +50,20 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="备注" prop="desc"> <el-form-item label="描述" prop="descs">
<el-input <el-input
v-model="dataForm.desc" v-model="dataForm.descs"
placeholder="请输入备注" placeholder="请输入描述"
clearable clearable
:style="{ width: '100%' }" :style="{ width: '100%' }"
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="描述" prop="description"> <el-form-item label="备注" prop="remark">
<el-input <el-input
v-model="dataForm.description" v-model="dataForm.remark"
placeholder="请输入描述" placeholder="请输入备注"
clearable clearable
:style="{ width: '100%' }" :style="{ width: '100%' }"
> >
@ -77,58 +71,43 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="产品类型" prop="productType"> <el-form-item label="产品类型" prop="productTypeId">
<el-select <el-select
v-model="dataForm.productType" v-model="dataForm.productTypeId"
placeholder="请选择产品类型" placeholder="请选择产品类型"
clearable clearable
:style="{ width: '100%' }" :style="{ width: '100%' }"
> >
<el-option <el-option
v-for="(item, index) in productTypeOptions" v-for="(item, index) in optionArr.arr0"
:key="index" :key="index"
:label="item.label" :label="item.name"
:value="item.value" :value="item.id"
:disabled="item.disabled"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="单位" prop="unit"> <el-form-item label="单位" prop="unitId">
<el-select <el-select
v-model="dataForm.unit" v-model="dataForm.unitId"
placeholder="请选择单位" placeholder="请选择单位"
clearable clearable
:style="{ width: '100%' }" :style="{ width: '100%' }"
> >
<el-option <el-option
v-for="(item, index) in unitOptions" v-for="(item, index) in optionArr.arr1"
:key="index" :key="index"
:label="item.label" :label="item.name"
:value="item.value" :value="item.id"
:disabled="item.disabled"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="检验阶段" prop="inspectionStage"> <el-form-item label="检验标准" prop="inspectionStandard">
<el-checkbox-group v-model="dataForm.inspectionStage" size="medium">
<el-checkbox
v-for="(item, index) in inspectionStageOptions"
:key="index"
:label="item.value"
:disabled="item.disabled"
>{{ item.label }}</el-checkbox
>
</el-checkbox-group>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="检验标准" prop="standard">
<el-input <el-input
v-model="dataForm.standard" v-model="dataForm.inspectionStandard"
placeholder="请输入检验标准" placeholder="请输入检验标准"
clearable clearable
:style="{ width: '100%' }" :style="{ width: '100%' }"
@ -136,143 +115,152 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col>
<el-form-item label="检验阶段" prop="inspectionStageArr">
<el-checkbox-group v-model="dataForm.inspectionStageArr"
@change="$forceUpdate()" size="medium">
<el-checkbox
v-for="(item, index) in inspectionStageOptions"
:key="index"
:label="item.value"
>{{ item.label }}</el-checkbox
>
</el-checkbox-group>
</el-form-item>
</el-col>
</el-form> </el-form>
</el-row> </el-row>
</template> </template>
<script> <script>
export default { export default {
props: {
productId: {
type: String
},
},
data() { data() {
return { return {
dataForm: { dataForm: {
id: '', id: "",
code: undefined, code: undefined,
name: undefined, name: undefined,
specs: undefined, specifications: undefined,
drawing: undefined, drawing: undefined,
desc: undefined, descs: undefined,
description: undefined, remark: undefined,
productType: undefined, productTypeId: undefined,
unit: undefined, unitId: undefined,
inspectionStage: [], inspectionStage: "",
standard: undefined inspectionStageArr: [],
inspectionStandard: undefined,
}, },
rules: { rules: {
code: [ code: [
{ {
required: true, required: true,
message: '请输入编码', message: "请输入编码",
trigger: 'blur' trigger: "blur",
} },
], ],
name: [ name: [
{ {
required: true, required: true,
message: '请输入名称', message: "请输入名称",
trigger: 'blur' trigger: "blur",
}
]
}, },
productTypeOptions: [
{
label: '选项一',
value: 1
},
{
label: '选项二',
value: 2
}
], ],
unitOptions: [
{
label: '选项一',
value: 1
}, },
{
label: '选项二',
value: 2
}
],
inspectionStageOptions: [ inspectionStageOptions: [
{ {
label: '进货检验', label: "进货检验",
value: 1 value: '1',
}, },
{ {
label: '过程检验', label: "过程检验",
value: 2 value: '2',
}, },
{ {
label: '成品检验', label: "成品检验",
value: 3 value: '3',
}, },
{ {
label: '出货检验', label: "出货检验",
value: 4 value: '4',
} },
] ],
} optionArrUrl: ["/basic/productType/page", "/basic/unit/page"],
optionArr: {},
};
}, },
methods: { methods: {
init (id) { init() {
this.dataForm.id = id || '' this.dataForm.id = this.productId || "";
this.getArr();
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.$refs["dataForm"].resetFields();
if (this.dataForm.id) { if (this.dataForm.id) {
this.$http({ this.$http
url: this.$http.adornUrl(`/alarmBase/get`), .get(`/basic/product/${this.dataForm.id}`)
method: 'post', .then(({ data: res }) => {
data: this.$http.adornData({ id }) if (res.code !== 0) {
}).then(({ data }) => { return this.$message.error(res.msg);
if (data && data.code === 0) {
this.dataForm = data.data
} else {
this.$message.error(data.msg)
} }
this.dataForm = res.data;
this.dataForm.inspectionStageArr = this.dataForm.inspectionStage.split(',')
}) })
} else { .catch(() => {});
this.$http({
url: this.$http.adornUrl(`/alarmBase/codeGenerator`),
method: 'post',
data: this.$http.adornData()
}).then(({ data }) => {
if (data && data.code === 0) {
this.dataForm.code = data.data
} else {
this.$message.error('编码生成失败')
} }
});
},
getArr() {
this.optionArrUrl.forEach((item, index) => {
this.$http
.get(item, {
params: {
page: 1,
limit: 500,
},
}) })
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
} }
this.$set(this.optionArr, `arr${index}`, res.data.list);
}) })
.catch(() => {});
});
}, },
// //
dataFormSubmit() { dataFormSubmit() {
this.$emit('nextStep') this.$refs["dataForm"].validate((valid) => {
// this.$refs['dataForm'].validate(valid => { if (!valid) {
// if (valid) { return false;
// this.$http({
// url: this.$http.adornUrl(
// `/alarmBase/${!this.dataForm.id ? 'add' : 'update'}`
// ),
// method: 'post',
// data: this.$http.adornData(this.dataForm)
// }).then(({ data }) => {
// if (data && data.code === 0) {
// this.$message({
// message: '',
// type: 'success',
// duration: 1500,
// onClose: () => {
// this.$emit('nextStep')
// }
// })
// } else {
// this.$message.error(data.msg)
// }
// })
// }
// })
} }
this.dataForm.inspectionStage = this.dataForm.inspectionStageArr.toString()
this.$http[!this.dataForm.id ? "post" : "put"](
`/basic/product/${!this.dataForm.id ? "save" : "update"}`,
this.dataForm
)
.then(({ data: res }) => {
this.$message({
message: this.$t("prompt.success"),
type: "success",
duration: 500,
onClose: () => {
this.$emit("nextStep");
this.$emit("setInspectionStage",this.dataForm.inspectionStageArr);
if(!this.dataForm.id){
this.$emit("setPrductId",res.id);
} }
},
});
})
.catch(({ data: res }) => {
this.$message.error(res.msg)
});
});
},
},
} }
</script> </script>

View File

@ -2,40 +2,130 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2022-08-18 16:30:37 * @LastEditTime: 2022-08-29 16:49:43
* @Description: * @Description:
--> -->
<template> <template>
<el-dialog <el-dialog
:title="!threeDataForm.id ? '新增' : '修改'" :title="!threeDataForm.id ? '新增' : '修改'"
append-to-body append-to-body
:visible.sync="threeVisible"> :visible.sync="threeVisible"
<el-form :model="threeDataForm" :rules="dataRule" ref="threeDataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px"> >
<el-row :gutter="10">
<el-form
:model="threeDataForm"
:rules="dataRule"
ref="threeDataForm"
@keyup.enter.native="dataFormSubmit()"
label-width="80px"
>
<el-col :span="8">
<el-form-item label="编码" prop="code"> <el-form-item label="编码" prop="code">
<el-input v-model="threeDataForm.code" placeholder="编码"></el-input> <el-input v-model="threeDataForm.code" placeholder="编码"></el-input>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="名称" prop="name"> <el-form-item label="名称" prop="name">
<el-input v-model="threeDataForm.name" placeholder="名称"></el-input> <el-input v-model="threeDataForm.name" placeholder="名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="站点" prop="site"> </el-col>
<el-col :span="8">
<el-form-item label="特性类型" prop="type">
<el-select <el-select
v-model="threeDataForm.site" v-model="threeDataForm.type"
:style="{ width: '100%' }"
filterable filterable
placeholder="请选择站点" placeholder="请选择特性类型"
> >
<el-option <el-option
v-for="item in siteArr" v-for="item in typeArr"
:key="item.id" :key="item.value"
:label="item.name" :label="item.name"
:value="item.id" :value="item.value"
> >
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="描述" prop="desc"> </el-col>
<el-input v-model="threeDataForm.desc" placeholder="描述"></el-input> <el-col :span="8">
<el-form-item label="缺陷等级" prop="defectLevel">
<el-select
v-model="threeDataForm.defectLevel"
:style="{ width: '100%' }"
filterable
placeholder="请选择缺陷等级"
>
<el-option
v-for="item in defectLevelArr"
:key="item.value"
:label="item.name"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="量具" prop="measureToolId">
<el-select
v-model="threeDataForm.measureToolId"
placeholder="请选择单位"
clearable
:style="{ width: '100%' }"
>
<el-option
v-for="(item, index) in measureToolArr"
:key="index"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="单位" prop="unitId">
<el-select
v-model="threeDataForm.unitId"
placeholder="请选择单位"
clearable
:style="{ width: '100%' }"
>
<el-option
v-for="(item, index) in unitArr"
:key="index"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="规格" prop="specifications">
<el-input v-model="threeDataForm.specifications" placeholder="规格"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="LSL" prop="lsl">
<el-input-number v-model="threeDataForm.lsl" placeholder="LSL"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="SL" prop="sl">
<el-input-number v-model="threeDataForm.sl" placeholder="SL"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="USL" prop="usl">
<el-input-number v-model="threeDataForm.usl" placeholder="USL"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注" prop="remark">
<el-input v-model="threeDataForm.remark" placeholder="备注"></el-input>
</el-form-item>
</el-col>
</el-form> </el-form>
</el-row>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="threeVisible = false">取消</el-button> <el-button @click="threeVisible = false">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
@ -49,69 +139,132 @@
return { return {
threeVisible: false, threeVisible: false,
threeDataForm: { threeDataForm: {
id: '', id: "",
code: '', productId: "",
name: '', code: "",
desc: '' name: "",
type: "",
defectLevel: "",
measureToolId: "",
unitId: "",
specifications: '',
lsl: '',
sl: '',
usl: '',
remark: ''
},
typeArr: [
{
name: "计数",
value: 2,
},
{
name: "计量",
value: 1,
}, },
siteArr: [],
dataRule: {
code: [
{ required: true, message: '编码不能为空', trigger: 'blur' }
], ],
name: [ defectLevelArr: [
{ required: true, message: '名称不能为空', trigger: 'blur' } {
] name: "致命缺陷",
} value: 1,
} },
{
name: "严重缺陷",
value: 2,
},
{
name: "轻微缺陷",
value: 3,
},
],
measureToolArr: [],
unitArr: [],
dataRule: {
code: [{ required: true, message: "编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "名称不能为空", trigger: "blur" }],
},
};
},
created() {
this.getArr();
}, },
methods: { methods: {
init (id) { init(id, productId) {
this.threeDataForm.id = id || '' this.threeDataForm.id = id || "";
this.threeVisible = true this.threeDataForm.productId = productId;
this.threeVisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['threeDataForm'].resetFields() this.$refs["threeDataForm"].resetFields();
if (this.threeDataForm.id) { if (this.threeDataForm.id) {
this.$http({ this.$http
url: this.$http.adornUrl(`/alarmBase/get`), .get(`/basic/productFeatures/${this.threeDataForm.id}`)
method: 'post', .then(({ data: res }) => {
data: this.$http.adornData({id}) if (res.code !== 0) {
}).then(({data}) => { return this.$message.error(res.msg);
if (data && data.code === 0) {
this.threeDataForm = data.data
} else {
this.$message.error(data.msg)
} }
this.threeDataForm = res.data;
}) })
.catch(() => {});
} }
});
},
getArr() {
this.$http
.get("/basic/unit/page", {
params: {
page: 1,
limit: 500,
},
}) })
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.unitArr = res.data.list;
})
.catch(() => {});
this.$http
.get("/basic/measureTool/page", {
params: {
page: 1,
limit: 500,
},
})
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.measureToolArr = res.data.list;
})
.catch(() => {});
}, },
// //
dataFormSubmit() { dataFormSubmit() {
this.$refs['threeDataForm'].validate((valid) => { this.$refs["threeDataForm"].validate((valid) => {
if (valid) { if (!valid) {
this.$http({ return false;
url: this.$http.adornUrl(`/alarmBase/${!this.threeDataForm.id ? 'add' : 'update'}`), }
method: 'post', this.$http[!this.threeDataForm.id ? "post" : "put"](
data: this.$http.adornData(this.threeDataForm) "/basic/productFeatures/",
}).then(({data}) => { this.threeDataForm
if (data && data.code === 0) { )
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.$message({ this.$message({
message: '操作成功', message: this.$t("prompt.success"),
type: 'success', type: "success",
duration: 1500, duration: 500,
onClose: () => { onClose: () => {
this.threeVisible = false this.threeVisible = false;
this.$emit('refreshThreeDataList') this.$emit("refreshThreeDataList");
} },
});
}) })
} else { .catch(() => {});
this.$message.error(data.msg) });
} },
}) },
} };
})
}
}
}
</script> </script>

View File

@ -2,60 +2,69 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2022-08-18 16:27:23 * @LastEditTime: 2022-08-29 16:46:06
* @Description: * @Description:
--> -->
<template> <template>
<div> <div>
<div style="float:right;margin-bottom:10px">
<el-button size="small" type="primary" @click="addOrUpdateHandle()"> <el-button size="small" type="primary" @click="addOrUpdateHandle()">
<icon-svg class="iconClass" name="新建"></icon-svg> <svg class="icon-svg"><use xlink:href="#icon-新建"></use></svg>
新增 新增
</el-button> </el-button>
</div>
<el-table <el-table
:data="dataList" :data="dataList"
:stripe="true" :stripe="true"
:header-cell-style="{ :header-cell-style="{
background: '#eef1f6', background: '#eef1f6',
color: '#606266', color: '#606266',
height: '56px' height: '56px',
}" }"
v-loading="dataListLoading" v-loading="dataListLoading"
style="width: 100%;" style="width: 100%;"
> >
<el-table-column <el-table-column type="index" header-align="center" align="center" label="序号" width="50">
type="index"
header-align="center"
align="center"
label="序号"
width="50"
>
</el-table-column> </el-table-column>
<el-table-column prop="code" label="编号"> </el-table-column> <el-table-column prop="code" label="编号"> </el-table-column>
<el-table-column prop="name" label="名称"> <el-table-column prop="name" label="名称"></el-table-column>
<el-table-column prop="type" label="特性类型">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.name" placeholder="名称"></el-input> <span>{{ scope.row.type === 2 ? "计数" : "计量" }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="defectLevel" label="缺陷等级">
fixed="right"
header-align="center"
align="center"
width="150"
label="操作"
>
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{
scope.row.defectLevel === 1
? "致命缺陷"
: scope.row.defectLevel === 2
? "严重缺陷"
: "轻微缺陷"
}}</span>
</template>
</el-table-column>
<el-table-column prop="measureToolName" label="量具"></el-table-column>
<el-table-column prop="unitName" label="单位"></el-table-column>
<el-table-column prop="specifications" label="规格"></el-table-column>
<el-table-column prop="lsl" label="LSL"></el-table-column>
<el-table-column prop="sl" label="SL"></el-table-column>
<el-table-column prop="usl" label="USL"></el-table-column>
<el-table-column prop="remark" label="备注"></el-table-column>
<el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">
<el-tooltip class="item" effect="dark" content="修改" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-编辑"></use></svg>
</el-tooltip>
</el-button>
<el-button <el-button
type="text" type="text"
style="color:red" style="color:red"
size="small" size="small"
@click="deleteHandle(scope.row.id)" @click="deleteHandle(scope.row.id, scope.row.name)"
>
<el-tooltip
class="item"
effect="dark"
content="删除"
placement="top"
> >
<el-tooltip class="item" effect="dark" content="删除" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-删除"></use></svg> <svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-删除"></use></svg>
</el-tooltip> </el-tooltip>
</el-button> </el-button>
@ -71,82 +80,86 @@
</template> </template>
<script> <script>
import threeAddOrUpdate from './productList-three-add' import threeAddOrUpdate from "./productList-three-add";
export default { export default {
props: {
productId: {
type: String,
},
},
data() { data() {
return { return {
dataListLoading: false, dataListLoading: false,
threeAddOrUpdateVisible: false, threeAddOrUpdateVisible: false,
dataList: [] dataList: [],
} };
}, },
components: { components: {
threeAddOrUpdate threeAddOrUpdate,
}, },
methods: { methods: {
init (id) { init() {
this.prductId = id || '' this.dataListLoading = false;
this.dataListLoading = false
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() if (this.productId) {
if (this.prductId) { this.getThreeDataList();
this.getThreeDataList()
} }
}) });
}, },
getThreeDataList() { getThreeDataList() {
this.dataListLoading = false this.dataListLoading = true;
// this.dataListLoading = true this.$http
// this.$http({ .post("/basic/productFeatures/getProductFeaturesByProductId", {
// url: this.$http.adornUrl('/alarmBase/page'), id: this.productId,
// method: 'post', })
// data: this.$http.adornData({ .then(({ data: res }) => {
// 'current': this.pageIndex, this.dataListLoading = false;
// 'size': this.pageSize, if (res.code !== 0) {
// 'key': this.dataForm.paramKey this.dataList = [];
// }) return this.$message.error(res.msg);
// }).then(({data}) => { }
// if (data && data.code === 0) { this.dataList = res.data;
// this.dataList = data.data.list })
// this.totalPage = data.data.total .catch(() => {
// } else { this.dataListLoading = false;
// this.dataList = [] });
// this.totalPage = 0
// }
// this.dataListLoading = false
// })
}, },
// / // /
addOrUpdateHandle(id) { addOrUpdateHandle(id) {
this.threeAddOrUpdateVisible = true this.threeAddOrUpdateVisible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.threeAddOrUpdate.init(id) this.$refs.threeAddOrUpdate.init(id, this.productId);
});
},
//
deleteHandle(id, name) {
this.$confirm(`确定对[名称=${name}]进行删除操作?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}) })
.then(() => {
this.$http.delete("/basic/productFeatures", { data: [id] }).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.getThreeDataList();
},
});
} else {
this.$message.error(data.msg);
}
});
})
.catch(() => {});
}, },
// //
dataFormSubmit() { dataFormSubmit() {
this.$emit('nextStep') this.$emit("nextStep");
// this.$http({ },
// url: this.$http.adornUrl( },
// `/alarmBase/${!this.dataForm.id ? 'add' : 'update'}` };
// ),
// method: 'post',
// data: this.$http.adornData(this.dataForm)
// }).then(({ data }) => {
// if (data && data.code === 0) {
// this.$message({
// message: '',
// type: 'success',
// duration: 1500,
// onClose: () => {
// this.$emit('nextStep')
// }
// })
// } else {
// this.$message.error(data.msg)
// }
// })
}
}
}
</script> </script>

View File

@ -2,25 +2,25 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: zwq * @LastEditors: zwq
* @LastEditTime: 2022-08-18 15:14:51 * @LastEditTime: 2022-08-31 09:38:20
* @Description: * @Description:
--> -->
<template> <template>
<div> <div>
<div style="margin-bottom:20px"> <div style="margin-bottom:20px">
<el-select v-model="processObj" filterable placeholder="请选择"> <el-tooltip content="选择工序,新增到表格" placement="top">
<el-option <el-select
v-for="item in processArr" size="small"
:key="item.value" v-model="processId"
:label="item.label" @change="addProcess"
:value="item.value" clearable
filterable
placeholder="请选择"
> >
<el-option v-for="item in processArr" :key="item.id" :label="item.name" :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
<el-button size="small" type="primary" @click="addProcess()"> </el-tooltip>
<icon-svg class="iconClass" name="新建"></icon-svg>
添加
</el-button>
</div> </div>
<el-table <el-table
:data="dataList" :data="dataList"
@ -28,46 +28,24 @@
:header-cell-style="{ :header-cell-style="{
background: '#eef1f6', background: '#eef1f6',
color: '#606266', color: '#606266',
height: '56px' height: '56px',
}" }"
v-loading="dataListLoading" v-loading="dataListLoading"
style="width: 100%;" style="width: 100%;"
> >
<el-table-column <el-table-column type="index" header-align="center" align="center" label="序号" width="50">
type="index"
header-align="center"
align="center"
label="序号"
width="50"
>
</el-table-column> </el-table-column>
<el-table-column prop="processName" label="工序名称"> </el-table-column> <el-table-column prop="workingProcedureName" label="工序名称"> </el-table-column>
<el-table-column prop="processCode" label="工序编码"> </el-table-column> <el-table-column prop="workingProcedureCode" label="工序编码"> </el-table-column>
<el-table-column prop="name" label="名称"> <el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
<template slot-scope="scope">
<el-input v-model="scope.row.name" placeholder="名称"></el-input>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
type="text" type="text"
style="color:red" style="color:red"
size="small" size="small"
@click="deleteHandle(scope.row.id)" @click="deleteHandle(scope.row.id, scope.row.workingProcedureName)"
>
<el-tooltip
class="item"
effect="dark"
content="删除"
placement="top"
> >
<el-tooltip class="item" effect="dark" content="删除" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-删除"></use></svg> <svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-删除"></use></svg>
</el-tooltip> </el-tooltip>
</el-button> </el-button>
@ -79,64 +57,120 @@
<script> <script>
export default { export default {
props: {
productId: {
type: String,
},
},
data() { data() {
return { return {
dataListLoading: false, dataListLoading: false,
dataList: [], dataList: [],
processArr: [], processArr: [],
processObj: {} processId: "",
} };
}, },
methods: { methods: {
init (id) { getArr() {
this.prductId = id || '' this.$http
this.dataListLoading = false .get("/basic/workingProcedure/page", {
params: {
page: 1,
limit: 500,
},
})
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.processArr = res.data.list;
})
.catch(() => {});
},
getList() {
this.dataListLoading = true;
this.$http
.get(`/basic/productWorkingprocedureRelation/getWorkingprocedureByProductId/${this.productId}`)
.then(({ data: res }) => {
this.dataListLoading = false;
if (res.code !== 0) {
this.dataList = [];
return this.$message.error(res.msg);
}
this.dataList = res.data;
})
.catch(() => {
this.dataListLoading = false;
});
},
init() {
this.getArr();
this.dataListLoading = false;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.processId = "";
if (this.prductId) { if (this.productId) {
this.dataListLoading = true this.getList();
this.$http({
url: this.$http.adornUrl(`/alarmBase/get`),
method: 'post',
data: this.$http.adornData({ id })
}).then(({ data }) => {
if (data && data.code === 0) {
this.dataListLoading = false
this.dataList = data.data.list
} else {
this.$message.error(data.msg)
} }
}) });
}
})
}, },
addProcess() { addProcess() {
console.log('add') if(this.processId){
this.$confirm(`确定新增此工序?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
this.$http
.post("/basic/productWorkingprocedureRelation/save", {
workingProcedureId: this.processId,
productId: this.productId,
})
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.$message({
message: this.$t("prompt.success"),
type: "success",
duration: 500,
onClose: () => {
this.getList();
},
});
})
.catch(() => {});
});
}
},
//
deleteHandle(id, name) {
this.$confirm(`确定对[名称=${name}]进行删除操作?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.$http.delete("/basic/productWorkingprocedureRelation", { data: [id] }).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.getList();
},
});
} else {
this.$message.error(data.msg);
}
});
})
.catch(() => {});
}, },
// //
dataFormSubmit() { dataFormSubmit() {
this.$emit('nextStep') this.$emit("nextStep");
// this.$http({ },
// url: this.$http.adornUrl( },
// `/alarmBase/${!this.dataForm.id ? 'add' : 'update'}` };
// ),
// method: 'post',
// data: this.$http.adornData(this.dataForm)
// }).then(({ data }) => {
// if (data && data.code === 0) {
// this.$message({
// message: '',
// type: 'success',
// duration: 1500,
// onClose: () => {
// this.$emit('nextStep')
// }
// })
// } else {
// this.$message.error(data.msg)
// }
// })
}
}
}
</script> </script>

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: zwq * @LastEditors: zwq
* @LastEditTime: 2022-08-23 14:37:30 * @LastEditTime: 2022-08-24 14:10:11
* @Description: * @Description:
--> -->
<template> <template>
@ -24,8 +24,8 @@
<el-form-item label="名称" prop="name"> <el-form-item label="名称" prop="name">
<el-input v-model="dataForm.name" placeholder="名称"></el-input> <el-input v-model="dataForm.name" placeholder="名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="描述" prop="desc"> <el-form-item label="描述" prop="descs">
<el-input v-model="dataForm.desc" placeholder="描述"></el-input> <el-input v-model="dataForm.descs" placeholder="描述"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
@ -36,15 +36,20 @@
</template> </template>
<script> <script>
import basicAdd from '@/mixins/basic-add'
export default { export default {
mixins: [basicAdd],
data() { data() {
return { return {
visible: false, urlOptions: {
submitURL: '/basic/productType/',
infoURL: '/basic/productType'
},
dataForm: { dataForm: {
id: "", id: "",
code: "", code: "",
name: "", name: "",
desc: "", descs: "",
}, },
dataRule: { dataRule: {
code: [{ required: true, message: "编码不能为空", trigger: "blur" }], code: [{ required: true, message: "编码不能为空", trigger: "blur" }],
@ -53,48 +58,6 @@ export default {
}; };
}, },
methods: { methods: {
init(id) {
this.dataForm.id = id || "";
this.visible = true;
this.$nextTick(() => {
this.$refs["dataForm"].resetFields();
if (this.dataForm.id) {
this.$http
.get(`/basic/productType/${this.dataForm.id}`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.dataForm = res.data;
})
.catch(() => {});
}
});
},
//
dataFormSubmit() {
this.$refs["dataForm"].validate((valid) => {
if (!valid) {
return false;
}
this.$http[!this.dataForm.id ? "post" : "put"]("/basic/productType", this.dataForm)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
}
this.$message({
message: this.$t("prompt.success"),
type: "success",
duration: 500,
onClose: () => {
this.visible = false;
this.$emit("refreshDataList");
},
});
})
.catch(() => {});
});
},
}, },
}; };
</script> </script>

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: zwq * @LastEditors: zwq
* @LastEditTime: 2022-08-12 15:43:06 * @LastEditTime: 2022-08-24 14:16:06
* @Description: * @Description:
--> -->
<template> <template>
@ -17,8 +17,8 @@
<el-form-item label="名称" prop="name"> <el-form-item label="名称" prop="name">
<el-input v-model="dataForm.name" placeholder="名称"></el-input> <el-input v-model="dataForm.name" placeholder="名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="站点分组" prop="group"> <el-form-item label="站点分组" prop="platformGroup">
<el-input v-model="dataForm.group" placeholder="站点分组"></el-input> <el-input v-model="dataForm.platformGroup" placeholder="站点分组"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
@ -29,15 +29,20 @@
</template> </template>
<script> <script>
import basicAdd from '@/mixins/basic-add'
export default { export default {
mixins: [basicAdd],
data() { data() {
return { return {
visible: false, urlOptions: {
submitURL: '/basic/platform/',
infoURL: '/basic/platform'
},
dataForm: { dataForm: {
id: '', id: '',
code: '', code: '',
name: '', name: '',
group: '' platformGroup: ''
}, },
dataRule: { dataRule: {
code: [ code: [
@ -50,64 +55,6 @@
} }
}, },
methods: { methods: {
init (id) {
this.dataForm.id = id || ''
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/alarmBase/get`),
method: 'post',
data: this.$http.adornData({id})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm = data.data
} else {
this.$message.error(data.msg)
}
})
} else {
this.$http({
url: this.$http.adornUrl(`/alarmBase/codeGenerator`),
method: 'post',
data: this.$http.adornData()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.code = data.data
} else {
this.$message.error('编码生成失败')
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/alarmBase/${!this.dataForm.id ? 'add' : 'update'}`),
method: 'post',
data: this.$http.adornData(this.dataForm)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
} }
} }
</script> </script>

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: zwq * @LastEditors: zwq
* @LastEditTime: 2022-08-16 16:44:03 * @LastEditTime: 2022-08-24 14:59:45
* @Description: * @Description:
--> -->
<template> <template>
@ -56,10 +56,15 @@
</template> </template>
<script> <script>
import basicAdd from '@/mixins/basic-add'
export default { export default {
mixins: [basicAdd],
data() { data() {
return { return {
visible: false, urlOptions: {
submitURL: '/basic/measureTool/',
infoURL: '/basic/measureTool'
},
dataForm: { dataForm: {
id: '', id: '',
code: '', code: '',
@ -70,11 +75,11 @@
typeArr: [ typeArr: [
{ {
name: '计数', name: '计数',
value: 2 value: '2'
}, },
{ {
name: '计量', name: '计量',
value: 1 value: '1'
} }
], ],
parentType: [], parentType: [],
@ -92,64 +97,6 @@
} }
}, },
methods: { methods: {
init (id) {
this.dataForm.id = id || ''
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/alarmBase/get`),
method: 'post',
data: this.$http.adornData({id})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm = data.data
} else {
this.$message.error(data.msg)
}
})
} else {
this.$http({
url: this.$http.adornUrl(`/alarmBase/codeGenerator`),
method: 'post',
data: this.$http.adornData()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.code = data.data
} else {
this.$message.error('编码生成失败')
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/alarmBase/${!this.dataForm.id ? 'add' : 'update'}`),
method: 'post',
data: this.$http.adornData(this.dataForm)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
} }
} }
</script> </script>

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: zwq * @LastEditors: zwq
* @LastEditTime: 2022-08-12 16:11:33 * @LastEditTime: 2022-08-24 15:07:43
* @Description: * @Description:
--> -->
<template> <template>
@ -38,10 +38,15 @@
</template> </template>
<script> <script>
import basicAdd from '@/mixins/basic-add'
export default { export default {
mixins: [basicAdd],
data() { data() {
return { return {
visible: false, urlOptions: {
submitURL: '',
infoURL: ''
},
dataForm: { dataForm: {
id: '', id: '',
code: '', code: '',
@ -59,64 +64,6 @@
} }
}, },
methods: { methods: {
init (id) {
this.dataForm.id = id || ''
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/alarmBase/get`),
method: 'post',
data: this.$http.adornData({id})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm = data.data
} else {
this.$message.error(data.msg)
}
})
} else {
this.$http({
url: this.$http.adornUrl(`/alarmBase/codeGenerator`),
method: 'post',
data: this.$http.adornData()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.code = data.data
} else {
this.$message.error('编码生成失败')
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/alarmBase/${!this.dataForm.id ? 'add' : 'update'}`),
method: 'post',
data: this.$http.adornData(this.dataForm)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
} }
} }
</script> </script>

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: zwq * @LastEditors: zwq
* @LastEditTime: 2022-08-12 16:08:09 * @LastEditTime: 2022-08-24 15:06:08
* @Description: * @Description:
--> -->
<template> <template>
@ -55,7 +55,7 @@
content="修改" content="修改"
placement="top" placement="top"
> >
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-编辑"></use></svg> <svg class="icon-svg"><use xlink:href="#icon-编辑"></use></svg>
</el-tooltip> </el-tooltip>
</el-button> </el-button>
<el-button <el-button
@ -70,7 +70,7 @@
content="删除" content="删除"
placement="top" placement="top"
> >
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-删除"></use></svg> <svg class="icon-svg"><use xlink:href="#icon-删除"></use></svg>
</el-tooltip> </el-tooltip>
</el-button> </el-button>
</template> </template>
@ -90,11 +90,16 @@
<script> <script>
import AddOrUpdate from './toolsType-detail-add' import AddOrUpdate from './toolsType-detail-add'
import basicPage from '@/mixins/basic-page'
export default { export default {
mixins: [basicPage],
data() { data() {
return { return {
urlOptions: {
getDataListURL: '/basic/measureTool/page',
deleteURL: '/basic/measureTool',
},
visible: false, visible: false,
addOrUpdateVisible: false,
toolsId: '' toolsId: ''
} }
}, },
@ -106,42 +111,6 @@ export default {
this.toolsId = id || '' this.toolsId = id || ''
this.visible = true this.visible = true
this.$nextTick(() => {}) this.$nextTick(() => {})
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
this.$confirm(`确定对[id=${id}]进行删除操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.$http({
url: this.$http.adornUrl('/alarmBase/delete'),
method: 'post',
data: this.$http.adornData({ id })
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
.catch(() => {})
} }
} }
} }

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: zwq * @LastEditors: zwq
* @LastEditTime: 2022-08-12 15:50:23 * @LastEditTime: 2022-08-24 15:13:08
* @Description: * @Description:
--> -->
<template> <template>
@ -41,10 +41,15 @@
</template> </template>
<script> <script>
import basicAdd from '@/mixins/basic-add'
export default { export default {
mixins: [basicAdd],
data() { data() {
return { return {
visible: false, urlOptions: {
submitURL: '/basic/unit/',
infoURL: '/basic/unit'
},
dataForm: { dataForm: {
id: '', id: '',
code: '', code: '',
@ -54,7 +59,7 @@
typeArr: [ typeArr: [
{ {
name: '不可计数', name: '不可计数',
value: 0 value: 2
}, },
{ {
name: '可计数', name: '可计数',
@ -75,64 +80,6 @@
} }
}, },
methods: { methods: {
init (id) {
this.dataForm.id = id || ''
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.$http({
url: this.$http.adornUrl(`/alarmBase/get`),
method: 'post',
data: this.$http.adornData({id})
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm = data.data
} else {
this.$message.error(data.msg)
}
})
} else {
this.$http({
url: this.$http.adornUrl(`/alarmBase/codeGenerator`),
method: 'post',
data: this.$http.adornData()
}).then(({data}) => {
if (data && data.code === 0) {
this.dataForm.code = data.data
} else {
this.$message.error('编码生成失败')
}
})
}
})
},
//
dataFormSubmit () {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl(`/alarmBase/${!this.dataForm.id ? 'add' : 'update'}`),
method: 'post',
data: this.$http.adornData(this.dataForm)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
} }
} }
</script> </script>

View File

@ -10,18 +10,25 @@
<el-input <el-input
size="small" size="small"
v-model="dataForm.paramKey" v-model="dataForm.paramKey"
clearable
placeholder="请输入关键字查询" placeholder="请输入关键字查询"
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button size="small" @click="getDataList()"> <el-button size="small" @click="getDataList()">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-sousuo"></use></svg> <svg class="icon-svg"><use xlink:href="#icon-sousuo"></use></svg>
查询 查询
</el-button> </el-button>
<el-button size="small" type="primary" @click="addOrUpdateHandle()"> <el-button size="small" type="primary" @click="addOrUpdateHandle()">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-新建"></use></svg> <svg class="icon-svg"><use xlink:href="#icon-新建"></use></svg>
新增 新增
</el-button> </el-button>
<el-button size="small" type="primary" @click="exportHandle('工厂管理')">
<svg class="icon-svg">
<use xlink:href="#导出"></use>
</svg>
导出
</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table
@ -52,14 +59,14 @@
label="类型" label="类型"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag :type="scope.row.type === 0 ? '' : 'success'">{{ <el-tag :type="scope.row.type === '1' ? '' : 'success'">{{
scope.row.type === 0 ? "工厂" : "供应商" scope.row.type === '1' ? "内部工厂" : "供应商"
}}</el-tag> }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="supplier" label="供应商"> </el-table-column> <!-- <el-table-column prop="supplier" label="供应商"> </el-table-column> -->
<el-table-column prop="telephone" label="联系地址"> </el-table-column> <el-table-column prop="address" label="联系地址"> </el-table-column>
<el-table-column prop="desc" label="描述"> </el-table-column> <el-table-column prop="descs" label="描述"> </el-table-column>
<el-table-column <el-table-column
type="status" type="status"
header-align="center" header-align="center"
@ -95,11 +102,27 @@
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-编辑"></use></svg> <svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-编辑"></use></svg>
</el-tooltip> </el-tooltip>
</el-button> </el-button>
<!-- <el-button type="text" style="color:red" size="small" @click="deleteHandle(scope.row.id)"> <el-popover placement="top" width="160" trigger="click" :ref="`popover-${scope.row.id}`">
<p>确定要改变状态吗</p>
<div style="text-align: right; margin: 0">
<el-button type="text" size="mini" @click="cancel(scope.row.id)">取消</el-button>
<el-button type="primary" size="mini" @click="changeStatus(scope.row.id)"
>确定</el-button
>
</div>
<el-button type="text" size="small" slot="reference">
<el-tooltip class="item" effect="dark" content="改变状态" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon">
<use xlink:href="#转让状态"></use>
</svg>
</el-tooltip>
</el-button>
</el-popover>
<el-button type="text" style="color:red" size="small" @click="deleteHandle(scope.row.id, scope.row.name)">
<el-tooltip class="item" effect="dark" content="删除" placement="top"> <el-tooltip class="item" effect="dark" content="删除" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-删除"></use></svg> <svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-删除"></use></svg>
</el-tooltip> </el-tooltip>
</el-button> --> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -124,96 +147,23 @@
<script> <script>
import AddOrUpdate from './components/factoryManage-add' import AddOrUpdate from './components/factoryManage-add'
import basicPage from '@/mixins/basic-page'
export default { export default {
mixins: [basicPage],
data() { data() {
return { return {
dataForm: { urlOptions: {
paramKey: '' getDataListURL: '/basic/factory/page',
deleteURL: '/basic/factory',
statusUrl: '/basic/factory/status',
exportUrl: '/basic/factory/export'
}, },
dataList: [], };
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
addOrUpdateVisible: false
}
}, },
components: { components: {
AddOrUpdate AddOrUpdate,
},
activated () {
this.getDataList()
}, },
methods: { methods: {
//
getDataList () {
// this.dataListLoading = true
// this.$http({
// url: this.$http.adornUrl('/alarmBase/page'),
// method: 'post',
// data: this.$http.adornData({
// 'current': this.pageIndex,
// 'size': this.pageSize,
// 'key': this.dataForm.paramKey
// })
// }).then(({data}) => {
// if (data && data.code === 0) {
// this.dataList = data.data.list
// this.totalPage = data.data.total
// } else {
// this.dataList = []
// this.totalPage = 0
// }
// this.dataListLoading = false
// })
}, },
// };
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
this.$confirm(`确定对[id=${id}]进行删除操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.$http({
url: this.$http.adornUrl('/alarmBase/delete'),
method: 'post',
data: this.$http.adornData({ id })
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
.catch(() => {})
}
}
}
</script> </script>

View File

@ -10,18 +10,25 @@
<el-input <el-input
size="small" size="small"
v-model="dataForm.paramKey" v-model="dataForm.paramKey"
clearable
placeholder="请输入关键字查询" placeholder="请输入关键字查询"
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button size="small" @click="getDataList()"> <el-button size="small" @click="getDataList()">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-sousuo"></use></svg> <svg class="icon-svg"><use xlink:href="#icon-sousuo"></use></svg>
查询 查询
</el-button> </el-button>
<el-button size="small" type="primary" @click="addOrUpdateHandle()"> <el-button size="small" type="primary" @click="addOrUpdateHandle()">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-新建"></use></svg> <svg class="icon-svg"><use xlink:href="#icon-新建"></use></svg>
新增 新增
</el-button> </el-button>
<el-button size="small" type="primary" @click="exportHandle('机台管理')">
<svg class="icon-svg">
<use xlink:href="#导出"></use>
</svg>
导出
</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table
@ -45,8 +52,8 @@
</el-table-column> </el-table-column>
<el-table-column prop="name" label="名称"> </el-table-column> <el-table-column prop="name" label="名称"> </el-table-column>
<el-table-column prop="code" label="编码"> </el-table-column> <el-table-column prop="code" label="编码"> </el-table-column>
<el-table-column prop="site" label="站点"> </el-table-column> <el-table-column prop="platformName" label="站点"> </el-table-column>
<el-table-column prop="desc" label="描述"> </el-table-column> <el-table-column prop="remark" label="描述"> </el-table-column>
<el-table-column <el-table-column
type="status" type="status"
header-align="center" header-align="center"
@ -82,11 +89,32 @@
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-编辑"></use></svg> <svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-编辑"></use></svg>
</el-tooltip> </el-tooltip>
</el-button> </el-button>
<!-- <el-button type="text" style="color:red" size="small" @click="deleteHandle(scope.row.id)"> <el-popover placement="top" width="160" trigger="click" :ref="`popover-${scope.row.id}`">
<p>确定要改变状态吗</p>
<div style="text-align: right; margin: 0">
<el-button type="text" size="mini" @click="cancel(scope.row.id)">取消</el-button>
<el-button type="primary" size="mini" @click="changeStatus(scope.row.id)"
>确定</el-button
>
</div>
<el-button type="text" size="small" slot="reference">
<el-tooltip class="item" effect="dark" content="改变状态" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon">
<use xlink:href="#转让状态"></use>
</svg>
</el-tooltip>
</el-button>
</el-popover>
<el-button
type="text"
style="color:red"
size="small"
@click="deleteHandle(scope.row.id, scope.row.name)"
>
<el-tooltip class="item" effect="dark" content="删除" placement="top"> <el-tooltip class="item" effect="dark" content="删除" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-删除"></use></svg> <svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-删除"></use></svg>
</el-tooltip> </el-tooltip>
</el-button> --> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -111,96 +139,23 @@
<script> <script>
import AddOrUpdate from './components/machineManage-add' import AddOrUpdate from './components/machineManage-add'
import basicPage from '@/mixins/basic-page'
export default { export default {
mixins: [basicPage],
data() { data() {
return { return {
dataForm: { urlOptions: {
paramKey: '' getDataListURL: '/basic/machine/page',
deleteURL: '/basic/machine',
statusUrl: '/basic/machine/status',
exportUrl: '/basic/machine/export'
}, },
dataList: [], };
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
addOrUpdateVisible: false
}
}, },
components: { components: {
AddOrUpdate AddOrUpdate,
},
activated () {
this.getDataList()
}, },
methods: { methods: {
//
getDataList () {
// this.dataListLoading = true
// this.$http({
// url: this.$http.adornUrl('/alarmBase/page'),
// method: 'post',
// data: this.$http.adornData({
// 'current': this.pageIndex,
// 'size': this.pageSize,
// 'key': this.dataForm.paramKey
// })
// }).then(({data}) => {
// if (data && data.code === 0) {
// this.dataList = data.data.list
// this.totalPage = data.data.total
// } else {
// this.dataList = []
// this.totalPage = 0
// }
// this.dataListLoading = false
// })
}, },
// };
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
this.$confirm(`确定对[id=${id}]进行删除操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.$http({
url: this.$http.adornUrl('/alarmBase/delete'),
method: 'post',
data: this.$http.adornData({ id })
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
.catch(() => {})
}
}
}
</script> </script>

View File

@ -10,18 +10,25 @@
<el-input <el-input
size="small" size="small"
v-model="dataForm.paramKey" v-model="dataForm.paramKey"
clearable
placeholder="请输入关键字查询" placeholder="请输入关键字查询"
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button size="small" @click="getDataList()"> <el-button size="small" @click="getDataList()">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-sousuo"></use></svg> <svg class="icon-svg"><use xlink:href="#icon-sousuo"></use></svg>
查询 查询
</el-button> </el-button>
<el-button size="small" type="primary" @click="addOrUpdateHandle()"> <el-button size="small" type="primary" @click="addOrUpdateHandle()">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-新建"></use></svg> <svg class="icon-svg"><use xlink:href="#icon-新建"></use></svg>
新增 新增
</el-button> </el-button>
<el-button size="small" type="primary" @click="exportHandle('工序定义')">
<svg class="icon-svg">
<use xlink:href="#导出"></use>
</svg>
导出
</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table
@ -45,10 +52,10 @@
</el-table-column> </el-table-column>
<el-table-column prop="name" label="名称"> </el-table-column> <el-table-column prop="name" label="名称"> </el-table-column>
<el-table-column prop="code" label="编码"> </el-table-column> <el-table-column prop="code" label="编码"> </el-table-column>
<el-table-column prop="type" label="类型"> </el-table-column> <el-table-column prop="workingProcedureTypeName" label="类型"> </el-table-column>
<el-table-column prop="Machine" label="机台"> <el-table-column prop="machineName" label="机台">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{scope.row.Machine.join(',')}}</span> <span>{{ scope.row.machineName}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -68,7 +75,7 @@
fixed="right" fixed="right"
header-align="center" header-align="center"
align="center" align="center"
width="150" width="200"
label="操作" label="操作"
> >
<template slot-scope="scope"> <template slot-scope="scope">
@ -97,14 +104,35 @@
content="绑定机台" content="绑定机台"
placement="top" placement="top"
> >
<icon-svg class="iconClass" name="进工业炉加工"></icon-svg> <svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-进工业炉加工"></use></svg>
</el-tooltip> </el-tooltip>
</el-button> </el-button>
<!-- <el-button type="text" style="color:red" size="small" @click="deleteHandle(scope.row.id)"> <el-popover placement="top" width="160" trigger="click" :ref="`popover-${scope.row.id}`">
<p>确定要改变状态吗</p>
<div style="text-align: right; margin: 0">
<el-button type="text" size="mini" @click="cancel(scope.row.id)">取消</el-button>
<el-button type="primary" size="mini" @click="changeStatus(scope.row.id)"
>确定</el-button
>
</div>
<el-button type="text" size="small" slot="reference">
<el-tooltip class="item" effect="dark" content="改变状态" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon">
<use xlink:href="#转让状态"></use>
</svg>
</el-tooltip>
</el-button>
</el-popover>
<el-button
type="text"
style="color:red"
size="small"
@click="deleteHandle(scope.row.id, scope.row.name)"
>
<el-tooltip class="item" effect="dark" content="删除" placement="top"> <el-tooltip class="item" effect="dark" content="删除" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-删除"></use></svg> <svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-删除"></use></svg>
</el-tooltip> </el-tooltip>
</el-button> --> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -135,18 +163,17 @@
<script> <script>
import AddOrUpdate from './components/processDefine-add' import AddOrUpdate from './components/processDefine-add'
import BindMachine from './components/processDefine-machine' import BindMachine from './components/processDefine-machine'
import basicPage from '@/mixins/basic-page'
export default { export default {
mixins: [basicPage],
data() { data() {
return { return {
dataForm: { urlOptions: {
paramKey: '' getDataListURL: '/basic/workingProcedure/page',
deleteURL: '/basic/workingProcedure',
statusUrl: '/basic/workingProcedure/status',
exportUrl: '/basic/workingProcedure/export'
}, },
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
addOrUpdateVisible: false,
bindMachineVisible: false bindMachineVisible: false
} }
}, },
@ -154,85 +181,13 @@ export default {
AddOrUpdate, AddOrUpdate,
BindMachine BindMachine
}, },
activated () {
this.getDataList()
},
methods: { methods: {
//
getDataList () {
// this.dataListLoading = true
// this.$http({
// url: this.$http.adornUrl('/alarmBase/page'),
// method: 'post',
// data: this.$http.adornData({
// 'current': this.pageIndex,
// 'size': this.pageSize,
// 'key': this.dataForm.paramKey
// })
// }).then(({data}) => {
// if (data && data.code === 0) {
// this.dataList = data.data.list
// this.totalPage = data.data.total
// } else {
// this.dataList = []
// this.totalPage = 0
// }
// this.dataListLoading = false
// })
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
bindMachine (id) { bindMachine (id) {
this.bindMachineVisible = true this.bindMachineVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.bindMachineRef.init(id) this.$refs.bindMachineRef.init(id)
}) })
}, },
//
deleteHandle (id) {
this.$confirm(`确定对[id=${id}]进行删除操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.$http({
url: this.$http.adornUrl('/alarmBase/delete'),
method: 'post',
data: this.$http.adornData({ id })
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
.catch(() => {})
}
} }
} }
</script> </script>

View File

@ -0,0 +1,115 @@
<!--
* @Author: zwq
* @Date: 2022-08-22 15:53:16
* @LastEditors: zwq
* @LastEditTime: 2022-09-01 15:45:42
* @Description:
-->
<template>
<el-card shadow="never" class="aui-card--fill">
<el-row :gutter="10">
<el-col :span="10">
<el-form
style="background-color:#e6f7ff;padding:10px 20px"
:inline="true"
:model="dataForm"
@keyup.enter.native="getDataList()"
>
<el-form-item>
<el-input v-model="dataForm.paramKey" clearable placeholder="请输入关键字查询" />
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">
<svg class="icon-svg"><use xlink:href="#icon-sousuo"></use></svg>
查询
</el-button>
</el-form-item>
</el-form>
<el-table
:data="dataList"
height="650"
highlight-current-row
@current-change="handleCurrentChange"
:header-cell-style="{
background: '#eef1f6',
color: '#606266',
height: '56px',
}"
border
v-loading="dataListLoading"
style="width: 100%;"
>
<el-table-column
fixed="left"
type="index"
header-align="center"
align="center"
label="序号"
width="50"
>
</el-table-column>
<el-table-column prop="name" label="名称" fixed="left"> </el-table-column>
<el-table-column prop="code" label="编码" fixed="left"> </el-table-column>
</el-table>
</el-col>
<el-col :span="14">
<process-flow-graph
ref="graphRef"
@refreshDataList="getDataList"
></process-flow-graph>
</el-col>
</el-row>
</el-card>
</template>
<script>
import processFlowGraph from './components/processFlow-graph'
export default {
data() {
return {
dataListLoading: false,
dataList: [],
dataForm: {
paramKey: "",
},
currentRow: "",
};
},
components: {
processFlowGraph,
},
activated() {
this.getDataList();
},
methods: {
getDataList() {
this.dataListLoading = true;
this.$http
.get("/basic/product/page", {
params: {
page: 1,
limit: 500,
code: this.dataForm.paramKey,
name: this.dataForm.paramKey,
},
})
.then(({ data: res }) => {
this.dataListLoading = false;
if (res.code !== 0) {
this.dataList = [];
return this.$message.error(res.msg);
}
this.dataList = res.data.list;
})
.catch(() => {
this.dataListLoading = false;
});
},
handleCurrentChange(val) {
console.log(val);
this.currentRow = val;
},
},
};
</script>

View File

@ -10,18 +10,25 @@
<el-input <el-input
size="small" size="small"
v-model="dataForm.paramKey" v-model="dataForm.paramKey"
clearable
placeholder="请输入关键字查询" placeholder="请输入关键字查询"
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button size="small" @click="getDataList()"> <el-button size="small" @click="getDataList()">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-sousuo"></use></svg> <svg class="icon-svg"><use xlink:href="#icon-sousuo"></use></svg>
查询 查询
</el-button> </el-button>
<el-button size="small" type="primary" @click="addOrUpdateHandle()"> <el-button size="small" type="primary" @click="addOrUpdateHandle()">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-新建"></use></svg> <svg class="icon-svg"><use xlink:href="#icon-新建"></use></svg>
新增 新增
</el-button> </el-button>
<el-button size="small" type="primary" @click="exportHandle('工序类型')">
<svg class="icon-svg">
<use xlink:href="#导出"></use>
</svg>
导出
</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table
@ -80,11 +87,27 @@
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-编辑"></use></svg> <svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-编辑"></use></svg>
</el-tooltip> </el-tooltip>
</el-button> </el-button>
<!-- <el-button type="text" style="color:red" size="small" @click="deleteHandle(scope.row.id)"> <el-popover placement="top" width="160" trigger="click" :ref="`popover-${scope.row.id}`">
<p>确定要改变状态吗</p>
<div style="text-align: right; margin: 0">
<el-button type="text" size="mini" @click="cancel(scope.row.id)">取消</el-button>
<el-button type="primary" size="mini" @click="changeStatus(scope.row.id)"
>确定</el-button
>
</div>
<el-button type="text" size="small" slot="reference">
<el-tooltip class="item" effect="dark" content="改变状态" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon">
<use xlink:href="#转让状态"></use>
</svg>
</el-tooltip>
</el-button>
</el-popover>
<el-button type="text" style="color:red" size="small" @click="deleteHandle(scope.row.id, scope.row.name)">
<el-tooltip class="item" effect="dark" content="删除" placement="top"> <el-tooltip class="item" effect="dark" content="删除" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-删除"></use></svg> <svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-删除"></use></svg>
</el-tooltip> </el-tooltip>
</el-button> --> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -109,96 +132,23 @@
<script> <script>
import AddOrUpdate from './components/processType-add' import AddOrUpdate from './components/processType-add'
import basicPage from '@/mixins/basic-page'
export default { export default {
mixins: [basicPage],
data() { data() {
return { return {
dataForm: { urlOptions: {
paramKey: '' getDataListURL: '/basic/workingProcedureType/page',
deleteURL: '/basic/workingProcedureType',
statusUrl: '/basic/workingProcedureType/status',
exportUrl: '/basic/workingProcedureType/export'
}, },
dataList: [], };
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
addOrUpdateVisible: false
}
}, },
components: { components: {
AddOrUpdate AddOrUpdate,
},
activated () {
this.getDataList()
}, },
methods: { methods: {
//
getDataList () {
// this.dataListLoading = true
// this.$http({
// url: this.$http.adornUrl('/alarmBase/page'),
// method: 'post',
// data: this.$http.adornData({
// 'current': this.pageIndex,
// 'size': this.pageSize,
// 'key': this.dataForm.paramKey
// })
// }).then(({data}) => {
// if (data && data.code === 0) {
// this.dataList = data.data.list
// this.totalPage = data.data.total
// } else {
// this.dataList = []
// this.totalPage = 0
// }
// this.dataListLoading = false
// })
}, },
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
this.$confirm(`确定对[id=${id}]进行删除操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.$http({
url: this.$http.adornUrl('/alarmBase/delete'),
method: 'post',
data: this.$http.adornData({ id })
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
.catch(() => {})
}
}
} }
</script> </script>

View File

@ -10,18 +10,25 @@
<el-input <el-input
size="small" size="small"
v-model="dataForm.paramKey" v-model="dataForm.paramKey"
clearable
placeholder="请输入关键字查询" placeholder="请输入关键字查询"
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button size="small" @click="getDataList()"> <el-button size="small" @click="getDataList()">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-sousuo"></use></svg> <svg class="icon-svg"><use xlink:href="#icon-sousuo"></use></svg>
查询 查询
</el-button> </el-button>
<el-button size="small" type="primary" @click="addOrUpdateHandle()"> <el-button size="small" type="primary" @click="addOrUpdateHandle()">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-新建"></use></svg> <svg class="icon-svg"><use xlink:href="#icon-新建"></use></svg>
新增 新增
</el-button> </el-button>
<el-button size="small" type="primary" @click="exportHandle('产品列表')">
<svg class="icon-svg">
<use xlink:href="#导出"></use>
</svg>
导出
</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table
@ -46,21 +53,22 @@
</el-table-column> </el-table-column>
<el-table-column prop="name" label="名称" fixed="left"> </el-table-column> <el-table-column prop="name" label="名称" fixed="left"> </el-table-column>
<el-table-column prop="code" label="编码" fixed="left"> </el-table-column> <el-table-column prop="code" label="编码" fixed="left"> </el-table-column>
<el-table-column prop="specs" label="规格"> </el-table-column> <el-table-column prop="specifications" label="规格"> </el-table-column>
<el-table-column prop="drawing" label="图纸"> </el-table-column> <el-table-column prop="drawing" label="图纸"> </el-table-column>
<el-table-column prop="productType" label="产品类型"> </el-table-column> <el-table-column prop="productType" label="产品类型"> </el-table-column>
<el-table-column prop="description" label="描述"> </el-table-column> <el-table-column prop="descs" label="描述"> </el-table-column>
<el-table-column prop="desc" label="备注"> </el-table-column> <el-table-column prop="remark" label="备注"> </el-table-column>
<el-table-column prop="standard" label="检验标准"> </el-table-column> <el-table-column prop="inspectionStandard" label="检验标准"> </el-table-column>
<el-table-column prop="model" label="技术型号"> </el-table-column>
<el-table-column prop="inspectionStage" label="检验阶段"> <el-table-column prop="inspectionStage" label="检验阶段">
<template slot-scope="scope"> <template slot-scope="scope">
<el-checkbox-group v-model="scope.row.inspectionStage"> <div style="pointer-events: none;">
<el-checkbox :label="1" disabled>进货检验</el-checkbox> <el-checkbox-group :value ="scope.row.inspectionStage.split(',')">
<el-checkbox :label="2" disabled>过程检验</el-checkbox> <el-checkbox label="1">进货检验</el-checkbox>
<el-checkbox :label="3" disabled>成品检验</el-checkbox> <el-checkbox label="2">过程检验</el-checkbox>
<el-checkbox :label="4" disabled>出货检验</el-checkbox> <el-checkbox label="3">成品检验</el-checkbox>
<el-checkbox label="4">出货检验</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -76,7 +84,7 @@
}}</el-tag> }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <!-- <el-table-column
fixed="right" fixed="right"
header-align="center" header-align="center"
align="center" align="center"
@ -95,11 +103,13 @@
content="检验计划" content="检验计划"
placement="top" placement="top"
> >
<icon-svg class="iconClass" name="日历"></icon-svg> <svg class="icon-svg aui-sidebar__menu-icon">
<use xlink:href="#icon-详情"></use>
</svg>
</el-tooltip> </el-tooltip>
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column> -->
<el-table-column <el-table-column
fixed="right" fixed="right"
header-align="center" header-align="center"
@ -122,11 +132,32 @@
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-编辑"></use></svg> <svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-编辑"></use></svg>
</el-tooltip> </el-tooltip>
</el-button> </el-button>
<!-- <el-button type="text" style="color:red" size="small" @click="deleteHandle(scope.row.id)"> <el-popover placement="top" width="160" trigger="click" :ref="`popover-${scope.row.id}`">
<p>确定要改变状态吗</p>
<div style="text-align: right; margin: 0">
<el-button type="text" size="mini" @click="cancel(scope.row.id)">取消</el-button>
<el-button type="primary" size="mini" @click="changeStatus(scope.row.id)"
>确定</el-button
>
</div>
<el-button type="text" size="small" slot="reference">
<el-tooltip class="item" effect="dark" content="改变状态" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon">
<use xlink:href="#转让状态"></use>
</svg>
</el-tooltip>
</el-button>
</el-popover>
<el-button
type="text"
style="color:red"
size="small"
@click="deleteHandle(scope.row.id, scope.row.name)"
>
<el-tooltip class="item" effect="dark" content="删除" placement="top"> <el-tooltip class="item" effect="dark" content="删除" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-删除"></use></svg> <svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-删除"></use></svg>
</el-tooltip> </el-tooltip>
</el-button> --> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -151,96 +182,23 @@
<script> <script>
import AddOrUpdate from './components/productList-add' import AddOrUpdate from './components/productList-add'
import basicPage from '@/mixins/basic-page'
export default { export default {
mixins: [basicPage],
data() { data() {
return { return {
dataForm: { urlOptions: {
paramKey: '' getDataListURL: '/basic/product/page',
deleteURL: '/basic/product/delete',
statusUrl: '/basic/product/status',
exportUrl: '/basic/product/export'
}, },
dataList: [], };
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
addOrUpdateVisible: false
}
}, },
components: { components: {
AddOrUpdate AddOrUpdate,
},
activated () {
this.getDataList()
}, },
methods: { methods: {
//
getDataList () {
// this.dataListLoading = true
// this.$http({
// url: this.$http.adornUrl('/alarmBase/page'),
// method: 'post',
// data: this.$http.adornData({
// 'current': this.pageIndex,
// 'size': this.pageSize,
// 'key': this.dataForm.paramKey
// })
// }).then(({data}) => {
// if (data && data.code === 0) {
// this.dataList = data.data.list
// this.totalPage = data.data.total
// } else {
// this.dataList = []
// this.totalPage = 0
// }
// this.dataListLoading = false
// })
}, },
// };
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
this.$confirm(`确定对[id=${id}]进行删除操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.$http({
url: this.$http.adornUrl('/alarmBase/delete'),
method: 'post',
data: this.$http.adornData({ id })
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
.catch(() => {})
}
}
}
</script> </script>

View File

@ -10,18 +10,25 @@
<el-input <el-input
size="small" size="small"
v-model="dataForm.paramKey" v-model="dataForm.paramKey"
clearable
placeholder="请输入关键字查询" placeholder="请输入关键字查询"
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button size="small" @click="getDataList()"> <el-button size="small" @click="getDataList()">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-sousuo"></use></svg> <svg class="icon-svg"><use xlink:href="#icon-sousuo"></use></svg>
查询 查询
</el-button> </el-button>
<el-button size="small" type="primary" @click="addOrUpdateHandle()"> <el-button size="small" type="primary" @click="addOrUpdateHandle()">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-新建"></use></svg> <svg class="icon-svg"><use xlink:href="#icon-新建"></use></svg>
新增 新增
</el-button> </el-button>
<el-button size="small" type="primary" @click="exportHandle('产品类型')">
<svg class="icon-svg">
<use xlink:href="#导出"></use>
</svg>
导出
</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table
@ -30,62 +37,56 @@
:header-cell-style="{ :header-cell-style="{
background: '#eef1f6', background: '#eef1f6',
color: '#606266', color: '#606266',
height: '56px' height: '56px',
}" }"
v-loading="dataListLoading" v-loading="dataListLoading"
style="width: 100%;" style="width: 100%;"
> >
<el-table-column <el-table-column type="index" header-align="center" align="center" label="序号" width="50">
type="index"
header-align="center"
align="center"
label="序号"
width="50"
>
</el-table-column> </el-table-column>
<el-table-column prop="name" label="名称"> </el-table-column> <el-table-column prop="name" label="名称"> </el-table-column>
<el-table-column prop="code" label="编码"> </el-table-column> <el-table-column prop="code" label="编码"> </el-table-column>
<el-table-column prop="desc" label="描述"> </el-table-column> <el-table-column prop="descs" label="描述"> </el-table-column>
<el-table-column <el-table-column type="status" header-align="center" align="center" label="状态" width="80">
type="status"
header-align="center"
align="center"
label="状态"
width="80"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag :type="scope.row.status === 0 ? 'danger' : 'success'">{{ <el-tag :type="scope.row.status === 0 ? 'danger' : 'success'">{{
scope.row.status === 0 ? "不可用" : "可用" scope.row.status === 0 ? "不可用" : "可用"
}}</el-tag> }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
fixed="right"
header-align="center"
align="center"
width="150"
label="操作"
>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">
type="text" <el-tooltip class="item" effect="dark" content="修改" placement="top">
size="small"
@click="addOrUpdateHandle(scope.row.id)"
>
<el-tooltip
class="item"
effect="dark"
content="修改"
placement="top"
>
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-编辑"></use></svg> <svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-编辑"></use></svg>
</el-tooltip> </el-tooltip>
</el-button> </el-button>
<!-- <el-button type="text" style="color:red" size="small" @click="deleteHandle(scope.row.id)"> <el-popover placement="top" width="160" trigger="click" :ref="`popover-${scope.row.id}`">
<p>确定要改变状态吗</p>
<div style="text-align: right; margin: 0">
<el-button type="text" size="mini" @click="cancel(scope.row.id)">取消</el-button>
<el-button type="primary" size="mini" @click="changeStatus(scope.row.id)"
>确定</el-button
>
</div>
<el-button type="text" size="small" slot="reference">
<el-tooltip class="item" effect="dark" content="改变状态" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon">
<use xlink:href="#转让状态"></use>
</svg>
</el-tooltip>
</el-button>
</el-popover>
<el-button
type="text"
style="color:red"
size="small"
@click="deleteHandle(scope.row.id, scope.row.name)"
>
<el-tooltip class="item" effect="dark" content="删除" placement="top"> <el-tooltip class="item" effect="dark" content="删除" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-删除"></use></svg> <svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-删除"></use></svg>
</el-tooltip> </el-tooltip>
</el-button> --> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -109,100 +110,24 @@
</template> </template>
<script> <script>
import AddOrUpdate from './components/productType-add' import AddOrUpdate from "./components/productType-add";
import basicPage from '@/mixins/basic-page'
export default { export default {
mixins: [basicPage],
data() { data() {
return { return {
dataForm: { urlOptions: {
paramKey: '' getDataListURL: '/basic/productType/page',
deleteURL: '/basic/productType',
statusUrl: '/basic/productType/status',
exportUrl: '/basic/productType/export'
}, },
dataList: [], };
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
addOrUpdateVisible: false
}
}, },
components: { components: {
AddOrUpdate AddOrUpdate,
},
activated () {
this.getDataList()
}, },
methods: { methods: {
//
getDataList () {
this.dataListLoading = true
this.$http({
url: this.$http.get('/basic/productType/page',
{
params: {
page: this.pageIndex,
limit: this.pageSize,
code: this.dataForm.paramKey,
name: this.dataForm.paramKey
}
}),
}).then(({data}) => {
if (data && data.code === 0) {
this.dataList = data.data.list
this.totalPage = data.data.total
} else {
this.dataList = []
this.totalPage = 0
}
this.dataListLoading = false
})
}, },
// };
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
this.$confirm(`确定对[id=${id}]进行删除操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.$http({
url: this.$http.delete('/basic/productType',
{'data': [id] }),
method: 'post',
data: this.$http.adornData({ id })
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
.catch(() => {})
}
}
}
</script> </script>

View File

@ -10,18 +10,25 @@
<el-input <el-input
size="small" size="small"
v-model="dataForm.paramKey" v-model="dataForm.paramKey"
clearable
placeholder="请输入关键字查询" placeholder="请输入关键字查询"
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button size="small" @click="getDataList()"> <el-button size="small" @click="getDataList()">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-sousuo"></use></svg> <svg class="icon-svg"><use xlink:href="#icon-sousuo"></use></svg>
查询 查询
</el-button> </el-button>
<el-button size="small" type="primary" @click="addOrUpdateHandle()"> <el-button size="small" type="primary" @click="addOrUpdateHandle()">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-新建"></use></svg> <svg class="icon-svg"><use xlink:href="#icon-新建"></use></svg>
新增 新增
</el-button> </el-button>
<el-button size="small" type="primary" @click="exportHandle('站点管理')">
<svg class="icon-svg">
<use xlink:href="#导出"></use>
</svg>
导出
</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table
@ -45,7 +52,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="name" label="名称"> </el-table-column> <el-table-column prop="name" label="名称"> </el-table-column>
<el-table-column prop="code" label="编码"> </el-table-column> <el-table-column prop="code" label="编码"> </el-table-column>
<el-table-column prop="group" label="站点分组"> </el-table-column> <el-table-column prop="platformGroup" label="站点分组"> </el-table-column>
<el-table-column <el-table-column
type="status" type="status"
header-align="center" header-align="center"
@ -81,11 +88,32 @@
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-编辑"></use></svg> <svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-编辑"></use></svg>
</el-tooltip> </el-tooltip>
</el-button> </el-button>
<!-- <el-button type="text" style="color:red" size="small" @click="deleteHandle(scope.row.id)"> <el-popover placement="top" width="160" trigger="click" :ref="`popover-${scope.row.id}`">
<p>确定要改变状态吗</p>
<div style="text-align: right; margin: 0">
<el-button type="text" size="mini" @click="cancel(scope.row.id)">取消</el-button>
<el-button type="primary" size="mini" @click="changeStatus(scope.row.id)"
>确定</el-button
>
</div>
<el-button type="text" size="small" slot="reference">
<el-tooltip class="item" effect="dark" content="改变状态" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon">
<use xlink:href="#转让状态"></use>
</svg>
</el-tooltip>
</el-button>
</el-popover>
<el-button
type="text"
style="color:red"
size="small"
@click="deleteHandle(scope.row.id, scope.row.name)"
>
<el-tooltip class="item" effect="dark" content="删除" placement="top"> <el-tooltip class="item" effect="dark" content="删除" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-删除"></use></svg> <svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-删除"></use></svg>
</el-tooltip> </el-tooltip>
</el-button> --> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -110,96 +138,23 @@
<script> <script>
import AddOrUpdate from './components/siteManage-add' import AddOrUpdate from './components/siteManage-add'
import basicPage from '@/mixins/basic-page'
export default { export default {
mixins: [basicPage],
data() { data() {
return { return {
dataForm: { urlOptions: {
paramKey: '' getDataListURL: '/basic/platform/page',
deleteURL: '/basic/platform',
statusUrl: '/basic/platform/status',
exportUrl: '/basic/platform/export'
}, },
dataList: [], };
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
addOrUpdateVisible: false
}
}, },
components: { components: {
AddOrUpdate AddOrUpdate,
},
activated () {
this.getDataList()
}, },
methods: { methods: {
//
getDataList () {
// this.dataListLoading = true
// this.$http({
// url: this.$http.adornUrl('/alarmBase/page'),
// method: 'post',
// data: this.$http.adornData({
// 'current': this.pageIndex,
// 'size': this.pageSize,
// 'key': this.dataForm.paramKey
// })
// }).then(({data}) => {
// if (data && data.code === 0) {
// this.dataList = data.data.list
// this.totalPage = data.data.total
// } else {
// this.dataList = []
// this.totalPage = 0
// }
// this.dataListLoading = false
// })
}, },
// };
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
this.$confirm(`确定对[id=${id}]进行删除操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.$http({
url: this.$http.adornUrl('/alarmBase/delete'),
method: 'post',
data: this.$http.adornData({ id })
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
.catch(() => {})
}
}
}
</script> </script>

View File

@ -10,18 +10,25 @@
<el-input <el-input
size="small" size="small"
v-model="dataForm.paramKey" v-model="dataForm.paramKey"
clearable
placeholder="请输入关键字查询" placeholder="请输入关键字查询"
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button size="small" @click="getDataList()"> <el-button size="small" @click="getDataList()">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-sousuo"></use></svg> <svg class="icon-svg"><use xlink:href="#icon-sousuo"></use></svg>
查询 查询
</el-button> </el-button>
<el-button size="small" type="primary" @click="addOrUpdateHandle()"> <el-button size="small" type="primary" @click="addOrUpdateHandle()">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-新建"></use></svg> <svg class="icon-svg"><use xlink:href="#icon-新建"></use></svg>
新增 新增
</el-button> </el-button>
<el-button size="small" type="primary" @click="exportHandle('量具管理')">
<svg class="icon-svg">
<use xlink:href="#导出"></use>
</svg>
导出
</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table
@ -48,7 +55,7 @@
<el-table-column prop="type" label="测量类型"> <el-table-column prop="type" label="测量类型">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ <span>{{
scope.row.type === 2 ? "计数" : "计量" scope.row.type === '2' ? "计数" : "计量"
}}</span> }}</span>
</template> </template>
</el-table-column> </el-table-column>
@ -69,7 +76,7 @@
fixed="right" fixed="right"
header-align="center" header-align="center"
align="center" align="center"
width="150" width="200"
label="操作" label="操作"
> >
<template slot-scope="scope"> <template slot-scope="scope">
@ -98,14 +105,37 @@
content="台差参数" content="台差参数"
placement="top" placement="top"
> >
<icon-svg class="iconClass" name="详情"></icon-svg> <svg class="icon-svg aui-sidebar__menu-icon">
<use xlink:href="#icon-详情"></use>
</svg>
</el-tooltip> </el-tooltip>
</el-button> </el-button>
<!-- <el-button type="text" style="color:red" size="small" @click="deleteHandle(scope.row.id)"> <el-popover placement="top" width="160" trigger="click" :ref="`popover-${scope.row.id}`">
<p>确定要改变状态吗</p>
<div style="text-align: right; margin: 0">
<el-button type="text" size="mini" @click="cancel(scope.row.id)">取消</el-button>
<el-button type="primary" size="mini" @click="changeStatus(scope.row.id)"
>确定</el-button
>
</div>
<el-button type="text" size="small" slot="reference">
<el-tooltip class="item" effect="dark" content="改变状态" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon">
<use xlink:href="#转让状态"></use>
</svg>
</el-tooltip>
</el-button>
</el-popover>
<el-button
type="text"
style="color:red"
size="small"
@click="deleteHandle(scope.row.id, scope.row.name)"
>
<el-tooltip class="item" effect="dark" content="删除" placement="top"> <el-tooltip class="item" effect="dark" content="删除" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-删除"></use></svg> <svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-删除"></use></svg>
</el-tooltip> </el-tooltip>
</el-button> --> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -125,115 +155,42 @@
ref="addOrUpdate" ref="addOrUpdate"
@refreshDataList="getDataList" @refreshDataList="getDataList"
></add-or-update> ></add-or-update>
<add-or-update <detail
v-if="detailVisible" v-if="detailVisible"
ref="detailRef" ref="detailRef"
@refreshDataList="getDataList" @refreshDataList="getDataList"
></add-or-update> ></detail>
</el-card> </el-card>
</template> </template>
<script> <script>
import AddOrUpdate from './components/toolsType-add' import AddOrUpdate from './components/toolsType-add'
import Detail from './components/toolsType-detail' import Detail from './components/toolsType-detail'
import basicPage from '@/mixins/basic-page'
export default { export default {
mixins: [basicPage],
data() { data() {
return { return {
dataForm: { urlOptions: {
paramKey: '' getDataListURL: '/basic/measureTool/page',
deleteURL: '/basic/measureTool',
statusUrl: '/basic/measureTool/status',
exportUrl: '/basic/measureTool/export'
}, },
dataList: [],
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
detailVisible: false, detailVisible: false,
addOrUpdateVisible: false
} }
}, },
components: { components: {
AddOrUpdate, AddOrUpdate,
Detail Detail
}, },
activated () {
this.getDataList()
},
methods: { methods: {
//
getDataList () {
// this.dataListLoading = true
// this.$http({
// url: this.$http.adornUrl('/alarmBase/page'),
// method: 'post',
// data: this.$http.adornData({
// 'current': this.pageIndex,
// 'size': this.pageSize,
// 'key': this.dataForm.paramKey
// })
// }).then(({data}) => {
// if (data && data.code === 0) {
// this.dataList = data.data.list
// this.totalPage = data.data.total
// } else {
// this.dataList = []
// this.totalPage = 0
// }
// this.dataListLoading = false
// })
},
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
detail (id) { detail (id) {
this.detailVisible = true this.detailVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.detailRef.init(id) this.$refs.detailRef.init(id)
}) })
}, },
//
deleteHandle (id) {
this.$confirm(`确定对[id=${id}]进行删除操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.$http({
url: this.$http.adornUrl('/alarmBase/delete'),
method: 'post',
data: this.$http.adornData({ id })
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
.catch(() => {})
}
} }
} }
</script> </script>

View File

@ -10,18 +10,25 @@
<el-input <el-input
size="small" size="small"
v-model="dataForm.paramKey" v-model="dataForm.paramKey"
clearable
placeholder="请输入关键字查询" placeholder="请输入关键字查询"
/> />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button size="small" @click="getDataList()"> <el-button size="small" @click="getDataList()">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-sousuo"></use></svg> <svg class="icon-svg"><use xlink:href="#icon-sousuo"></use></svg>
查询 查询
</el-button> </el-button>
<el-button size="small" type="primary" @click="addOrUpdateHandle()"> <el-button size="small" type="primary" @click="addOrUpdateHandle()">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-新建"></use></svg> <svg class="icon-svg"><use xlink:href="#icon-新建"></use></svg>
新增 新增
</el-button> </el-button>
<el-button size="small" type="primary" @click="exportHandle('计量单位管理')">
<svg class="icon-svg">
<use xlink:href="#导出"></use>
</svg>
导出
</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table
@ -48,7 +55,7 @@
<el-table-column prop="type" label="类型"> <el-table-column prop="type" label="类型">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ <span>{{
scope.row.type === 0 ? "不可计数" : "可计数" scope.row.type === 2 ? "不可计数" : "可计数"
}}</span> }}</span>
</template> </template>
</el-table-column> </el-table-column>
@ -87,11 +94,32 @@
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-编辑"></use></svg> <svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-编辑"></use></svg>
</el-tooltip> </el-tooltip>
</el-button> </el-button>
<!-- <el-button type="text" style="color:red" size="small" @click="deleteHandle(scope.row.id)"> <el-popover placement="top" width="160" trigger="click" :ref="`popover-${scope.row.id}`">
<p>确定要改变状态吗</p>
<div style="text-align: right; margin: 0">
<el-button type="text" size="mini" @click="cancel(scope.row.id)">取消</el-button>
<el-button type="primary" size="mini" @click="changeStatus(scope.row.id)"
>确定</el-button
>
</div>
<el-button type="text" size="small" slot="reference">
<el-tooltip class="item" effect="dark" content="改变状态" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon">
<use xlink:href="#转让状态"></use>
</svg>
</el-tooltip>
</el-button>
</el-popover>
<el-button
type="text"
style="color:red"
size="small"
@click="deleteHandle(scope.row.id, scope.row.name)"
>
<el-tooltip class="item" effect="dark" content="删除" placement="top"> <el-tooltip class="item" effect="dark" content="删除" placement="top">
<svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-删除"></use></svg> <svg class="icon-svg aui-sidebar__menu-icon"><use xlink:href="#icon-删除"></use></svg>
</el-tooltip> </el-tooltip>
</el-button> --> </el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -116,96 +144,23 @@
<script> <script>
import AddOrUpdate from './components/unitList-add' import AddOrUpdate from './components/unitList-add'
import basicPage from '@/mixins/basic-page'
export default { export default {
mixins: [basicPage],
data() { data() {
return { return {
dataForm: { urlOptions: {
paramKey: '' getDataListURL: '/basic/unit/page',
deleteURL: '/basic/unit',
statusUrl: '/basic/unit/status',
exportUrl: '/basic/unit/export'
}, },
dataList: [], };
pageIndex: 1,
pageSize: 10,
totalPage: 0,
dataListLoading: false,
addOrUpdateVisible: false
}
}, },
components: { components: {
AddOrUpdate AddOrUpdate,
},
activated () {
this.getDataList()
}, },
methods: { methods: {
//
getDataList () {
// this.dataListLoading = true
// this.$http({
// url: this.$http.adornUrl('/alarmBase/page'),
// method: 'post',
// data: this.$http.adornData({
// 'current': this.pageIndex,
// 'size': this.pageSize,
// 'key': this.dataForm.paramKey
// })
// }).then(({data}) => {
// if (data && data.code === 0) {
// this.dataList = data.data.list
// this.totalPage = data.data.total
// } else {
// this.dataList = []
// this.totalPage = 0
// }
// this.dataListLoading = false
// })
}, },
// };
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
// /
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
//
deleteHandle (id) {
this.$confirm(`确定对[id=${id}]进行删除操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.$http({
url: this.$http.adornUrl('/alarmBase/delete'),
method: 'post',
data: this.$http.adornData({ id })
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
})
.catch(() => {})
}
}
}
</script> </script>