|
|
@@ -0,0 +1,314 @@
|
|
|
+<!-- 交易服务-出境检测-提交申请/修改 -->
|
|
|
+<template>
|
|
|
+ <app-drawer class="customs-exit-edit" title="出境申请" :width="960" v-model:show="show" :loading="loading"
|
|
|
+ :refresh="refresh">
|
|
|
+ <div class="customs-exit-edit__info">
|
|
|
+ <p>*若货物由广州钻石交易中心经快递发送,快递员揽件时即视为委托方已收货,广州钻石交易中心不承担后续货物安全责任。</p>
|
|
|
+ <p>本表将作为委托方委托广州钻石交易中心办理出境检测业务申请使用,敬请务必如实填写公司信息、货物资料,并盖章确认。广州钻石交易中心根据此表确认信息,作为接受委托办理该批货物出境检测业务的凭证,仅对数量负责。</p>
|
|
|
+ </div>
|
|
|
+ <el-form ref="formRef" class="el-form--horizontal" label-width="170px" :model="formData" :rules="formRules">
|
|
|
+ <el-form-item :class="formData.GZCJAccountType === 2 ? 'el-form-item--row' : ''" label="用户类型"
|
|
|
+ prop="GZCJAccountType">
|
|
|
+ <el-radio-group v-model="formData.GZCJAccountType" @change="clearList">
|
|
|
+ <el-radio :label="item.value" v-for="(item, index) in gzcjAccountTypeList" :key="index">
|
|
|
+ {{ item.label }}
|
|
|
+ </el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="送检账户" prop="GZCJAccount" v-if="formData.GZCJAccountType === 1">
|
|
|
+ <el-input placeholder="请输入" v-model="formData.GZCJAccount" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="公司名称(中文)" prop="CompanyNameCN">
|
|
|
+ <el-input placeholder="请输入" v-model="formData.CompanyNameCN" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="公司名称(英文)" prop="CompanyNameEn">
|
|
|
+ <el-input placeholder="请输入" v-model="formData.CompanyNameEn" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item class="el-form-item--row" label="地址(中文)" prop="AddressCN">
|
|
|
+ <el-input placeholder="请输入" v-model="formData.AddressCN" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item class="el-form-item--row" label="地址(英文)" prop="AddressEN">
|
|
|
+ <el-input placeholder="请输入" v-model="formData.AddressEN" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="联系人姓名" prop="ContactName">
|
|
|
+ <el-input placeholder="请输入" v-model="formData.ContactName" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="联系人职位" prop="ContactPosition">
|
|
|
+ <el-input placeholder="请输入" v-model="formData.ContactPosition" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="联系人电话" prop="ContactPhoneNo">
|
|
|
+ <el-input type="number" placeholder="请输入" v-model.number="formData.ContactPhoneNo" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="邮箱" prop="Email">
|
|
|
+ <el-input placeholder="请输入" v-model="formData.Email" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="货物品类" prop="GZCJCategoryType">
|
|
|
+ <el-select v-model="formData.GZCJCategoryType">
|
|
|
+ <el-option :label="item.label" :value="item.value"
|
|
|
+ v-for="(item, index) in getGZCJCategoryTypeList()" :key="index" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="成品钻石加工国" prop="ProcessingCountry">
|
|
|
+ <el-input placeholder="请输入" v-model="formData.ProcessingCountry" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="天然钻石毛坯原产地" prop="ZSOrigin">
|
|
|
+ <el-input placeholder="请输入" v-model="formData.ZSOrigin" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="完成检测后收货方式" prop="GZCJDeliveryType">
|
|
|
+ <el-select v-model="formData.GZCJDeliveryType">
|
|
|
+ <el-option :label="item.label" :value="item.value"
|
|
|
+ v-for="(item, index) in getGZCJDeliveryTypeList()" :key="index" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div class="customs-exit-edit__table"
|
|
|
+ v-if="formData.GZCJAccountType === 2 ? !!formData.GZCJCategoryType : !!formData.GZCJAccountType">
|
|
|
+ <div class="btnbar">
|
|
|
+ <!-- <el-button size="small">导入</el-button> -->
|
|
|
+ <el-button size="small" @click="openEdit()">新增</el-button>
|
|
|
+ <el-button size="small" @click="clearList()">清空</el-button>
|
|
|
+ </div>
|
|
|
+ <app-table :data="formData.GZCJCategoryDetails" :columns="columns" :max-height="400" :show-header="false"
|
|
|
+ border>
|
|
|
+ <!-- 形状 -->
|
|
|
+ <template #GZCJShapeType="{ value }">
|
|
|
+ {{ getGZCJShapeTypeName(value) }}
|
|
|
+ </template>
|
|
|
+ <!-- 刻印服务(证书号/ 其他/ 无) -->
|
|
|
+ <template #GZCJMarkType="{ value }">
|
|
|
+ {{ getGZCJMarkTypeName(value) }}
|
|
|
+ </template>
|
|
|
+ <!-- 是否披露处理 -->
|
|
|
+ <template #GZCJPublishType="{ value }">
|
|
|
+ {{ getGZCJPublishTypeName(value) }}
|
|
|
+ </template>
|
|
|
+ <!-- 服务类别 -->
|
|
|
+ <template #GZCJServiceType="{ value }">
|
|
|
+ {{ getGZCJServiceTypeName(value) }}
|
|
|
+ </template>
|
|
|
+ <!-- 操作 -->
|
|
|
+ <template #operate="{ row, index }">
|
|
|
+ <el-button size="small" @click="openEdit(row)">修改</el-button>
|
|
|
+ <el-button size="small" @click="deleteDetail(index)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </app-table>
|
|
|
+ </div>
|
|
|
+ <template #footer>
|
|
|
+ <el-button @click="onCancel(false)" plain>取消</el-button>
|
|
|
+ <el-button type="primary" @click="onSubmit(true)">保存草稿</el-button>
|
|
|
+ <el-button type="primary" @click="onSubmit()">提交申请</el-button>
|
|
|
+ </template>
|
|
|
+ <component :is="componentMap.get(componentId)" v-bind="{ formData, detail }" @update="onUpdate"
|
|
|
+ @closed="closeComponent" v-if="componentId" />
|
|
|
+ </app-drawer>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script lang="ts" setup>
|
|
|
+import { ref, computed, onMounted, defineAsyncComponent, PropType } from 'vue'
|
|
|
+import { ElMessage } from 'element-plus'
|
|
|
+import type { FormInstance, FormRules, } from 'element-plus'
|
|
|
+import { useComponent } from '@/hooks/component'
|
|
|
+import { validateRules } from '@/constants/regex'
|
|
|
+import { getGZCJAccountTypeList, getGZCJCategoryTypeList, getGZCJDeliveryTypeList, getGZCJShapeTypeName, getGZCJPublishTypeName, getGZCJMarkTypeName, getGZCJServiceTypeName } from '@/constants/customs'
|
|
|
+import { useCJJCOrderEdit } from '@/business/customs'
|
|
|
+import AppDrawer from '@pc/components/base/drawer/index.vue'
|
|
|
+import AppTable from '@pc/components/base/table/index.vue'
|
|
|
+
|
|
|
+const props = defineProps({
|
|
|
+ selectedRow: {
|
|
|
+ type: Object as PropType<Ermcp.GZCJJCOrderRsp>
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+const componentMap = new Map<string, unknown>([
|
|
|
+ ['detailEdit', defineAsyncComponent(() => import('./detail-edit/index.vue'))],
|
|
|
+])
|
|
|
+
|
|
|
+const { componentId, openComponent, closeComponent } = useComponent()
|
|
|
+const { loading, formData, formSubmit } = useCJJCOrderEdit(props.selectedRow)
|
|
|
+const show = ref(true)
|
|
|
+const refresh = ref(false)
|
|
|
+const formRef = ref<FormInstance>()
|
|
|
+const gzcjAccountTypeList = getGZCJAccountTypeList()
|
|
|
+const detail = ref<Proto.GZCJCategoryDetail>() // 当前选择的货物明细
|
|
|
+
|
|
|
+const columns = computed<Ermcp.TableColumn[]>(() => {
|
|
|
+ switch (formData.GZCJAccountType) {
|
|
|
+ case 1: {
|
|
|
+ return [
|
|
|
+ { prop: 'GZNo', label: '货物编号', show: true },
|
|
|
+ { prop: 'GZCJShapeType', label: '形状', width: 200, show: true },
|
|
|
+ { prop: 'Weight', label: '重量ct', show: true },
|
|
|
+ { prop: 'Amount', label: '参考货值USD', show: true },
|
|
|
+ { prop: 'ColorInfo', label: '彩钻信息', show: true },
|
|
|
+ { prop: 'Remark', label: '其他', show: true },
|
|
|
+ { prop: 'operate', label: '操作', width: 160, fixed: 'right', show: true }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ case 2: {
|
|
|
+ return [
|
|
|
+ { prop: 'GZNo', label: '货物编号', show: true },
|
|
|
+ { prop: 'GZCJShapeType', label: '形状', width: 200, show: true },
|
|
|
+ { prop: 'Weight', label: '重量ct', show: true },
|
|
|
+ { prop: 'Amount', label: '参考货值USD', show: true },
|
|
|
+ { prop: 'GZCJMarkType', label: '刻印服务(证书号/ 其他/ 无)', width: 220, show: true },
|
|
|
+ { prop: 'GZCJPublishType', label: '是否披露处理', show: true },
|
|
|
+ { prop: 'GZCJServiceType', label: '服务类别', show: true },
|
|
|
+ { prop: 'OriginCertNo', label: '原证书号', show: true },
|
|
|
+ { prop: 'ColorInfo', label: '彩钻信息', show: true },
|
|
|
+ { prop: 'Remark', label: '其他', show: true },
|
|
|
+ { prop: 'operate', label: '操作', width: 160, fixed: 'right', show: true }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return []
|
|
|
+})
|
|
|
+
|
|
|
+const formRules: FormRules = {
|
|
|
+ GZCJAccountType: [{
|
|
|
+ required: true,
|
|
|
+ message: '请选择用户类型'
|
|
|
+ }],
|
|
|
+ GZCJAccount: [{
|
|
|
+ required: true,
|
|
|
+ message: '请输入送检账户'
|
|
|
+ }],
|
|
|
+ CompanyNameCN: [{
|
|
|
+ required: true,
|
|
|
+ message: '请输入公司名称(中文)'
|
|
|
+ }],
|
|
|
+ CompanyNameEn: [{
|
|
|
+ required: true,
|
|
|
+ message: '请输入公司名称(英文)'
|
|
|
+ }],
|
|
|
+ AddressCN: [{
|
|
|
+ required: true,
|
|
|
+ message: '请输入地址(中文)'
|
|
|
+ }],
|
|
|
+ AddressEN: [{
|
|
|
+ required: true,
|
|
|
+ message: '请输入地址(英文)'
|
|
|
+ }],
|
|
|
+ ContactName: [{
|
|
|
+ required: true,
|
|
|
+ message: '请输入联系人姓名'
|
|
|
+ }],
|
|
|
+ ContactPosition: [{
|
|
|
+ required: true,
|
|
|
+ message: '请输入联系人职位'
|
|
|
+ }],
|
|
|
+ ContactPhoneNo: [{
|
|
|
+ required: true,
|
|
|
+ trigger: 'blur',
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
+ if (value) {
|
|
|
+ if (validateRules.phone.validate(value)) {
|
|
|
+ callback()
|
|
|
+ } else {
|
|
|
+ callback(new Error(validateRules.phone.message))
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ callback(new Error('请输入联系人电话'))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }],
|
|
|
+ Email: [{
|
|
|
+ required: true,
|
|
|
+ trigger: 'blur',
|
|
|
+ validator: (rule, value, callback) => {
|
|
|
+ if (value) {
|
|
|
+ if (validateRules.email.validate(value)) {
|
|
|
+ callback()
|
|
|
+ } else {
|
|
|
+ callback(new Error(validateRules.email.message))
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ callback(new Error('请输入邮箱'))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }],
|
|
|
+ GZCJCategoryType: [{
|
|
|
+ required: true,
|
|
|
+ message: '请选择货物品类'
|
|
|
+ }],
|
|
|
+ ProcessingCountry: [{
|
|
|
+ required: true,
|
|
|
+ message: '请输入成品钻石加工国'
|
|
|
+ }],
|
|
|
+ ZSOrigin: [{
|
|
|
+ required: true,
|
|
|
+ message: '请输入天然钻石毛坯原产地'
|
|
|
+ }],
|
|
|
+ GZCJDeliveryType: [{
|
|
|
+ required: true,
|
|
|
+ message: '请选择完成检测后收货方式'
|
|
|
+ }],
|
|
|
+}
|
|
|
+
|
|
|
+// 打开编辑
|
|
|
+const openEdit = (row?: Proto.GZCJCategoryDetail) => {
|
|
|
+ detail.value = row
|
|
|
+ openComponent('detailEdit')
|
|
|
+}
|
|
|
+
|
|
|
+// 清空列表数据
|
|
|
+const clearList = () => {
|
|
|
+ formData.GZCJCategoryDetails = []
|
|
|
+}
|
|
|
+
|
|
|
+// 删除列表数据
|
|
|
+const deleteDetail = (index: number) => {
|
|
|
+ formData.GZCJCategoryDetails?.splice(index, 1)
|
|
|
+ formData.GZCJCategoryDetails?.forEach((e, i) => e.OrderIndex = i + 1) // 重置序列
|
|
|
+}
|
|
|
+
|
|
|
+// 更新列表数据
|
|
|
+const onUpdate = (item: Proto.GZCJCategoryDetail) => {
|
|
|
+ const { GZCJCategoryDetails = [] } = formData
|
|
|
+ const index = GZCJCategoryDetails.findIndex((e) => e.OrderIndex === item.OrderIndex)
|
|
|
+
|
|
|
+ if (index > -1) {
|
|
|
+ GZCJCategoryDetails[index] = item
|
|
|
+ } else {
|
|
|
+ item.OrderIndex = GZCJCategoryDetails.length + 1
|
|
|
+ GZCJCategoryDetails.push(item)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const onCancel = (isRefresh = false) => {
|
|
|
+ show.value = false
|
|
|
+ refresh.value = isRefresh
|
|
|
+}
|
|
|
+
|
|
|
+const onSubmit = (draft = false) => {
|
|
|
+ if (draft) {
|
|
|
+ formData.ApplyType = props.selectedRow?.orderid ? 2 : 1
|
|
|
+ } else {
|
|
|
+ formData.ApplyType = 3
|
|
|
+ }
|
|
|
+ formRef.value?.validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ if (formData.GZCJCategoryDetails?.length) {
|
|
|
+ formSubmit().then(() => {
|
|
|
+ ElMessage.success('提交成功')
|
|
|
+ onCancel(true)
|
|
|
+ }).catch((err) => {
|
|
|
+ ElMessage.error(err)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ ElMessage.warning('请添加批次')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ if (gzcjAccountTypeList.length) {
|
|
|
+ formData.GZCJAccountType = gzcjAccountTypeList[0].value
|
|
|
+ }
|
|
|
+})
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less">
|
|
|
+@import './index.less';
|
|
|
+</style>
|