|
@@ -2,9 +2,28 @@
|
|
|
<div id="detail">
|
|
|
<admin-frame topType="2" @back="back" :rightArrow="false" :usePage="false" :useNav="false">
|
|
|
<template v-slot:info>
|
|
|
- <info-1 :form="form" @addContract="addContract" @revoke="revoke" @confirm="confirm"></info-1>
|
|
|
+ <info-1 :form="form" @addContract="addContract" @revoke="revoke" @confirm="confirm" @endTrans="endTrans"></info-1>
|
|
|
</template>
|
|
|
</admin-frame>
|
|
|
+ <van-dialog class="dialog" v-model="show" title="上传合同" :show-confirm-button="false" :show-cancel-button="false">
|
|
|
+ <van-form>
|
|
|
+ <van-field v-model="contartForm.patent_name" name="专利名称" label="专利名称" row="1" type="textarea" />
|
|
|
+ <van-field name="offine_contract" label="合同">
|
|
|
+ <template #input>
|
|
|
+ <van-uploader
|
|
|
+ :fileList="contartForm.offine_contract"
|
|
|
+ :max-count="1"
|
|
|
+ :after-read="(file) => toUpload(file, 'offine_contract')"
|
|
|
+ @delete="(file) => toDelete(file, 'offine_contract')"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </van-field>
|
|
|
+ <van-col span="24" class="btn">
|
|
|
+ <van-button type="info" size="small" @click="onSubmit">提交合同</van-button>
|
|
|
+ <van-button type="danger" size="small" @click="resetBtn">取消提交</van-button>
|
|
|
+ </van-col>
|
|
|
+ </van-form>
|
|
|
+ </van-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -13,6 +32,9 @@ import info1 from './parts/info-1.vue';
|
|
|
import adminFrame from '@frame/src/components/mobile-frame/mobile-main.vue';
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
const { mapActions: patenttrans } = createNamespacedHelpers('patenttrans');
|
|
|
+const { mapActions: patentinfo } = createNamespacedHelpers('patentinfo');
|
|
|
+const { mapActions: upload } = createNamespacedHelpers('upload');
|
|
|
+var moment = require('moment');
|
|
|
export default {
|
|
|
name: 'detail',
|
|
|
props: {},
|
|
@@ -23,13 +45,18 @@ export default {
|
|
|
data: function () {
|
|
|
return {
|
|
|
form: {},
|
|
|
+ // 结束交易
|
|
|
+ show: false,
|
|
|
+ contartForm: {},
|
|
|
};
|
|
|
},
|
|
|
async created() {
|
|
|
await this.search();
|
|
|
},
|
|
|
methods: {
|
|
|
- ...patenttrans(['fetch', 'update']),
|
|
|
+ ...upload(['upload']),
|
|
|
+ ...patenttrans(['fetch', 'update', 'check']),
|
|
|
+ ...patentinfo({ infoUpdate: 'update' }),
|
|
|
async search() {
|
|
|
let res = await this.fetch(this.id);
|
|
|
if (this.$checkRes(res)) {
|
|
@@ -57,7 +84,7 @@ export default {
|
|
|
async confirm() {
|
|
|
let data = this.form;
|
|
|
data.status = '3';
|
|
|
- let res = await this.update(data);
|
|
|
+ let res = await this.check(data);
|
|
|
if (this.$checkRes(res)) {
|
|
|
this.$toast({ type: `success`, message: `用户确认成功,待机构审核通过,交易结束` });
|
|
|
this.back();
|
|
@@ -65,10 +92,47 @@ export default {
|
|
|
this.$toast({ type: `success`, message: `${res.errmsg}` });
|
|
|
}
|
|
|
},
|
|
|
+ // 结束交易
|
|
|
+ endTrans() {
|
|
|
+ this.$set(this, `contartForm`, this.form);
|
|
|
+ this.show = true;
|
|
|
+ },
|
|
|
+ // 提交合同
|
|
|
+ async onSubmit() {
|
|
|
+ let data = this.contartForm;
|
|
|
+ data.is_contract = '0';
|
|
|
+ data.status = '4';
|
|
|
+ let res = await this.update(data);
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ let arr = await this.infoUpdate({ id: data.patent_id, trans_status: '1' });
|
|
|
+ if (this.$checkRes(arr)) {
|
|
|
+ this.$toast({ type: `success`, message: `合同上传成功,交易完成` });
|
|
|
+ this.back();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$toast({ type: `success`, message: `${res.errmsg}` });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 取消提交
|
|
|
+ resetBtn() {
|
|
|
+ this.contartForm = {};
|
|
|
+ this.show = false;
|
|
|
+ },
|
|
|
// 返回
|
|
|
back() {
|
|
|
this.$router.push({ path: '/service/patent/user/transaction/index', query: { type: this.type } });
|
|
|
},
|
|
|
+ async toUpload({ file }, model) {
|
|
|
+ // 上传,赋值
|
|
|
+ const res = await this.upload({ file, dir: 'file' });
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ this.$set(this.contartForm, model, [{ name: res.name, url: res.uri }]);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ toDelete(file, model) {
|
|
|
+ const index = this.contartForm[model].findIndex((f) => _.isEqual(f, file));
|
|
|
+ this.contartForm[model].splice(index, 1);
|
|
|
+ },
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['user']),
|
|
@@ -92,4 +156,18 @@ export default {
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
-<style lang="less" scoped></style>
|
|
|
+<style lang="less" scoped>
|
|
|
+.dialog {
|
|
|
+ /deep/.van-dialog__content {
|
|
|
+ height: 250px;
|
|
|
+ overflow-y: auto;
|
|
|
+ }
|
|
|
+ .btn {
|
|
|
+ text-align: center;
|
|
|
+ margin: 15px 0;
|
|
|
+ .van-button {
|
|
|
+ margin: 0 10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|