|
@@ -7,6 +7,37 @@
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
+ <el-dialog title="发放证书" width="40%" :visible.sync="dialog" @closed="handleClose" :destroy-on-close="true">
|
|
|
+ <el-form>
|
|
|
+ <el-form-item label="成果名称">{{ getProp('basic.achieve_name') }}</el-form-item>
|
|
|
+ <el-timeline>
|
|
|
+ <el-timeline-item
|
|
|
+ v-for="(i, index) in line"
|
|
|
+ :key="`line${index}`"
|
|
|
+ :icon="i.status <= 0 ? 'el-icon-close ' : 'el-icon-check'"
|
|
|
+ :type="i.status <= 0 ? 'danger ' : 'success'"
|
|
|
+ size="large"
|
|
|
+ :timestamp="i.status <= 0 ? '' : i.create_time"
|
|
|
+ >
|
|
|
+ {{ i.step }}
|
|
|
+ <el-collapse v-if="i.status <= 0">
|
|
|
+ <el-collapse-item title="点击展开" name="1">
|
|
|
+ <el-table :data="i.list">
|
|
|
+ <el-table-column align="center" label="时间" prop="create_time" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="建议" prop="desc" show-overflow-tooltip></el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-collapse-item>
|
|
|
+ </el-collapse>
|
|
|
+ </el-timeline-item>
|
|
|
+ </el-timeline>
|
|
|
+ <el-form-item label="是否缴费">
|
|
|
+ <el-checkbox v-model="cost" :label="true">已缴费</el-checkbox>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="">
|
|
|
+ <el-button type="primary" :disabled="!cost" @click="haveCert">发放证书</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -39,6 +70,11 @@ export default {
|
|
|
],
|
|
|
list: [],
|
|
|
total: 0,
|
|
|
+ dialog: false,
|
|
|
+ info: {},
|
|
|
+ test: true,
|
|
|
+ cost: false,
|
|
|
+ line: [],
|
|
|
};
|
|
|
},
|
|
|
async created() {
|
|
@@ -46,7 +82,7 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
...achieveApply(['query']),
|
|
|
- ...verifyRecord(['create']),
|
|
|
+ ...verifyRecord({ create: 'create', getRecord: 'query' }),
|
|
|
// 查询列表
|
|
|
async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
|
const res = await this.query({ skip, limit, ...info, status: '5' });
|
|
@@ -56,7 +92,33 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
async toCert({ data }) {
|
|
|
- // TODO 发证书
|
|
|
+ this.$set(this, `info`, data);
|
|
|
+ const records = await this.getRecord({ apply_id: data._id });
|
|
|
+ const order = [-1, 1, -2, 2, -3, 3, 4, -5, 5, 6]; //时间轴的顺序,如果有修改,请注意这里的逗号,少写了只会让顺序出错,不会报错,被识别成减法了(实际体验的结果)
|
|
|
+ if (this.$checkRes(records)) {
|
|
|
+ let data = _.get(records, 'data', []);
|
|
|
+ data = _.groupBy(data, 'status');
|
|
|
+ const arr = [];
|
|
|
+ for (const n of order) {
|
|
|
+ const obj = _.get(data, n);
|
|
|
+ if (obj) {
|
|
|
+ const head = _.head(obj);
|
|
|
+ if (!head) continue;
|
|
|
+ const aobj = { step: _.get(head, 'step'), create_time: _.get(head, 'create_time'), list: obj, status: _.get(head, 'status') };
|
|
|
+ arr.push(aobj);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.$set(this, `line`, arr);
|
|
|
+ }
|
|
|
+ this.dialog = true;
|
|
|
+ },
|
|
|
+ getProp(prop) {
|
|
|
+ return _.get(this.info, prop, '');
|
|
|
+ },
|
|
|
+
|
|
|
+ async haveCert() {
|
|
|
+ const data = _.cloneDeep(this.info);
|
|
|
+ // 发证书
|
|
|
let dup = { status: '6' };
|
|
|
dup.apply_id = _.get(data, '_id');
|
|
|
dup.verify = _.get(this.user, 'name');
|
|
@@ -64,7 +126,14 @@ export default {
|
|
|
dup.verify_id = _.get(this.user, '_id');
|
|
|
dup.step = '发证书';
|
|
|
const res = await this.create(dup);
|
|
|
- if (this.$checkRes(res, '已确定发放证书', res.errmsg || '确定发放失败')) this.search();
|
|
|
+ if (this.$checkRes(res, '已确定发放证书', res.errmsg || '确定发放失败')) {
|
|
|
+ this.handleClose();
|
|
|
+ this.search();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleClose() {
|
|
|
+ this.info = {};
|
|
|
+ this.line = [];
|
|
|
},
|
|
|
},
|
|
|
computed: {
|