Compare commits
No commits in common. "47c9d3b46bcd90d53945e83f87fe2bde0eb0768d" and "dead496fbcb69eb49185f6345d73cfce8892bc6f" have entirely different histories.
47c9d3b46b
...
dead496fbc
@ -59,7 +59,7 @@
|
|||||||
<view class="no" @click="confirmOpe('no')">
|
<view class="no" @click="confirmOpe('no')">
|
||||||
{{ backText }}
|
{{ backText }}
|
||||||
</view>
|
</view>
|
||||||
<view class="yes" @click="confirmOpe('yes')">
|
<view class="yes" @click="openFile">
|
||||||
{{ yesText }}
|
{{ yesText }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@ -50,18 +50,8 @@
|
|||||||
<text class="label"></text>
|
<text class="label"></text>
|
||||||
<text class="repairNum"></text>
|
<text class="repairNum"></text>
|
||||||
<view class="submit" @click="toPart">采购</view>
|
<view class="submit" @click="toPart">采购</view>
|
||||||
<view class="submit" @click="submitBefore">{{ isReceive ? '通知领料' : '通知退料' }}</view>
|
<view class="submit" @click="submit">{{ isReceive ? '通知领料' : '通知退料' }}</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<uni-popup ref="popup" background-color="#fff">
|
|
||||||
<view class="popup-content" style="padding: 15px;">
|
|
||||||
<view class="dl-avatar-box">
|
|
||||||
<uni-file-picker :value="fileList" :sizeType="sizeType" @select="afterRead" @delete="deleteFile"
|
|
||||||
limit="9" title="请上传配件申请单照片(最多选择9张图片)"></uni-file-picker>
|
|
||||||
</view>
|
|
||||||
<button type="primary" @click="submit">保存</button>
|
|
||||||
</view>
|
|
||||||
</uni-popup>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -72,8 +62,6 @@ import {
|
|||||||
getJSONData, setJSONData
|
getJSONData, setJSONData
|
||||||
} from '@/utils/auth'
|
} from '@/utils/auth'
|
||||||
import {getDictTextByCodeAndValue, createUniqueCodeByHead} from "@/utils/utils";
|
import {getDictTextByCodeAndValue, createUniqueCodeByHead} from "@/utils/utils";
|
||||||
import upload from "@/utils/upload";
|
|
||||||
import config from "@/config";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {VNavigationBar},
|
components: {VNavigationBar},
|
||||||
@ -90,9 +78,7 @@ export default {
|
|||||||
active: '',
|
active: '',
|
||||||
isToBeReviewed: true,
|
isToBeReviewed: true,
|
||||||
query: null,
|
query: null,
|
||||||
selectRows: [],
|
selectRows: []
|
||||||
fileList: [],
|
|
||||||
sizeType: ['compressed'],
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(data) {
|
onLoad(data) {
|
||||||
@ -109,36 +95,6 @@ export default {
|
|||||||
|
|
||||||
computed: {},
|
computed: {},
|
||||||
methods: {
|
methods: {
|
||||||
submitBefore(){
|
|
||||||
if (this.isReceive){
|
|
||||||
if (!this.selectRows || this.selectRows.length === 0){
|
|
||||||
uni.showToast({
|
|
||||||
title: '请选择配件!',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.$refs.popup.open()
|
|
||||||
}else {
|
|
||||||
this.submit()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
afterRead(file) {
|
|
||||||
for (let i = 0; i < file.tempFilePaths.length; i++) {
|
|
||||||
upload({
|
|
||||||
url: '/admin-api/infra/file/upload',
|
|
||||||
filePath: file.tempFilePaths[i]
|
|
||||||
}).then((res) => {
|
|
||||||
this.fileList.push({
|
|
||||||
url: config.baseImageUrl + res.data
|
|
||||||
})
|
|
||||||
console.log(this.fileList)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
deleteFile(file, index) {
|
|
||||||
this.fileList.splice(index, 1);
|
|
||||||
},
|
|
||||||
chooseItem(item) {
|
chooseItem(item) {
|
||||||
const index = this.selectRows.findIndex(i => i.id === item.id)
|
const index = this.selectRows.findIndex(i => i.id === item.id)
|
||||||
const parentIndex = this.wares.findIndex(i => i.id === item.id)
|
const parentIndex = this.wares.findIndex(i => i.id === item.id)
|
||||||
@ -196,6 +152,27 @@ export default {
|
|||||||
item.isSelected = this.selectRows.findIndex(i => i.id === item.id) !== -1
|
item.isSelected = this.selectRows.findIndex(i => i.id === item.id) !== -1
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
// res.data.map((item)=>{
|
||||||
|
// if(!item.waresAlreadyCount){
|
||||||
|
// item.waresAlreadyCount = 0
|
||||||
|
// }
|
||||||
|
// if(!item.wares.stock){
|
||||||
|
// item.wares.stock=0
|
||||||
|
// }
|
||||||
|
// if(this.isReceive){
|
||||||
|
// //领料,最大可领取数量为申请数量-已领取数量,同时不能大于库存数量,默认数量就是最大可领取数量
|
||||||
|
// item.maxNum = parseInt(item.waresCount) - parseInt(item.waresAlreadyCount)
|
||||||
|
// if(item.maxNum >item.wares.stock){
|
||||||
|
// item.maxNum = item.wares.stock
|
||||||
|
// }
|
||||||
|
// item.thisNum = item.maxNum
|
||||||
|
// }else{
|
||||||
|
// //退料,最大数量为已领取数量,最小数量为0,默认数量为0
|
||||||
|
// item.maxNum = item.waresAlreadyCount
|
||||||
|
// item.thisNum = 0
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// this.wares = res.data;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@ -252,15 +229,8 @@ export default {
|
|||||||
userName: this.formData.repairName,
|
userName: this.formData.repairName,
|
||||||
soStatus: this.isReceive ? '04' : '07'
|
soStatus: this.isReceive ? '04' : '07'
|
||||||
}
|
}
|
||||||
if (!this.selectRows || this.selectRows.length === 0){
|
|
||||||
uni.showToast({
|
|
||||||
title: '请选择配件!',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// 过滤一下,thisNum不等0才行
|
// 过滤一下,thisNum不等0才行
|
||||||
const flag = this.selectRows.filter(item => item.thisNum > 0)
|
const flag = this.wares.filter(item => item.thisNum > 0)
|
||||||
if (!flag || flag.length === 0) {
|
if (!flag || flag.length === 0) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请设置配件数量!',
|
title: '请设置配件数量!',
|
||||||
@ -268,8 +238,8 @@ export default {
|
|||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// this.wares = flag
|
this.wares = flag
|
||||||
this.formData.repairSois = [...flag.map(item => {
|
this.formData.repairSois = [...this.wares.map(item => {
|
||||||
return {
|
return {
|
||||||
soiType: this.isReceive ? '02' : "04",
|
soiType: this.isReceive ? '02' : "04",
|
||||||
goodsId: item.waresId,
|
goodsId: item.waresId,
|
||||||
@ -277,25 +247,17 @@ export default {
|
|||||||
}
|
}
|
||||||
})]
|
})]
|
||||||
if (this.isReceive) {
|
if (this.isReceive) {
|
||||||
this.formData.items = [...flag.map(item => {
|
this.formData.items = [...this.wares.map(item => {
|
||||||
return {
|
return {
|
||||||
id: item.id,
|
id: item.id,
|
||||||
}
|
}
|
||||||
})]
|
})]
|
||||||
}
|
}
|
||||||
if (this.isReceive && this.fileList && this.fileList.length > 0){
|
|
||||||
this.formData.images = this.fileList.map(item => {
|
|
||||||
return item.path.replace(config.baseImageUrl, "")
|
|
||||||
}).join(",")
|
|
||||||
}
|
|
||||||
request({
|
request({
|
||||||
url: '/admin-api/repair/tw/pass',
|
url: '/admin-api/repair/tw/pass',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: this.formData
|
data: this.formData
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (this.isReceive){
|
|
||||||
this.$refs.popup.close()
|
|
||||||
}
|
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '通知成功!',
|
title: '通知成功!',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user