Compare commits

..

No commits in common. "0dc9c57c40589180d0b26740f8c47a293fab71be" and "27375030c17aba46ec9ea5ce27f2171339533ecd" have entirely different histories.

3 changed files with 75 additions and 87 deletions

View File

@ -1,9 +1,9 @@
// 应用全局配置 // 应用全局配置
module.exports = { module.exports = {
baseUrl: 'https://www.nuoyunr.com', // baseUrl: 'https://www.nuoyunr.com',
// baseUrl: 'http://124.222.105.7:48080', // baseUrl: 'http://124.222.105.7:48080',
// baseUrl: 'http://192.168.1.4:48080', // baseUrl: 'http://192.168.1.4:48080',
// baseUrl: "http://localhost:48080", baseUrl: "http://localhost:48080",
imagesUrl: 'http://shequ.0315e.com/static/images/pages/', imagesUrl: 'http://shequ.0315e.com/static/images/pages/',
baseImageUrl: 'https://www.nuoyunr.com/minio/', baseImageUrl: 'https://www.nuoyunr.com/minio/',
shareUrl: 'https://www.lighting-it.cn/share?inviteId=', shareUrl: 'https://www.lighting-it.cn/share?inviteId=',

View File

@ -199,7 +199,6 @@ export default {
}, },
// //
canClick:true, canClick:true,
subLoading: false
}; };
}, },
onLoad(data) { onLoad(data) {
@ -357,60 +356,54 @@ export default {
}) })
}, },
confirmOpe(type) { confirmOpe(type) {
if (!this.subLoading){ if(this.selectWares.length==0){
this.subLoading = true uni.showToast({
if(this.selectWares.length==0){ title: '请选中要审核的配件!',
uni.showToast({ icon: 'none'
title: '请选中要审核的配件!', })
icon: 'none' return
}) }
this.subLoading = false if (this.canClick) {
return this.canClick = false
let url = '/admin-api/repair/tw/audit'
let dataObj = {
id: this.id,
type: "01",
status: "yes" == type ? "01" : "02"
} }
if (this.canClick) { try {
this.canClick = false if (this.selectWares && this.selectWares.length > 0) {
let url = '/admin-api/repair/tw/audit' dataObj.items = [...this.selectWares.map(item => {
let dataObj = { return {
id: this.id, id: item.id
type: "01",
status: "yes" == type ? "01" : "02"
}
try {
if (this.selectWares && this.selectWares.length > 0) {
dataObj.items = [...this.selectWares.map(item => {
return {
id: item.id
}
})]
} else {
dataObj.items = []
this.repairList.map((groupItem) => {
groupItem.twItemList.map((item) => {
dataObj.items.push({id: item.id})
})
})
}
request({
url: url,
method: 'POST',
data: dataObj
}).then((res) => {
this.canClick = true
if (res.code == 200) {
uni.showToast({
title: '审批成功!',
icon: 'none'
})
setTimeout(() => {
uni.navigateBack()
}, 700)
} }
this.subLoading = false })]
} else {
dataObj.items = []
this.repairList.map((groupItem) => {
groupItem.twItemList.map((item) => {
dataObj.items.push({id: item.id})
})
}) })
} catch (e) {
this.subLoading = false
this.canClick = true
} }
request({
url: url,
method: 'POST',
data: dataObj
}).then((res) => {
this.canClick = true
if (res.code == 200) {
uni.showToast({
title: '审批成功!',
icon: 'none'
})
setTimeout(() => {
uni.navigateBack()
}, 700)
}
})
} catch (e) {
this.canClick = true
} }
} }
}, },

View File

@ -96,7 +96,7 @@
<text class="label"></text> <text class="label"></text>
<text class="repairNum"></text> <text class="repairNum"></text>
<view class="submit" @click="submit" v-if="!isInput">保存</view> <view class="submit" @click="submit" v-if="!isInput">保存</view>
<view class="submit" @click="inWare" v-else :disabled="subLoading">入库</view> <view class="submit" @click="inWare" v-else>入库</view>
</view> </view>
</view> </view>
</template> </template>
@ -143,7 +143,6 @@ export default {
unitList: [], unitList: [],
query: null, query: null,
selectRows: [], selectRows: [],
subLoading: false
}; };
}, },
onLoad(data) { onLoad(data) {
@ -425,39 +424,35 @@ export default {
* 入库 * 入库
*/ */
inWare() { inWare() {
if (!this.subLoading){ const data = {
this.subLoading = true id: this.soId,
const data = { soNo: createUniqueCodeByHead("RK")
id: this.soId,
soNo: createUniqueCodeByHead("RK")
}
const values = this.partList.map(([key, value]) => value).reduce((acc, item) => acc.concat(item))
if (this.selectRows && this.selectRows.length > 0){
const ids = this.selectRows.map(item => item.id)
const newSelect = values.filter(item => ids.includes(item.id))
data.soiList = [...newSelect]
data.waresList = [...newSelect.map(item => item.wares)]
}else {
data.soiList = [...values]
data.waresList = [...values.map(item => item.wares)]
}
request({
url: '/admin-api/repair/so/inWare',
method: 'post',
data: data
}).then((res) => {
if (res.code == 200) {
uni.showToast({
title: '入库成功!',
icon: 'none'
})
setTimeout(() => {
uni.navigateBack()
}, 700)
}
this.subLoading = false
})
} }
const values = this.partList.map(([key, value]) => value).reduce((acc, item) => acc.concat(item))
if (this.selectRows && this.selectRows.length > 0){
const ids = this.selectRows.map(item => item.id)
const newSelect = values.filter(item => ids.includes(item.id))
data.soiList = [...newSelect]
data.waresList = [...newSelect.map(item => item.wares)]
}else {
data.soiList = [...values]
data.waresList = [...values.map(item => item.wares)]
}
request({
url: '/admin-api/repair/so/inWare',
method: 'post',
data: data
}).then((res) => {
if (res.code == 200) {
uni.showToast({
title: '入库成功!',
icon: 'none'
})
setTimeout(() => {
uni.navigateBack()
}, 700)
}
})
// this.partList.forEach(item => { // this.partList.forEach(item => {
// item.inCount = item.count // item.inCount = item.count
// item.goodsId = item.id // item.goodsId = item.id