diff --git a/api/upload.js b/api/upload.js
new file mode 100644
index 0000000..31891f5
--- /dev/null
+++ b/api/upload.js
@@ -0,0 +1,12 @@
+import upload from '@/utils/upload'
+import request from '@/utils/request'
+// 上传
+export function uploadFile(data) {
+ console.log(data)
+ return upload({
+ url: '/infra/file/upload',
+ method: 'PUT',
+ filePath:data.filePath,
+ name: data.name
+ })
+}
diff --git a/config.js b/config.js
index b2655d2..c399f60 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.1.18:12080' : 'http://dev.ccwin-in.com:25200/api',
+ baseUrl: process.env.NODE_ENV === 'development' ? 'http://192.168.0.181: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 3c9b4c5..9521e44 100644
--- a/pages/deviceReport/addForm.vue
+++ b/pages/deviceReport/addForm.vue
@@ -142,11 +142,16 @@
this.$modal.showToast('请输入所属厂区')
return;
}
+ if (this.imgList.length == 0) {
+ this.$modal.showToast('请选择图片')
+ return;
+ }
const data = {
describes: this.form.describes,
deviceNumber: this.form.deviceNumber,
factoryAreaNumber: this.form.factoryAreaNumber,
- type: this.type
+ type: this.type,
+ filePathList: this.imgList,
}
this.$modal.confirm('是否添加报修').then(() => {
this.$modal.loading('加载中')
diff --git a/pages/deviceReport/index.vue b/pages/deviceReport/index.vue
index 2dac7c3..d8488f2 100644
--- a/pages/deviceReport/index.vue
+++ b/pages/deviceReport/index.vue
@@ -31,6 +31,9 @@
所属厂区:{{item.factoryAreaName}}
+
+
+
撤销
-
@@ -104,6 +106,21 @@
})
})
+ },
+ previewImage(current,array){
+ uni.previewImage({
+ urls: array,
+ current:current,
+ longPressActions: {
+ itemList: ['发送给朋友', '保存图片', '收藏'],
+ success: function(data) {
+ console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
+ },
+ fail: function(err) {
+ console.log(err.errMsg);
+ }
+ }
+ });
}
},
onLoad(option) {
@@ -234,4 +251,14 @@
}
}
}
+ .images{
+ display: flex;
+ width: 100%;
+ image{
+ width: 30%;
+ margin-right: 20rpx;
+ height: 200rpx;
+ border-radius: 10rpx;
+ }
+ }
\ No newline at end of file
diff --git a/pages/repairOrder/detail.vue b/pages/repairOrder/detail.vue
index ee19489..42e0c06 100644
--- a/pages/repairOrder/detail.vue
+++ b/pages/repairOrder/detail.vue
@@ -246,10 +246,13 @@
},
// APP维修工单接单、点击完成、验证
orderClick(type) {
- if(!this.serviceList || this.serviceList&&this.serviceList.length == 0){
- this.$modal.showToast('请添加维修内容')
- return;
+ if(this.data.status == 'PECEIVED'){
+ if(!this.serviceList || this.serviceList&&this.serviceList.length == 0){
+ this.$modal.showToast('请添加维修内容')
+ return;
+ }
}
+
const data = {
number: this.data.number,
status: this.data.status,
diff --git a/pages/sparePartsServiceWorkOrderList/addForm.vue b/pages/sparePartsServiceWorkOrderList/addForm.vue
index 17d8dcd..108aef0 100644
--- a/pages/sparePartsServiceWorkOrderList/addForm.vue
+++ b/pages/sparePartsServiceWorkOrderList/addForm.vue
@@ -1,11 +1,68 @@
-
-
-
-
- {{selectFormat(form.itemNumber,sparePartsList)}}
+
+
+
+ *申请备件
+
+
+
+
+
+ {{item.name}}
+
+
+
+
+
+ 库位:{{item.locationNumber}}
+
+
+
+
+ 数量:{{item.qty}}
+
+
+
+
+ 维修结果:{{item.result == 'YES'?'完成':'未完成'}}
+
+
+
+
+ 维修原因:{{item.reasons}}
+
+
+
+
+
+
+
+ 添加备件
+
+
+
+
+
+
+
-
-
+
+
@@ -48,14 +104,25 @@
import * as sparePartsServiceWorkOrderListApi from "@/api/sparePartsServiceWorkOrderList.js"
import * as dictApi from "@/api/dict.js"
import * as locationApi from "@/api/location.js"
-
+
export default {
data() {
return {
loading: false,
type: "",
+ // 备件弹窗
+ isPopupShow: false,
+ sparePartsList: [],
+ // 下拉框字段
+ singleColumnShow: false,
+ singleColumnDefaultValue: [],
+ singleColumnList: [],
+ field: '',
form: {
+ itemNumbers:[]
+ },
+ form1: {
itemNumber: "",
qty: '',
result: 'YES',
@@ -63,11 +130,6 @@
locationNumber:'',
areaNumber:''
},
- sparePartsList: [],
- singleColumnShow: false,
- singleColumnDefaultValue: [],
- singleColumnList: [],
- field: '',
result: [],
isShow:false
}
@@ -76,30 +138,10 @@
// 触发提交表单
submit() {
// 校验
- if (!this.form.itemNumber) {
+ if (this.form.itemNumbers == 0) {
this.$modal.showToast('请选择备件')
return;
}
- if (this.isInAccount == 'TRUE') {
- this.$modal.showToast('该库位属于帐内库,请选择帐外库')
- return;
- }
- if (this.itemNumber) {
- this.$modal.showToast('该库位已绑定过备件')
- return;
- }
- if (!this.form.qty) {
- this.$modal.showToast(`请输入数量`)
- return;
- }
- if (!this.form.result) {
- this.$modal.showToast('请选择维修结果')
- return;
- }
- if (!this.form.reasons) {
- this.$modal.showToast('请输入维修原因')
- return;
- }
this.$modal.confirm('是否添加备件维修工单').then(() => {
this.$modal.loading('加载中')
this.loading = true
@@ -124,12 +166,8 @@
},
// 重置
reset() {
- if (this.form.id) {
- this.form.classes = '';
- this.form.faultType = ''
- } else {
-
- this.form = {}
+ this.form = {
+ itemNumbers:[]
}
},
//
@@ -155,14 +193,16 @@
},
// 单列模式点击确定之后
chooseSingleColumn(e) {
- console.log(this.field)
- this.form[this.field] = e[0].value
+ this.form1[this.field] = e[0].value
if (this.field == 'itemNumber') {
this.choosesingleColumnItem = this.singleColumnList.filter(item => item.number == e[0].value)
- this.form.locationNumber = this.choosesingleColumnItem[0].locationNumber
- this.form.areaNumber = this.choosesingleColumnItem[0].areaNumber
+ console.log( this.choosesingleColumnItem[0])
+ this.form1.locationNumber = this.choosesingleColumnItem[0].locationNumber
+ this.form1.areaNumber = this.choosesingleColumnItem[0].areaNumber
if(!this.choosesingleColumnItem[0].locationNumber){
this.isShow = true
+ }else{
+ this.isShow = false
}
}
this.singleColumnShow = false
@@ -194,16 +234,77 @@
this.$modal.showToast('找不到该库位')
return;
}
- this.form.areaNumber = res.data.areaNumber;
+ this.form1.areaNumber = res.data.areaNumber;
this.isInAccount = res.data.isInAccount
this.itemNumber = res.data.itemNumber
})
},
blur() {
- if (this.form.locationNumber) {
+ if (this.form1.locationNumber) {
this.getLocation()
}
},
+ // 打开弹窗
+ open() {
+ this.form1 = {
+ itemNumber: "",
+ qty: '',
+ result: 'YES',
+ reasons: '',
+ locationNumber:'',
+ areaNumber:''
+ }
+ this.isPopupShow = true
+ },
+ // 添加配件
+ addSpare() {
+ // 校验
+ if (!this.form1.itemNumber) {
+ this.$modal.showToast('请选择备件')
+ return;
+ }
+ console.log(this.form1)
+ if (!this.form1.locationNumber) {
+ this.$modal.showToast('请扫描库位')
+ return;
+ }
+ if (this.isInAccount == 'TRUE') {
+ this.$modal.showToast('该库位属于帐内库,请选择帐外库')
+ return;
+ }
+ if (this.itemNumber) {
+ this.$modal.showToast('该库位已绑定过备件')
+ return;
+ }
+ if (!this.form1.qty) {
+ this.$modal.showToast(`请输入数量`)
+ return;
+ }
+ if (!this.form1.result) {
+ this.$modal.showToast('请选择维修结果')
+ return;
+ }
+ if (!this.form1.reasons) {
+ this.$modal.showToast('请输入维修原因')
+ return;
+ }
+ this.form1.name = this.selectFormat(this.form1.itemNumber, this.sparePartsList)
+ if (this.form.itemNumbers && this.form.itemNumbers.length > 0) {
+ let arr = this.form.itemNumbers.filter(item => item.itemNumber == this.form1.itemNumber)
+ if (arr && arr.length > 0) {
+ this.$modal.showToast('该备件已添加')
+ return;
+ }
+ }
+
+ this.form.itemNumbers.push(this.form1)
+ this.isPopupShow = false
+ },
+ // 删除备件
+ delSpareParts(index) {
+ this.form.itemNumbers.splice(index, 1)
+ }
+
},
async onLoad(option) {
if (option.type) this.type = option.type;
@@ -217,42 +318,15 @@
.add-form-container {
min-height: calc(100vh - 140rpx);
background: white;
- padding: 0px 30rpx 140rpx;
+ padding: 0px 0rpx 140rpx;
}
- .list {
- padding-bottom: 20rpx;
-
- .item {
- margin-top: 20rpx;
- background: white;
- padding: 30rpx;
- display: flex;
- align-items: center;
-
- image {
- width: 160rpx;
- height: 160rpx;
- margin-right: 20rpx;
- }
-
- .title {
- font-size: 32rpx;
- font-weight: bold;
- }
-
- .dec1 {
- font-size: 28rpx;
- margin-top: 16rpx;
- color: #acacac;
- }
+ .u-form-item {
+ padding: 20rpx 30rpx;
+ }
- .dec2 {
- font-size: 28rpx;
- margin-top: 6rpx;
- color: #acacac;
- }
- }
+ .disabled {
+ background: #f5f5f5;
}
.footer {
@@ -260,6 +334,7 @@
bottom: 0px;
left: 0px;
width: 100%;
+ z-index: 22;
}
.btns {
@@ -319,4 +394,87 @@
}
}
+
+ .title {
+ padding: 32rpx 0rpx;
+ position: relative;
+
+ span {
+ position: absolute;
+ left: -16rpx;
+ color: #fa3534;
+ top: 19px;
+ }
+ }
+
+ .list {
+ padding: 0rpx 30rpx;
+ .item {
+ display: flex;
+ margin-bottom: 20rpx;
+
+ .item-box {
+ background: #F5F5F5;
+ border-radius: 12rpx;
+ flex: 1;
+ width: 0rpx;
+ }
+
+ .spare-title {
+ padding: 20rpx 30rpx;
+ border-bottom: 1px solid #e4e4e4;
+
+ .title-txt {
+ color: #409eff;
+ font-size: 30rpx;
+ font-weight: bold;
+ }
+ }
+
+ .dec {
+ color: #9c9c9c;
+ padding: 20rpx 30rpx 20rpx;
+ }
+
+ }
+ }
+
+ .add-btn {
+ display: flex;
+ justify-content: flex-start;
+ align-items: center;
+ }
+
+ .popup-title {
+ text-align: center;
+ font-size: 32rpx;
+ font-weight: bold;
+ color: #409eff;
+ padding: 30rpx 30rpx 0px
+ }
+
+ .popup {
+ width: 600rpx;
+ padding: 30rpx 0rpx 30rpx;
+
+ }
+
+ .popup-footer {
+ display: flex;
+ border-top: 1px solid #e4e4e4;
+
+ view {
+ line-height: 100rpx;
+ flex: 1;
+ text-align: center;
+
+ &.sure {
+ color: #409eff;
+ }
+ }
+ }
+
+ ::v-deep .u-checkbox-group {
+ display: grid !important;
+ }
\ No newline at end of file
diff --git a/static/images/photo.png b/static/images/photo.png
new file mode 100644
index 0000000..52523a1
Binary files /dev/null and b/static/images/photo.png differ