| | |
| | | id: d.id, |
| | | productId: d.productId, |
| | | productName: d.productName, |
| | | productModelId: d.productModelId, |
| | | productModelId: d.productModelId ?? d.modelId ?? d.productModeId ?? '', |
| | | model: d.model, |
| | | unit: d.unit, |
| | | batchNo: d.batchNo, |
| | |
| | | |
| | | const validate = () => { |
| | | if (!form.productId) return toast('请选择产品名称'), false |
| | | if (!form.productModelId) return toast('请选择规格型号'), false |
| | | // 对齐 PC 端:编辑态允许仅回显型号文本(历史数据可能缺少 productModelId) |
| | | if (!isEdit.value && !form.productModelId) return toast('请选择规格型号'), false |
| | | if (isEdit.value && !form.productModelId && !form.model) return toast('请选择规格型号'), false |
| | | if (!form.batchNo) return toast('请输入批号'), false |
| | | if (form.checkType === undefined || form.checkType === '') return toast('请选择检验类型'), false |
| | | if (!form.checkName) return toast('请选择检验员'), false |
| | |
| | | </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" v-if="item.inspectState == 0" @click.stop="handleDelete(item)">删除</view> |
| | | <view class="btn-link btn-link-plain" v-if="item.inspectState == 0 && hasNonconformingEdit" @click.stop="openForm('edit', item)">编辑</view> |
| | | <view class="btn-link btn-link-warn" v-if="item.inspectState == 0 && hasNonconformingCancel" @click.stop="handleDelete(item)">删除</view> |
| | | </view> |
| | | </view> |
| | | <view class="load-more-wrap"> |
| | |
| | | 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: '', |
| | |
| | | }; |
| | | |
| | | const handleDelete = (row) => { |
| | | if (!hasNonconformingCancel.value) return |
| | | showConfirm('确认删除该不合格记录吗?').then(async res => { |
| | | if (!res.confirm) return |
| | | await qualityUnqualifiedDel([row.id]) |
| | |
| | | }; |
| | | |
| | | const openForm = (type, row) => { |
| | | if (type === 'edit' && !hasNonconformingEdit.value) return |
| | | if (type !== 'add' && row?.inspectState == 1) { |
| | | toast('已处理的数据不能再编辑') |
| | | return |
| | |
| | | <up-button v-if="item.inspectState != 1" type="primary" size="mini" @click.stop="openForm('edit', item)">编辑</up-button> |
| | | <up-button type="info" size="mini" @click.stop="openFiles(item)">附件</up-button> |
| | | <up-button v-if="item.inspectState != 1" type="success" size="mini" @click.stop="handleConfirmSubmit(item)">提交</up-button> |
| | | <up-button type="error" size="mini" @click.stop="handleDelete(item)">删除</up-button> |
| | | <up-button v-if="hasRawCancel" type="error" size="mini" @click.stop="handleDelete(item)">删除</up-button> |
| | | </view> |
| | | </view> |
| | | <view class="pagination-container"> |
| | |
| | | } from '@/api/qualityManagement/rawMaterial.js'; |
| | | import { toast, showConfirm } from '@/utils/common'; |
| | | import useUserStore from '@/store/modules/user'; |
| | | import { checkPermi } from '@/utils/permission'; |
| | | |
| | | const userStore = useUserStore(); |
| | | const hasRawCancel = computed(() => checkPermi(['raw_cancel'])); |
| | | |
| | | const searchForm = reactive({ |
| | | batchNo: '', |
| | |
| | | }; |
| | | |
| | | const openForm = (type, item) => { |
| | | if (type === 'edit' && !hasRawEdit.value) return |
| | | const id = item?.id |
| | | uni.navigateTo({ |
| | | url: `/pages/qualityManagement/rawMaterial/form?type=${type}${id ? `&id=${id}` : ''}` |
| | |
| | | }; |
| | | |
| | | const handleDelete = (row) => { |
| | | if (!hasRawCancel.value) return |
| | | showConfirm('确认删除该记录吗?').then(res => { |
| | | if (res.confirm) { |
| | | // 对齐 PC 端:删除接口接收 id 数组 |