-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ {{ node.label }}
+
+ edit(node, data)" />
+ append(data)" />
+ remove(node, data)" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -34,97 +137,129 @@
import AddOrUpdate from './add-or-updata';
import basicPage from '../../core/mixins/basic-page';
import { parseTime } from '../../core/mixins/code-filter';
-import {
- getMaterialPage,
- deleteMaterial
-} from '@/api/base/material';
-import { listData } from "@/api/system/dict/data";
import { publicFormatter } from '@/utils/dict';
+import {
+ getProductMaterialPage,
+ deleteProductMaterial,
+ getMaterialTree,
+ createMaterialTree,
+ updateMaterialTree,
+ deleteMaterialTree,
+} from '@/api/base/material';
+import Treeselect from '@riophae/vue-treeselect';
+import '@riophae/vue-treeselect/dist/vue-treeselect.css';
const tableProps = [
{
prop: 'createTime',
label: '添加时间',
- filter: parseTime
- },
- {
- prop: 'code',
- label: '物料编码'
+ filter: parseTime,
+ width: 150,
},
{
prop: 'name',
- label: '物料名称'
+ label: '物料产品名称',
},
{
- prop: 'engName',
- label: '英文名称'
+ prop: 'code',
+ label: '物料产品编码',
},
{
- prop: 'type',
- label: '物料类型',
- filter: publicFormatter('material_type')
+ prop: 'typeNameChain',
+ label: '物料产品类型',
+ },
+ {
+ prop: 'unit',
+ label: '单位',
+ filter: publicFormatter('unit_dict'),
+ width: 60,
+ },
+ {
+ prop: 'specifications',
+ label: '规格',
},
{
prop: 'supplierName',
- label: '供应商'
+ label: '供应商',
},
{
prop: 'remark',
- label: '备注'
- }
+ label: '备注',
+ },
];
export default {
mixins: [basicPage],
+ name: '',
+ components: {
+ AddOrUpdate,
+ Treeselect,
+ },
data() {
return {
+ // 部门树选项
+ treeName: undefined,
+ deptOptions: undefined,
+ deptOptions1: undefined,
+ treeLoading: false,
+ defaultProps: {
+ children: 'children',
+ label: 'name',
+ },
+ // 弹出层标题
+ title: '',
+ // 是否显示弹出层
+ open: false,
+ // 表单参数
+ form: {
+ id: undefined,
+ parentId: undefined,
+ name: undefined,
+ defaultType: false,
+ },
+ // 表单校验
+ rules: {
+ name: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
+ },
urlOptions: {
- getDataListURL: getMaterialPage,
- deleteURL: deleteMaterial
- // exportURL: exportFactoryExcel,
+ getDataListURL: getProductMaterialPage,
+ deleteURL: deleteProductMaterial,
},
tableProps,
tableBtn: [
- this.$auth.hasPermi(`base:material:queryAttr`)
- ? {
- type: 'detail',
- btnName: '查看属性',
- }
- : undefined,
- this.$auth.hasPermi(`base:material:update`)
+ this.$auth.hasPermi(`base:core-product:update`)
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
- // this.$auth.hasPermi(`base:material:editAttr`)
- // ? {
- // type: 'editAttr',
- // btnName: '编辑属性',
- // }
- // : undefined,
- this.$auth.hasPermi(`base:material:delete`)
+ this.$auth.hasPermi(`base:core-product:delete`)
? {
type: 'delete',
btnName: '删除',
}
: undefined,
- ].filter((v)=>v),
+ ].filter((v) => v),
tableData: [],
- typeList: [],
formConfig: [
{
type: 'input',
- label: '物料名称',
- placeholder: '物料名称',
+ label: '物料产品名称',
+ placeholder: '物料产品名称',
param: 'name',
},
{
type: 'input',
- label: '物料编码',
- placeholder: '物料编码',
+ label: '物料产品编号',
+ placeholder: '物料产品编号',
param: 'code',
},
+ {
+ type: 'input',
+ label: '物料产品类型',
+ param: 'type',
+ disabled: true,
+ },
{
type: 'button',
btnName: '查询',
@@ -139,63 +274,43 @@ export default {
btnName: '新增',
name: 'add',
color: 'success',
- plain: true
+ plain: true,
},
],
};
},
- components: {
- AddOrUpdate,
+ watch: {
+ // 根据名称筛选部门树
+ treeName(val) {
+ this.$refs.tree.filter(val);
+ },
},
created() {
- this.getDict()
+ this.getDataList();
+ this.getTreeselect();
},
methods: {
- async getDict() {
- // 物料类型列表
- const res = await listData({
- pageNo: 1,
- pageSize: 99,
- dictType: 'material_type',
- });
- this.typeList = res.data.list.map(item => {
- return {
- label: item.label,
- value: Number(item.value)
- }
- });
+ // 删除
+ deleteHandle(id, name, index) {
+ this.$confirm(`是否确认删除物料产品名称为"${name}"的数据项`, '提示', {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning',
+ })
+ .then(() => {
+ this.urlOptions.deleteURL(id).then(({ data }) => {
+ this.$message({
+ message: '操作成功',
+ type: 'success',
+ duration: 1500,
+ onClose: () => {
+ this.getDataList();
+ },
+ });
+ });
+ })
+ .catch(() => {});
},
- otherMethods(val) {
- if (val.type === 'detail') {
- this.addOrUpdateVisible = true;
- this.addOrEditTitle = '详情';
- this.$nextTick(() => {
- this.$refs.addOrUpdate.init(val.data.id, true);
- });
- } else {
- this.addOrEditTitle = '编辑';
- this.addOrUpdateVisible = true;
- this.$nextTick(() => {
- this.$refs.addOrUpdate.init(val.data.id);
- });
- }
- },
- // 获取数据列表
- getDataList() {
- this.dataListLoading = true;
- this.urlOptions.getDataListURL(this.listQuery).then(response => {
- this.tableData = response.data.records.map(item => {
- this.typeList.filter(t => {
- if (item.type === t.value) {
- item.materialType = t.label
- }
- })
- return item
- });
- this.listQuery.total = response.data.total;
- this.dataListLoading = false;
- });
- },
buttonClick(val) {
switch (val.btnName) {
case 'search':
@@ -205,19 +320,13 @@ export default {
this.listQuery.code = val.code ? val.code : undefined;
this.getDataList();
break;
- case 'reset':
- this.$refs.searchBarForm.resetForm();
- this.listQuery = {
- pageSize: 10,
- pageNo: 1,
- total: 1,
- };
- this.getDataList();
- break;
case 'add':
this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
- this.addOrUpdateHandle();
+ this.$nextTick(() => {
+ this.$refs.addOrUpdate.init();
+ this.$refs.addOrUpdate.typeId(this.listQuery.typeId,this.listQuery.product);
+ });
break;
case 'export':
this.handleExport();
@@ -226,27 +335,126 @@ export default {
console.log(val);
}
},
- // 删除
- deleteHandle(id, name, index) {
- this.$confirm(`是否删除物料名称为"${name}"的数据项?`, "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- this.urlOptions.deleteURL(id).then(({ data }) => {
- this.$message({
- message: "操作成功",
- type: "success",
- duration: 1500,
- onClose: () => {
- this.getDataList();
- },
- });
- });
- })
- .catch(() => { });
- }
+
+ /** 树操作 */
+
+ // 查询下拉树结构
+ getTreeselect() {
+ this.treeLoading = true;
+ getMaterialTree().then((response) => {
+ // treeArr[0].push(...this.handleTree(response.data, 'id'));
+ // 处理 deptOptions 参数
+ this.deptOptions = [];
+ this.treeLoading = false;
+ this.deptOptions.push(...this.handleTree(response.data, 'id'));
+ const arr = [{ name: '全部', parentId: -1 }];
+ this.deptOptions1 = arr.concat(this.deptOptions);
+ });
+ },
+ // 筛选节点
+ filterNode(value, data) {
+ if (!value) return true;
+ return data.name.indexOf(value) !== -1;
+ },
+ // 节点单击事件
+ handleNodeClick(data) {
+ this.listQuery.typeId = data.id || undefined;
+ this.listQuery.product = data.product;
+ this.$refs.searchBarForm.formInline.type = data.name || undefined;
+ },
+ // 新增节点
+ append(data) {
+ this.open = true;
+ this.title = '新增物料产品类型';
+ this.form.id = undefined;
+ this.form.parentId = data.id;
+ },
+ // 删除节点
+ remove(node, data) {
+ this.$confirm(`是否确认删除名称为"${data.name}"的数据项`, '提示', {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning',
+ })
+ .then(() => {
+ deleteMaterialTree(data.id).then(({ data }) => {
+ this.$message({
+ message: '操作成功',
+ type: 'success',
+ duration: 1500,
+ onClose: () => {
+ this.getTreeselect();
+ },
+ });
+ });
+ })
+ .catch(() => {});
+ },
+ // 编辑节点
+ edit(node, data) {
+ this.open = true;
+ this.title = '编辑物料产品类型';
+ this.form.id = data.id;
+ this.form.name = data.name;
+ this.form.parentId = data.parentId;
+ },
+
+ /** 转换菜单数据结构 */
+ normalizer(node) {
+ if (node.children && !node.children.length) {
+ delete node.children;
+ }
+ return {
+ id: node.id,
+ label: node.name,
+ children: node.children,
+ };
+ },
+ // 取消按钮
+ cancel() {
+ this.open = false;
+ this.reset();
+ },
+ // 表单重置
+ reset() {
+ this.form = {
+ id: undefined,
+ parentId: 0,
+ name: undefined,
+ defaultType: false,
+ };
+ this.resetForm('form');
+ },
+ // 表单提交
+ submitForm() {
+ this.$refs['form'].validate((valid) => {
+ if (!valid) {
+ return false;
+ }
+ // 修改的提交
+ if (this.form.id) {
+ updateMaterialTree(this.form).then((response) => {
+ this.$modal.msgSuccess('修改成功');
+ this.cancel();
+ this.getTreeselect();
+ });
+ return;
+ }
+ // 添加的提交
+ createMaterialTree(this.form).then((response) => {
+ this.$modal.msgSuccess('新增成功');
+ this.cancel();
+ this.getTreeselect();
+ });
+ });
+ },
},
};
+
+
diff --git a/src/views/oldBase/materialProductBom/add-or-updata.vue b/src/views/oldBase/materialProductBom/add-or-updata.vue
index b95d06e1..84846a3a 100644
--- a/src/views/oldBase/materialProductBom/add-or-updata.vue
+++ b/src/views/oldBase/materialProductBom/add-or-updata.vue
@@ -1,8 +1,8 @@
@@ -107,10 +107,9 @@
diff --git a/src/views/oldBase/mixins/basic-page.js b/src/views/oldBase/mixins/basic-page.js
index 06c2b851..28fa3b54 100644
--- a/src/views/oldBase/mixins/basic-page.js
+++ b/src/views/oldBase/mixins/basic-page.js
@@ -1,8 +1,8 @@
/*
* @Author: zwq
* @Date: 2022-08-24 11:19:43
- * @LastEditors: zhp
- * @LastEditTime: 2023-11-24 09:29:36
+ * @LastEditors: zwq
+ * @LastEditTime: 2024-07-05 10:10:12
* @Description:
*/
export default {
@@ -53,11 +53,12 @@ export default {
this.listQuery.pageNo = val;
this.getDataList();
},
- // 新增 / 修改
- addOrUpdateHandle(id) {
+ // 新增
+ addOrUpdateHandle() {
+ this.addOrEditTitle = '新增';
this.addOrUpdateVisible = true;
this.$nextTick(() => {
- this.$refs.addOrUpdate.init(id);
+ this.$refs.addOrUpdate.init();
});
},
cancel(id) {
diff --git a/src/views/oldBase/mixins/code-filter.js b/src/views/oldBase/mixins/code-filter.js
index 30c5f12e..96061ff5 100644
--- a/src/views/oldBase/mixins/code-filter.js
+++ b/src/views/oldBase/mixins/code-filter.js
@@ -1,8 +1,8 @@
/*
* @Date: 2020-12-29 16:49:28
- * @LastEditors: DY
- * @LastEditTime: 2023-09-12 11:13:34
+ * @LastEditors: zwq
+ * @LastEditTime: 2024-07-08 16:27:39
* @FilePath: \basic-admin\src\filters\basicData\index.js
* @Description:
*/
@@ -33,7 +33,7 @@ export function parseTime(time, pattern) {
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
time = parseInt(time)
} else if (typeof time === 'string') {
- time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.\d{3}/gm),'');
+ time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.\d{3}/gm), '');
}
if ((typeof time === 'number') && (time.toString().length === 10)) {
time = time * 1000
@@ -62,6 +62,22 @@ export function parseTime(time, pattern) {
})
return time_str
}
+// 遍历树结构返回数组
+export function getTreeArr(arr) {
+ let result =[]
+ arr.forEach(item => {
+ if(item.children && item.children.length>0){
+ let {children,...obj} = item
+ result.push(obj)
+ result = result.concat(getTreeArr(children))
+ }else{
+ let {children,...obj} = item
+ result.push(obj)
+ }
+ });
+ return result
+}
+
export default function (dictTable) {
return function (val) {
return table?.[dictTable]?.[val]
diff --git a/src/views/quality/base/qualityScrapDet/add-or-updata.vue b/src/views/quality/base/qualityScrapDet/add-or-updata.vue
deleted file mode 100644
index 30047dad..00000000
--- a/src/views/quality/base/qualityScrapDet/add-or-updata.vue
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/quality/base/qualityScrapLog/add-or-updata.vue b/src/views/quality/base/qualityScrapLog/add-or-updata.vue
deleted file mode 100644
index bcfc9530..00000000
--- a/src/views/quality/base/qualityScrapLog/add-or-updata.vue
+++ /dev/null
@@ -1,209 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/quality/base/qualityScrapLog/detail-or-updata.vue b/src/views/quality/base/qualityScrapLog/detail-or-updata.vue
deleted file mode 100644
index a689f27f..00000000
--- a/src/views/quality/base/qualityScrapLog/detail-or-updata.vue
+++ /dev/null
@@ -1,222 +0,0 @@
-
-
-
-
- {{ '详情' }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/quality/base/qualityScrapLog/index.vue b/src/views/quality/base/qualityScrapLog/index.vue
deleted file mode 100644
index 5237cb8d..00000000
--- a/src/views/quality/base/qualityScrapLog/index.vue
+++ /dev/null
@@ -1,213 +0,0 @@
-
-
-
-
-
diff --git a/src/views/quality/base/qualityScrapType/add-or-updata.vue b/src/views/quality/base/qualityScrapType/add-or-updata.vue
deleted file mode 100644
index 6ef00826..00000000
--- a/src/views/quality/base/qualityScrapType/add-or-updata.vue
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/quality/currentData/baseChart.vue b/src/views/quality/currentData/baseChart.vue
new file mode 100644
index 00000000..477f8383
--- /dev/null
+++ b/src/views/quality/currentData/baseChart.vue
@@ -0,0 +1,128 @@
+
+
+
+
diff --git a/src/views/quality/currentData/currentTest.vue b/src/views/quality/currentData/currentTest.vue
new file mode 100644
index 00000000..f00ada1b
--- /dev/null
+++ b/src/views/quality/currentData/currentTest.vue
@@ -0,0 +1,232 @@
+
+
+
+
+
+ 工单:{{ item.workOrderName }}
+ 产品名称:{{ item.productionName }}
+ 规格:{{ item.productionSize }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/quality/currentData/hourData.vue b/src/views/quality/currentData/hourData.vue
new file mode 100644
index 00000000..5199b1e6
--- /dev/null
+++ b/src/views/quality/currentData/hourData.vue
@@ -0,0 +1,86 @@
+
+
+
+
diff --git a/src/views/quality/currentData/index.vue b/src/views/quality/currentData/index.vue
new file mode 100644
index 00000000..c461d5df
--- /dev/null
+++ b/src/views/quality/currentData/index.vue
@@ -0,0 +1,88 @@
+
+
+
+
+ 当前检测数据
+ 24小时检测数据
+
+
+
+
+
+
+
diff --git a/src/views/quality/monitoring/currentData/index.vue b/src/views/quality/monitoring/currentData/index.vue
deleted file mode 100644
index 0125ab85..00000000
--- a/src/views/quality/monitoring/currentData/index.vue
+++ /dev/null
@@ -1,622 +0,0 @@
-
-
-
-
-
-
-
-
-
- 产品名:{{ productDetail.name }} 产品规格:{{ productDetail.specifications }}
-
-
-
-
工单名称:{{ list[index].workOrderName }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/quality/monitoring/deviceParameters/index.vue b/src/views/quality/monitoring/deviceParameters/index.vue
index 1146b523..70ad1556 100644
--- a/src/views/quality/monitoring/deviceParameters/index.vue
+++ b/src/views/quality/monitoring/deviceParameters/index.vue
@@ -6,663 +6,701 @@
-->
-
-
+
-
- {{ currentFactory?.label || '点我选择设备' }}
-
-
- -
-
- {{ fc.label }}
-
-
-
-
-
- - 无 -
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
handleEmitFun(table, val)">
-
- getListFor(table, { page, limit, current })
- " />
-
-
-
-
-
-
+
+
+
+
+
+
handleEmitFun(table, val)">
+
+ getListFor(table, { page, limit, current })
+ " />
+
+
+
+
+
-
-
-
-
+
+
+
+