|
|
@@ -42,15 +42,29 @@
|
|
|
<div class="line">
|
|
|
<div class="info-line aic">
|
|
|
<div class="info-line-title">上传身份证 :</div>
|
|
|
- <el-upload
|
|
|
- class="upload-demo"
|
|
|
- drag
|
|
|
- action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15"
|
|
|
- multiple
|
|
|
- >
|
|
|
- <div class="fs30 c9">+</div>
|
|
|
- <div class="el-upload__text c9">拖动或点击上传</div>
|
|
|
- </el-upload>
|
|
|
+ <Upload
|
|
|
+ uploaderId="idfront"
|
|
|
+ :limit="1"
|
|
|
+ :params="{}"
|
|
|
+ :actionUrl="store.state.idCardUrl"
|
|
|
+ :hidden="false"
|
|
|
+ :disabled="false"
|
|
|
+ :fileList="idFrontList"
|
|
|
+ @onSendFileList="idFrontUploadSuccess"
|
|
|
+ uploadText="身份证人像面"
|
|
|
+ class="mr20"
|
|
|
+ ></Upload>
|
|
|
+ <Upload
|
|
|
+ uploaderId="idback"
|
|
|
+ :limit="1"
|
|
|
+ :params="{}"
|
|
|
+ :actionUrl="store.state.idCardUrl"
|
|
|
+ :hidden="false"
|
|
|
+ :disabled="false"
|
|
|
+ :fileList="idBackList"
|
|
|
+ @onSendFileList="idBackUploadSuccess"
|
|
|
+ uploadText="身份证国徽面"
|
|
|
+ ></Upload>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="df aic jcfe">
|
|
|
@@ -154,6 +168,8 @@ import _ from "lodash";
|
|
|
const route = useRoute();
|
|
|
let shipOwnerDetail = ref({});
|
|
|
let shipDetail = ref({});
|
|
|
+let unchangeableShipOwner = ref(false);
|
|
|
+let unchangeableShip = ref(false);
|
|
|
async function getShipOwnerDetail() {
|
|
|
let res = await api.getShipOwnerDetail({
|
|
|
shipOwnerId: route.query.shipOwnerId,
|
|
|
@@ -235,8 +251,75 @@ async function getShipOwnerDetail() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+let idFrontList = ref([]);
|
|
|
+function idFrontUploadSuccess(list) {
|
|
|
+ if (list.length) {
|
|
|
+ let { url, response } = list[0];
|
|
|
+ let { downloadUrl, viewUrl, key } = response.result;
|
|
|
+ idFrontList.value = [{ url, downloadUrl, viewUrl, key }];
|
|
|
+ } else {
|
|
|
+ idFrontList.value = [];
|
|
|
+ }
|
|
|
+}
|
|
|
+let idBackList = ref([]);
|
|
|
+function idBackUploadSuccess(list) {
|
|
|
+ if (list.length) {
|
|
|
+ let { url, response } = list[0];
|
|
|
+ let { downloadUrl, viewUrl, key } = response.result;
|
|
|
+ idBackList.value = [{ url, downloadUrl, viewUrl, key }];
|
|
|
+ } else {
|
|
|
+ idBackList.value = [];
|
|
|
+ }
|
|
|
+}
|
|
|
+function checkShipOwner() {
|
|
|
+ let { userName, userPhone } = shipOwnerDetail.value;
|
|
|
+ if (!userName) {
|
|
|
+ ElNotification.error({
|
|
|
+ title: "请填写船东姓名",
|
|
|
+ duration: 1500,
|
|
|
+ });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (!userPhone) {
|
|
|
+ ElNotification.error({
|
|
|
+ title: "请填写船东手机号",
|
|
|
+ duration: 1500,
|
|
|
+ });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+}
|
|
|
function addShipOwner() {
|
|
|
- console.log();
|
|
|
+ if (!checkShipOwner()) return;
|
|
|
+ let postData = shipOwnerDetail.value;
|
|
|
+ if (idFrontList.value.length) {
|
|
|
+ let {
|
|
|
+ downloadUrl: idcardFrontDownloadUrl,
|
|
|
+ viewUrl: idcardFrontViewUrl,
|
|
|
+ key: idcardFrontFileKey,
|
|
|
+ } = idFrontList.value[0];
|
|
|
+ postData = {
|
|
|
+ ...postData,
|
|
|
+ idcardFrontDownloadUrl,
|
|
|
+ idcardFrontViewUrl,
|
|
|
+ idcardFrontFileKey,
|
|
|
+ };
|
|
|
+ }
|
|
|
+ if (idBackList.value.length) {
|
|
|
+ let {
|
|
|
+ downloadUrl: idcardBackDownloadUrl,
|
|
|
+ viewUrl: idcardBackViewUrl,
|
|
|
+ key: idcardBackFileKey,
|
|
|
+ } = idBackList.value[0];
|
|
|
+ postData = {
|
|
|
+ ...postData,
|
|
|
+ idcardBackDownloadUrl,
|
|
|
+ idcardBackViewUrl,
|
|
|
+ idcardBackFileKey,
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log(postData);
|
|
|
}
|
|
|
|
|
|
onMounted(() => {
|