更新
This commit is contained in:
99
src/views/core/base/lineBindProcess/index.vue
Normal file
99
src/views/core/base/lineBindProcess/index.vue
Normal file
@@ -0,0 +1,99 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-02 15:12:42
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2024-11-29 13:25:51
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<search-bar
|
||||
:formConfigs="[{ label: '产线在制工艺', type: 'title' }]"
|
||||
ref="searchBarForm" />
|
||||
<base-table
|
||||
v-loading="dataListLoading"
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.pageNo"
|
||||
:limit="listQuery.pageSize"
|
||||
:table-data="tableData"
|
||||
@emitFun="inputChange" />
|
||||
<pagination
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:page.sync="listQuery.pageNo"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicPage from '../../mixins/basic-page';
|
||||
import { parseTime } from '../../mixins/code-filter';
|
||||
import { getLineBindProcessPage } from '@/api/core/base/lineBindProcess';
|
||||
import selectProduct from './selectProduct';
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'lineName',
|
||||
label: '产线'
|
||||
},
|
||||
{
|
||||
prop: 'processDictName',
|
||||
label: '在制工艺',
|
||||
list: [],
|
||||
subcomponent: selectProduct,
|
||||
},
|
||||
{
|
||||
prop: 'recordTime',
|
||||
label: '开始时间',
|
||||
filter: parseTime,
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage, selectProduct],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: getLineBindProcessPage,
|
||||
},
|
||||
tableProps,
|
||||
tableData: [],
|
||||
// formConfig: [
|
||||
// {
|
||||
// type: 'button',
|
||||
// btnName: '同步',
|
||||
// name: 'search',
|
||||
// color: 'primary',
|
||||
// },
|
||||
// ],
|
||||
};
|
||||
},
|
||||
components: {},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.dataListLoading = true;
|
||||
this.urlOptions.getDataListURL(this.listQuery).then(response => {
|
||||
this.tableData = response.data;
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.getDataList();
|
||||
break;
|
||||
default:
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
inputChange() {
|
||||
this.getDataList();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
80
src/views/core/base/lineBindProcess/selectProduct.vue
Normal file
80
src/views/core/base/lineBindProcess/selectProduct.vue
Normal file
@@ -0,0 +1,80 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-03 14:09:18
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2024-11-29 13:29:28
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="tableInner">
|
||||
<el-popover
|
||||
placement="top"
|
||||
title="切换在制工艺"
|
||||
width="160"
|
||||
v-model="visible">
|
||||
<el-select v-model="list.processDict" style="margin: 5px" filterable>
|
||||
<el-option
|
||||
v-for="opt in getDictDatas(DICT_TYPE.PROCESS_TYPE)"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value + '+' + opt.label"></el-option>
|
||||
</el-select>
|
||||
<div style="text-align: right; margin: 0">
|
||||
<el-button size="mini" type="text" @click="visible = false">
|
||||
取消
|
||||
</el-button>
|
||||
<el-button type="primary" size="mini" @click="changeInput">
|
||||
确定
|
||||
</el-button>
|
||||
</div>
|
||||
<el-button type="text" slot="reference">
|
||||
<svg-icon icon-class="changelogo" />
|
||||
</el-button>
|
||||
</el-popover>
|
||||
<el-input
|
||||
readonly
|
||||
v-model="list.processDictName"
|
||||
style="width: 50%; margin-left: 5px"></el-input>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { switchLineBindProcess } from '@/api/core/base/lineBindProcess';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list: this.injectData,
|
||||
visible: false,
|
||||
};
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
changeInput() {
|
||||
const data = {
|
||||
id: this.list.id,
|
||||
processDict: this.list.processDict.split('+')[0],
|
||||
processDictName: this.list.processDict.split('+')[1],
|
||||
};
|
||||
switchLineBindProcess(data).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.visible = false;
|
||||
this.list.processDictName = this.list.processDict.split('+')[1];
|
||||
this.$emit('emitData');
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.tableInner .el-input__inner {
|
||||
border: none;
|
||||
padding: 0;
|
||||
height: 33px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user