This commit is contained in:
parent
8923fca4f3
commit
1ba8b6eb90
|
|
@ -55,6 +55,13 @@
|
||||||
@blur="checkPhone"
|
@blur="checkPhone"
|
||||||
></uni-easyinput>
|
></uni-easyinput>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
|
<uni-forms-item label="备注" name="remark">
|
||||||
|
<uni-easyinput
|
||||||
|
v-model="formData.remark"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
maxlength="200"
|
||||||
|
></uni-easyinput>
|
||||||
|
</uni-forms-item>
|
||||||
<uni-section title="工器具退料" type="line"></uni-section>
|
<uni-section title="工器具退料" type="line"></uni-section>
|
||||||
<eselect
|
<eselect
|
||||||
v-model="equipmentId"
|
v-model="equipmentId"
|
||||||
|
|
@ -112,7 +119,9 @@
|
||||||
>
|
>
|
||||||
删除
|
删除
|
||||||
</button>
|
</button>
|
||||||
<button class="uni-button" size="mini" type="primary" @click="">出库</button>
|
<!-- <button class="uni-button" size="mini" type="primary" @click="submit(1, item)">
|
||||||
|
出库
|
||||||
|
</button> -->
|
||||||
</uni-td>
|
</uni-td>
|
||||||
</uni-tr>
|
</uni-tr>
|
||||||
</uni-table>
|
</uni-table>
|
||||||
|
|
@ -122,7 +131,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
import { onLoad, onShow, onBackPress } from '@dcloudio/uni-app'
|
||||||
import { ref, reactive } from 'vue'
|
import { ref, reactive } from 'vue'
|
||||||
import eselect from '@/components/tree-select/eselect.vue'
|
import eselect from '@/components/tree-select/eselect.vue'
|
||||||
import {
|
import {
|
||||||
|
|
@ -147,6 +156,7 @@ const formData = reactive({
|
||||||
agreementId: undefined,
|
agreementId: undefined,
|
||||||
remark: undefined,
|
remark: undefined,
|
||||||
isBack: 1,
|
isBack: 1,
|
||||||
|
remark: '',
|
||||||
})
|
})
|
||||||
const agreementId = ref('')
|
const agreementId = ref('')
|
||||||
const equipmentId = ref()
|
const equipmentId = ref()
|
||||||
|
|
@ -172,7 +182,7 @@ const getDetailsById = async () => {
|
||||||
const res = await detailsBackTask(opts.value.id)
|
const res = await detailsBackTask(opts.value.id)
|
||||||
console.log('🚀 ~ getDetailsById ~ res:', res)
|
console.log('🚀 ~ getDetailsById ~ res:', res)
|
||||||
res.data.backApplyInfo.projectId = res.data.backApplyInfo.proId
|
res.data.backApplyInfo.projectId = res.data.backApplyInfo.proId
|
||||||
if (res.data && res.data.backApplyDetailsList.length > 0) {
|
if (res.data && res.data.backApplyDetailsList && res.data.backApplyDetailsList.length > 0) {
|
||||||
tableData.value = res.data.backApplyDetailsList.map((item) => {
|
tableData.value = res.data.backApplyDetailsList.map((item) => {
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
|
|
@ -435,16 +445,18 @@ const submit = (isBack) => {
|
||||||
title: '提交中...',
|
title: '提交中...',
|
||||||
})
|
})
|
||||||
try {
|
try {
|
||||||
|
let res = null
|
||||||
if (!opts.value.isEdit) {
|
if (!opts.value.isEdit) {
|
||||||
const res = await backTask(params)
|
console.log('🚀 ~ .then ~ 新增:')
|
||||||
console.log('🚀 ~ .then ~ res:', res)
|
res = await backTask(params)
|
||||||
uni.hideLoading()
|
|
||||||
back()
|
|
||||||
} else {
|
} else {
|
||||||
const res = await editBackTask(params)
|
console.log('🚀 ~ .then ~ 编辑:')
|
||||||
uni.hideLoading()
|
res = await editBackTask(params)
|
||||||
back()
|
|
||||||
}
|
}
|
||||||
|
console.log('🚀 ~ .then ~ res:', res)
|
||||||
|
tableData.value = []
|
||||||
|
uni.hideLoading()
|
||||||
|
back()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('🚀 ~ .then ~ error:', error)
|
console.log('🚀 ~ .then ~ error:', error)
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
|
|
@ -504,6 +516,22 @@ onShow(() => {
|
||||||
})
|
})
|
||||||
console.log('🚀 ~ onShow ~ tableData.value:', tableData.value)
|
console.log('🚀 ~ onShow ~ tableData.value:', tableData.value)
|
||||||
})
|
})
|
||||||
|
onBackPress((opt) => {
|
||||||
|
console.log('🚀 ~ onBackPress ~ opt:', opt)
|
||||||
|
if (opt.from == 'backbutton') {
|
||||||
|
if (tableData.value.length > 0) {
|
||||||
|
// 仅提示数据未提交
|
||||||
|
uni.showToast({
|
||||||
|
title: '当前有未提交数据, 请暂存或提交',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1000,
|
||||||
|
})
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
||||||
|
|
@ -167,7 +167,7 @@ const getList = async () => {
|
||||||
]
|
]
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
options: item.taskStatus == 4 ? [] : options, // 如果任务状态为4,则不显示操作按钮
|
options: item.taskStatus == 2 ? [] : options, // 如果任务状态为4,则不显示操作按钮
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
console.log('🚀 ~ getList ~ tableList.value:', tableList.value)
|
console.log('🚀 ~ getList ~ tableList.value:', tableList.value)
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,27 @@
|
||||||
<text>{{ isSelectNum }} / {{ codeDeviceList.length }} 条已选</text>
|
<text>{{ isSelectNum }} / {{ codeDeviceList.length }} 条已选</text>
|
||||||
</checkbox-group>
|
</checkbox-group>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
|
<uni-forms-item label="" name="">
|
||||||
|
<div
|
||||||
|
style="display: flex; align-items: center; flex-wrap: wrap"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
v-for="(item, index) in codeDeviceList"
|
||||||
|
style="margin: 0 5px"
|
||||||
|
v-show="item.checked"
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
>{{ item.maCode }}
|
||||||
|
<uni-icons
|
||||||
|
type="close"
|
||||||
|
size="18"
|
||||||
|
color="red"
|
||||||
|
@click="handleItemChecked(item)"
|
||||||
|
></uni-icons
|
||||||
|
></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</uni-forms-item>
|
||||||
<!--
|
<!--
|
||||||
|
|
||||||
<uni-forms-item
|
<uni-forms-item
|
||||||
|
|
@ -243,14 +264,15 @@ const getCodeList = async () => {
|
||||||
materialModel: item.typeName,
|
materialModel: item.typeName,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// 将 queryParamsTemp.value.maCodeList 有的值设置 为 checked= true
|
// 将queryParamsTemp.value.maCodeList 与 codeDeviceList.value 去重合并
|
||||||
queryParamsTemp.value.maCodeList.forEach((e) => {
|
codeDeviceList.value = [
|
||||||
const index = codeDeviceList.value.findIndex((item) => item.maId === e.maId)
|
...new Map(
|
||||||
console.log('🚀 ~ queryParamsTemp.value.maCodeList.forEach ~ index:', index)
|
[...codeDeviceList.value, ...queryParamsTemp.value.maCodeList].map((item) => [
|
||||||
if (index !== -1) {
|
item.maId,
|
||||||
codeDeviceList.value[index].checked = true
|
item,
|
||||||
}
|
]),
|
||||||
})
|
).values(),
|
||||||
|
]
|
||||||
// 更新全选状态
|
// 更新全选状态
|
||||||
allChecked.value = codeDeviceList.value.every((e) => e.checked)
|
allChecked.value = codeDeviceList.value.every((e) => e.checked)
|
||||||
console.log('🚀 ~ getCodeList ~ allChecked.value:', allChecked.value)
|
console.log('🚀 ~ getCodeList ~ allChecked.value:', allChecked.value)
|
||||||
|
|
@ -302,21 +324,34 @@ const getCodeDetailData = async (id, publishTask, typeId) => {
|
||||||
// 获取编码列表
|
// 获取编码列表
|
||||||
const getCodeDeviceListData = async () => {
|
const getCodeDeviceListData = async () => {
|
||||||
console.log('🚀 ~ getCodeDeviceListData ~ queryCodeParams.value:', queryCodeParams.value)
|
console.log('🚀 ~ getCodeDeviceListData ~ queryCodeParams.value:', queryCodeParams.value)
|
||||||
const res = await getCodeDeviceListAPI(queryCodeParams.value)
|
try {
|
||||||
console.log('🚀 ~ getCodeDeviceListData ~ res:', res)
|
uni.showLoading({
|
||||||
codeDeviceList.value.push(...res.data)
|
title: '加载中...',
|
||||||
if (codeDeviceList.value.length > 0) {
|
mask: true,
|
||||||
codeDeviceList.value = codeDeviceList.value.map((e) => {
|
|
||||||
return { ...e, checked: false, outType: 0, checked: false }
|
|
||||||
})
|
})
|
||||||
|
const res = await getCodeDeviceListAPI(queryCodeParams.value)
|
||||||
|
console.log('🚀 ~ getCodeDeviceListData ~ res:', res)
|
||||||
|
codeDeviceList.value.push(...res.data)
|
||||||
|
if (codeDeviceList.value.length > 0) {
|
||||||
|
codeDeviceList.value = codeDeviceList.value.map((e) => {
|
||||||
|
return { ...e, checked: false, outType: 0, checked: false }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
total.value = res.total
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.hideLoading()
|
||||||
|
}, 500)
|
||||||
|
} catch (error) {
|
||||||
|
console.log('🚀 ~ getCodeDeviceListData ~ error:', error)
|
||||||
|
uni.hideLoading()
|
||||||
}
|
}
|
||||||
total.value = res.total
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编码搜索按钮
|
// 编码搜索按钮
|
||||||
const onCodeSearch = () => {
|
const onCodeSearch = () => {
|
||||||
queryCodeParams.value.pageNum = 1
|
queryCodeParams.value.pageNum = 1
|
||||||
codeDeviceList.value = []
|
codeDeviceList.value = []
|
||||||
|
allChecked.value = false
|
||||||
getCodeDeviceListData()
|
getCodeDeviceListData()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,13 @@
|
||||||
@blur="checkPhone"
|
@blur="checkPhone"
|
||||||
></uni-easyinput>
|
></uni-easyinput>
|
||||||
</uni-forms-item>
|
</uni-forms-item>
|
||||||
|
<uni-forms-item label="备注" name="remark">
|
||||||
|
<uni-easyinput
|
||||||
|
v-model="formData.remark"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
maxlength="200"
|
||||||
|
></uni-easyinput>
|
||||||
|
</uni-forms-item>
|
||||||
<uni-section title="领用工具器" type="line" />
|
<uni-section title="领用工具器" type="line" />
|
||||||
<eselect
|
<eselect
|
||||||
v-model="equipmentId"
|
v-model="equipmentId"
|
||||||
|
|
@ -145,7 +152,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
import { onLoad, onShow, onBackPress } from '@dcloudio/uni-app'
|
||||||
import { ref, reactive } from 'vue'
|
import { ref, reactive } from 'vue'
|
||||||
import eselect from '@/components/tree-select/eselect.vue'
|
import eselect from '@/components/tree-select/eselect.vue'
|
||||||
import {
|
import {
|
||||||
|
|
@ -169,6 +176,7 @@ const formData = reactive({
|
||||||
leasePerson: '',
|
leasePerson: '',
|
||||||
phone: '',
|
phone: '',
|
||||||
isOut: 1,
|
isOut: 1,
|
||||||
|
remark: '',
|
||||||
})
|
})
|
||||||
const equipmentId = ref()
|
const equipmentId = ref()
|
||||||
const teamRange = ref([]) // 班组
|
const teamRange = ref([]) // 班组
|
||||||
|
|
@ -569,6 +577,22 @@ onShow(() => {
|
||||||
})
|
})
|
||||||
console.log('🚀 ~ onShow ~ tableData.value:', tableData.value)
|
console.log('🚀 ~ onShow ~ tableData.value:', tableData.value)
|
||||||
})
|
})
|
||||||
|
onBackPress((opt) => {
|
||||||
|
console.log('🚀 ~ onBackPress ~ opt:', opt)
|
||||||
|
if (opt.from == 'backbutton') {
|
||||||
|
if (tableData.value.length > 0) {
|
||||||
|
// 仅提示数据未提交
|
||||||
|
uni.showToast({
|
||||||
|
title: '当前有未提交数据, 请暂存或提交',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1000,
|
||||||
|
})
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue