|
|
@@ -98,7 +98,15 @@
|
|
|
>
|
|
|
发布
|
|
|
</el-link>
|
|
|
-
|
|
|
+ <el-link
|
|
|
+ type="primary"
|
|
|
+ :underline="false"
|
|
|
+ icon="el-icon-finished"
|
|
|
+ @click="alteration(row)"
|
|
|
+ v-if="row.approvalStatus == 2"
|
|
|
+ >
|
|
|
+ 变更
|
|
|
+ </el-link>
|
|
|
<el-link
|
|
|
type="primary"
|
|
|
:underline="false"
|
|
|
@@ -167,288 +175,307 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import tabMixins from '@/mixins/tableColumnsMixin';
|
|
|
- import UserSearch from './components/user-search.vue';
|
|
|
- import UserEdit from './components/user-edit.vue';
|
|
|
- import UserDetail from './components/user-detail.vue';
|
|
|
- import historyModal from './components/historyModal.vue';
|
|
|
- import route from '@/api/technology/route';
|
|
|
- import processSubmitDialog from '@/components/processSubmitDialog/processSubmitDialog.vue';
|
|
|
- import { reviewStatus } from '@/enum/dict';
|
|
|
- import importDialog from '@/components/upload/import-dialogNew.vue';
|
|
|
- export default {
|
|
|
- name: 'technologyRoute',
|
|
|
- mixins: [tabMixins],
|
|
|
- components: {
|
|
|
- UserSearch,
|
|
|
- UserEdit,
|
|
|
- UserDetail,
|
|
|
- historyModal,
|
|
|
- processSubmitDialog,
|
|
|
- importDialog
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- isUpdate: false,
|
|
|
- // 表格列配置
|
|
|
- columns: [
|
|
|
- {
|
|
|
- columnKey: 'index',
|
|
|
- label: '序号',
|
|
|
- type: 'index',
|
|
|
- width: 55,
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- fixed: 'left'
|
|
|
- },
|
|
|
- // {
|
|
|
- // slot: 'routeType',
|
|
|
- // label: '类型',
|
|
|
- // align: 'center',
|
|
|
- // showOverflowTooltip: true
|
|
|
- // },
|
|
|
- {
|
|
|
- prop: 'sort',
|
|
|
- label: '排序',
|
|
|
- showOverflowTooltip: true,
|
|
|
- align: 'center',
|
|
|
- width: 110,
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'code',
|
|
|
- label: '工艺路线编码',
|
|
|
- showOverflowTooltip: true,
|
|
|
- align: 'center',
|
|
|
- minWidth: 110,
|
|
|
- slot: 'code'
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'name',
|
|
|
- label: '工艺路线名称',
|
|
|
- showOverflowTooltip: true,
|
|
|
- align: 'center',
|
|
|
- minWidth: 110
|
|
|
- },
|
|
|
-
|
|
|
- {
|
|
|
- prop: 'version',
|
|
|
- label: '工艺路线版本',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110
|
|
|
- },
|
|
|
+import tabMixins from '@/mixins/tableColumnsMixin';
|
|
|
+import UserSearch from './components/user-search.vue';
|
|
|
+import UserEdit from './components/user-edit.vue';
|
|
|
+import UserDetail from './components/user-detail.vue';
|
|
|
+import historyModal from './components/historyModal.vue';
|
|
|
+import route from '@/api/technology/route';
|
|
|
+import processSubmitDialog from '@/components/processSubmitDialog/processSubmitDialog.vue';
|
|
|
+import { reviewStatus } from '@/enum/dict';
|
|
|
+import importDialog from '@/components/upload/import-dialogNew.vue';
|
|
|
+export default {
|
|
|
+ name: 'technologyRoute',
|
|
|
+ mixins: [tabMixins],
|
|
|
+ components: {
|
|
|
+ UserSearch,
|
|
|
+ UserEdit,
|
|
|
+ UserDetail,
|
|
|
+ historyModal,
|
|
|
+ processSubmitDialog,
|
|
|
+ importDialog
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ isUpdate: false,
|
|
|
+ // 表格列配置
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ columnKey: 'index',
|
|
|
+ label: '序号',
|
|
|
+ type: 'index',
|
|
|
+ width: 55,
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ fixed: 'left'
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // slot: 'routeType',
|
|
|
+ // label: '类型',
|
|
|
+ // align: 'center',
|
|
|
+ // showOverflowTooltip: true
|
|
|
+ // },
|
|
|
+ {
|
|
|
+ prop: 'sort',
|
|
|
+ label: '排序',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ align: 'center',
|
|
|
+ width: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'code',
|
|
|
+ label: '工艺路线编码',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 110,
|
|
|
+ slot: 'code'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'name',
|
|
|
+ label: '工艺路线名称',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
|
|
|
- // {
|
|
|
- // prop: 'produceVersionName',
|
|
|
- // label: '工艺类型',
|
|
|
- // align: 'center',
|
|
|
- // showOverflowTooltip: true
|
|
|
- // },
|
|
|
+ {
|
|
|
+ prop: 'version',
|
|
|
+ label: '工艺路线版本',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
|
|
|
- {
|
|
|
- //修改此prop名称时,请同步修改columnKey属性和下方selectType方法
|
|
|
- prop: 'status',
|
|
|
- label: '状态',
|
|
|
- align: 'center',
|
|
|
- slot: 'status',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110,
|
|
|
- filters: [
|
|
|
- { text: '草稿', value: -1 },
|
|
|
- { text: '失效', value: 0 },
|
|
|
- { text: '生效', value: 1 }
|
|
|
- ],
|
|
|
- filterMultiple: false,
|
|
|
- columnKey: 'status'
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'approvalStatus',
|
|
|
- label: '审核状态',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 100,
|
|
|
- formatter: (_row, _column, cellValue) => {
|
|
|
- return reviewStatus[_row.approvalStatus];
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'factoriesName',
|
|
|
- label: '所属工厂',
|
|
|
- align: 'center',
|
|
|
- showOverflowTooltip: true
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // prop: 'produceVersionName',
|
|
|
+ // label: '工艺类型',
|
|
|
+ // align: 'center',
|
|
|
+ // showOverflowTooltip: true
|
|
|
+ // },
|
|
|
|
|
|
- {
|
|
|
- align: 'center',
|
|
|
- prop: 'createTime',
|
|
|
- label: '创建时间',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110
|
|
|
- },
|
|
|
- {
|
|
|
- columnKey: 'action',
|
|
|
- label: '操作',
|
|
|
- width: 280,
|
|
|
- align: 'left',
|
|
|
- resizable: false,
|
|
|
- slot: 'action'
|
|
|
+ {
|
|
|
+ //修改此prop名称时,请同步修改columnKey属性和下方selectType方法
|
|
|
+ prop: 'status',
|
|
|
+ label: '状态',
|
|
|
+ align: 'center',
|
|
|
+ slot: 'status',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110,
|
|
|
+ filters: [
|
|
|
+ { text: '草稿', value: -1 },
|
|
|
+ { text: '失效', value: 0 },
|
|
|
+ { text: '生效', value: 1 }
|
|
|
+ ],
|
|
|
+ filterMultiple: false,
|
|
|
+ columnKey: 'status'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'approvalStatus',
|
|
|
+ label: '审核状态',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 100,
|
|
|
+ formatter: (_row, _column, cellValue) => {
|
|
|
+ return reviewStatus[_row.approvalStatus];
|
|
|
}
|
|
|
- ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'factoriesName',
|
|
|
+ label: '所属工厂',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
|
|
|
- // 表格选中数据
|
|
|
- selection: [],
|
|
|
- // 当前编辑数据
|
|
|
- current: null,
|
|
|
- processSubmitDialogFlag: false,
|
|
|
- // 是否显示编辑弹窗
|
|
|
- showEdit: false,
|
|
|
- detailEdit: false,
|
|
|
+ {
|
|
|
+ align: 'center',
|
|
|
+ prop: 'createTime',
|
|
|
+ label: '创建时间',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnKey: 'action',
|
|
|
+ label: '操作',
|
|
|
+ width: 280,
|
|
|
+ align: 'left',
|
|
|
+ resizable: false,
|
|
|
+ slot: 'action'
|
|
|
+ }
|
|
|
+ ],
|
|
|
|
|
|
- statusList: [
|
|
|
- { label: '草稿', value: -1 },
|
|
|
- { label: '失效', value: 0 },
|
|
|
- { label: '生效', value: 1 }
|
|
|
- ],
|
|
|
- loading: false,
|
|
|
- cacheKeyUrl: 'fb92f8df-technology-route'
|
|
|
- };
|
|
|
- },
|
|
|
- computed: {
|
|
|
- // 是否开启响应式布局
|
|
|
- clientEnvironmentId() {
|
|
|
- return this.$store.state.user.info.clientEnvironmentId;
|
|
|
+ // 表格选中数据
|
|
|
+ selection: [],
|
|
|
+ // 当前编辑数据
|
|
|
+ current: null,
|
|
|
+ processSubmitDialogFlag: false,
|
|
|
+ // 是否显示编辑弹窗
|
|
|
+ showEdit: false,
|
|
|
+ detailEdit: false,
|
|
|
+
|
|
|
+ statusList: [
|
|
|
+ { label: '草稿', value: -1 },
|
|
|
+ { label: '失效', value: 0 },
|
|
|
+ { label: '生效', value: 1 }
|
|
|
+ ],
|
|
|
+ loading: false,
|
|
|
+ cacheKeyUrl: 'fb92f8df-technology-route'
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ // 是否开启响应式布局
|
|
|
+ clientEnvironmentId() {
|
|
|
+ return this.$store.state.user.info.clientEnvironmentId;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ selectType(value) {
|
|
|
+ let where = {};
|
|
|
+ if (value.status.length > 0) {
|
|
|
+ where['status'] = value.status[0];
|
|
|
}
|
|
|
+ this.reload(where);
|
|
|
+ },
|
|
|
+ /* 表格数据源 */
|
|
|
+ async datasource({ page, limit, where, order }) {
|
|
|
+ const res = await route.list({
|
|
|
+ ...where,
|
|
|
+ ...order,
|
|
|
+ pageNum: page,
|
|
|
+ size: limit
|
|
|
+ });
|
|
|
+ return res;
|
|
|
+ },
|
|
|
+ importDialog() {
|
|
|
+ this.$refs.importDialogRef.open();
|
|
|
+ },
|
|
|
+ checkStatus(row) {
|
|
|
+ let obj = this.statusList.find((it) => it.value == row.status);
|
|
|
+ return obj.label;
|
|
|
},
|
|
|
- methods: {
|
|
|
- selectType(value) {
|
|
|
- let where = {};
|
|
|
- if (value.status.length > 0) {
|
|
|
- where['status'] = value.status[0];
|
|
|
- }
|
|
|
- this.reload(where);
|
|
|
- },
|
|
|
- /* 表格数据源 */
|
|
|
- async datasource({ page, limit, where, order }) {
|
|
|
- const res = await route.list({
|
|
|
- ...where,
|
|
|
- ...order,
|
|
|
- pageNum: page,
|
|
|
- size: limit
|
|
|
- });
|
|
|
- return res;
|
|
|
- },
|
|
|
- importDialog() {
|
|
|
- this.$refs.importDialogRef.open();
|
|
|
- },
|
|
|
- checkStatus(row) {
|
|
|
- let obj = this.statusList.find((it) => it.value == row.status);
|
|
|
- return obj.label;
|
|
|
- },
|
|
|
|
|
|
- /* 刷新表格 */
|
|
|
- reload(where) {
|
|
|
- this.$refs.table.reload({ page: 1, where: where });
|
|
|
- },
|
|
|
- /* 打开编辑弹窗 */
|
|
|
- openEdit(row) {
|
|
|
- this.current = row;
|
|
|
- this.showEdit = true;
|
|
|
- if (row?.id) {
|
|
|
- this.$refs.userEdit.isUpdate = true;
|
|
|
- } else {
|
|
|
- this.$refs.userEdit.isUpdate = false;
|
|
|
- }
|
|
|
+ /* 刷新表格 */
|
|
|
+ reload(where) {
|
|
|
+ this.$refs.table.reload({ page: 1, where: where });
|
|
|
+ },
|
|
|
+ /* 打开编辑弹窗 */
|
|
|
+ openEdit(row) {
|
|
|
+ this.current = row;
|
|
|
+ this.showEdit = true;
|
|
|
+ if (row?.id) {
|
|
|
+ this.$refs.userEdit.isUpdate = true;
|
|
|
+ } else {
|
|
|
+ this.$refs.userEdit.isUpdate = false;
|
|
|
+ }
|
|
|
|
|
|
- this.$refs.userEdit.$refs.form &&
|
|
|
- this.$refs.userEdit.$refs.form.clearValidate();
|
|
|
- },
|
|
|
- /* 打开历史版本 */
|
|
|
- openHistory(row) {
|
|
|
- this.$refs.historyRefs.open(row);
|
|
|
- },
|
|
|
- /* 删除 */
|
|
|
- remove(row) {
|
|
|
- const loading = this.$loading({ lock: true });
|
|
|
+ this.$refs.userEdit.$refs.form &&
|
|
|
+ this.$refs.userEdit.$refs.form.clearValidate();
|
|
|
+ },
|
|
|
+ /* 打开历史版本 */
|
|
|
+ openHistory(row) {
|
|
|
+ this.$refs.historyRefs.open(row);
|
|
|
+ },
|
|
|
+ /* 删除 */
|
|
|
+ remove(row) {
|
|
|
+ const loading = this.$loading({ lock: true });
|
|
|
|
|
|
- route
|
|
|
- .delete(row.id)
|
|
|
- .then((msg) => {
|
|
|
- loading.close();
|
|
|
- this.$message.success('删除' + msg);
|
|
|
- this.reload();
|
|
|
- })
|
|
|
- .catch((e) => {
|
|
|
- loading.close();
|
|
|
- // this.$message.error(e.message);
|
|
|
- });
|
|
|
- },
|
|
|
- /* 批量删除 */
|
|
|
- removeBatch() {
|
|
|
- if (!this.selection.length) {
|
|
|
- this.$message.error('请至少选择一条数据');
|
|
|
- return;
|
|
|
- }
|
|
|
- this.$confirm('确定要删除选中的工序吗?', '提示', {
|
|
|
- type: 'warning'
|
|
|
+ route
|
|
|
+ .delete(row.id)
|
|
|
+ .then((msg) => {
|
|
|
+ loading.close();
|
|
|
+ this.$message.success('删除' + msg);
|
|
|
+ this.reload();
|
|
|
})
|
|
|
- .then(() => {
|
|
|
- const loading = this.$loading({ lock: true });
|
|
|
- producetask
|
|
|
- .delete(this.selection.map((d) => d.id))
|
|
|
- .then((msg) => {
|
|
|
- loading.close();
|
|
|
- this.$message.success('删除' + msg);
|
|
|
- this.reload();
|
|
|
- })
|
|
|
- .catch((e) => {
|
|
|
- loading.close();
|
|
|
- // this.$message.error(e.message);
|
|
|
- });
|
|
|
- })
|
|
|
- .catch(() => {});
|
|
|
- },
|
|
|
- approve(res) {
|
|
|
- this.processSubmitDialogFlag = true;
|
|
|
- this.$nextTick(() => {
|
|
|
- let params = {
|
|
|
- businessId: res.id,
|
|
|
- businessKey: 'routing_approve',
|
|
|
- formCreateUserId: res.createUserId,
|
|
|
- routingId: res.id,
|
|
|
- variables: {
|
|
|
- businessCode: res.code,
|
|
|
- businessName: res.name,
|
|
|
- businessType: ' 版本:' + res.version
|
|
|
- }
|
|
|
- };
|
|
|
+ .catch((e) => {
|
|
|
+ loading.close();
|
|
|
+ // this.$message.error(e.message);
|
|
|
+ });
|
|
|
+ },
|
|
|
|
|
|
- this.$refs.processSubmitDialogRef.init(params);
|
|
|
+ //变更
|
|
|
+ alteration(row) {
|
|
|
+ console.log();
|
|
|
+ let param = {
|
|
|
+ id: row.id
|
|
|
+ };
|
|
|
+ route
|
|
|
+ .taskinstanceChange(param)
|
|
|
+ .then((msg) => {
|
|
|
+ // loading.close();
|
|
|
+ this.$message.success('变更' + msg);
|
|
|
+ this.reload();
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ loading.close();
|
|
|
+ // this.$message.error(e.message);
|
|
|
});
|
|
|
- },
|
|
|
- // 刷新数据
|
|
|
- refreshData() {
|
|
|
- this.loading = true;
|
|
|
- route
|
|
|
- .syncRouting()
|
|
|
- .then((res) => {
|
|
|
- if (res == '0') {
|
|
|
- this.loading = false;
|
|
|
- this.$message.success('数据刷新成功!');
|
|
|
+ },
|
|
|
+ /* 批量删除 */
|
|
|
+ removeBatch() {
|
|
|
+ if (!this.selection.length) {
|
|
|
+ this.$message.error('请至少选择一条数据');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.$confirm('确定要删除选中的工序吗?', '提示', {
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ const loading = this.$loading({ lock: true });
|
|
|
+ producetask
|
|
|
+ .delete(this.selection.map((d) => d.id))
|
|
|
+ .then((msg) => {
|
|
|
+ loading.close();
|
|
|
+ this.$message.success('删除' + msg);
|
|
|
this.reload();
|
|
|
- }
|
|
|
- })
|
|
|
- .catch((e) => {
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ loading.close();
|
|
|
+ // this.$message.error(e.message);
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ },
|
|
|
+ approve(res) {
|
|
|
+ this.processSubmitDialogFlag = true;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ let params = {
|
|
|
+ businessId: res.id,
|
|
|
+ businessKey: 'routing_approve',
|
|
|
+ formCreateUserId: res.createUserId,
|
|
|
+ routingId: res.id,
|
|
|
+ variables: {
|
|
|
+ businessCode: res.code,
|
|
|
+ businessName: res.name,
|
|
|
+ businessType: ' 版本:' + res.version
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ this.$refs.processSubmitDialogRef.init(params);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 刷新数据
|
|
|
+ refreshData() {
|
|
|
+ this.loading = true;
|
|
|
+ route
|
|
|
+ .syncRouting()
|
|
|
+ .then((res) => {
|
|
|
+ if (res == '0') {
|
|
|
this.loading = false;
|
|
|
- });
|
|
|
- },
|
|
|
+ this.$message.success('数据刷新成功!');
|
|
|
+ this.reload();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
|
|
|
- openDetail(row) {
|
|
|
- this.current = row;
|
|
|
- //
|
|
|
+ openDetail(row) {
|
|
|
+ this.current = row;
|
|
|
+ //
|
|
|
|
|
|
- // this.$refs.userEdit.datasource(this.current.id);
|
|
|
- this.detailEdit = true;
|
|
|
- }
|
|
|
+ // this.$refs.userEdit.datasource(this.current.id);
|
|
|
+ this.detailEdit = true;
|
|
|
}
|
|
|
- };
|
|
|
+ }
|
|
|
+};
|
|
|
</script>
|