Przeglądaj źródła

上周六未定的新增“二线出区核放单管理”:
一:当基本信息绑定类型选择为"一车多票”时
1.1,“核放单表体“页面不再可编辑,置灰
1.2,基本信息页面的“关联核注清单编号”置灰
二:当基本信息绑定类型选择为"一票多车”时
1.1,“关联单证“页面不再可编辑,置灰
@Rger  @🇼

CzRger 9 miesięcy temu
rodzic
commit
8df42f9c05

+ 42 - 11
snowy-admin-web/src/views/yqyc/zero/two/out-nuclear-release/detail.vue

@@ -45,12 +45,12 @@
 						</a-col>
 						<a-col :span="8">
 							<a-form-item label="绑定类型:" name="bdlx">
-								<a-select v-model:value="formData.bdlx" :disabled="isView" placeholder="请选择绑定类型" :options="bdlxOptions" show-search allow-clear option-filter-prop="label"/>
+								<a-select v-model:value="formData.bdlx" :disabled="isView" placeholder="请选择绑定类型" :options="bdlxOptions" show-search allow-clear option-filter-prop="label" @change="onChangeBdlx"/>
 							</a-form-item>
 						</a-col>
 						<a-col :span="8">
 							<a-form-item label="关联核注清单编号:" name="glhzqdbh">
-								<a-select v-model:value="formData.glhzqdbh" :disabled="isView" placeholder="请输入关联核注清单编号" :options="hzqdOptions" show-search allow-clear option-filter-prop="label" @change="onChangHzqd"/>
+								<a-select v-model:value="formData.glhzqdbh" :disabled="isView || !showHfdbt" placeholder="请输入关联核注清单编号" :options="hzqdOptions" show-search allow-clear option-filter-prop="label" @change="onChangHzqd"/>
 							</a-form-item>
 						</a-col>
 						<a-col :span="8">
@@ -166,7 +166,7 @@
 					</a-row>
 				</a-form>
 			</a-collapse-panel>
-			<a-collapse-panel key="2" header="核放单表体">
+			<a-collapse-panel key="2" header="核放单表体" v-if="showHfdbt">
 				<a-button type="primary" @click="onBodyReset" v-if="!isView">重置</a-button>
 				<a-form ref="bodyFormRef" :model="bodyData" :rules="bodyRules" style="margin-bottom: 20px;">
 					<a-row :gutter="16">
@@ -242,7 +242,7 @@
 					</template>
 				</a-table>
 			</a-collapse-panel>
-			<a-collapse-panel key="4" header="关联单证">
+			<a-collapse-panel key="4" header="关联单证" v-if="showGldz">
 				<a-button type="primary" @click="onRelationReset" v-if="!isView">重置</a-button>
 				<a-form ref="relationFormRef" :model="relationData" :rules="relationRules" style="margin-bottom: 20px;">
 					<a-row :gutter="16">
@@ -341,10 +341,6 @@
 				</a-table>
 			</a-collapse-panel>
 		</a-collapse>
-
-
-		<a-form ref="formRef" :model="formData" :rules="formRules" layout="vertical">
-        </a-form>
 	</a-card>
 </template>
 
@@ -383,6 +379,8 @@
 	const statusOptions = ref([])
 	const userInfo = tool.data.get('USER_INFO')
 	const showFileUpload = ref(true)
+	const showGldz = ref(false)
+	const showHfdbt = ref(false)
 
 	const bodySelectedRowKeys = ref([])
 	const bodyList = ref([])
@@ -498,12 +496,21 @@
 	// 打开抽屉
 	const onOpen = (record, view = false, type, copy) => {
 	    isView.value = view
+		showGldz.value = false
+		showHfdbt.value = false
 		if (record) {
 			qySecondlineHfdApi.qySecondlineHfdDetail({id: record.id}).then(res => {
 				formData.value = res.baseInfo
 				bodyList.value = res.productList
 				relationList.value = res.dzList
 				fileList.value = res.attachmentList
+				if (formData.value.bdlx == 1) {
+					showGldz.value = false
+					showHfdbt.value = true
+				} else if (formData.value.bdlx == 2) {
+					showGldz.value = true
+					showHfdbt.value = false
+				}
 				if (type) {
 					formData.value.sblx = type
 				}
@@ -539,12 +546,11 @@
 		emit('onClose')
 	}
 	// 默认要校验的
-	const formRules = {
+	const formRules = ref({
 		hfdLx: [required('请选择核放单类型')],
 		ledgerCode: [required('请选择台账编号')],
 		jcbz: [required('请选择进出口标志')],
 		bdlx: [required('请选择绑定类型')],
-		glhzqdbh: [required('请输入关联核注单编号')],
 		sblx: [required('请选择申报类型')],
 		cyccph: [required('请输入承运车车牌号')],
 		ickh: [required('请输入IC卡号(电子车牌)')],
@@ -554,7 +560,15 @@
 		zzl: [required('请输入总重量(kg)')],
 		hwmzl: [required('货物毛净重(kg)')],
 		hwjzl: [required('货物总净重(kg)')],
-	}
+	})
+	watch(() => formData.value.bdlx, (n) => {
+		if (n == 1) {
+			formRules.value.glhzqdbh = [required('请输入关联核注单编号')]
+		} else {
+			delete formRules.value.glhzqdbh
+			formRef.value.clearValidate('glhzqdbh')
+		}
+	})
 	// 默认要校验的
 	const bodyRules = {
 		productId: [required('请输入关联商品序号')],
@@ -820,6 +834,23 @@
 			onBodyReset()
 		}
 	}
+	const onChangeBdlx = (val) => {
+		bodyList.value = []
+		onBodyReset()
+		relationList.value = []
+		onRelationReset()
+		if (val == 1) {
+			showGldz.value = false
+			showHfdbt.value = true
+		} else if (val == 2) {
+			showGldz.value = true
+			showHfdbt.value = false
+			formData.value.glhzqdbh = ''
+		} else {
+			showGldz.value = false
+			showHfdbt.value = false
+		}
+	}
 	// 抛出函数
 	defineExpose({
 		onOpen