This commit is contained in:
caoqianming 2025-10-16 16:31:16 +08:00
commit 20adbc9377
9 changed files with 224 additions and 389 deletions

View File

@ -61,6 +61,16 @@
prop="return_date"
min-width="100"
></el-table-column>
<el-table-column label="所在节点" min-width="60">
<template #default="scope">
{{scope.row.ticket_.state_.name}}
</template>
</el-table-column>
<el-table-column label="进行状态" min-width="60">
<template #default="scope">
{{statusOptions[scope.row.ticket_.state_.type]}}
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="250">
<template #default="scope">
<el-button
@ -135,6 +145,11 @@ export default {
edit: "编辑",
show: "查看",
},
statusOptions:{
0: "审批中",
1: "初始中",
2: "已完成",
},
//
addForm: {
borrow_file: [],

View File

@ -14,12 +14,12 @@
v-for="item in fileList"
:key="item.id"
:value="item.id"
:disabled="mode==='view'"
:disabled="localMode ==='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-input v-model="addForm.contacts" clearable style="width: 300px;" :disabled="localMode ==='view'"></el-input>
</el-form-item>
<el-form-item label="借阅时间" prop="borrow_date">
<el-date-picker
@ -28,7 +28,7 @@
placeholder="选择日期时间"
align="right"
value-format="YYYY-MM-DD"
:disabled="mode==='view'"
:disabled="localMode ==='view'"
>
</el-date-picker>
</el-form-item>
@ -42,7 +42,7 @@
>
</el-date-picker>
</el-form-item>
<el-form-item label="用途" prop="remark" :disabled="mode==='view'">
<el-form-item label="用途" prop="remark" :disabled="localMode ==='view'">
<el-checkbox-group v-model="addForm.remark">
<el-checkbox label="借阅"></el-checkbox>
<el-checkbox label="复印"></el-checkbox>
@ -64,7 +64,7 @@
/>
</el-footer>
</el-main>
<el-aside v-if="addForm.ticket">
<el-aside v-if="addForm.ticket_">
<ticketd
:ticket_="addForm.ticket_"
:ticket_data="ticket_data"
@ -87,14 +87,25 @@ export default {
type: String, default: "view"
},
modelValue: { type: Object, default: () => ({}) },
t_id: {
type: String,
default: null
},
},
components: {
ticketd, ticketd_b_start
},
data() {
return {
ticketTitle: "档案借阅",
addForm: {...this.modelValue},
addForm: {
ticket_: {
state_: { type: '' }
},
borrow_file: [],
...this.modelValue },
localMode : this.mode,
query: {},
fileList: [],
ticket_data: {},
@ -106,22 +117,16 @@ export default {
};
},
mounted(){
this.getFileList();
this.getFileList().then(() => {
console.log('fileList:', this.fileList)
console.log('addForm.borrow_file:', this.addForm.borrow_file)
});
if (this.addForm.ticket_?.state_.type===1){
this.localMode = 'edit'
};
this.getTid();
},
watch: {
modelValue: {
handler(val) {
this.addForm = { ...val };
},
deep: true,
},
// ->
addForm: {
handler(val) {
this.$emit("update:modelValue", val);
},
deep: true,
},
addForm: {
handler(val){
Object.assign(this.ticket_data,{
@ -136,22 +141,36 @@ export default {
let that = this;
let res = null;
if (that.mode === "add") {
if (that.localMode === "add") {
res = await that.$API.ofm.borrow.create.req(that.addForm);
that.addForm.id = res.id;
} else if (that.mode === "edit") {
} else if (that.localMode === "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) => {
getFileList() {
return this.$API.ofm.filerecord.list.req(this.query).then((res) => {
this.fileList = res.results;
console.log('----111---',this.fileList);
});
},
},
getTid (){
var that = this;
if (that.t_id) {
that.$API.ofm.borrow.item.req(that.t_id).then(res=>{
that.form = res;
if(res.ticket_.state_.type == 1 && res.create_by == that.$TOOL.data.get("USER_INFO").id ) {
that.localMode = "edit";
}else{
that.localMode = "show";
}
})
}
},
},
};
</script>

View File

@ -1,313 +0,0 @@
<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>

View File

@ -68,6 +68,16 @@
prop="dept_opinion_review"
min-width="100"
></el-table-column>
<el-table-column label="所在节点" min-width="60">
<template #default="scope">
{{scope.row.ticket_.state_.name}}
</template>
</el-table-column>
<el-table-column label="进行状态" min-width="60">
<template #default="scope">
{{statusOptions[scope.row.ticket_.state_.type]}}
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="250">
<template #default="scope">
<el-button
@ -137,6 +147,11 @@ export default {
edit: "编辑",
show: "查看",
},
statusOptions:{
0: "审批中",
1: "初始中",
2: "已完成",
},
//
addForm: {
number: null,

View File

@ -9,35 +9,35 @@
label-position="left"
>
<el-form-item label="送审稿件标题" prop="title">
<el-input v-model="addForm.title" clearable :disabled="mode==='view'"></el-input>
<el-input v-model="addForm.title" clearable :disabled="localMode ==='view'"></el-input>
</el-form-item>
<el-form-item label="文件内容">
<sc-upload-file
v-model="addForm.pfile"
:multiple="false"
:limit="1"
:disabled="mode==='view'"
:disabled="localMode ==='view'"
:accept="['.xlsx', '.xls','.pdf','.docx', '.doc', '.jpg', '.png', '.jpeg']"
@success = "fileUPSuccess"
>
<el-button type="primary" icon="el-icon-upload" :disabled="mode==='view'"> </el-button>
<el-button type="primary" icon="el-icon-upload" :disabled="localMode ==='view'"> </el-button>
</sc-upload-file>
</el-form-item>
<el-form-item label="所有撰稿人" prop="participants">
<el-input v-model="addForm.participants" clearable :disabled="mode==='view'"></el-input>
<el-input v-model="addForm.participants" clearable :disabled="localMode ==='view'"></el-input>
</el-form-item>
<el-form-item label="部室/研究院" prop="pub_dept">
<el-input v-model="addForm.pub_dept" clearable :disabled="mode==='view'"></el-input>
<el-input v-model="addForm.pub_dept" clearable :disabled="localMode ==='view'"></el-input>
</el-form-item>
<el-form-item label="第一撰稿人涉密等级" prop="level">
<el-radio-group v-model="addForm.level" :disabled="mode==='view'">
<el-radio-group v-model="addForm.level" :disabled="localMode ==='view'">
<el-radio label="重要"></el-radio>
<el-radio label="一般"></el-radio>
<el-radio label="非涉密"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="稿件内容涉及" prop="content">
<el-checkbox-group v-model="addForm.content" :disabled="mode==='view'">
<el-checkbox-group v-model="addForm.content" :disabled="localMode ==='view'">
<el-checkbox label="武器装备科研生产综合事项"></el-checkbox>
<el-checkbox label="其他"></el-checkbox>
</el-checkbox-group>
@ -47,14 +47,14 @@
placeholder = "请输入名称"
size = "small"
style="margin-top: 10;"
:disabled="mode==='view'"
:disabled="localMode ==='view'"
></el-input>
</el-form-item>
<el-form-item label="宣传报道目的" prop="report_purpose">
<el-input v-model="addForm.report_purpose" clearable :disabled="mode==='view'"></el-input>
<el-input v-model="addForm.report_purpose" clearable :disabled="localMode ==='view'"></el-input>
</el-form-item>
<el-form-item label="宣传渠道" prop="channel">
<el-checkbox-group v-model="addForm.channel" :disabled="mode==='view'">
<el-checkbox-group v-model="addForm.channel" :disabled="localMode ==='view'">
<el-checkbox label="互联网"></el-checkbox>
<el-checkbox label="信息平台"></el-checkbox>
<el-checkbox label="官微"></el-checkbox>
@ -67,11 +67,11 @@
placeholder = "请输入渠道名称"
size = "small"
style="margin-top: 10;"
:disabled="mode==='view'"
:disabled="localMode ==='view'"
></el-input>
</el-form-item>
<el-form-item label="第一撰稿人自审" prop="review">
<el-radio-group v-model="addForm.review" :disabled="mode==='view'">
<el-radio-group v-model="addForm.review" :disabled="localMode ==='view'">
<el-radio label="内容不涉及国家秘密和商业秘密,申请公开"></el-radio>
<el-radio label="内容不涉及国家秘密、但涉及商业秘密,申请受控公开"></el-radio>
<el-radio label="内容涉及国家秘密,申请按涉密渠道发布"></el-radio>
@ -172,6 +172,7 @@ export default {
return {
ticketTitle: "宣传报道",
ticket_data: {},
localMode : this.mode,
rules: {
file_name: [
{ required: true, message: "请选择档案", trigger: "blur" },
@ -189,21 +190,39 @@ export default {
},
},
},
mounted() {
this.getTid();
if (this.addForm.ticket_?.state_.type===1){
this.localMode = 'edit'
}
},
methods: {
async submit_b_func() {
let that = this;
let res = null;
if (that.mode === "add") {
if (that.localMode === "add") {
res = await that.$API.ofm.publicity.create.req(that.addForm);
that.addForm.id = res.id;
} else if (that.mode === "edit"){
} else if (that.localMode === "edit"){
res = await that.$API.ofm.publicity.update.req(
that.addForm.id,
that.addForm
);
}
},
getTid (){
var that = this;
if (that.t_id) {
that.$API.ofm.publicity.item.req(that.t_id).then(res=>{
that.form = res;
if(res.ticket_.state_.type == 1 && res.create_by == that.$TOOL.data.get("USER_INFO").id ) {
that.localMode = "edit";
}else{
that.localMode = "show";
}
})
}
},
},
};

View File

@ -35,12 +35,12 @@
<el-table-column
label="用印时间"
prop="create_time"
min-width="100"
min-width="60"
></el-table-column>
<el-table-column
label="用印类别"
prop="seal"
min-width="100"
min-width="60"
></el-table-column>
<el-table-column
label="文件(资料)名称"
@ -50,47 +50,57 @@
<el-table-column
label="份数"
prop="file_count"
min-width="100"
min-width="60"
></el-table-column>
<el-table-column
label="印章部门"
prop="belong_dept_name"
min-width="100"
min-width="60"
></el-table-column>
<el-table-column
label="用印人"
prop="create_by_name"
min-width="100"
min-width="60"
></el-table-column>
<el-table-column
label="借出时间"
prop="lending_date"
min-width="100"
min-width="60"
></el-table-column>
<el-table-column
label="拟归还时间"
prop="return_date"
min-width="100"
min-width="60"
></el-table-column>
<el-table-column
label="实际归还时间"
prop="actual_return_date"
min-width="100"
min-width="60"
></el-table-column>
<el-table-column
label="是否借出"
prop="is_lending"
min-width="100"
min-width="60"
>
<template #default="scope">
<span v-if="scope.row.is_lending" style="color: red;"></span>
<span v-else></span>
</template>
</el-table-column>
<el-table-column label="所在节点" min-width="60">
<template #default="scope">
{{scope.row.ticket_.state_.name}}
</template>
</el-table-column>
<el-table-column label="进行状态" min-width="60">
<template #default="scope">
{{statusOptions[scope.row.ticket_.state_.type]}}
</template>
</el-table-column>
<el-table-column
label="备注"
prop="reason"
min-width="100"
min-width="60"
></el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="250">
<template #default="scope">
@ -144,8 +154,6 @@
<script>
import SealForm from "./sealForm.vue";
export default {
components: { SealForm},
name: "index",
@ -170,6 +178,11 @@ export default {
edit: "审批流",
view: "查看印章使用",
},
statusOptions:{
0: "审批中",
1: "初始中",
2: "已完成",
},
currentRow: null,
//
addForm: {

View File

@ -3,14 +3,14 @@
<el-main>
<el-form :model="localForm" label-width="100px" label-position="left" :rules="rules">
<el-form-item label="文件名称" prop="filename">
<el-input v-model="localForm.filename" clearable :disabled="mode==='view'"></el-input>
<el-input v-model="localForm.filename" clearable :disabled="localMode ==='view'"></el-input>
</el-form-item>
<el-form-item label="联系电话" prop="contacts">
<el-input v-model="localForm.contacts" clearable :disabled="mode==='view'"></el-input>
<el-input v-model="localForm.contacts" clearable :disabled="localMode ==='view'"></el-input>
</el-form-item>
<el-form-item label="印章类型">
<el-checkbox-group v-model="localForm.seal" :disabled="mode==='view'">
<el-checkbox-group v-model="localForm.seal" :disabled="localMode ==='view'">
<el-checkbox label="公章"></el-checkbox>
<el-checkbox label="法人章"></el-checkbox>
<el-checkbox label="合同章"></el-checkbox>
@ -36,7 +36,7 @@
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:disabled="mode==='view'"
:disabled="localMode ==='view'"
@change="handleDateChange">
</el-date-picker>
</el-form-item>
@ -57,7 +57,7 @@
placeholder="请输入借用理由"
v-model="localForm.reason"
rows = '3'
:disabled="mode==='view'">
:disabled="localMode ==='view'">
</el-input>
</el-form-item>
</template>
@ -69,7 +69,7 @@
:limit="1"
:accept="['.xlsx', '.xls','.pdf','.docx', '.doc', '.jpg', '.png', '.jpeg']"
@success = "fileUPSuccess"
:disabled="mode==='view'"
:disabled="localMode ==='view'"
>
<el-button type="primary" icon="el-icon-upload"> </el-button>
</sc-upload-file>
@ -80,10 +80,10 @@
:min="0"
:step="1"
controls-position="right"
:disabled="mode==='view'"></el-input-number>
:disabled="localMode ==='view'"></el-input-number>
</el-form-item>
</el-form>
<el-footer v-show="mode!=='show'">
<el-footer v-show="localMode!=='show'">
<ticketd_b_start
:workflow_key="'seal'"
:title="ticketTitle"
@ -94,10 +94,9 @@
ref="ticketd_b_start"
@success="$emit('success')"
/>
<el-button @click="$emit('closed')">取消</el-button>
</el-footer>
</el-main>
<el-aside v-if="localForm.ticket">
<el-aside v-if="localForm.ticket_">
<ticketd
:ticket_="localForm.ticket_"
:ticket_data="ticket_data"
@ -116,6 +115,10 @@ export default {
mode: { type: String, default: "view" }, // add / edit / view
lending_type: { type: String, default: "outer" }, // inner / outer
modelValue: { type: Object, default: () => ({}) },
t_id: {
type: String,
default: null
},
},
components: {ticketd, ticketd_b_start },
emits: ["update:modelValue", "submit", "cancel"],
@ -123,7 +126,12 @@ export default {
return {
ticket_data: {},
ticketTitle: "用印申请",
localForm: { ...this.modelValue },
localForm: {
ticket_: {
state_: { type: '' }
},
...this.modelValue },
localMode : this.mode,
timeRange: [],
rules: {
filename: [{ required: true, message: "请输入文件名称", trigger: "blur" }],
@ -131,7 +139,11 @@ export default {
};
},
mounted() {
this.getTid();
this.initTimeRange();
if (this.localForm.ticket_?.state_.type===1){
this.localMode = 'edit'
}
if(this.lending_type === 'outer'){
this.ticket_data = {
is_lending: true
@ -143,7 +155,6 @@ export default {
watch: {
'localForm.actual_return_date'(val) {
this.ticket_data.actual_return_date = val
console.log('ticket_data发生变化',this.ticket_data)
},
},
computed: {
@ -165,14 +176,27 @@ export default {
async submit_b_func() {
let that = this;
this.ticketTitle = `${this.localForm.filename}-用印申请`
if(that.mode == "add") {
if(that.localMode == "add") {
let res = await that.$API.ofm.lendingseal.create.req(that.localForm);
that.localForm.id = res.id;
} else if (that.mode == "edit") {
} else if (that.localMode == "edit") {
await that.$API.ofm.lendingseal.update.req(that.localForm.id, that.localForm);
}
},
getTid (){
var that = this;
if (that.t_id) {
that.$API.ofm.lendingseal.item.req(that.t_id).then(res=>{
that.form = res;
if(res.ticket_.state_.type == 1 && res.create_by == that.$TOOL.data.get("USER_INFO").id ) {
that.localMode = "edit";
}else{
that.localMode = "show";
}
})
}
},
initTimeRange() {
if (this.localForm.lending_date && this.localForm.return_date) {
this.timeRange = [

View File

@ -80,6 +80,16 @@
prop="actual_km"
min-width="100"
></el-table-column>
<el-table-column label="所在节点" min-width="60">
<template #default="scope">
{{scope.row.ticket_.state_.name}}
</template>
</el-table-column>
<el-table-column label="所在节点" min-width="60">
<template #default="scope">
{{statusOptions[scope.row.ticket_.state_.type]}}
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="250">
<template #default="scope">
<el-button
@ -150,6 +160,11 @@ export default {
edit: "编辑车辆使用",
view: "查看车辆使用",
},
statusOptions:{
0: "审批中",
1: "初始中",
2: "已完成",
},
timeRange: [],
lending_type: "",
choiceOption: [],

View File

@ -9,10 +9,10 @@
label-position="left"
>
<el-form-item label="用车事由" prop="reason">
<el-input v-model="addForm.reason" clearable :disabled="mode==='view'"></el-input>
<el-input v-model="addForm.reason" clearable :disabled="localMode ==='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-select v-model="addForm.is_city" placeholder="请选择" :disabled="localMode ==='view'">
<el-option
v-for="item in vehicle_scope"
:key="item.is_city"
@ -22,16 +22,16 @@
</el-select>
</el-form-item>
<el-form-item label="出发地点" prop="location">
<el-input v-model="addForm.location" clearable :disabled="mode==='view'"></el-input>
<el-input v-model="addForm.location" clearable :disabled="localMode ==='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-input v-model="addForm.via" clearable :disabled="localMode ==='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-input v-model="addForm.destination" clearable :disabled="localMode ==='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-input-number v-model="addForm.start_km" clearable :disabled="localMode ==='view'"></el-input-number>
</el-form-item>
<el-form-item label="归还公里数" prop="end_km" v-if="addForm.ticket_?.state_?.name=='用车中'">
<el-input-number v-model="addForm.end_km" clearable>
@ -95,14 +95,24 @@ export default {
mode: { type: String, default: "view" }, // add / edit / view
modelValue: { type: Object, default: () => ({}) },
transitions: { type: Array, default: () => [] },
t_id: {
type: String,
default: null
},
},
components: {ticketd, ticketd_b_start},
emits: ["update:modelValue", "submit", "cancel"],
data() {
return {
addForm: { ...this.modelValue },
addForm: {
ticket_: {
state_: { type: '' }
},
...this.modelValue },
ticketTitle: "用车申请",
ticket_data: {},
localMode : this.mode,
rules:{
filename: [{ required: true, message: "请输入文件名称", trigger: "blur" }],
},
@ -111,10 +121,15 @@ export default {
}
},
mounted() {
if (this.addForm.ticket_?.state_.type===1){
this.localMode = 'edit'
};
this.ticket_data = {
...this.ticket_data,
is_city: this.addForm.is_city,
}
};
this.getTid();
},
watch: {
// ->
@ -152,13 +167,26 @@ export default {
that.workflow_key = "vehicle_out"
}
this.ticketTitle = `${this.addForm.reason}-用车申请`
if(that.mode == "add") {
if(that.localMode == "add") {
let res = await that.$API.ofm.vehicle.create.req(that.addForm);
that.addForm.id = res.id;
} else if (that.mode == "edit") {
} else if (that.localMode == "edit") {
await that.$API.ofm.vehicle.update.req(that.addForm.id, that.addForm);
}
},
getTid (){
var that = this;
if (that.t_id) {
that.$API.ofm.vehicle.item.req(that.t_id).then(res=>{
that.form = res;
if(res.ticket_.state_.type == 1 && res.create_by == that.$TOOL.data.get("USER_INFO").id ) {
that.localMode = "edit";
}else{
that.localMode = "show";
}
})
}
},
},
};