|
|
@@ -20,7 +20,7 @@
|
|
|
class="ele-btn-icon"
|
|
|
@click="openAdd()"
|
|
|
>
|
|
|
- 新增
|
|
|
+ 添加质检项
|
|
|
</el-button>
|
|
|
</template>
|
|
|
<!-- 编码列 -->
|
|
|
@@ -35,20 +35,29 @@
|
|
|
:underline="false"
|
|
|
@click="openDetail(row.qualityStandard)"
|
|
|
>
|
|
|
- {{row.qualityStandard && row.qualityStandard.code }}
|
|
|
+ {{ row.qualityStandard && row.qualityStandard.code }}
|
|
|
</el-link>
|
|
|
</template>
|
|
|
|
|
|
<template v-slot:type="{ row }">
|
|
|
- {{ getDictValue('质检标准类型', row.qualityStandard && row.qualityStandard.type) }}
|
|
|
+ {{
|
|
|
+ getDictValue(
|
|
|
+ '质检标准类型',
|
|
|
+ row.qualityStandard && row.qualityStandard.type
|
|
|
+ )
|
|
|
+ }}
|
|
|
</template>
|
|
|
|
|
|
<template v-slot:standardCode="{ row }">
|
|
|
- {{row.qualityStandard && row.qualityStandard.standardCode }}
|
|
|
+ {{ row.qualityStandard && row.qualityStandard.standardCode }}
|
|
|
</template>
|
|
|
|
|
|
<template v-slot:status="{ row }">
|
|
|
- {{ row.qualityStandard && row.qualityStandard.status == 1 ? '启用' : '停用' }}
|
|
|
+ {{
|
|
|
+ row.qualityStandard && row.qualityStandard.status == 1
|
|
|
+ ? '启用'
|
|
|
+ : '停用'
|
|
|
+ }}
|
|
|
</template>
|
|
|
|
|
|
<template v-slot:mode="{ row }">
|
|
|
@@ -82,168 +91,173 @@
|
|
|
</template>
|
|
|
</ele-pro-table>
|
|
|
|
|
|
- <Add @chooseProcess="chooseProcess" ref="addRef" />
|
|
|
+ <!-- <Add @chooseProcess="chooseProcess" ref="addRef" /> -->
|
|
|
|
|
|
<edit ref="edit" @done="done"></edit>
|
|
|
<Detail ref="detailRef"></Detail>
|
|
|
-
|
|
|
-
|
|
|
+ <qualityItem ref="qualityItemRef"></qualityItem>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import userSearch from './user-search.vue';
|
|
|
-import { getList, removeItem, saveBatch } from '@/api/inspectionClassify/index';
|
|
|
-import dictMixins from '@/mixins/dictMixins';
|
|
|
-import Add from './add.vue';
|
|
|
-import Edit from './edit.vue';
|
|
|
-import Detail from '@/views/inspectionStandard/components/edit.vue';
|
|
|
-
|
|
|
-export default {
|
|
|
- mixins: [dictMixins],
|
|
|
- components: { userSearch, Add, Edit ,Detail},
|
|
|
- props: {
|
|
|
- // 类别id
|
|
|
-
|
|
|
- rootId: [Number, String]
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- // 当前编辑数据
|
|
|
- current: null,
|
|
|
-
|
|
|
- // 表格列配置
|
|
|
- columns: [
|
|
|
- {
|
|
|
- columnKey: 'index',
|
|
|
- type: 'index',
|
|
|
- label: '序号',
|
|
|
- width: 55,
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
-
|
|
|
- {
|
|
|
- prop: 'code',
|
|
|
- label: '标准编码',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110,
|
|
|
- slot: 'code'
|
|
|
- },
|
|
|
-
|
|
|
- {
|
|
|
- prop: 'name',
|
|
|
- label: '标准名称',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110,
|
|
|
- slot: 'name'
|
|
|
- },
|
|
|
-
|
|
|
- {
|
|
|
- label: '标准类型',
|
|
|
- prop: 'type',
|
|
|
- slot: 'type'
|
|
|
- },
|
|
|
-
|
|
|
- {
|
|
|
- label: '标准代码',
|
|
|
- prop: 'standardCode'
|
|
|
- },
|
|
|
-
|
|
|
- {
|
|
|
- prop: 'status',
|
|
|
- label: '状态',
|
|
|
- align: 'center',
|
|
|
- minWidth: 110,
|
|
|
- slot: 'status'
|
|
|
- },
|
|
|
-
|
|
|
- {
|
|
|
- prop: 'version',
|
|
|
- label: '版本号',
|
|
|
- align: 'center',
|
|
|
- minWidth: 110,
|
|
|
- slot: 'version'
|
|
|
- },
|
|
|
-
|
|
|
- {
|
|
|
- label: '操作',
|
|
|
- prop: 'action',
|
|
|
- slot: 'action',
|
|
|
- action: 'action'
|
|
|
- }
|
|
|
- ]
|
|
|
- };
|
|
|
- },
|
|
|
- created() {
|
|
|
- this.requestDict('质检方式');
|
|
|
- this.requestDict('质检标准类型');
|
|
|
- },
|
|
|
- methods: {
|
|
|
- /* 表格数据源 */
|
|
|
- datasource({ page, limit, where }) {
|
|
|
- return getList({
|
|
|
- ...where,
|
|
|
- pageNum: page,
|
|
|
- size: limit,
|
|
|
- categoryLevelId: this.categoryLevelId || 12,
|
|
|
- rootCategoryLevelId: this.rootId
|
|
|
- });
|
|
|
- },
|
|
|
- /* 刷新表格 */
|
|
|
- reload(where) {
|
|
|
- this.$refs.table.reload({
|
|
|
- pageNum: 1,
|
|
|
- where: where,
|
|
|
- categoryLevelId: this.categoryLevelId,
|
|
|
- rootCategoryLevelId: this.rootId
|
|
|
- });
|
|
|
- },
|
|
|
+ import userSearch from './user-search.vue';
|
|
|
+ import {
|
|
|
+ getList,
|
|
|
+ removeItem,
|
|
|
+ saveBatch
|
|
|
+ } from '@/api/inspectionClassify/index';
|
|
|
+ import dictMixins from '@/mixins/dictMixins';
|
|
|
+ // import Add from './add.vue';
|
|
|
+ import Edit from './edit.vue';
|
|
|
+ import Detail from '@/views/inspectionStandard/components/edit.vue';
|
|
|
+ import qualityItem from './qualityItem.vue'
|
|
|
|
|
|
- /* 打开编辑弹窗 */
|
|
|
- openAdd() {
|
|
|
- this.$refs.addRef.open(this.categoryLevelId || 12);
|
|
|
- },
|
|
|
+ export default {
|
|
|
+ mixins: [dictMixins],
|
|
|
+ components: { userSearch, Edit, Detail , qualityItem},
|
|
|
+ props: {
|
|
|
+ // 类别id
|
|
|
|
|
|
- openEdit(row) {
|
|
|
- this.$refs.edit.open(row);
|
|
|
+ rootId: [Number, String]
|
|
|
},
|
|
|
- openDetail(row) {
|
|
|
- console.log(row)
|
|
|
- this.$refs.detailRef.open('detail',row);
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ // 当前编辑数据
|
|
|
+ current: null,
|
|
|
+
|
|
|
+ // 表格列配置
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ columnKey: 'index',
|
|
|
+ type: 'index',
|
|
|
+ label: '序号',
|
|
|
+ width: 55,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: 'code',
|
|
|
+ label: '标准编码',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110,
|
|
|
+ slot: 'code'
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: 'name',
|
|
|
+ label: '标准名称',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110,
|
|
|
+ slot: 'name'
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ label: '标准类型',
|
|
|
+ prop: 'type',
|
|
|
+ slot: 'type'
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ label: '标准代码',
|
|
|
+ prop: 'standardCode'
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: 'status',
|
|
|
+ label: '状态',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 110,
|
|
|
+ slot: 'status'
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: 'version',
|
|
|
+ label: '版本号',
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 110,
|
|
|
+ slot: 'version'
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ label: '操作',
|
|
|
+ prop: 'action',
|
|
|
+ slot: 'action',
|
|
|
+ action: 'action'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ };
|
|
|
},
|
|
|
-
|
|
|
- chooseProcess(data) {
|
|
|
- saveBatch(data).then((res) => {
|
|
|
- console.log(res);
|
|
|
- if (res.code == 0) {
|
|
|
- this.$message.success(res.message);
|
|
|
- this.reload();
|
|
|
- }
|
|
|
- });
|
|
|
+ created() {
|
|
|
+ this.requestDict('质检方式');
|
|
|
+ this.requestDict('质检标准类型');
|
|
|
},
|
|
|
+ methods: {
|
|
|
+ /* 表格数据源 */
|
|
|
+ datasource({ page, limit, where }) {
|
|
|
+ return getList({
|
|
|
+ ...where,
|
|
|
+ pageNum: page,
|
|
|
+ size: limit,
|
|
|
+ categoryLevelId: this.categoryLevelId || 12,
|
|
|
+ rootCategoryLevelId: this.rootId
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /* 刷新表格 */
|
|
|
+ reload(where) {
|
|
|
+ this.$refs.table.reload({
|
|
|
+ pageNum: 1,
|
|
|
+ where: where,
|
|
|
+ categoryLevelId: this.categoryLevelId,
|
|
|
+ rootCategoryLevelId: this.rootId
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 打开编辑弹窗 */
|
|
|
+ openAdd() {
|
|
|
+ // this.$refs.addRef.open(this.categoryLevelId || 12);
|
|
|
+ this.$refs.qualityItemRef.open()
|
|
|
+ },
|
|
|
|
|
|
- /* 删除 */
|
|
|
- remove(row) {
|
|
|
- const loading = this.$loading({ lock: true });
|
|
|
- removeItem([row.id])
|
|
|
- .then((msg) => {
|
|
|
- loading.close();
|
|
|
- this.$message.success(msg);
|
|
|
- this.reload();
|
|
|
- })
|
|
|
- .catch((e) => {
|
|
|
- loading.close();
|
|
|
+ openEdit(row) {
|
|
|
+ this.$refs.edit.open(row);
|
|
|
+ },
|
|
|
+ openDetail(row) {
|
|
|
+ console.log(row);
|
|
|
+ this.$refs.detailRef.open('detail', row);
|
|
|
+ },
|
|
|
+
|
|
|
+ chooseProcess(data) {
|
|
|
+ saveBatch(data).then((res) => {
|
|
|
+ console.log(res);
|
|
|
+ if (res.code == 0) {
|
|
|
+ this.$message.success(res.message);
|
|
|
+ this.reload();
|
|
|
+ }
|
|
|
});
|
|
|
- },
|
|
|
- done() {
|
|
|
- this.$refs.searchRef.search();
|
|
|
- },
|
|
|
+ },
|
|
|
+
|
|
|
+ /* 删除 */
|
|
|
+ remove(row) {
|
|
|
+ const loading = this.$loading({ lock: true });
|
|
|
+ removeItem([row.id])
|
|
|
+ .then((msg) => {
|
|
|
+ loading.close();
|
|
|
+ this.$message.success(msg);
|
|
|
+ this.reload();
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ loading.close();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ done() {
|
|
|
+ this.$refs.searchRef.search();
|
|
|
+ },
|
|
|
|
|
|
- clickSearch(info) {
|
|
|
- this.categoryLevelId = info.id;
|
|
|
- this.rootCategoryLevelId = info.rootCategoryLevelId;
|
|
|
- this.reload();
|
|
|
+ clickSearch(info) {
|
|
|
+ this.categoryLevelId = info.id;
|
|
|
+ this.rootCategoryLevelId = info.rootCategoryLevelId;
|
|
|
+ this.reload();
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
-};
|
|
|
+ };
|
|
|
</script>
|