From 63bf19f98ceea75e5cf1c7ba3fd170ae4a617208 Mon Sep 17 00:00:00 2001
From: zhang_li <2235006734@qqq.com>
Date: Tue, 27 Feb 2024 16:24:39 +0800
Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E4=BF=9D=E4=BF=AE=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD=E4=BF=AE=E6=94=B9=EF=BC=8C=E7=BB=B4=E4=BF=AE=E5=B7=A5?=
=?UTF-8?q?=E5=8D=95=E6=B7=BB=E5=8A=A0=E7=B1=BB=E5=9E=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
api/dept.js | 9 ++
api/device.js | 7 ++
api/mold.js | 7 ++
config.js | 2 +-
pages/deviceReport/addForm.vue | 102 ++++++++++++------
pages/deviceReport/index.vue | 2 +-
pages/repairOrder/addForm.vue | 15 +++
pages/repairOrder/detail.vue | 6 +-
pages/repairOrder/index.vue | 2 +-
.../addForm.vue | 2 +-
pages/spotCheckOrder/addForm.vue | 2 +-
11 files changed, 114 insertions(+), 42 deletions(-)
diff --git a/api/dept.js b/api/dept.js
index 04d8a54..3199d20 100644
--- a/api/dept.js
+++ b/api/dept.js
@@ -8,3 +8,12 @@ export function getSelecUser(params) {
params
})
}
+
+// 获取厂区列表
+export function getFactoryAreaList(params) {
+ return request({
+ url: '/system/dept/selectAllFactoryArea',
+ 'method': 'GET',
+ params
+ })
+}
diff --git a/api/device.js b/api/device.js
index abab97d..1e44e07 100644
--- a/api/device.js
+++ b/api/device.js
@@ -8,6 +8,13 @@ export function getDeviceDetailsByNumber(params) {
params
})
}
+// 根据厂区查询设备
+export function getDeviceByFactoryAreaNumber(factoryAreaNumber) {
+ return request({
+ url: '/eam/device-accounts/selectData?factoryAreaNumber='+factoryAreaNumber,
+ 'method': 'GET'
+ })
+}
// 添加报修
export function deviceRepairCreate(data) {
return request({
diff --git a/api/mold.js b/api/mold.js
index c5ddb6c..ba23367 100644
--- a/api/mold.js
+++ b/api/mold.js
@@ -7,6 +7,13 @@ export function getMoldDetailsByNumber(params) {
params
})
}
+// 根据厂区查询模具
+export function getMoldByFactoryAreaNumber(factoryAreaNumber) {
+ return request({
+ url: '/eam/mold-accounts/selectData?factoryAreaNumber='+factoryAreaNumber,
+ 'method': 'GET'
+ })
+}
// 模具分页列表
export function moldPage(params) {
return request({
diff --git a/config.js b/config.js
index c399f60..54b06ac 100644
--- a/config.js
+++ b/config.js
@@ -1,7 +1,7 @@
// 应用全局配置
module.exports = {
// http://192.168.0.165:1208
- baseUrl: process.env.NODE_ENV === 'development' ? 'http://192.168.0.181:12080' : 'http://dev.ccwin-in.com:25200/api',
+ baseUrl: process.env.NODE_ENV === 'development' ? 'http://192.168.0.172:12080' : 'http://dev.ccwin-in.com:25200/api',
baseApi:process.env.NODE_ENV === 'development' ? '/admin-api' : '/api/admin-api',
// 应用信息
appInfo: {
diff --git a/pages/deviceReport/addForm.vue b/pages/deviceReport/addForm.vue
index 46738b2..7f665de 100644
--- a/pages/deviceReport/addForm.vue
+++ b/pages/deviceReport/addForm.vue
@@ -5,18 +5,27 @@
-
-
-
- 扫描
+
+
+
+ {{selectFormat(form.factoryAreaNumber,factoryAreaList)}}
+
+
+ {{`请选择所属厂区`}}
+
+
-
-
-
-
-
+
+
+
+ {{selectFormat(form.deviceNumber,deviceList)}}
+
+
+ {{`请选择${type=='DEVICE'?'设备' : '模具'}`}}
+
+
+
@@ -59,6 +68,7 @@
import * as moldApi from "@/api/mold.js"
import * as dictApi from "@/api/dict.js"
import * as uploadApi from "@/api/upload.js"
+ import * as deptApi from "@/api/dept.js"
export default {
data() {
@@ -66,6 +76,8 @@
loading: false,
type: "",
appDeviceMoldType: [],
+ factoryAreaList:[],//工厂列表
+ deviceList:[],//设备列表
form: {
describes: "",
deviceNumber: '',
@@ -95,30 +107,44 @@
this.getDetailsByNumber()
}
},
+ // 获取厂区列表
+ getFactoryAreaList() {
+ deptApi.getFactoryAreaList().then((res) => {
+ if (res.data&&res.data.length>0) {
+ res.data.map(item => {
+ item.value = item.id
+ item.label = item.name
+ })
+ this.factoryAreaList = res.data
+ } else{
+ this.factoryAreaList =[]
+ }
+ })
+ },
// 根据设备/模具号查询信息
getDetailsByNumber() {
- const data = {
- number: this.form.deviceNumber,
- id: ''
- }
if (this.type == 'DEVICE') {
- deviceApi.getDeviceDetailsByNumber(data).then((res) => {
- if (res.data) {
- this.form.deviceName = res.data.name
- this.form.factoryAreaName = res.data.factoryAreaName
- this.form.factoryAreaNumber = res.data.factoryAreaNumber
- } else {
- this.$modal.showToast(`找不到该${this.type=='DEVICE'?'设备' : '模具'}`)
+ deviceApi.getDeviceByFactoryAreaNumber(this.form.factoryAreaNumber).then((res) => {
+ if (res.data&&res.data.length>0) {
+ res.data.map(item => {
+ item.value = item.number
+ item.label = item.name
+ })
+ this.deviceList = res.data
+ }else{
+ this.deviceList = []
}
})
} else if (this.type == 'MOLD') {
- moldApi.getMoldDetailsByNumber(data).then((res) => {
- if (res.data) {
- this.form.deviceName = res.data.name
- this.form.factoryAreaName = res.data.factoryAreaName
- this.form.factoryAreaNumber = res.data.factoryAreaNumber
- } else {
- this.$modal.showToast(`找不到该${this.type=='DEVICE'?'设备' : '模具'}`)
+ moldApi.getMoldByFactoryAreaNumber(this.form.factoryAreaNumber).then((res) => {
+ if (res.data&&res.data.length>0) {
+ res.data.map(item => {
+ item.value = item.number
+ item.label = item.name
+ })
+ this.deviceList = res.data
+ }else{
+ this.deviceList = []
}
})
}
@@ -130,16 +156,16 @@
this.$modal.showToast('请输入故障描述')
return;
}
- if (!this.form.deviceNumber) {
- this.$modal.showToast(`请输入${this.type=='DEVICE'?'设备' : '模具'}编码`)
+ if (!this.form.factoryAreaNumber) {
+ this.$modal.showToast(`请选择选择所属厂区`)
return;
}
- if (!this.form.deviceName) {
- this.$modal.showToast(`请输入${this.type=='DEVICE'?'设备' : '模具'}名称`)
+ if (!this.form.deviceNumber) {
+ this.$modal.showToast(`请选择${this.type=='DEVICE'?'设备' : '模具'}`)
return;
}
- if (!this.form.factoryAreaName) {
- this.$modal.showToast('请输入所属厂区')
+ if (!this.form.receiverType) {
+ this.$modal.showToast(`请选择类型'}`)
return;
}
if (this.imgList.length == 0) {
@@ -150,6 +176,7 @@
describes: this.form.describes,
deviceNumber: this.form.deviceNumber,
factoryAreaNumber: this.form.factoryAreaNumber,
+ receiverType: this.form.receiverType,
type: this.type,
filePathList: this.imgList,
}
@@ -197,6 +224,11 @@
// 单列模式点击确定之后
chooseSingleColumn(e) {
this.form[this.field] = e[0].value
+ if(this.field == 'factoryAreaNumber'){
+ this.form.deviceNumber = ''
+ this.form.deviceName = ''
+ this.getDetailsByNumber()
+ }
this.singleColumnShow = false
this.$emit('singleColumn', this.field, this.form[this.field])
this.$forceUpdate()
@@ -233,6 +265,8 @@
async onLoad(option) {
if (option.type) this.type = option.type;
this.appDeviceMoldType = await dictApi.getDict('app_device_mold_type')
+ this.appDeviceMoldType = this.appDeviceMoldType.filter((item=>item.value!="MOLD"))
+ this.getFactoryAreaList()
}
}
diff --git a/pages/deviceReport/index.vue b/pages/deviceReport/index.vue
index d8488f2..aa32b70 100644
--- a/pages/deviceReport/index.vue
+++ b/pages/deviceReport/index.vue
@@ -9,7 +9,7 @@
-
+
{{item.describes}}
diff --git a/pages/repairOrder/addForm.vue b/pages/repairOrder/addForm.vue
index f2de396..ced6dc6 100644
--- a/pages/repairOrder/addForm.vue
+++ b/pages/repairOrder/addForm.vue
@@ -5,6 +5,17 @@
+
+
+
+ {{selectFormat(form.receiverType,appDeviceMoldType)}}
+
+
+ {{`请选择类型`}}
+
+
+
+
@@ -65,6 +76,7 @@
data() {
return {
loading: false,
+ appDeviceMoldType: [],
type: "",
form: {
id: '',
@@ -108,6 +120,7 @@
const data = {
id: this.form && this.form.id ? this.form.id : '',
describes: this.form.describes,
+ receiverType: this.form.receiverType,
deviceNumber: this.form.deviceNumber,
factoryAreaNumber: this.form.factoryAreaNumber,
classes: this.form.classes,
@@ -243,6 +256,8 @@
};
await this.getDeviceList()
this.maintenanceShift = await dictApi.getDict('maintenance_shift')
+ this.appDeviceMoldType = await dictApi.getDict('app_device_mold_type')
+ this.appDeviceMoldType = this.appDeviceMoldType.filter((item=>item.value!="MOLD"))
this.faultType = await dictApi.getDict('fault_type')
}
}
diff --git a/pages/repairOrder/detail.vue b/pages/repairOrder/detail.vue
index 42e0c06..ed3b07d 100644
--- a/pages/repairOrder/detail.vue
+++ b/pages/repairOrder/detail.vue
@@ -121,11 +121,11 @@
-
+
扫描
diff --git a/pages/spotCheckOrder/addForm.vue b/pages/spotCheckOrder/addForm.vue
index 74c029e..3beb1a6 100644
--- a/pages/spotCheckOrder/addForm.vue
+++ b/pages/spotCheckOrder/addForm.vue
@@ -7,7 +7,7 @@
+ :placeholder="`请输入${type=='DEVICE'?'设备' : '模具'}编码`" @blur="blur"/>
扫描