质量管理检验项目维护 新增:类型下拉框右侧显示不全

新增、编辑:类型、额定工时非必填
dev-scheduling
姜雪 3 weeks ago
parent 87f4026966
commit 820a66af07
  1. 13
      src/api/basicData/calculationFormula.js
  2. 45
      src/views/basicData/calculationFormula/tankDosing.vue
  3. 46
      src/views/basicData/calculationFormula/theoreticalValue.vue
  4. 4
      src/views/exemption/index.vue
  5. 70
      src/views/productionTesting/components/trialItem.vue

@ -39,4 +39,15 @@ export const getSelectFormula = (params) =>
url: '/api/blade-desk/QA/LiquidTank/listForSelectDistinct',
method: 'get',
params
})
})
export const userListpage = (current, size, params) => {
return request({
url: '/blade-system/user/userListByRaise',
method: 'get',
params: {
...params,
current,
size,
},
});
};

@ -46,7 +46,7 @@
<script>
import addEditDosing from "./components/addEditDosing.vue";
import workCenterSet from "./components/workCenterSet.vue";
import {getList,addFormula,deleteFormula} from "@/api/basicData/calculationFormula"
import {getList,addFormula,deleteFormula,userListpage} from "@/api/basicData/calculationFormula"
export default {
components: {
addEditDosing,
@ -57,6 +57,8 @@ export default {
selectionList: [],
loading:false,
query:{},
userListData: [],
userListLoaded: false,
option: {
height: "auto",
calcHeight: 32,
@ -123,12 +125,15 @@ export default {
},
{
label: "操作人",
prop: "updateUserName",
prop: "updateUser",
sortable: true,
filter: true,
span: 24,
search: false,
display: true,
formatter: (row) => {
return this.userMapObj[row.updateUser] || row.updateUser || '-';
},
},
{
label: "更新时间",
@ -152,7 +157,37 @@ export default {
isWorkOpen: false,
};
},
computed: {
userMapObj() {
const map = {};
this.userListData.forEach(user => {
map[user.value] = user.label;
map[String(user.value)] = user.label;
map[Number(user.value)] = user.label;
});
return map;
},
},
methods: {
loadUserList() {
return new Promise((resolve) => {
userListpage(1, 99999).then(res => {
if (res.data.code == 200) {
const users = res.data.data;
this.userListData = users.map(user => ({
label: user.realName || user.name,
value: String(user.id)
}));
this.userListLoaded = true;
}
resolve();
}).catch(error => {
console.error('获取用户列表失败', error);
resolve();
});
});
},
addEdit() {
this.checkRow = {};
this.isOpen = true;
@ -256,8 +291,12 @@ export default {
selectionChange(list) {
this.selectionList = list;
},
onLoad() {
async onLoad() {
this.loading = true;
//
if (!this.userListLoaded) {
await this.loadUserList();
}
getList({
current:this.page.currentPage,
size:this.page.pageSize,

@ -33,7 +33,7 @@
<script>
import addEditDosing from './components/addEditDosing.vue'
import workCenterSet from './components/workCenterSet.vue'
import {getList,deleteFormula} from "@/api/basicData/calculationFormula"
import {getList,deleteFormula,userListpage} from "@/api/basicData/calculationFormula"
export default {
components: {
addEditDosing,
@ -44,6 +44,8 @@ export default {
selectionList: [],
loading: false,
query: {},
userListData: [],
userListLoaded: false,
option: {
height: 'auto',
calcHeight: 32,
@ -111,16 +113,19 @@ export default {
},
{
label: '操作人',
prop: 'subName',
prop: 'updateUser',
sortable: true,
filter: true,
span: 24,
search: false,
display: true,
formatter: (row) => {
return this.userMapObj[row.updateUser] || row.updateUser || '-';
},
},
{
label: '更新时间',
prop: 'subName',
prop: 'updateTime',
sortable: true,
filter: true,
span: 24,
@ -142,7 +147,36 @@ export default {
checkRow:{}
}
},
computed: {
userMapObj() {
const map = {};
this.userListData.forEach(user => {
map[user.value] = user.label;
map[String(user.value)] = user.label;
map[Number(user.value)] = user.label;
});
return map;
},
},
methods: {
loadUserList() {
return new Promise((resolve) => {
userListpage(1, 99999).then(res => {
if (res.data.code == 200) {
const users = res.data.data;
this.userListData = users.map(user => ({
label: user.realName || user.name,
value: String(user.id)
}));
this.userListLoaded = true;
}
resolve();
}).catch(error => {
console.error('获取用户列表失败', error);
resolve();
});
});
},
addEdit() {
this.checkRow = {}
this.isOpen = true
@ -247,8 +281,12 @@ export default {
selectionChange(list) {
this.selectionList = list;
},
onLoad() {
async onLoad() {
this.loading = true
//
if (!this.userListLoaded) {
await this.loadUserList();
}
getList({
current:this.page.currentPage,
size:this.page.pageSize,

@ -267,9 +267,7 @@ export default {
},
methods: {
loadUserList(page, params = {}) {
console.log(1213999999999999999999999999999999999999999);
userList(page.currentPage, page.pageSize).then(res => {
userList(page.currentPage, page.pageSize).then(res => {
if (res.data.code == 200) {
const users = res.data.data;

@ -1,7 +1,6 @@
<template>
<div>
<div class="trial-item-container">
<avue-crud
:height="460"
:option="option"
v-model:search="search"
:table-loading="loading"
@ -52,9 +51,9 @@
<el-input v-model="scope.row.standardWorkMinute"></el-input>
</template>
</el-table-column>
<el-table-column label="类型" prop="itemType">
<el-table-column label="类型" prop="itemType" width="280">
<template #default="scope">
<el-select v-model="scope.row.itemType" placeholder="请选择" style="width: 240px">
<el-select v-model="scope.row.itemType" placeholder="请选择" style="width: 100%" teleported>
<el-option
v-for="item in typeList"
:key="item.id"
@ -107,7 +106,8 @@ export default {
align: 'center',
height: 'auto',
searchLabelWidth: 120,
simplePage: true,
simplePage: false,
pagination: true,
searchShow: true,
searchMenuSpan: 6,
searchIcon: true,
@ -185,19 +185,15 @@ export default {
type: 'select',
dicUrl: '/blade-system/dict/dictionary?code=InspectionItem-ItemType',
props: { label: 'dictValue', value: 'dictKey' },
// dicData:[
// {
// label:'',
// value:1
// },
// {
// label:'',
// value:2
// },
// ],
formatter: (row, value) => {
if (value === 0 || value === '0') {
return '';
}
return value;
},
rules: [
{
required: true,
required: false,
message: '请输入名称',
trigger: 'click',
},
@ -211,9 +207,15 @@ export default {
span: 24,
search: true,
searchLabelWidth: 50,
formatter: (row, value) => {
if (value === -1 || value === '-1') {
return '';
}
return value;
},
rules: [
{
required: true,
required: false,
message: '请输入名称',
trigger: 'click',
},
@ -253,9 +255,11 @@ export default {
},
currentChange(currentPage) {
this.page.currentPage = currentPage;
this.onLoad();
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
this.onLoad();
},
refreshChange() {
this.onLoad();
@ -284,8 +288,18 @@ export default {
},
handleEdit(row, index) {
getDetail({ id: row.id }).then(res => {
res.data.data.itemType = res.data.data.itemType + '';
this.$refs.crud.rowEdit(res.data.data, index);
const data = res.data.data;
// 0
if (data.itemType === 0 || data.itemType === '0') {
data.itemType = '';
} else if (data.itemType !== null && data.itemType !== undefined && data.itemType !== '') {
data.itemType = String(data.itemType);
}
// -1
if (data.standardWorkMinute === -1 || data.standardWorkMinute === '-1') {
data.standardWorkMinute = '';
}
this.$refs.crud.rowEdit(data, index);
});
},
rowUpdate(form, index, done, loading) {
@ -301,7 +315,7 @@ export default {
if (this.tidList.length == 0) {
this.$message.error('请至少填写一条数据');
} else {
let tmp = this.tidList.find(item => !item.code || !item.name || !item.itemType);
let tmp = this.tidList.find(item => !item.code || !item.name);
if (tmp) {
this.$message.error('数据请填写完整!');
} else {
@ -349,4 +363,18 @@ export default {
};
</script>
<style></style>
<style scoped>
.trial-item-container {
height: calc(100vh - 200px);
overflow-y: auto;
}
.trial-item-container :deep(.avue-crud__pagination) {
position: relative;
margin-top: 10px;
padding-bottom: 10px;
}
.trial-item-container :deep(.el-table) {
/* max-height: none !important; */
height: 300px !important;
}
</style>

Loading…
Cancel
Save