Commit 5061aa12 authored by liqiuyu's avatar liqiuyu

fix(*): 更改所属区域

parent 621d9565
...@@ -159,8 +159,6 @@ import { useRoute, useRouter } from "vue-router"; ...@@ -159,8 +159,6 @@ import { useRoute, useRouter } from "vue-router";
import { getDataFun, postDataJSON } from "@/request/method.js"; import { getDataFun, postDataJSON } from "@/request/method.js";
import moment from "moment"; import moment from "moment";
const route = useRoute();
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
......
...@@ -8,15 +8,15 @@ ...@@ -8,15 +8,15 @@
<el-form-item label="发生位置:"> <el-form-item label="发生位置:">
<el-input v-model="formInline.keyword" placeholder="请输入"></el-input> <el-input v-model="formInline.keyword" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="所属区域:"> <el-form-item label="所属工序:">
<el-select v-model="formInline.branchFactoryIds" <el-select v-model="formInline.productionLineId"
placeholder="请选择" placeholder="请选择"
style="width: 180px" style="width: 180px"
> >
<el-option v-for="(item, index) in basicConfiguration.branchFactoryList" <el-option v-for="(item, index) in basicConfiguration.productLineList"
:key="item.branchFactoryId" :key="item.productionLineId"
:label="item.branchFactory" :label="item.productionLineName"
:value="item.branchFactoryId" :value="item.productionLineId"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -135,9 +135,9 @@ ...@@ -135,9 +135,9 @@
<div class="label-title">告警信息</div> <div class="label-title">告警信息</div>
<div class="alarm-content"> <div class="alarm-content">
<div class="content-item"> <div class="content-item">
<span class="name">所属区域:</span> <span class="name">所属工序:</span>
<span class="value">{{ <span class="value">{{
workSheetDetail?.branchFactory || "--" workSheetDetail?.productionLine || "--"
}}</span> }}</span>
</div> </div>
<div class="content-item"> <div class="content-item">
...@@ -818,7 +818,7 @@ const dispatchHandle = async (url,param) => { ...@@ -818,7 +818,7 @@ const dispatchHandle = async (url,param) => {
const basicConfiguration = reactive({ const basicConfiguration = reactive({
ticketEventName: [{ name: '全部', id: '' }], ticketEventName: [{ name: '全部', id: '' }],
eventTypeList: [], eventTypeList: [],
branchFactoryList: [{ branchFactory: '全部', branchFactoryId: '' }], productLineList: [{productionLineName: '全部', productionLineId: ''}],
deviceList: [] deviceList: []
}); });
...@@ -1026,11 +1026,11 @@ const tableColumns = ref([ ...@@ -1026,11 +1026,11 @@ const tableColumns = ref([
width: '10%' width: '10%'
}, },
{ {
prop: 'branchFactory', label: '所属区域',width: '10%' }, prop: 'productionLine', label: '所属工序',width: '10%' },
{ prop: 'warnTypeName', label: '类型',width: '10%' }, { prop: 'warnTypeName', label: '类型',width: '10%' },
{ prop: 'createTime', label: '发生时间',width: '10%' }, { prop: 'createTime', label: '发生时间',width: '10%' },
{ prop: 'desc', label: '闭环状态',width: '10%' }, { prop: 'desc', label: '闭环状态',width: '10%' },
{ prop: 'person', label: '处理人',width: '10%' }, { prop: 'handleUser', label: '处理人',width: '10%' },
{ prop: 'level', label: '级别',width: '5%' }, { prop: 'level', label: '级别',width: '5%' },
{ {
prop: "operation", prop: "operation",
...@@ -1039,33 +1039,8 @@ const tableColumns = ref([ ...@@ -1039,33 +1039,8 @@ const tableColumns = ref([
}, },
]); ]);
const permissionBranchFactory = JSON.parse(sessionStorage.getItem('branchFactoryList'))|| [];
const customerId = getToken('customerId'); const customerId = getToken('customerId');
const getBranchTypeList = ()=> {
const url = '/transaction/getBranchFactory';
const params = {
customerId
}
getDataFun(url,params).then(res => {
if (res && res.code === 1) {
const branchFactory = res.data;
if (permissionBranchFactory.length === 0) {
basicConfiguration.branchFactoryList = [];
} else if (permissionBranchFactory.length === 1 && permissionBranchFactory[0] == 0) {
basicConfiguration.branchFactoryList = basicConfiguration.branchFactoryList.concat(branchFactory);
} else {
basicConfiguration.branchFactoryList = branchFactory.filter((item) =>
permissionBranchFactory.includes(item.branchFactoryId)
);
basicConfiguration.branchFactoryList.unshift({ branchFactory: '全部', branchFactoryId: '' });
}
}
});
}
const getWarnAndTicketConfigMap = ()=> { const getWarnAndTicketConfigMap = ()=> {
const url = '/system/getWarnAndTicketConfigMap'; const url = '/system/getWarnAndTicketConfigMap';
const params = { const params = {
...@@ -1091,18 +1066,6 @@ let realBtn = ''; ...@@ -1091,18 +1066,6 @@ let realBtn = '';
const searchData =()=> { const searchData =()=> {
currentPage.value = 1; currentPage.value = 1;
pageSize.value = 20; pageSize.value = 20;
if (!formInline.value.branchFactoryIds) {
if (permissionBranchFactory.length === 0) {
realBtn = -1;
} else if (permissionBranchFactory.length === 1 && permissionBranchFactory[0] == 0) {
realBtn = '';
} else {
realBtn = permissionBranchFactory.join(',');
}
} else {
realBtn = formInline.value.branchFactoryIds;
}
getTableData(); getTableData();
} }
...@@ -1130,6 +1093,17 @@ const getTableData = ()=> { ...@@ -1130,6 +1093,17 @@ const getTableData = ()=> {
total.value = res.data.total; total.value = res.data.total;
disposeType(list); disposeType(list);
tableData.value = list; tableData.value = list;
tableData.value.forEach(item => {
item.handleUser = '';
item.handleUsers.forEach((ele,eIndex)=>{
if (eIndex > 0) {
item.handleUser += ',' + ele.userName;
} else {
item.handleUser += ele.userName;
}
});
});
} }
}); });
} }
...@@ -1214,7 +1188,7 @@ const disposeWorkSheetDetail = (obj)=> { ...@@ -1214,7 +1188,7 @@ const disposeWorkSheetDetail = (obj)=> {
} }
onMounted(()=>{ onMounted(()=>{
getBranchTypeList(); getProDuctLine();
getWarnAndTicketConfigMap(); getWarnAndTicketConfigMap();
getDeviceType(); getDeviceType();
searchData(); searchData();
...@@ -1223,6 +1197,12 @@ onMounted(()=>{ ...@@ -1223,6 +1197,12 @@ onMounted(()=>{
const formModel = ref({ const formModel = ref({
selectReason: [], selectReason: [],
}); });
const getProDuctLine = ()=>{
const url = '/transaction/getProductionLine';
getData(url).then(res => {
basicConfiguration.productLineList = res.data;
});
}
const currentPage = ref(1); const currentPage = ref(1);
......
...@@ -8,15 +8,15 @@ ...@@ -8,15 +8,15 @@
<el-form-item label="发生位置:"> <el-form-item label="发生位置:">
<el-input v-model="formInline.keyword" placeholder="请输入"></el-input> <el-input v-model="formInline.keyword" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="所属区域:"> <el-form-item label="所属工序:">
<el-select v-model="formInline.branchFactoryIds" <el-select v-model="formInline.productionLineId"
placeholder="请选择" placeholder="请选择"
style="width: 180px" style="width: 180px"
> >
<el-option v-for="(item, index) in basicConfiguration.branchFactoryList" <el-option v-for="(item, index) in basicConfiguration.productLineList"
:key="item.branchFactoryId" :key="item.productionLineId"
:label="item.branchFactory" :label="item.productionLineName"
:value="item.branchFactoryId" :value="item.productionLineId"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -77,14 +77,14 @@ ...@@ -77,14 +77,14 @@
<span class="view-btn" @click="handleView(row)"> <span class="view-btn" @click="handleView(row)">
查看 查看
</span> </span>
<span class="table-btn">|</span> <!-- <span class="table-btn">|</span>
<span class="view-btn" @click="handleReject(row)"> <span class="view-btn" @click="handleReject(row)">
驳回 驳回
</span> </span>
<span class="table-btn">|</span> <span class="table-btn">|</span>
<span class="view-btn" @click="changeBag(row)"> <span class="view-btn" @click="changeBag(row)">
更换布袋 更换布袋
</span> </span>-->
</template> </template>
</common-table> </common-table>
</div> </div>
...@@ -123,9 +123,9 @@ ...@@ -123,9 +123,9 @@
<div class="label-title">告警信息</div> <div class="label-title">告警信息</div>
<div class="alarm-content"> <div class="alarm-content">
<div class="content-item"> <div class="content-item">
<span class="name">所属区域</span> <span class="name">所属工序</span>
<span class="value">{{ <span class="value">{{
workSheetDetail.branchFactory || "--" workSheetDetail.productionLine || "--"
}}</span> }}</span>
</div> </div>
<div class="content-item"> <div class="content-item">
...@@ -901,12 +901,19 @@ const getIndex = (index) => { ...@@ -901,12 +901,19 @@ const getIndex = (index) => {
const basicConfiguration = reactive({ const basicConfiguration = reactive({
ticketEventName: [], ticketEventName: [],
branchFactoryList: [{ branchFactory: "全部", branchFactoryId: "" }], deviceList: [],
deviceList: [] productLineList: [{productionLineName: '全部', productionLineId: ''}],
}); });
const workSheetDetail = ref(null); const workSheetDetail = ref(null);
const getProDuctLine = ()=>{
const url = '/transaction/getProductionLine';
getData(url).then(res => {
basicConfiguration.productLineList = res.data;
});
}
const getColor = computed(()=>{ const getColor = computed(()=>{
return (level) => { return (level) => {
if (level == 2) { if (level == 2) {
...@@ -1074,11 +1081,11 @@ const tableColumns = ref([ ...@@ -1074,11 +1081,11 @@ const tableColumns = ref([
width: '10%' width: '10%'
}, },
{ {
prop: 'branchFactory', label: '所属区域',width: '10%' }, prop: 'productionLine', label: '所属工序',width: '10%' },
{ prop: 'warnTypeName', label: '类型',width: '10%' }, { prop: 'warnTypeName', label: '类型',width: '10%' },
{ prop: 'createTime', label: '发生时间',width: '10%' }, { prop: 'createTime', label: '发生时间',width: '10%' },
{ prop: 'desc', label: '闭环状态',width: '10%' }, { prop: 'desc', label: '闭环状态',width: '10%' },
{ prop: 'person', label: '处理人',width: '10%' }, { prop: 'handleUser', label: '处理人',width: '10%' },
{ prop: 'level', label: '级别',width: '5%' }, { prop: 'level', label: '级别',width: '5%' },
{ {
prop: "operation", prop: "operation",
...@@ -1087,32 +1094,10 @@ const tableColumns = ref([ ...@@ -1087,32 +1094,10 @@ const tableColumns = ref([
}, },
]); ]);
const permissionBranchFactory = JSON.parse(sessionStorage.getItem('branchFactoryList'))|| [];
const customerId = getToken('customerId');
const getBranchTypeList = ()=> { const customerId = getToken('customerId');
const url = '/transaction/getBranchFactory';
const params = {
customerId
}
getDataFun(url,params).then(res => {
if (res && res.code === 1) {
const branchFactory = res.data;
if (permissionBranchFactory.length === 0) {
basicConfiguration.branchFactoryList = [];
} else if (permissionBranchFactory.length === 1 && permissionBranchFactory[0] == 0) {
basicConfiguration.branchFactoryList = basicConfiguration.branchFactoryList.concat(branchFactory);
} else {
basicConfiguration.branchFactoryList = branchFactory.filter((item) =>
permissionBranchFactory.includes(item.branchFactoryId)
);
basicConfiguration.branchFactoryList.unshift({ branchFactory: '全部', branchFactoryId: '' });
}
}
});
}
const getWarnAndTicketConfigMap = ()=> { const getWarnAndTicketConfigMap = ()=> {
const url = '/system/getWarnAndTicketConfigMap'; const url = '/system/getWarnAndTicketConfigMap';
...@@ -1133,17 +1118,6 @@ const searchData = ()=>{ ...@@ -1133,17 +1118,6 @@ const searchData = ()=>{
currentPage.value = 1; currentPage.value = 1;
pageSize.value = 20; pageSize.value = 20;
if (!formInline.value.branchFactoryIds) {
if (permissionBranchFactory.length === 0) {
realBtn = -1;
} else if (permissionBranchFactory.length === 1 && permissionBranchFactory[0] == 0) {
realBtn = '';
} else {
realBtn = permissionBranchFactory.join(',');
}
} else {
realBtn = formInline.value.branchFactoryIds;
}
getTableData(); getTableData();
} }
...@@ -1173,6 +1147,16 @@ const getTableData = ()=> { ...@@ -1173,6 +1147,16 @@ const getTableData = ()=> {
total.value = res.data.total; total.value = res.data.total;
disposeType(list); disposeType(list);
tableData.value = list; tableData.value = list;
tableData.value.forEach(item => {
item.handleUser = '';
item.handleUsers.forEach((ele,eIndex)=>{
if (eIndex > 0) {
item.handleUser += ',' + ele.userName;
} else {
item.handleUser += ele.userName;
}
});
});
} }
}); });
} }
...@@ -1224,7 +1208,7 @@ const getDeviceType =() => { ...@@ -1224,7 +1208,7 @@ const getDeviceType =() => {
} }
onMounted(() => { onMounted(() => {
getBranchTypeList(); getProDuctLine();
getWarnAndTicketConfigMap(); getWarnAndTicketConfigMap();
getDeviceType(); getDeviceType();
searchData(); searchData();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment