diff --git a/src/pages/toolsLease/codeOut.vue b/src/pages/toolsLease/codeOut.vue index bd658ca..8377e07 100644 --- a/src/pages/toolsLease/codeOut.vue +++ b/src/pages/toolsLease/codeOut.vue @@ -48,7 +48,7 @@ class="flex" v-if="!queryParams.isAddCode" > - {{ queryParams.outNum }} + {{ queryParams.isAddCode }} @@ -196,14 +196,13 @@ onLoad((opt) => { queryParamsTemp.value = opt.params ? JSON.parse(opt.params) : {} queryParamsTemp.value.id = queryParamsTemp.value.parentId console.log('xxxxxxxx', queryParamsTemp.value) - queryParams.value.isAddCode = queryParamsTemp.value.isAddCode + queryCodeParams.value.typeId = queryParamsTemp.value.typeId getDetailsById() - // getDetailsById() // console.log('🚀 ~ onLoad ~ queryParams.value:', queryParams.value) }) onShow(() => { - getDetailsById() + // getDetailsById() // getCodeDetailData(queryParams.value.id, queryParams.value.publishTask, queryParams.value.typeId) //获取详情 }) @@ -219,6 +218,7 @@ const getDetailsById = async () => { queryParams.value = res.data[0] queryParams.value.projectName = queryParamsTemp.value.projectName queryParams.value.teamName = queryParamsTemp.value.teamName + queryParams.value.isAddCode = queryParamsTemp.value.isAddCode } catch (error) { console.log('🚀 ~ getDetailsById ~ error:', error) } @@ -249,6 +249,7 @@ const getCodeDetailData = async (id, publishTask, typeId) => { // 获取编码列表 const getCodeDeviceListData = async () => { + console.log('🚀 ~ getCodeDeviceListData ~ queryCodeParams.value:', queryCodeParams.value) const res = await getCodeDeviceListAPI(queryCodeParams.value) console.log('🚀 ~ getCodeDeviceListData ~ res:', res) codeDeviceList.value.push(...res.data) @@ -308,6 +309,24 @@ const onHandleOutbound = async () => { // }) // return // } + if (codeDeviceList.value.length == 0) { + uni.showToast({ + title: '请添加出库设备', + icon: 'none', + }) + return + } + // 弹框确认 + const { confirm } = await uni.showModal({ + title: '提示', + content: '是否确认出库', + confirmText: '确定', + cancelText: '取消', + }) + console.log('🚀 ~ onHandleOutbound ~ confirm:', confirm) + if (!confirm) { + return + } // 解构所需要的数据 const { typeId, parentId, publishTask } = queryParams.value // 组装出库参数 @@ -334,13 +353,20 @@ const onHandleOutbound = async () => { }) }) console.log('mmmmmmmmmmmmmmmm', paramsList) - const res = await setOutboundNumAPI({ leaseOutDetailsList: paramsList }) - if (res.code === 200) { - uni.showToast({ - title: '出库成功!', - icon: 'none', - }) - back() + try { + const res = await setOutboundNumAPI({ leaseOutDetailsList: paramsList }) + if (res.code === 200) { + uni.showToast({ + title: '出库成功!', + icon: 'none', + }) + setTimeout(() => { + back() + }, 1000) + } + console.log('🚀 ~ onHandleOutbound ~ res:', res) + } catch (error) { + console.log('🚀 ~ onHandleOutbound ~ error:', error) } } diff --git a/src/pages/toolsLease/numOut.vue b/src/pages/toolsLease/numOut.vue index cd339ac..d488764 100644 --- a/src/pages/toolsLease/numOut.vue +++ b/src/pages/toolsLease/numOut.vue @@ -59,7 +59,6 @@ justify-content: center; background: #67c23a; " - size="mini" type="primary" @click="submit" > @@ -116,7 +115,10 @@ const submit = () => { icon: 'none', title: '出库成功', }) - back() + setTimeout(() => { + // 返回上一页 + back() + }, 1000) } catch (error) { console.log('🚀 ~ submit ~ error:', error) } diff --git a/src/pages/toolsLease/toolsLease.vue b/src/pages/toolsLease/toolsLease.vue index f420b0c..2089101 100644 --- a/src/pages/toolsLease/toolsLease.vue +++ b/src/pages/toolsLease/toolsLease.vue @@ -127,6 +127,7 @@ const add = () => { const params = JSON.stringify({ isOut: opts.value.isOut, isNew: opts.value.isNew, + title: opts.value.isOut ? '工器具出库' : '工器具领料', }) uni.navigateTo({ url: '/pages/toolsLease/toolsLeaseAdd?params=' + params, @@ -160,10 +161,12 @@ const getList = async () => { { text: '编辑', style: { backgroundColor: '#2f8cf0' } }, { text: '删除', style: { backgroundColor: '#ff4949' } }, ] - if (!opts.value.isOut) { + console.log('🚀 ~ tableList.value=res.data.rows.map ~ item.taskStatus:', item.taskStatus) + if (!opts.value.isOut && item.taskStatus != 4) { options = options.filter((option) => option.text !== '提交') } - if (item.taskStatus != 1) { + if (item.taskStatus == 1 || item.taskStatus == 5) { + // 未完成状态 options = options.filter((option) => option.text !== '编辑' && option.text !== '删除') } else if (item.taskStatus == 4) { @@ -205,7 +208,7 @@ const onScrollTolower = () => { // 滑动 const onClickSwipe = async (e, item) => { console.log('🚀 ~ onClickSwipe ~ e:', e, item) - if (e.index == 0) { + if (e.content.text == '电子签名') { // 电子签名 console.log('电子签名-e', e) console.log('电子签名-item', item) @@ -218,7 +221,7 @@ const onClickSwipe = async (e, item) => { uni.navigateTo({ url: `/pages/my/signature?params=${JSON.stringify(params)}`, }) - } else if (e.index == 1) { + } else if (e.content.text == '提交') { // 提交 try { let paramsOne = { @@ -308,7 +311,7 @@ const onClickSwipe = async (e, item) => { icon: 'none', }) } - } else if (e.index == 2) { + } else if (e.content.text == '编辑') { // 编辑 const params = JSON.stringify({ id: item.id, @@ -318,7 +321,7 @@ const onClickSwipe = async (e, item) => { uni.navigateTo({ url: `/pages/toolsLease/toolsLeaseAdd?params=${params}`, }) - } else { + } else if (e.content.text == '删除') { // 删除 deleteItem(item) } diff --git a/src/pages/toolsLease/toolsLeaseAdd.vue b/src/pages/toolsLease/toolsLeaseAdd.vue index a1f7144..8cc6392 100644 --- a/src/pages/toolsLease/toolsLeaseAdd.vue +++ b/src/pages/toolsLease/toolsLeaseAdd.vue @@ -384,7 +384,7 @@ const back = () => { onLoad((opt) => { console.log('onLoad', opt) opts.value = opt.params ? JSON.parse(opt.params) : {} - title.value = opts.value.isEdit && opts.value.isNew != 0 ? '编辑工器具领料' : '新增工器具领料' + title.value = opts.value.title if (opts.value.isNew == 0) { console.log('🚀 ~ onLoad ~ opts.value.isNew:', opts.value.isNew) formData.teamId = opts.value.teamId diff --git a/src/pages/toolsLease/toolsLeaseOut.vue b/src/pages/toolsLease/toolsLeaseOut.vue index adafe86..be6a8e9 100644 --- a/src/pages/toolsLease/toolsLeaseOut.vue +++ b/src/pages/toolsLease/toolsLeaseOut.vue @@ -110,6 +110,7 @@ const addLeaseNum = () => { projectName: opts.value.projectName, parentId: tableList.value[0].parentId, isEdit: true, + title: '数量出库', } uni.navigateTo({ url: '/pages/toolsLease/toolsLeaseAdd?params=' + JSON.stringify(params),