|
|
@@ -29,37 +29,66 @@
|
|
|
</el-link>
|
|
|
</template>
|
|
|
|
|
|
+ <template v-slot:isTemp="{ row }">
|
|
|
+ <el-tag size="mini" v-if="row.isTemp == 1">主数据</el-tag>
|
|
|
+ </template>
|
|
|
+
|
|
|
<!-- 表头工具栏 -->
|
|
|
<template v-slot:action="{ row }">
|
|
|
<el-link type="primary" @click="handelDetail(row)">详情</el-link>
|
|
|
- <!-- <el-switch
|
|
|
- :active-value="'1'"
|
|
|
- :inactive-value="'0'"
|
|
|
- @change="openBom(row, $event)"
|
|
|
- v-model="row.status"
|
|
|
- >
|
|
|
- </el-switch> -->
|
|
|
+
|
|
|
<el-link
|
|
|
- v-if="row.status == 0"
|
|
|
+ v-if="row.status != 1 && (row.approvalStatus == 0 || row.approvalStatus == 3)"
|
|
|
type="primary"
|
|
|
@click="handSubmit(row)"
|
|
|
>发布</el-link
|
|
|
>
|
|
|
+
|
|
|
+ <el-link
|
|
|
+ type="danger"
|
|
|
+ :underline="false"
|
|
|
+ v-if="activeName == 1 && row.status != 1 && (row.approvalStatus == 0 || row.approvalStatus == 3)"
|
|
|
+ @click="handDel(row)"
|
|
|
+ >
|
|
|
+ 删除
|
|
|
+ </el-link>
|
|
|
</template>
|
|
|
</ele-pro-table>
|
|
|
</el-tabs>
|
|
|
</el-card>
|
|
|
|
|
|
+ <el-dialog
|
|
|
+ title="发布"
|
|
|
+ :visible.sync="isSubmit"
|
|
|
+ v-if="isSubmit"
|
|
|
+ width="30%"
|
|
|
+ center
|
|
|
+ >
|
|
|
+ <div>
|
|
|
+ <el-radio v-model="radioSubmit" :label="1">药品</el-radio>
|
|
|
+ <el-radio v-model="radioSubmit" :label="2">器械</el-radio>
|
|
|
+ </div>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="isSubmit = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="handJsSubmit()">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
|
|
|
<LCdetail ref="detailRef"></LCdetail>
|
|
|
-
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import BOMSearch from './components/BOM-search.vue';
|
|
|
- import { getBomPageList, startAndStop, bomSubmit } from '@/api/material/BOM';
|
|
|
- import LCdetail from './components/LCdetail.vue'
|
|
|
+ import {
|
|
|
+ getBomPageList,
|
|
|
+ startAndStop,
|
|
|
+ bomSubmit,
|
|
|
+ jsBomSubmit,
|
|
|
+ deviceBomSubmit,
|
|
|
+ deleteBomTreeList
|
|
|
+ } from '@/api/material/BOM';
|
|
|
+ import LCdetail from './components/LCdetail.vue';
|
|
|
export default {
|
|
|
name: 'SystemDictionary',
|
|
|
components: { BOMSearch, LCdetail },
|
|
|
@@ -87,12 +116,12 @@
|
|
|
},
|
|
|
{
|
|
|
prop: 'categoryCode',
|
|
|
- label: '物品编码',
|
|
|
+ label: '编码',
|
|
|
showOverflowTooltip: true
|
|
|
},
|
|
|
{
|
|
|
prop: 'categoryName',
|
|
|
- label: '物品名称',
|
|
|
+ label: '名称',
|
|
|
showOverflowTooltip: true
|
|
|
},
|
|
|
{
|
|
|
@@ -111,6 +140,14 @@
|
|
|
label: '审核状态',
|
|
|
slot: 'approvalStatus'
|
|
|
},
|
|
|
+
|
|
|
+ {
|
|
|
+ width: 100,
|
|
|
+ prop: 'isTemp',
|
|
|
+ slot: 'isTemp',
|
|
|
+ label: '主数据'
|
|
|
+ },
|
|
|
+
|
|
|
{
|
|
|
prop: 'createName',
|
|
|
label: '创建人',
|
|
|
@@ -128,8 +165,9 @@
|
|
|
}
|
|
|
],
|
|
|
statusOpt: {
|
|
|
- 0: '已停用',
|
|
|
- 1: '已发布'
|
|
|
+ 0: '草稿',
|
|
|
+ 1: '已发布',
|
|
|
+ 2: '已停用'
|
|
|
},
|
|
|
|
|
|
approvalStatusOpt: {
|
|
|
@@ -142,9 +180,20 @@
|
|
|
loadingInstance: null,
|
|
|
where: {},
|
|
|
|
|
|
- activeName: '1'
|
|
|
+ activeName: '1',
|
|
|
+
|
|
|
+ isSubmit: false,
|
|
|
+ JsRId: null,
|
|
|
+ radioSubmit: 1
|
|
|
};
|
|
|
},
|
|
|
+
|
|
|
+ computed: {
|
|
|
+ clientEnvironmentId() {
|
|
|
+ return this.$store.state.user.info.clientEnvironmentId;
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
mounted() {
|
|
|
this.initData();
|
|
|
},
|
|
|
@@ -193,15 +242,38 @@
|
|
|
},
|
|
|
|
|
|
handSubmit(row) {
|
|
|
+ if (this.clientEnvironmentId == 3) {
|
|
|
+ this.JsRId = row.id;
|
|
|
+ this.isSubmit = true;
|
|
|
+ } else {
|
|
|
+ this.$alert('确定要发布吗?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ bomSubmit({ businessId: row.id }).then((res) => {
|
|
|
+ this.$message.success('发布成功');
|
|
|
+ this.reload();
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ handJsSubmit() {
|
|
|
+ let URL = this.radioSubmit == 1 ? jsBomSubmit : deviceBomSubmit;
|
|
|
this.$alert('确定要发布吗?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
})
|
|
|
.then(() => {
|
|
|
- bomSubmit({ businessId: row.id }).then((res) => {
|
|
|
+ URL({ businessId: this.JsRId }).then((res) => {
|
|
|
+ this.isSubmit = false;
|
|
|
this.$message.success('发布成功');
|
|
|
this.reload();
|
|
|
+
|
|
|
});
|
|
|
})
|
|
|
.catch(() => {});
|
|
|
@@ -212,6 +284,7 @@
|
|
|
return getBomPageList({
|
|
|
...where,
|
|
|
bomType: Number(this.activeName),
|
|
|
+ isTemp: true,
|
|
|
pageNum: page,
|
|
|
size: limit
|
|
|
});
|
|
|
@@ -224,7 +297,9 @@
|
|
|
categoryId: row.categoryId,
|
|
|
noBack,
|
|
|
bType: this.activeName,
|
|
|
- categoryLevelPathIdParent: row.rootCategoryLevelId
|
|
|
+ categoryLevelPathIdParent: row.rootCategoryLevelId,
|
|
|
+ isProduct: true,
|
|
|
+ isTemp: row.isTemp
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
@@ -232,76 +307,38 @@
|
|
|
reload(where) {
|
|
|
this.$refs.table.reload({ where });
|
|
|
},
|
|
|
- /* 显示编辑 */
|
|
|
- handelEdit(type, row) {
|
|
|
- this.$refs.editDialogRef.open(type, row);
|
|
|
+
|
|
|
+ handleClick(tab) {
|
|
|
+ this.activeName = tab.name;
|
|
|
+ this.reload();
|
|
|
},
|
|
|
- /* 删除 */
|
|
|
- remove() {
|
|
|
- this.$confirm('确定要删除选中的字典吗?', '提示', {
|
|
|
+
|
|
|
+ handDel(row) {
|
|
|
+ this.$confirm('是否确认删除?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
})
|
|
|
.then(() => {
|
|
|
- if (this.$refs.dictData.selection.length == 0) {
|
|
|
- this.$message({
|
|
|
- message: '当前未选择数据',
|
|
|
- type: 'error'
|
|
|
- });
|
|
|
- return;
|
|
|
- }
|
|
|
- let ids = this.$refs.dictData.selection.map((item) => item.id);
|
|
|
- const loading = this.$loading({ lock: true });
|
|
|
-
|
|
|
- removeDictionary(ids, true)
|
|
|
- .then((msg) => {
|
|
|
- loading.close();
|
|
|
- this.$message.success(msg);
|
|
|
- this.reload();
|
|
|
- })
|
|
|
- .catch((e) => {
|
|
|
- loading.close();
|
|
|
- // this.$message.error(e.message);
|
|
|
- });
|
|
|
- })
|
|
|
- .catch(() => {});
|
|
|
- },
|
|
|
-
|
|
|
- // 刷新数据
|
|
|
- refreshData() {
|
|
|
- this.loading = true;
|
|
|
- syncBom()
|
|
|
- .then((res) => {
|
|
|
- if (res == '0') {
|
|
|
- this.loading = false;
|
|
|
- this.$message.success('数据刷新成功!');
|
|
|
+ deleteBomTreeList([row.id]).then(() => {
|
|
|
this.reload();
|
|
|
- }
|
|
|
+ });
|
|
|
})
|
|
|
- .catch((e) => {
|
|
|
- this.loading = false;
|
|
|
+ .catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '已取消删除'
|
|
|
+ });
|
|
|
});
|
|
|
},
|
|
|
|
|
|
- handleClick(tab) {
|
|
|
- this.activeName = tab.name;
|
|
|
- getBomPageList({
|
|
|
- pageNum: 1,
|
|
|
- size: 10,
|
|
|
- bomType: Number(this.activeName)
|
|
|
- }).then((data) => {
|
|
|
- this.$refs.table.setData(data.list || []);
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
- handleDetails(row) {
|
|
|
- if (!row.processInstanceId) {
|
|
|
- this.$message.info('未提交没有审核流程')
|
|
|
- } else {
|
|
|
- this.$refs.detailRef.open(row.processInstanceId);
|
|
|
+ handleDetails(row) {
|
|
|
+ if (!row.processInstanceId) {
|
|
|
+ this.$message.info('未提交没有审核流程');
|
|
|
+ } else {
|
|
|
+ this.$refs.detailRef.open(row.processInstanceId);
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
- }
|
|
|
}
|
|
|
};
|
|
|
</script>
|