feat: 光芯-行政管理
This commit is contained in:
parent
de016d48bf
commit
b2b6346a9b
|
@ -0,0 +1,313 @@
|
||||||
|
<template>
|
||||||
|
<el-container>
|
||||||
|
<el-header>
|
||||||
|
<div class="left-panel-group">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-auth="'filerecord.create'"
|
||||||
|
></el-button>
|
||||||
|
</div>
|
||||||
|
<div class="right-panel">
|
||||||
|
<el-input
|
||||||
|
v-model="query.name"
|
||||||
|
placeholder="档案名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
></el-input>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-search"
|
||||||
|
@click="handleQuery"
|
||||||
|
></el-button>
|
||||||
|
</div>
|
||||||
|
</el-header>
|
||||||
|
<el-main class="nopadding">
|
||||||
|
<scTable ref="table" :apiObj="apiObj" row-key="id">
|
||||||
|
<el-table-column label="序号" type="index"></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="资料名称"
|
||||||
|
prop="name"
|
||||||
|
min-width="100"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="文件份数"
|
||||||
|
prop="counts"
|
||||||
|
min-width="100"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="档案编号"
|
||||||
|
prop="number"
|
||||||
|
min-width="100"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="存档部门"
|
||||||
|
prop="belong_dept_name"
|
||||||
|
min-width="120">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="存档人姓名"
|
||||||
|
prop="create_by_name"
|
||||||
|
min-width="120">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="存档人电话"
|
||||||
|
prop="contacts"
|
||||||
|
min-width="100"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="存档位置"
|
||||||
|
prop="location"
|
||||||
|
min-width="100"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="存档时间"
|
||||||
|
prop="create_time"
|
||||||
|
min-width="100"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="接收人(综合办公室)"
|
||||||
|
prop="reciver"
|
||||||
|
min-width="100"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="备注"
|
||||||
|
prop="remark"
|
||||||
|
min-width="100"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column label="操作" fixed="right" align="center" width="250">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
size="small"
|
||||||
|
type="primary"
|
||||||
|
@click="filerecordEidt(scope.row)"
|
||||||
|
v-auth="'filerecord.update'"
|
||||||
|
>编辑
|
||||||
|
</el-button>
|
||||||
|
<el-popconfirm
|
||||||
|
title="确定删除吗?"
|
||||||
|
@confirm="fileDel(scope.row)"
|
||||||
|
>
|
||||||
|
<template #reference>
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
size="small"
|
||||||
|
type="danger"
|
||||||
|
v-auth="'filerecord.delete'"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-popconfirm>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</scTable>
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
<el-drawer :title="titleMap[type] " v-model="limitedVisible" size="50%">
|
||||||
|
<el-form
|
||||||
|
:model="addForm"
|
||||||
|
:rules="rules"
|
||||||
|
ref="addForm"
|
||||||
|
label-width="100px"
|
||||||
|
label-position="left"
|
||||||
|
>
|
||||||
|
<el-form-item label="资料名称" prop="name">
|
||||||
|
<el-input v-model="addForm.name" clearable></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="档案编号" prop="number">
|
||||||
|
<el-input v-model="addForm.number" clearable></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="文件份数" prop="counts">
|
||||||
|
<el-input v-model="addForm.counts" clearable></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="存放位置" prop="location">
|
||||||
|
<el-input v-model="addForm.location" clearable></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="存档人电话" prop="contacts">
|
||||||
|
<el-input v-model="addForm.contacts" clearable></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="接收人(综合办)" prop="reciver" label-width="120px">
|
||||||
|
<el-input v-model="addForm.reciver" clearable></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark" type="textarea">
|
||||||
|
<el-input v-model="addForm.remark" clearable></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<el-button
|
||||||
|
v-auth="'filerecord.create'"
|
||||||
|
v-if="type !== 'show'"
|
||||||
|
type="primary"
|
||||||
|
:loading="isSaving"
|
||||||
|
@click="submitHandle()"
|
||||||
|
> 保 存</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-drawer>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "index",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
workflowName:"",
|
||||||
|
workFlowId:'',
|
||||||
|
apiObj: this.$API.ofm.filerecord.list,
|
||||||
|
selection: [],
|
||||||
|
checkList: [],
|
||||||
|
transitions:[],
|
||||||
|
timeRange: [],
|
||||||
|
query: {},
|
||||||
|
editId: null,
|
||||||
|
isSaving: false,
|
||||||
|
limitedVisible: false,
|
||||||
|
limitedWatch: false,
|
||||||
|
type: "add",
|
||||||
|
titleMap: {
|
||||||
|
add: "新增",
|
||||||
|
edit: "编辑",
|
||||||
|
show: "查看",
|
||||||
|
},
|
||||||
|
//表单数据
|
||||||
|
addForm: {
|
||||||
|
name: null,
|
||||||
|
number: null,
|
||||||
|
counts: null,
|
||||||
|
location: null,
|
||||||
|
contacts: null,
|
||||||
|
reciver: "",
|
||||||
|
remark: ""
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleAdd() {
|
||||||
|
this.type = "add";
|
||||||
|
this.addForm = this.getDefaultForm();
|
||||||
|
this.limitedVisible = true;
|
||||||
|
},
|
||||||
|
handleAdd_outer() {
|
||||||
|
this.addForm = this.getDefaultForm();
|
||||||
|
this.type = "add";
|
||||||
|
this.limitedVisible = true;
|
||||||
|
this.lending_type = "outer";
|
||||||
|
this.addForm.is_lending = true;
|
||||||
|
},
|
||||||
|
handleCancel() {
|
||||||
|
this.limitedVisible = false; // 关闭弹窗
|
||||||
|
this.lending_type = ""; // 重置 lending_type
|
||||||
|
this.getDefaultForm()// 清空表单
|
||||||
|
},
|
||||||
|
submitHandle() {
|
||||||
|
let that = this;
|
||||||
|
that.isSaving = true;
|
||||||
|
that.submit();
|
||||||
|
},
|
||||||
|
getDefaultForm(){
|
||||||
|
return {
|
||||||
|
name: null,
|
||||||
|
number: null,
|
||||||
|
counts: null,
|
||||||
|
location: null,
|
||||||
|
contacts: null,
|
||||||
|
reciver: "",
|
||||||
|
remark: ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async submit() {
|
||||||
|
let that = this;
|
||||||
|
let res = null;
|
||||||
|
try {
|
||||||
|
if (that.type === "add") {
|
||||||
|
res = await that.$API.ofm.filerecord.create.req(that.addForm);
|
||||||
|
} else {
|
||||||
|
res = await that.$API.ofm.filerecord.update.req(
|
||||||
|
that.editId,
|
||||||
|
that.addForm
|
||||||
|
);
|
||||||
|
}
|
||||||
|
that.isSaving = false;
|
||||||
|
that.limitedVisible = false;
|
||||||
|
that.$refs.table.refresh();
|
||||||
|
} catch (e) {
|
||||||
|
that.isSaving = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 审批流结束之后才可以编辑
|
||||||
|
filerecordEidt(row) {
|
||||||
|
this.type = "edit";
|
||||||
|
this.editId = row.id;
|
||||||
|
this.limitedVisible = true;
|
||||||
|
this.addForm = Object.assign({}, row);
|
||||||
|
},
|
||||||
|
async filerecordDel(row) {
|
||||||
|
var id = row.id;
|
||||||
|
var res = await this.$API.ofm.filerecord.delete.req(id);
|
||||||
|
if (res.err_msg) {
|
||||||
|
this.$message.error(res.err_msg);
|
||||||
|
} else {
|
||||||
|
this.$refs.table.refresh();
|
||||||
|
this.$message.success("删除成功");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//搜索
|
||||||
|
handleQuery() {
|
||||||
|
this.$refs.table.queryData(this.query);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.treeMain {
|
||||||
|
height: 280px;
|
||||||
|
overflow: auto;
|
||||||
|
border: 1px solid #dcdfe6;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar {
|
||||||
|
width: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar-track {
|
||||||
|
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.2);
|
||||||
|
background-color: #fefefe;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar-thumb {
|
||||||
|
border-radius: 5px;
|
||||||
|
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
}
|
||||||
|
.node rect {
|
||||||
|
stroke: #606266;
|
||||||
|
fill: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.edgePath path {
|
||||||
|
stroke: #606266;
|
||||||
|
fill: #333;
|
||||||
|
stroke-width: 1.5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
g.conditions > rect {
|
||||||
|
fill: #00ffd0;
|
||||||
|
stroke: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-icon-close {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.left-panel-group {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px; /* 按钮之间的间隙,可以调小点 */
|
||||||
|
margin-left: 0; /* 靠左 */
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
|
@ -0,0 +1,89 @@
|
||||||
|
<template>
|
||||||
|
<el-container>
|
||||||
|
<el-main>
|
||||||
|
<el-form
|
||||||
|
:model="addForm"
|
||||||
|
:rules="rules"
|
||||||
|
ref="addForm"
|
||||||
|
label-width="100px"
|
||||||
|
label-position="left"
|
||||||
|
>
|
||||||
|
<el-form-item label="资料名称" prop="name">
|
||||||
|
<el-input v-model="addForm.name" clearable :disabled="mode==='view'"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="档案编号" prop="number">
|
||||||
|
<el-input v-model="addForm.number" clearable :disabled="mode==='view'"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="文件份数" prop="counts">
|
||||||
|
<el-input v-model="addForm.counts" clearable :disabled="mode==='view'"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="存放位置" prop="location">
|
||||||
|
<el-input v-model="addForm.location" clearable :disabled="mode==='view'"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="存档人电话" prop="contacts">
|
||||||
|
<el-input v-model="addForm.contacts" clearable :disabled="mode==='view'"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="接收人(综合办)" prop="reciver" label-width="120px">
|
||||||
|
<el-input v-model="addForm.reciver" clearable :disabled="mode==='view'"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark" type="textarea">
|
||||||
|
<el-input v-model="addForm.remark" clearable :disabled="mode==='view'"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<el-footer v-show="mode!=='show'">
|
||||||
|
<ticketd_b_start
|
||||||
|
:workflow_key="'borrowrecord'"
|
||||||
|
:title="ticketTitle"
|
||||||
|
:t_id="addForm.id"
|
||||||
|
:ticket_="addForm.ticket_"
|
||||||
|
:submit_b_func="submit_b_func"
|
||||||
|
:ticket_data="ticket_data"
|
||||||
|
ref="ticketd_b_start"
|
||||||
|
@success="$emit('success')"
|
||||||
|
@colsed="$emit('closed')"
|
||||||
|
/>
|
||||||
|
</el-footer>
|
||||||
|
</el-main>
|
||||||
|
<el-aside width="20%" v-if="addForm.ticket_">
|
||||||
|
<ticketd ::ticket_="addForm.ticket_" @success="$emit('success')"></ticketd>
|
||||||
|
</el-aside>
|
||||||
|
</el-container>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import ticketd_b_start from "@/views/wf/ticketd_b_start.vue";
|
||||||
|
import ticketd from '@/views/wf/ticketd.vue'
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
mode: { type: String, default: "view" }, // add / edit / view
|
||||||
|
modelValue: { type: Object, default: () => ({}) },
|
||||||
|
transitions: { type: Array, default: () => [] },
|
||||||
|
},
|
||||||
|
components: {ticketd, ticketd_b_start},
|
||||||
|
emits: ["update:modelValue", "submit", "cancel"],
|
||||||
|
data(){
|
||||||
|
return {
|
||||||
|
addForm: { ...this.modelValue },
|
||||||
|
ticketTitle: "档案申请",
|
||||||
|
rules:{
|
||||||
|
filename: [{ required: true, message: "请输入文件名称", trigger: "blur" }],
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
async submit_b_func() {
|
||||||
|
let that = this;
|
||||||
|
|
||||||
|
this.ticketTitle = `${this.addForm.name}-档案申请`
|
||||||
|
if(that.mode == "add") {
|
||||||
|
let res = await that.$API.ofm.filerecord.create.req(that.addForm);
|
||||||
|
|
||||||
|
that.addForm.id = res.id;
|
||||||
|
} else if (that.mode == "edit") {
|
||||||
|
await that.$API.ofm.filerecord.update.req(that.addForm.id, that.addForm);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
|
@ -69,9 +69,9 @@
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="borrowEidt(scope.row)"
|
@click="borrowEidt(scope.row)"
|
||||||
v-auth="'fileborrow.update'"
|
v-auth="'fileborrow.update'"
|
||||||
>编辑
|
>详情
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-popconfirm
|
<!-- <el-popconfirm
|
||||||
title="确定删除吗?"
|
title="确定删除吗?"
|
||||||
@confirm="borrowDel(scope.row)"
|
@confirm="borrowDel(scope.row)"
|
||||||
>
|
>
|
||||||
|
@ -84,85 +84,36 @@
|
||||||
>删除</el-button
|
>删除</el-button
|
||||||
>
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-popconfirm>
|
</el-popconfirm> -->
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</scTable>
|
</scTable>
|
||||||
</el-main>
|
</el-main>
|
||||||
</el-container>
|
</el-container>
|
||||||
<el-drawer :title="titleMap[type] " v-model="limitedVisible" size="50%">
|
<el-drawer :title="titleMap[type] "
|
||||||
<el-form
|
v-model="limitedVisible"
|
||||||
:model="addForm"
|
direction="rtl"
|
||||||
:rules="rules"
|
size="70%">
|
||||||
ref="addForm"
|
|
||||||
label-width="100px"
|
|
||||||
label-position="left"
|
|
||||||
>
|
|
||||||
<el-form-item label="档案名称">
|
|
||||||
<el-select v-model="addForm.borrow_file" multiple placeholder="请选择档案" clearable style="width: 300px;">
|
|
||||||
<el-option
|
|
||||||
v-for="item in fileList"
|
|
||||||
:key="item.id"
|
|
||||||
:value="item.id"
|
|
||||||
:label="item.name"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="申请人电话" prop="contacts">
|
|
||||||
<el-input v-model="addForm.contacts" clearable style="width: 300px;"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="借阅时间" prop="borrow_date">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="addForm.borrow_date"
|
|
||||||
type="date"
|
|
||||||
placeholder="选择日期时间"
|
|
||||||
align="right"
|
|
||||||
value-format="YYYY-MM-DD"
|
|
||||||
>
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="归还时间" prop="return_date">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="addForm.return_date"
|
|
||||||
type="date"
|
|
||||||
placeholder="选择日期时间"
|
|
||||||
align="right"
|
|
||||||
value-format="YYYY-MM-DD"
|
|
||||||
>
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="用途" prop="remark">
|
|
||||||
<el-checkbox-group v-model="addForm.remark">
|
|
||||||
<el-checkbox label="借阅"></el-checkbox>
|
|
||||||
<el-checkbox label="复印"></el-checkbox>
|
|
||||||
<el-checkbox label="查阅"></el-checkbox>
|
|
||||||
</el-checkbox-group>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
</el-form>
|
<div style="display: flex; height: calc(100% - 60px);">
|
||||||
<template #footer>
|
<div style="flex: 1; padding-right: 20px; overflow-y: auto;">
|
||||||
<el-button
|
<borrowlForm
|
||||||
v-for="item in transitions"
|
:mode="type"
|
||||||
:key="item.id"
|
v-model="addForm"
|
||||||
type="primary"
|
:lending_type="lending_type"
|
||||||
:loading="isSaving"
|
@success="()=>{handleQuery(); limitedVisible = false}"
|
||||||
:disabled="isSaving"
|
@closed="limitedVisible = false"
|
||||||
@click="submitTicketCreate(item.id)"
|
/>
|
||||||
style="margin-right: 4px"
|
</div>
|
||||||
>{{ item.name }}</el-button>
|
</div>
|
||||||
<el-button @click="handleCancel">取 消</el-button>
|
|
||||||
<el-button
|
|
||||||
v-auth="'fileborrow.return'"
|
|
||||||
v-if="type !== 'show'"
|
|
||||||
type="primary"
|
|
||||||
:loading="isSaving"
|
|
||||||
@click="submitHandle()"
|
|
||||||
> 保 存</el-button
|
|
||||||
>
|
|
||||||
</template>
|
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
import borrowlForm from "./borrowfile_form.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: { borrowlForm },
|
||||||
name: "index",
|
name: "index",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -192,7 +143,7 @@ export default {
|
||||||
counts: null,
|
counts: null,
|
||||||
location: null,
|
location: null,
|
||||||
contacts: null,
|
contacts: null,
|
||||||
ticket: null,
|
ticket_: null,
|
||||||
reciver: "",
|
reciver: "",
|
||||||
remark: [],
|
remark: [],
|
||||||
},
|
},
|
||||||
|
@ -201,13 +152,12 @@ export default {
|
||||||
mounted(){
|
mounted(){
|
||||||
let that = this;
|
let that = this;
|
||||||
that.getInit();
|
that.getInit();
|
||||||
this.getFileList();
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getInit() {
|
getInit() {
|
||||||
let that = this;
|
let that = this;
|
||||||
if(this.addForm.ticket!==null){
|
if(this.addForm.ticket_!==null){
|
||||||
this.$API.wf.ticket.ticketTransitions.req(this.addForm.ticket).then((res) => {
|
this.$API.wf.ticket_.ticketTransitions.req(this.addForm.ticket_).then((res) => {
|
||||||
that.transitions = res;
|
that.transitions = res;
|
||||||
})
|
})
|
||||||
}else{
|
}else{
|
||||||
|
@ -222,21 +172,12 @@ export default {
|
||||||
this.addForm = this.getDefaultForm();
|
this.addForm = this.getDefaultForm();
|
||||||
this.limitedVisible = true;
|
this.limitedVisible = true;
|
||||||
},
|
},
|
||||||
getFileList() {
|
|
||||||
this.$API.ofm.filerecord.list.req(this.query).then((res) => {
|
|
||||||
this.fileList = res.results;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
handleCancel() {
|
handleCancel() {
|
||||||
this.limitedVisible = false; // 关闭弹窗
|
this.limitedVisible = false; // 关闭弹窗
|
||||||
this.lending_type = ""; // 重置 lending_type
|
this.lending_type = ""; // 重置 lending_type
|
||||||
this.getDefaultForm()// 清空表单
|
this.getDefaultForm()// 清空表单
|
||||||
},
|
},
|
||||||
submitHandle() {
|
|
||||||
let that = this;
|
|
||||||
that.isSaving = true;
|
|
||||||
that.submit();
|
|
||||||
},
|
|
||||||
getDefaultForm(){
|
getDefaultForm(){
|
||||||
return {
|
return {
|
||||||
borrow_file: [],
|
borrow_file: [],
|
||||||
|
@ -244,108 +185,28 @@ export default {
|
||||||
counts: null,
|
counts: null,
|
||||||
location: null,
|
location: null,
|
||||||
contacts: null,
|
contacts: null,
|
||||||
|
ticket_:null,
|
||||||
reciver: "",
|
reciver: "",
|
||||||
remark: [],
|
remark: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async submit() {
|
|
||||||
let that = this;
|
|
||||||
let res = null;
|
|
||||||
try {
|
|
||||||
if (that.type === "add") {
|
|
||||||
res = await that.$API.ofm.borrow.create.req(that.addForm);
|
|
||||||
} else {
|
|
||||||
res = await that.$API.ofm.borrow.update.req(
|
|
||||||
that.editId,
|
|
||||||
that.addForm
|
|
||||||
);
|
|
||||||
}
|
|
||||||
that.isSaving = false;
|
|
||||||
that.limitedVisible = false;
|
|
||||||
that.$refs.table.refresh();
|
|
||||||
} catch (e) {
|
|
||||||
that.isSaving = false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
submitTicketCreate(id) {
|
|
||||||
let that = this;
|
|
||||||
if(that.type == "add") {
|
|
||||||
that.$API.ofm.borrow.create.req(that.addForm).then((res) => {
|
|
||||||
let ticket = {};
|
|
||||||
ticket.title = '档案借阅审批单';
|
|
||||||
ticket.workflow = that.initForm.workflow;
|
|
||||||
ticket.ticket_data = {t_id: res.id};
|
|
||||||
ticket.transition = id;
|
|
||||||
that.$API.wf.ticket.create.req(ticket).then((res) => {
|
|
||||||
that.isSaving = false;
|
|
||||||
that.limitedVisible = false;
|
|
||||||
that.$emit("success");
|
|
||||||
that.$refs.table.refresh();
|
|
||||||
that.$message.success("提交成功");
|
|
||||||
}).catch((e) => {
|
|
||||||
that.isSaving = false;
|
|
||||||
});
|
|
||||||
}).catch((e) => {
|
|
||||||
that.isSaving = false;
|
|
||||||
});
|
|
||||||
} else if (that.type == "edit") {
|
|
||||||
that.$API.ofm.borrow.update.req(that.addForm.id, that.addForm).then((res) => {
|
|
||||||
if (that.addForm.ticket == null) {
|
|
||||||
let ticket = {};
|
|
||||||
ticket.title = '档案借阅审批单';
|
|
||||||
ticket.workflow = that.initForm.workflow;
|
|
||||||
ticket.ticket_data = {t_id: res.id};
|
|
||||||
ticket.transition = id;
|
|
||||||
that.$API.wf.ticket.create.req(ticket).then((res) => {
|
|
||||||
that.isSaving = false;
|
|
||||||
that.limitedVisible = false;
|
|
||||||
that.$emit("success");
|
|
||||||
that.$message.success("提交成功");
|
|
||||||
that.$refs.table.refresh();
|
|
||||||
}).catch((e) => {
|
|
||||||
that.isSaving = false;
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
let data = {transition: id, ticket_data: {}}
|
|
||||||
that.$API.wf.ticket.ticketHandle.req(that.addForm.ticket, data).then(res=>{
|
|
||||||
that.isSaving = false;
|
|
||||||
that.limitedVisible = false;
|
|
||||||
that.$emit("success");
|
|
||||||
that.$message.success("提交成功");
|
|
||||||
that.$refs.table.refresh();
|
|
||||||
}).catch((e) => {
|
|
||||||
that.isSaving = false;
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}).catch((err) => {
|
|
||||||
that.isSaving = false;
|
|
||||||
return err;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 审批流结束之后才可以编辑
|
// 审批流结束之后才可以编辑
|
||||||
borrowEidt(row) {
|
borrowEidt(row) {
|
||||||
this.type = "edit";
|
this.type = "view";
|
||||||
this.editId = row.id;
|
this.editId = row.id;
|
||||||
this.limitedVisible = true;
|
this.limitedVisible = true;
|
||||||
if (!this.fileList || this.fileList.length === 0) {
|
|
||||||
this.getFileList();
|
|
||||||
}
|
|
||||||
this.addForm = Object.assign({}, row);
|
this.addForm = Object.assign({}, row);
|
||||||
if(row.file_detail){
|
|
||||||
this.addForm.borrow_file = row.file_detail.map(item => item.id);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async borrowDel(row) {
|
|
||||||
var id = row.id;
|
|
||||||
var res = await this.$API.ofm.borrow.delete.req(id);
|
|
||||||
if (res.err_msg) {
|
|
||||||
this.$message.error(res.err_msg);
|
|
||||||
} else {
|
|
||||||
this.$refs.table.refresh();
|
|
||||||
this.$message.success("删除成功");
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
// async borrowDel(row) {
|
||||||
|
// var id = row.id;
|
||||||
|
// var res = await this.$API.ofm.borrow.delete.req(id);
|
||||||
|
// if (res.err_msg) {
|
||||||
|
// this.$message.error(res.err_msg);
|
||||||
|
// } else {
|
||||||
|
// this.$refs.table.refresh();
|
||||||
|
// this.$message.success("删除成功");
|
||||||
|
// }
|
||||||
|
// },
|
||||||
//搜索
|
//搜索
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.$refs.table.queryData(this.query);
|
this.$refs.table.queryData(this.query);
|
||||||
|
|
|
@ -0,0 +1,185 @@
|
||||||
|
<template>
|
||||||
|
<el-container>
|
||||||
|
<el-main>
|
||||||
|
<el-form
|
||||||
|
:model="addForm"
|
||||||
|
:rules="rules"
|
||||||
|
ref="addForm"
|
||||||
|
label-width="100px"
|
||||||
|
label-position="left"
|
||||||
|
>
|
||||||
|
<el-form-item label="档案名称">
|
||||||
|
<el-select v-model="addForm.borrow_file" multiple placeholder="请选择档案" clearable style="width: 300px;">
|
||||||
|
<el-option
|
||||||
|
v-for="item in fileList"
|
||||||
|
:key="item.id"
|
||||||
|
:value="item.id"
|
||||||
|
:disabled="mode==='view'"
|
||||||
|
:label="item.name"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="申请人电话" prop="contacts">
|
||||||
|
<el-input v-model="addForm.contacts" clearable style="width: 300px;" :disabled="mode==='view'"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="借阅时间" prop="borrow_date">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="addForm.borrow_date"
|
||||||
|
type="date"
|
||||||
|
placeholder="选择日期时间"
|
||||||
|
align="right"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
:disabled="mode==='view'"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="归还时间" prop="return_date">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="addForm.return_date"
|
||||||
|
type="date"
|
||||||
|
placeholder="选择日期时间"
|
||||||
|
align="right"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
:disabled="mode==='view'"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="用途" prop="remark" :disabled="mode==='view'">
|
||||||
|
<el-checkbox-group v-model="addForm.remark">
|
||||||
|
<el-checkbox label="借阅"></el-checkbox>
|
||||||
|
<el-checkbox label="复印"></el-checkbox>
|
||||||
|
<el-checkbox label="查阅"></el-checkbox>
|
||||||
|
</el-checkbox-group>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
<el-footer v-show="mode!=='show'">
|
||||||
|
<ticketd_b_start
|
||||||
|
:workflow_key="'borrowrecord'"
|
||||||
|
:title="ticketTitle"
|
||||||
|
:t_id="addForm.id"
|
||||||
|
:ticket_="addForm.ticket_"
|
||||||
|
:submit_b_func="submit"
|
||||||
|
ref="ticketd_b_start"
|
||||||
|
@success="$emit('success')"
|
||||||
|
/>
|
||||||
|
<el-button @click="$emit('closed')">取消</el-button>
|
||||||
|
</el-footer>
|
||||||
|
</el-main>
|
||||||
|
<el-aside v-if="addForm.ticket">
|
||||||
|
<ticketd
|
||||||
|
:ticket_="addForm.ticket_"
|
||||||
|
@success="$emit('success')"
|
||||||
|
style="margin-top: 20px;"
|
||||||
|
/>
|
||||||
|
</el-aside>
|
||||||
|
</el-container>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import ticketd_b_start from "@/views/wf/ticketd_b_start.vue";
|
||||||
|
import ticketd from "@/views/wf/ticketd.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "index",
|
||||||
|
props: {
|
||||||
|
mode: {
|
||||||
|
type: String, default: "view"
|
||||||
|
},
|
||||||
|
modelValue: { type: Object, default: () => ({}) },
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
ticketd, ticketd_b_start
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
ticketTitle: "档案借阅",
|
||||||
|
addForm: {...this.modelValue},
|
||||||
|
query: {},
|
||||||
|
fileList: [],
|
||||||
|
rules: {
|
||||||
|
file_name: [
|
||||||
|
{ required: true, message: "请选择档案", trigger: "blur" },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted(){
|
||||||
|
this.getFileList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async submit() {
|
||||||
|
let that = this;
|
||||||
|
let res = null;
|
||||||
|
this.ticketTitle = `${this.addForm.file_name}-档案借阅`;
|
||||||
|
|
||||||
|
if (that.mode === "add") {
|
||||||
|
res = await that.$API.ofm.borrow.create.req(that.addForm);
|
||||||
|
that.addForm.id = res.id;
|
||||||
|
} else if (that.mode === "edit") {
|
||||||
|
res = await that.$API.ofm.borrow.update.req(
|
||||||
|
that.addForm.id,
|
||||||
|
that.addForm
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getFileList() {
|
||||||
|
this.$API.ofm.filerecord.list.req(this.query).then((res) => {
|
||||||
|
this.fileList = res.results;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.treeMain {
|
||||||
|
height: 280px;
|
||||||
|
overflow: auto;
|
||||||
|
border: 1px solid #dcdfe6;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar {
|
||||||
|
width: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar-track {
|
||||||
|
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.2);
|
||||||
|
background-color: #fefefe;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar-thumb {
|
||||||
|
border-radius: 5px;
|
||||||
|
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
}
|
||||||
|
.node rect {
|
||||||
|
stroke: #606266;
|
||||||
|
fill: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.edgePath path {
|
||||||
|
stroke: #606266;
|
||||||
|
fill: #333;
|
||||||
|
stroke-width: 1.5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
g.conditions > rect {
|
||||||
|
fill: #00ffd0;
|
||||||
|
stroke: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-icon-close {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.left-panel-group {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px; /* 按钮之间的间隙,可以调小点 */
|
||||||
|
margin-left: 0; /* 靠左 */
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
|
@ -167,7 +167,7 @@ export default {
|
||||||
mode: "add",
|
mode: "add",
|
||||||
drawerTitle: {
|
drawerTitle: {
|
||||||
add: "新增印章使用",
|
add: "新增印章使用",
|
||||||
edit: "编辑印章使用",
|
edit: "审批流",
|
||||||
view: "查看印章使用",
|
view: "查看印章使用",
|
||||||
},
|
},
|
||||||
currentRow: null,
|
currentRow: null,
|
||||||
|
@ -185,7 +185,7 @@ export default {
|
||||||
return_date: null,
|
return_date: null,
|
||||||
actual_return_date: null,
|
actual_return_date: null,
|
||||||
reason: "",
|
reason: "",
|
||||||
ticket:null
|
ticket_:null
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -198,8 +198,8 @@ export default {
|
||||||
//渲染工单提交按钮
|
//渲染工单提交按钮
|
||||||
getInit() {
|
getInit() {
|
||||||
let that = this;
|
let that = this;
|
||||||
if(this.addForm.ticket!==null){
|
if(this.addForm.ticket_!==null){
|
||||||
this.$API.wf.ticket.ticketTransitions.req(this.addForm.ticket).then((res) => {
|
this.$API.wf.ticket_.ticketTransitions.req(this.addForm.ticket_).then((res) => {
|
||||||
that.transitions = res;
|
that.transitions = res;
|
||||||
})
|
})
|
||||||
}else{
|
}else{
|
||||||
|
@ -242,12 +242,12 @@ export default {
|
||||||
return_date: null,
|
return_date: null,
|
||||||
actual_return_date: null,
|
actual_return_date: null,
|
||||||
reason: "",
|
reason: "",
|
||||||
ticket:null
|
ticket_:null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 审批流结束之后才可以编辑
|
// 审批流结束之后才可以编辑
|
||||||
sealEidt(row) {
|
sealEidt(row) {
|
||||||
this.mode = "edit";
|
this.mode = "view";
|
||||||
this.editId = row.id;
|
this.editId = row.id;
|
||||||
this.limitedVisible = true;
|
this.limitedVisible = true;
|
||||||
this.lending_type = 'outer';
|
this.lending_type = 'outer';
|
||||||
|
|
|
@ -1,104 +1,102 @@
|
||||||
<template>
|
<template>
|
||||||
<el-container>
|
<el-container>
|
||||||
<el-main>
|
<el-main>
|
||||||
<el-form :model="localForm" label-width="100px" label-position="left" :rules="rules">
|
<el-form :model="localForm" label-width="100px" label-position="left" :rules="rules">
|
||||||
<el-form-item label="文件名称" prop="filename">
|
<el-form-item label="文件名称" prop="filename">
|
||||||
<el-input v-model="localForm.filename" clearable></el-input>
|
<el-input v-model="localForm.filename" clearable :disabled="mode==='view'"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="联系电话" prop="contacts">
|
<el-form-item label="联系电话" prop="contacts">
|
||||||
<el-input v-model="localForm.contacts" clearable></el-input>
|
<el-input v-model="localForm.contacts" clearable :disabled="mode==='view'"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="印章类型">
|
<el-form-item label="印章类型">
|
||||||
<el-checkbox-group v-model="localForm.seal">
|
<el-checkbox-group v-model="localForm.seal" :disabled="mode==='view'">
|
||||||
<el-checkbox label="公章"></el-checkbox>
|
<el-checkbox label="公章"></el-checkbox>
|
||||||
<el-checkbox label="法人章"></el-checkbox>
|
<el-checkbox label="法人章"></el-checkbox>
|
||||||
<el-checkbox label="合同章"></el-checkbox>
|
<el-checkbox label="合同章"></el-checkbox>
|
||||||
<el-checkbox label="财务章"></el-checkbox>
|
<el-checkbox label="财务章"></el-checkbox>
|
||||||
<el-checkbox label="其他"></el-checkbox>
|
<el-checkbox label="其他"></el-checkbox>
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
<el-input
|
<el-input
|
||||||
v-if="localForm.seal.includes('其他')"
|
v-if="localForm.seal.includes('其他')"
|
||||||
v-model="localForm.seal_other"
|
v-model="localForm.seal_other"
|
||||||
placeholder = "请输入印章名称"
|
placeholder = "请输入印章名称"
|
||||||
size = "small"
|
size = "small"
|
||||||
style="margin-top: 10;"
|
style="margin-top: 10;"
|
||||||
></el-input>
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<template v-if="lending_type === 'outer'">
|
<template v-if="lending_type === 'outer'">
|
||||||
<el-form-item label="借用日期">
|
<el-form-item label="借用日期">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="timeRange"
|
v-model="timeRange"
|
||||||
type="daterange"
|
type="daterange"
|
||||||
|
align="right"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
unlink-panels
|
||||||
|
range-separator="至"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
:disabled="mode==='view'"
|
||||||
|
@change="handleDateChange">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="实际归还日期" v-auth="'seal.return'">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="localForm.actual_return_date"
|
||||||
|
type="date"
|
||||||
align="right"
|
align="right"
|
||||||
value-format="YYYY-MM-DD"
|
value-format="YYYY-MM-DD"
|
||||||
unlink-panels
|
unlink-panels
|
||||||
range-separator="至"
|
placeholder="选择日期"
|
||||||
start-placeholder="开始日期"
|
:disabled="mode==='view'"
|
||||||
end-placeholder="结束日期"
|
>
|
||||||
@change="handleDateChange">
|
</el-date-picker>
|
||||||
</el-date-picker>
|
</el-form-item>
|
||||||
</el-form-item>
|
<el-form-item label="借用理由" prop="reason" >
|
||||||
<el-form-item label="实际归还日期" v-auth="'seal.return'">
|
<el-input
|
||||||
<el-date-picker
|
type='textarea'
|
||||||
v-model="localForm.actual_return_date"
|
placeholder="请输入借用理由"
|
||||||
type="date"
|
v-model="localForm.reason"
|
||||||
align="right"
|
rows = '3'
|
||||||
value-format="YYYY-MM-DD"
|
:disabled="mode==='view'">
|
||||||
unlink-panels
|
</el-input>
|
||||||
placeholder="选择日期"
|
</el-form-item>
|
||||||
>
|
</template>
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="借用理由" prop="reason" >
|
|
||||||
<el-input
|
|
||||||
type='textarea'
|
|
||||||
placeholder="请输入借用理由"
|
|
||||||
v-model="localForm.reason"
|
|
||||||
rows = '3'>
|
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<el-form-item label="文件内容">
|
<el-form-item label="文件内容">
|
||||||
<sc-upload-file
|
<sc-upload-file
|
||||||
v-model="localForm.file"
|
v-model="localForm.file"
|
||||||
:multiple="false"
|
:multiple="false"
|
||||||
:limit="1"
|
:limit="1"
|
||||||
:accept="['.xlsx', '.xls','.pdf','.docx', '.doc', '.jpg', '.png', '.jpeg']"
|
:accept="['.xlsx', '.xls','.pdf','.docx', '.doc', '.jpg', '.png', '.jpeg']"
|
||||||
@success = "fileUPSuccess"
|
@success = "fileUPSuccess"
|
||||||
>
|
:disabled="mode==='view'"
|
||||||
<el-button type="primary" icon="el-icon-upload"> </el-button>
|
>
|
||||||
</sc-upload-file>
|
<el-button type="primary" icon="el-icon-upload"> </el-button>
|
||||||
</el-form-item>
|
</sc-upload-file>
|
||||||
<el-form-item label="用印份数" prop="file_count">
|
</el-form-item>
|
||||||
<el-input v-model="localForm.file_count" clearable></el-input>
|
<el-form-item label="用印份数" prop="file_count">
|
||||||
</el-form-item>
|
<el-input v-model="localForm.file_count" clearable :disabled="mode==='view'"></el-input>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item v-if="!isView">
|
</el-form>
|
||||||
<el-button type="primary" @click="onSubmit">保存</el-button>
|
|
||||||
<el-button @click="$emit('cancel')">取消</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
</el-form>
|
|
||||||
<el-footer v-show="mode!=='show'">
|
<el-footer v-show="mode!=='show'">
|
||||||
<ticketd_b_start
|
<ticketd_b_start
|
||||||
:workflow_key="'seal'"
|
:workflow_key="'seal'"
|
||||||
:title="ticketTitle"
|
:title="ticketTitle"
|
||||||
:t_id="localForm.id"
|
:t_id="localForm.id"
|
||||||
:ticketId="localForm.ticket"
|
:ticket_="localForm.ticket_"
|
||||||
:submit_b_func="submit_b_func"
|
:submit_b_func="submit_b_func"
|
||||||
ref="ticketd_b_start"
|
ref="ticketd_b_start"
|
||||||
@success="$emit('success')"
|
@success="$emit('success')"
|
||||||
/>
|
/>
|
||||||
<el-button @click="$emit('closed')">取消</el-button>
|
<el-button @click="$emit('closed')">取消</el-button>
|
||||||
</el-footer>
|
</el-footer>
|
||||||
</el-main>
|
</el-main>
|
||||||
<el-aside v-if="localForm.ticket">
|
<el-aside v-if="localForm.ticket">
|
||||||
<ticketd
|
<ticketd
|
||||||
:ticketId="localForm.ticket"
|
:ticket_="localForm.ticket_"
|
||||||
@success="$emit('success')"
|
@success="$emit('success')"
|
||||||
style="margin-top: 20px;"
|
style="margin-top: 20px;"
|
||||||
/>
|
/>
|
||||||
</el-aside>
|
</el-aside>
|
||||||
</el-container>
|
</el-container>
|
||||||
|
@ -113,7 +111,6 @@ export default {
|
||||||
lending_type: { type: String, default: "outer" }, // inner / outer
|
lending_type: { type: String, default: "outer" }, // inner / outer
|
||||||
modelValue: { type: Object, default: () => ({}) },
|
modelValue: { type: Object, default: () => ({}) },
|
||||||
},
|
},
|
||||||
|
|
||||||
components: {ticketd, ticketd_b_start },
|
components: {ticketd, ticketd_b_start },
|
||||||
emits: ["update:modelValue", "submit", "cancel"],
|
emits: ["update:modelValue", "submit", "cancel"],
|
||||||
data() {
|
data() {
|
||||||
|
@ -125,11 +122,6 @@ export default {
|
||||||
filename: [{ required: true, message: "请输入文件名称", trigger: "blur" }],
|
filename: [{ required: true, message: "请输入文件名称", trigger: "blur" }],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
isView() {
|
|
||||||
return this.mode === "view";
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.initTimeRange();
|
this.initTimeRange();
|
||||||
|
@ -149,12 +141,9 @@ export default {
|
||||||
this.$emit("update:modelValue", val);
|
this.$emit("update:modelValue", val);
|
||||||
},
|
},
|
||||||
deep: true,
|
deep: true,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onSubmit() {
|
|
||||||
this.$emit("submit", this.localForm);
|
|
||||||
},
|
|
||||||
handleDateChange(val) {
|
handleDateChange(val) {
|
||||||
this.localForm.lending_date = val?.[0] || null
|
this.localForm.lending_date = val?.[0] || null
|
||||||
this.localForm.return_date = val?.[1] || null
|
this.localForm.return_date = val?.[1] || null
|
||||||
|
|
|
@ -33,6 +33,13 @@
|
||||||
prop="reason"
|
prop="reason"
|
||||||
min-width="120">
|
min-width="120">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="市内用车" prop="is_city" mim-width="100">
|
||||||
|
<template #default="scope">
|
||||||
|
<span :style="{color: scope.row.is_city ? '#67C23A' : '#F56C6C'}">
|
||||||
|
{{ scope.row.is_city ? '是' : '否'}}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="出车时间"
|
label="出车时间"
|
||||||
prop="start_time"
|
prop="start_time"
|
||||||
|
@ -81,7 +88,7 @@
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="vehicleEidt(scope.row)"
|
@click="vehicleEidt(scope.row)"
|
||||||
v-auth="'vehicle.update'"
|
v-auth="'vehicle.update'"
|
||||||
>编辑
|
>详情
|
||||||
</el-button>
|
</el-button>
|
||||||
<!-- <el-popconfirm
|
<!-- <el-popconfirm
|
||||||
title="确定删除吗?"
|
title="确定删除吗?"
|
||||||
|
@ -102,79 +109,34 @@
|
||||||
</scTable>
|
</scTable>
|
||||||
</el-main>
|
</el-main>
|
||||||
</el-container>
|
</el-container>
|
||||||
<el-drawer :title="titleMap[type] " v-model="limitedVisible" direction="rtl" size="50%">
|
<el-drawer
|
||||||
<el-form
|
:title="drawerTitle[type]"
|
||||||
:model="addForm"
|
v-model="limitedVisible"
|
||||||
:rules="rules"
|
:destroy-on-close="true"
|
||||||
ref="addForm"
|
direction="rtl"
|
||||||
label-width="100px"
|
size="70%">
|
||||||
label-position="left"
|
<div style="display: flex; height: calc(100% - 60px);">
|
||||||
>
|
<div style="flex: 1; padding-right: 20px; overflow-y: auto;">
|
||||||
<el-form-item label="用车事由" prop="reason">
|
<VehicleForm
|
||||||
<el-input v-model="addForm.reason" clearable></el-input>
|
:mode="type"
|
||||||
</el-form-item>
|
v-model="addForm"
|
||||||
<el-form-item label="出发地点" prop="location">
|
:lending_type="lending_type"
|
||||||
<el-input v-model="addForm.location" clearable></el-input>
|
:transitions="transitions"
|
||||||
</el-form-item>
|
@success="()=>{handleQuery(); limitedVisible = false}"
|
||||||
<el-form-item label="途经地点" prop="via">
|
@closed="limitedVisible = false"
|
||||||
<el-input v-model="addForm.via" clearable></el-input>
|
@submit="saveVehicle"
|
||||||
</el-form-item>
|
/>
|
||||||
<el-form-item label="到达地点" prop="destination">
|
</div>
|
||||||
<el-input v-model="addForm.destination" clearable></el-input>
|
</div>
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="出发公里数" prop="start_km">
|
|
||||||
<el-input v-model="addForm.start_km" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="归还公里数" prop="end_km">
|
|
||||||
<el-input v-model="addForm.end_km" clearable></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="出车时间">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="addForm.start_time"
|
|
||||||
type="date"
|
|
||||||
align="right"
|
|
||||||
value-format="YYYY-MM-DD"
|
|
||||||
unlink-panels
|
|
||||||
placeholder="选择日期"
|
|
||||||
>
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="还车时间" v-auth="'vehicle.return'">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="addForm.end_time"
|
|
||||||
type="date"
|
|
||||||
align="right"
|
|
||||||
value-format="YYYY-MM-DD"
|
|
||||||
unlink-panels
|
|
||||||
placeholder="选择日期"
|
|
||||||
>
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<template #footer>
|
|
||||||
<el-button
|
|
||||||
v-for="item in transitions"
|
|
||||||
:key="item.id"
|
|
||||||
type="primary"
|
|
||||||
:loading="isSaving"
|
|
||||||
:disabled="isSaving"
|
|
||||||
@click="submitTicketCreate(item.id)"
|
|
||||||
style="margin-right: 4px"
|
|
||||||
>{{ item.name }}</el-button>
|
|
||||||
<el-button @click="handleCancel">取 消</el-button>
|
|
||||||
<el-button
|
|
||||||
v-auth="'vehicle.return'"
|
|
||||||
v-if="type !== 'show'"
|
|
||||||
type="primary"
|
|
||||||
:loading="isSaving"
|
|
||||||
@click="submitHandle()"
|
|
||||||
> 保 存</el-button
|
|
||||||
>
|
|
||||||
</template>
|
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
import VehicleForm from "./vehicleForm.vue";
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
VehicleForm
|
||||||
|
},
|
||||||
name: "index",
|
name: "index",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -183,8 +145,12 @@ export default {
|
||||||
apiObj: this.$API.ofm.vehicle.list,
|
apiObj: this.$API.ofm.vehicle.list,
|
||||||
selection: [],
|
selection: [],
|
||||||
checkList: [],
|
checkList: [],
|
||||||
fileList: [],
|
|
||||||
transitions:[],
|
transitions:[],
|
||||||
|
drawerTitle: {
|
||||||
|
add: "新增车辆使用",
|
||||||
|
edit: "编辑车辆使用",
|
||||||
|
view: "查看车辆使用",
|
||||||
|
},
|
||||||
timeRange: [],
|
timeRange: [],
|
||||||
lending_type: "",
|
lending_type: "",
|
||||||
choiceOption: [],
|
choiceOption: [],
|
||||||
|
@ -194,11 +160,6 @@ export default {
|
||||||
limitedVisible: false,
|
limitedVisible: false,
|
||||||
limitedWatch: false,
|
limitedWatch: false,
|
||||||
type: "add",
|
type: "add",
|
||||||
titleMap: {
|
|
||||||
add: "新增",
|
|
||||||
edit: "编辑",
|
|
||||||
show: "查看",
|
|
||||||
},
|
|
||||||
//表单数据
|
//表单数据
|
||||||
addForm: {
|
addForm: {
|
||||||
start_time: null,
|
start_time: null,
|
||||||
|
@ -206,11 +167,11 @@ export default {
|
||||||
location: null,
|
location: null,
|
||||||
via: null,
|
via: null,
|
||||||
destination: null,
|
destination: null,
|
||||||
start_km: "",
|
start_km: null,
|
||||||
end_km: "",
|
end_km: null,
|
||||||
is_city: true,
|
is_city: true,
|
||||||
reason: null,
|
reason: null,
|
||||||
ticket:null
|
ticket_:null
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -219,99 +180,29 @@ export default {
|
||||||
that.getInit();
|
that.getInit();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//添加工作流
|
|
||||||
//渲染工单提交按钮
|
|
||||||
getInit() {
|
getInit() {
|
||||||
let that = this;
|
let that = this;
|
||||||
if(this.addForm.ticket!==null){
|
if(this.addForm.ticket_!==null){
|
||||||
this.$API.wf.ticket.ticketTransitions.req(this.addForm.ticket).then((res) => {
|
this.$API.wf.ticket_.ticketTransitions.req(this.addForm.ticket_).then((res) => {
|
||||||
that.transitions = res;
|
that.transitions = res;
|
||||||
})
|
})
|
||||||
}else{
|
}else{
|
||||||
that.$API.wf.workflow.initkey.req("vehicle").then((res) => {
|
that.$API.wf.workflow.initkey.req("vehicle").then((res) => {
|
||||||
that.initForm = res;
|
that.initForm = res;
|
||||||
that.transitions = res.transitions;
|
that.transitions = res.transitions;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.type = "add";
|
this.type = "add";
|
||||||
this.addForm = this.getDefaultForm();
|
this.addForm = this.getDefaultForm();
|
||||||
this.limitedVisible = true;
|
this.limitedVisible = true;
|
||||||
},
|
},
|
||||||
handleAdd_outer() {
|
|
||||||
this.addForm = this.getDefaultForm();
|
|
||||||
this.type = "add";
|
|
||||||
this.limitedVisible = true;
|
|
||||||
this.lending_type = "outer";
|
|
||||||
this.addForm.is_lending = true;
|
|
||||||
},
|
|
||||||
handleCancel() {
|
handleCancel() {
|
||||||
this.limitedVisible = false; // 关闭弹窗
|
this.limitedVisible = false; // 关闭弹窗
|
||||||
this.lending_type = ""; // 重置 lending_type
|
this.lending_type = ""; // 重置 lending_type
|
||||||
this.getDefaultForm()// 清空表单
|
this.getDefaultForm()// 清空表单
|
||||||
},
|
},
|
||||||
submitTicketCreate(id) {
|
|
||||||
let that = this;
|
|
||||||
if(that.type == "add") {
|
|
||||||
that.$API.ofm.vehicle.create.req(that.addForm).then((res) => {
|
|
||||||
let ticket = {};
|
|
||||||
ticket.title = '车辆使用审批单';
|
|
||||||
ticket.workflow = that.initForm.workflow;
|
|
||||||
ticket.ticket_data = {t_id: res.id};
|
|
||||||
ticket.transition = id;
|
|
||||||
that.$API.wf.ticket.create.req(ticket).then((res) => {
|
|
||||||
that.isSaving = false;
|
|
||||||
that.limitedVisible = false;
|
|
||||||
that.$emit("success");
|
|
||||||
that.$refs.table.refresh();
|
|
||||||
that.$message.success("提交成功");
|
|
||||||
}).catch((e) => {
|
|
||||||
that.isSaving = false;
|
|
||||||
});
|
|
||||||
}).catch((e) => {
|
|
||||||
that.isSaving = false;
|
|
||||||
});
|
|
||||||
} else if (that.type == "edit") {
|
|
||||||
that.$API.ofm.vehicle.update.req(that.addForm.id, that.addForm).then((res) => {
|
|
||||||
if (that.addForm.ticket == null) {
|
|
||||||
let ticket = {};
|
|
||||||
ticket.title = '车辆使用审批单';
|
|
||||||
ticket.workflow = that.initForm.workflow;
|
|
||||||
ticket.ticket_data = {t_id: res.id};
|
|
||||||
ticket.transition = id;
|
|
||||||
that.$API.wf.ticket.create.req(ticket).then((res) => {
|
|
||||||
that.isSaving = false;
|
|
||||||
that.limitedVisible = false;
|
|
||||||
that.$emit("success");
|
|
||||||
that.$message.success("提交成功");
|
|
||||||
that.$refs.table.refresh();
|
|
||||||
}).catch((e) => {
|
|
||||||
that.isSaving = false;
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
let data = {transition: id, ticket_data: {}}
|
|
||||||
that.$API.wf.ticket.ticketHandle.req(that.addForm.ticket, data).then(res=>{
|
|
||||||
that.isSaving = false;
|
|
||||||
that.limitedVisible = false;
|
|
||||||
that.$emit("success");
|
|
||||||
that.$message.success("提交成功");
|
|
||||||
that.$refs.table.refresh();
|
|
||||||
}).catch((e) => {
|
|
||||||
that.isSaving = false;
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}).catch((err) => {
|
|
||||||
that.isSaving = false;
|
|
||||||
return err;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
submitHandle() {
|
|
||||||
let that = this;
|
|
||||||
that.isSaving = true;
|
|
||||||
that.submit();
|
|
||||||
},
|
|
||||||
getDefaultForm(){
|
getDefaultForm(){
|
||||||
return {
|
return {
|
||||||
start_time: null,
|
start_time: null,
|
||||||
|
@ -319,39 +210,35 @@ export default {
|
||||||
location: null,
|
location: null,
|
||||||
via: null,
|
via: null,
|
||||||
destination: null,
|
destination: null,
|
||||||
start_km: "",
|
start_km: null,
|
||||||
end_km: "",
|
end_km: null,
|
||||||
is_city: true,
|
is_city: true,
|
||||||
reason: null,
|
reason: null,
|
||||||
ticket:null
|
ticket_:null
|
||||||
}
|
|
||||||
},
|
|
||||||
async submit() {
|
|
||||||
let that = this;
|
|
||||||
let res = null;
|
|
||||||
try {
|
|
||||||
if (that.type === "add") {
|
|
||||||
res = await that.$API.ofm.vehicle.create.req(that.addForm);
|
|
||||||
} else {
|
|
||||||
res = await that.$API.ofm.vehicle.update.req(
|
|
||||||
that.editId,
|
|
||||||
that.addForm
|
|
||||||
);
|
|
||||||
}
|
|
||||||
that.isSaving = false;
|
|
||||||
that.limitedVisible = false;
|
|
||||||
that.$refs.table.refresh();
|
|
||||||
} catch (e) {
|
|
||||||
that.isSaving = false;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 审批流结束之后才可以编辑
|
// 审批流结束之后才可以编辑
|
||||||
vehicleEidt(row) {
|
vehicleEidt(row) {
|
||||||
this.type = "edit";
|
this.type = "view";
|
||||||
this.editId = row.id;
|
this.editId = row.id;
|
||||||
this.limitedVisible = true;
|
this.limitedVisible = true;
|
||||||
this.addForm = Object.assign({}, row);
|
this.addForm = Object.assign({}, row);
|
||||||
},
|
},
|
||||||
|
// 更新审批流
|
||||||
|
saveVehicle() {
|
||||||
|
this.isSaving = true;
|
||||||
|
this.$API.ofm.vehicle.update.req(this.addForm.id, this.addForm).then((res) => {
|
||||||
|
this.isSaving = false;
|
||||||
|
if (res.err_code) {
|
||||||
|
this.$message.error(res.err_msg);
|
||||||
|
} else {
|
||||||
|
this.$message.success("更新成功");
|
||||||
|
this.limitedVisible = false;
|
||||||
|
this.$refs.table.refresh();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
async vehicleDel(row) {
|
async vehicleDel(row) {
|
||||||
var id = row.id;
|
var id = row.id;
|
||||||
var res = await this.$API.ofm.vehicle.delete.req(id);
|
var res = await this.$API.ofm.vehicle.delete.req(id);
|
||||||
|
@ -366,7 +253,6 @@ export default {
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.$refs.table.queryData(this.query);
|
this.$refs.table.queryData(this.query);
|
||||||
},
|
},
|
||||||
},
|
|
||||||
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -0,0 +1,152 @@
|
||||||
|
<template>
|
||||||
|
<el-container>
|
||||||
|
<el-main>
|
||||||
|
<el-form
|
||||||
|
:model="addForm"
|
||||||
|
:rules="rules"
|
||||||
|
ref="addForm"
|
||||||
|
label-width="100px"
|
||||||
|
label-position="left"
|
||||||
|
>
|
||||||
|
<el-form-item label="用车事由" prop="reason">
|
||||||
|
<el-input v-model="addForm.reason" clearable :disabled="mode==='view'"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="用车范围" prop="is_city">
|
||||||
|
<el-select v-model="addForm.is_city" placeholder="请选择" :disabled="mode==='view'">
|
||||||
|
<el-option
|
||||||
|
v-for="item in vehicle_scope"
|
||||||
|
:key="item.is_city"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.is_city"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="出发地点" prop="location">
|
||||||
|
<el-input v-model="addForm.location" clearable :disabled="mode==='view'"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="途经地点" prop="via">
|
||||||
|
<el-input v-model="addForm.via" clearable :disabled="mode==='view'"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="到达地点" prop="destination">
|
||||||
|
<el-input v-model="addForm.destination" clearable :disabled="mode==='view'"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="出发公里数" prop="start_km">
|
||||||
|
<el-input-number v-model="addForm.start_km" clearable :disabled="mode==='view'"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="归还公里数" prop="end_km">
|
||||||
|
<el-input-number v-model="addForm.end_km" clearable></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="出车时间">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="addForm.start_time"
|
||||||
|
type="date"
|
||||||
|
align="right"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
unlink-panels
|
||||||
|
placeholder="选择日期"
|
||||||
|
:disabled="mode==='view'"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="还车时间" v-auth="'vehicle.return'">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="addForm.end_time"
|
||||||
|
type="date"
|
||||||
|
align="right"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
unlink-panels
|
||||||
|
placeholder="选择日期"
|
||||||
|
:disabled="mode==='view'"
|
||||||
|
>
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<el-footer v-show="mode!=='show'">
|
||||||
|
<ticketd_b_start
|
||||||
|
:workflow_key="'vehicle'"
|
||||||
|
:title="ticketTitle"
|
||||||
|
:t_id="addForm.id"
|
||||||
|
:ticket_="addForm.ticket_"
|
||||||
|
:submit_b_func="submit_b_func"
|
||||||
|
:ticket_data="ticket_data"
|
||||||
|
ref="ticketd_b_start"
|
||||||
|
@success="$emit('success')"
|
||||||
|
@colsed="$emit('closed')"
|
||||||
|
/>
|
||||||
|
<el-button type='primary' @click="$emit('submit')">保存</el-button>
|
||||||
|
</el-footer>
|
||||||
|
</el-main>
|
||||||
|
<el-aside v-if="addForm.ticket_">
|
||||||
|
<ticketd
|
||||||
|
:ticket_="addForm.ticket_"
|
||||||
|
:ticket_data="ticket_data"
|
||||||
|
@success="$emit('success')"
|
||||||
|
style="margin-top: 20px;"
|
||||||
|
/>
|
||||||
|
</el-aside>
|
||||||
|
</el-container>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import ticketd_b_start from "@/views/wf/ticketd_b_start.vue";
|
||||||
|
import ticketd from '@/views/wf/ticketd.vue'
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
mode: { type: String, default: "view" }, // add / edit / view
|
||||||
|
lending_type: { type: String, default: "outer" }, // inner / outer
|
||||||
|
modelValue: { type: Object, default: () => ({}) },
|
||||||
|
transitions: { type: Array, default: () => [] },
|
||||||
|
},
|
||||||
|
components: {ticketd, ticketd_b_start},
|
||||||
|
emits: ["update:modelValue", "submit", "cancel"],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
addForm: { ...this.modelValue },
|
||||||
|
ticketTitle: "用车申请",
|
||||||
|
ticket_data: {},
|
||||||
|
rules:{
|
||||||
|
filename: [{ required: true, message: "请输入文件名称", trigger: "blur" }],
|
||||||
|
},
|
||||||
|
workflow_key: "vehicle_in",
|
||||||
|
vehicle_scope:[{name: '市内', is_city: true},{name: '市外', is_city: false}],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// mounted() {
|
||||||
|
// console.log(this.transitions)
|
||||||
|
// },
|
||||||
|
watch: {
|
||||||
|
// 父组件数据变动 -> 同步到本地
|
||||||
|
modelValue: {
|
||||||
|
handler(val) {
|
||||||
|
this.addForm = { ...val };
|
||||||
|
},
|
||||||
|
deep: true,
|
||||||
|
},
|
||||||
|
// 本地数据变动 -> 同步回父组件
|
||||||
|
addForm: {
|
||||||
|
handler(val) {
|
||||||
|
this.$emit("update:modelValue", val);
|
||||||
|
},
|
||||||
|
deep: true,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async submit_b_func() {
|
||||||
|
let that = this;
|
||||||
|
if (this.addForm.is_city === true){
|
||||||
|
that.workflow_key = "vehicle"
|
||||||
|
}else{
|
||||||
|
that.workflow_key = "vehicle_out"
|
||||||
|
}
|
||||||
|
this.ticketTitle = `${this.addForm.reason}-用车申请`
|
||||||
|
if(that.mode == "add") {
|
||||||
|
let res = await that.$API.ofm.vehicle.create.req(that.addForm);
|
||||||
|
that.addForm.id = res.id;
|
||||||
|
} else if (that.mode == "edit") {
|
||||||
|
console.log(that.transitions)
|
||||||
|
await that.$API.ofm.vehicle.update.req(that.addForm.id, that.addForm);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
Loading…
Reference in New Issue