页面按钮权限

This commit is contained in:
huhao
2026-08-11 11:30:27 +08:00
parent d1d3636cf1
commit 94ec5e65ca
8 changed files with 148 additions and 59 deletions
+9 -3
View File
@@ -168,7 +168,7 @@
<nbd-submit-bar text="提交" :loading="submitting" @click="handleSubmit" />
<nbd-submit-bar v-if="canEdit" text="提交" :loading="submitting" @click="handleSubmit" />
</view>
<nbd-select v-model="showPaintCodePicker" title="选择防腐等级" :list="paintCodeList" label-key="PaintCode" value-key="Id"
@@ -176,11 +176,11 @@
</template>
<script setup>
import { ref } from 'vue'
import { ref, computed } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { storeToRefs } from 'pinia'
import { watch, nextTick } from 'vue'
import { useUserStore } from '@/store'
import { useUserStore, useMenuStore } from '@/store'
import { reqMaterialInfoByMaterialCode, reqPaintCodeList, reqSaveAntiCorrosionCheck, reqGetAntiCorrosionCheck } from '@/api/hj.js'
// 防腐记录字段
@@ -202,7 +202,9 @@ const antiFields = [
const antiList = ref([])
const userStore = useUserStore()
const menuStore = useMenuStore()
const { userInfo, currentProject } = storeToRefs(userStore)
const canEdit = computed(() => menuStore.canEditFunc('antiRust'))
const form = ref({})
const showPaintCodePicker = ref(false)
const paintCodeList = ref([])
@@ -307,6 +309,10 @@ const loadData = async (id) => {
// 提交
const handleSubmit = async () => {
if (!canEdit.value) {
uni.showToast({ title: '当前岗位仅可查看', icon: 'none' })
return
}
if (!antiForm.value.PaintId) {
uni.showToast({ title: '请选择防腐等级', icon: 'none' })
return