| | |
| | | </view> |
| | | <view class="card-actions"> |
| | | <view class="btn-link btn-link-primary" v-if="item.inspectState == 0" @click.stop="openDealDialog(item)">处理</view> |
| | | <view class="btn-link btn-link-plain" v-if="item.inspectState == 0" @click.stop="openForm('edit', item)">编辑</view> |
| | | <view class="btn-link btn-link-warn" @click.stop="handleDelete(item)">删除</view> |
| | | <view class="btn-link btn-link-plain" v-if="hasNonconformingEdit" @click.stop="openForm('edit', item)">编辑</view> |
| | | <view class="btn-link btn-link-warn" v-if="hasNonconformingCancel" @click.stop="handleDelete(item)">删除</view> |
| | | </view> |
| | | </view> |
| | | <view class="load-more-wrap"> |
| | |
| | | <up-datetime-picker |
| | | :show="showEntryStartPicker" |
| | | v-model="entryStartValue" |
| | | mode="date" |
| | | mode="year-month" |
| | | @confirm="confirmEntryStart" |
| | | @cancel="showEntryStartPicker = false" |
| | | /> |
| | |
| | | <up-datetime-picker |
| | | :show="showEntryEndPicker" |
| | | v-model="entryEndValue" |
| | | mode="date" |
| | | mode="year-month" |
| | | @confirm="confirmEntryEnd" |
| | | @cancel="showEntryEndPicker = false" |
| | | /> |
| | |
| | | import dayjs from 'dayjs'; |
| | | import PageHeader from '@/components/PageHeader.vue' |
| | | import { onReachBottom, onShow } from '@dcloudio/uni-app' |
| | | import { checkPermi } from '@/utils/permission' |
| | | |
| | | const hasNonconformingEdit = computed(() => checkPermi(['nonconforming_edit'])) |
| | | const hasNonconformingCancel = computed(() => checkPermi(['nonconforming_cancel'])) |
| | | |
| | | const searchForm = reactive({ |
| | | productName: '', |
| | |
| | | return types[String(type ?? '')] || '-'; |
| | | }; |
| | | |
| | | const getList = () => { |
| | | const getList = (force = false) => { |
| | | const isFirstPage = page.current === 1 |
| | | if (loadStatus.value === 'loading' || (!isFirstPage && page.total > 0 && tableData.value.length >= page.total)) return |
| | | if ( |
| | | !force && |
| | | (loadStatus.value === 'loading' || |
| | | (!isFirstPage && page.total > 0 && tableData.value.length >= page.total)) |
| | | ) |
| | | return |
| | | |
| | | loadStatus.value = 'loading' |
| | | const params = { |
| | |
| | | page.total = 0; |
| | | tableData.value = []; |
| | | loadStatus.value = 'loadmore'; |
| | | getList(); |
| | | getList(true); |
| | | }; |
| | | |
| | | const selectType = (e) => { |
| | |
| | | }; |
| | | |
| | | const openDateRange = () => { |
| | | entryStartValue.value = searchForm.entryDateStart ? dayjs(searchForm.entryDateStart, 'YYYY-MM-DD').valueOf() : Date.now() |
| | | entryStartValue.value = searchForm.entryDateStart ? dayjs(searchForm.entryDateStart).valueOf() : Date.now() |
| | | showEntryStartPicker.value = true |
| | | } |
| | | const confirmEntryStart = (e) => { |
| | | const ts = e?.value ?? entryStartValue.value |
| | | searchForm.entryDateStart = dayjs(ts).format('YYYY-MM-DD') |
| | | searchForm.entryDateStart = `${dayjs(ts).format('YYYY-MM')}-01` |
| | | showEntryStartPicker.value = false |
| | | entryEndValue.value = searchForm.entryDateEnd ? dayjs(searchForm.entryDateEnd, 'YYYY-MM-DD').valueOf() : Date.now() |
| | | entryEndValue.value = searchForm.entryDateEnd ? dayjs(searchForm.entryDateEnd).valueOf() : Date.now() |
| | | showEntryEndPicker.value = true |
| | | } |
| | | const confirmEntryEnd = (e) => { |
| | | const ts = e?.value ?? entryEndValue.value |
| | | searchForm.entryDateEnd = dayjs(ts).format('YYYY-MM-DD') |
| | | searchForm.entryDateEnd = `${dayjs(ts).format('YYYY-MM')}-01` |
| | | showEntryEndPicker.value = false |
| | | handleQuery() |
| | | } |
| | |
| | | }; |
| | | |
| | | const handleDelete = (row) => { |
| | | showConfirm('确认删除该不合格记录吗?').then(res => { |
| | | if (res.confirm) { |
| | | qualityUnqualifiedDel([row.id]).then(() => { |
| | | toast('删除成功'); |
| | | handleQuery(); |
| | | }); |
| | | } |
| | | }); |
| | | if (!hasNonconformingCancel.value) return |
| | | showConfirm('确认删除该不合格记录吗?').then(async res => { |
| | | if (!res.confirm) return |
| | | await qualityUnqualifiedDel([row.id]) |
| | | toast('删除成功') |
| | | handleQuery() |
| | | }) |
| | | }; |
| | | |
| | | const confirmDate = (e) => { |
| | |
| | | }; |
| | | |
| | | const openForm = (type, row) => { |
| | | if (type === 'edit' && !hasNonconformingEdit.value) return |
| | | if (type !== 'add' && row?.inspectState == 1) { |
| | | toast('已处理的数据不能再编辑') |
| | | return |