|
@@ -16,8 +16,31 @@
|
|
|
size="small"
|
|
|
class="el-button--small-yh"
|
|
|
@click.stop="openEdit"
|
|
|
+ v-if="disabled"
|
|
|
>编 辑</el-button>
|
|
|
<el-button
|
|
|
+ v-if="checker && form.status != 3"
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ class="el-button--small-yh"
|
|
|
+ @click.stop="openCheckDialog">
|
|
|
+ 审批
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ v-if="form.status > 0"
|
|
|
+ @click.native="checkScheduleDialog = true,checkId=form.id"
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ >审核进度</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ v-if="!checkDisabled"
|
|
|
+ :disabled="!form.id || disabled"
|
|
|
+ size="small"
|
|
|
+ @click="pleaseCheck"
|
|
|
+ :loading="btnLoading"
|
|
|
+ >请核</el-button>
|
|
|
+ <el-button
|
|
|
type="success"
|
|
|
:disabled="!form.id"
|
|
|
size="small"
|
|
@@ -41,32 +64,37 @@
|
|
|
v-model="form"
|
|
|
:option="option"
|
|
|
>
|
|
|
- <template slot="createUser">
|
|
|
+ <template slot="userId">
|
|
|
<el-select
|
|
|
- v-model="form.createUser"
|
|
|
+ v-model="form.userId"
|
|
|
filterable
|
|
|
clearable
|
|
|
size="small"
|
|
|
placeholder="请选择"
|
|
|
+ @change="userHandle"
|
|
|
+ @clear="form.userName == null"
|
|
|
+ :disabled="disabled || checkDisabled"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="(item,index) in userList"
|
|
|
:key="index"
|
|
|
:label="item.realName"
|
|
|
- :value="item.realName"
|
|
|
+ :value="item.id"
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
</template>
|
|
|
- <template slot="dept">
|
|
|
+ <template slot="deptId">
|
|
|
<avue-input-tree
|
|
|
leaf-only
|
|
|
style="width: 100%;"
|
|
|
size="small"
|
|
|
:props="{ label: 'title' }"
|
|
|
- v-model="form.dept"
|
|
|
+ v-model="form.deptId"
|
|
|
placeholder=" "
|
|
|
type="tree"
|
|
|
:dic="dic"
|
|
|
+ :nodeClick="deptClick"
|
|
|
+ :disabled="disabled || checkDisabled"
|
|
|
></avue-input-tree>
|
|
|
</template>
|
|
|
<template slot="postId">
|
|
@@ -74,9 +102,10 @@
|
|
|
v-model="form.postId"
|
|
|
clearable
|
|
|
filterable
|
|
|
- multiple
|
|
|
- collapse-tags
|
|
|
placeholder="请选择 岗位"
|
|
|
+ @change="postHandle"
|
|
|
+ @clear="form.postId == null"
|
|
|
+ :disabled="disabled || checkDisabled"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="(item, index) in postDic"
|
|
@@ -104,6 +133,7 @@
|
|
|
icon="el-icon-plus"
|
|
|
size="small"
|
|
|
@click.stop="newDetails"
|
|
|
+ :disabled="disabled || checkDisabled"
|
|
|
>录入明细</el-button>
|
|
|
<el-button
|
|
|
type="info"
|
|
@@ -117,55 +147,59 @@
|
|
|
icon="el-icon-edit"
|
|
|
type="text"
|
|
|
@click="rowCell(row, index)"
|
|
|
+ :disabled="disabled || checkDisabled"
|
|
|
>{{ row.$cellEdit ? "保存" : "修改" }}</el-button>
|
|
|
<el-button
|
|
|
size="small"
|
|
|
icon="el-icon-delete"
|
|
|
type="text"
|
|
|
@click="rowDel(row, index)"
|
|
|
+ :disabled="disabled || checkDisabled"
|
|
|
>删除</el-button>
|
|
|
</template>
|
|
|
- <template slot="date" slot-scope="{ row, index }">
|
|
|
+ <template slot="expenseDate" slot-scope="{ row, index }">
|
|
|
<el-date-picker
|
|
|
v-if="row.$cellEdit"
|
|
|
- v-model="row.date"
|
|
|
+ v-model="row.expenseDate"
|
|
|
type="date"
|
|
|
placeholder="选择日期"
|
|
|
size="small"
|
|
|
style="width: 100%"
|
|
|
+ format="yyyy-MM-dd"
|
|
|
+ valueFormat="yyyy-MM-dd"
|
|
|
></el-date-picker>
|
|
|
- <span v-else>{{row.date}}</span>
|
|
|
+ <span v-else>{{row.expenseDate}}</span>
|
|
|
</template>
|
|
|
- <template slot="feeName" slot-scope="{ row }">
|
|
|
+ <template slot="expenseId" slot-scope="{ row }">
|
|
|
<breakdown-select
|
|
|
v-if="row.$cellEdit"
|
|
|
- v-model="row.itemId"
|
|
|
+ v-model="row.expenseId"
|
|
|
@selectValue="value => selectValue(value, row)"
|
|
|
:configuration="breakConfiguration"
|
|
|
>
|
|
|
</breakdown-select>
|
|
|
- <span v-else>{{ row.feeName }}</span>
|
|
|
+ <span v-else>{{ row.expenseItem }}</span>
|
|
|
</template>
|
|
|
- <template slot="content" slot-scope="{ row, index }">
|
|
|
+ <template slot="explanation" slot-scope="{ row, index }">
|
|
|
<el-input
|
|
|
v-if="row.$cellEdit"
|
|
|
- v-model="row.content"
|
|
|
+ v-model="row.explanation"
|
|
|
size="small"
|
|
|
placeholder="输入内容"
|
|
|
/>
|
|
|
- <span v-else>{{row.content}}</span>
|
|
|
+ <span v-else>{{row.explanation}}</span>
|
|
|
</template>
|
|
|
- <template slot="num" slot-scope="{ row, index }">
|
|
|
+ <template slot="quantity" slot-scope="{ row, index }">
|
|
|
<el-input-number
|
|
|
v-if="row.$cellEdit"
|
|
|
- v-model="row.num"
|
|
|
+ v-model="row.quantity"
|
|
|
size="small"
|
|
|
:controls="false"
|
|
|
:precision="0"
|
|
|
style="width: 100%"
|
|
|
placeholder="单据张数"
|
|
|
></el-input-number>
|
|
|
- <span v-else>{{ row.num }}</span>
|
|
|
+ <span v-else>{{ row.quantity }}</span>
|
|
|
</template>
|
|
|
<template slot="amount" slot-scope="{ row, index }">
|
|
|
<el-input-number
|
|
@@ -182,6 +216,44 @@
|
|
|
</avue-crud>
|
|
|
</basic-container>
|
|
|
</div>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ append-to-body
|
|
|
+ title="审批"
|
|
|
+ class="el-dialogDeep"
|
|
|
+ :visible.sync="checkDialog"
|
|
|
+ width="50%"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :destroy-on-close="true"
|
|
|
+ :close-on-press-escape="false"
|
|
|
+ v-dialog-drag
|
|
|
+ >
|
|
|
+ <check
|
|
|
+ :checkData="checkData"
|
|
|
+ :checkDetail="false"
|
|
|
+ :idList="[]"
|
|
|
+ @choceCheckFun="choceCheckFun"
|
|
|
+ >
|
|
|
+ </check>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ append-to-body
|
|
|
+ title="审批进度"
|
|
|
+ class="el-dialogDeep"
|
|
|
+ :visible.sync="checkScheduleDialog"
|
|
|
+ width="40%"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :destroy-on-close="true"
|
|
|
+ :close-on-press-escape="false"
|
|
|
+ v-dialog-drag
|
|
|
+ >
|
|
|
+ <check-schedule
|
|
|
+ :checkId="checkId"
|
|
|
+ :batchNo="batchNo"
|
|
|
+ @choceScheduleFun="choceScheduleFun"
|
|
|
+ >
|
|
|
+ </check-schedule>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -198,11 +270,25 @@ import {getUserInfo} from "@/api/system/user";
|
|
|
import {getDeptTree} from "@/api/system/dept";
|
|
|
import { getCurrentDate } from "@/util/date";
|
|
|
import {getList as getPostList} from "@/api/system/post";
|
|
|
+import {dataDetail, typeSave, removeGoods, pleaseCheck} from "@/api/standAlone/reimbursement";
|
|
|
+import { contrastObj, contrastList } from "@/util/contrastData";
|
|
|
+import check from "@/components/check/check";
|
|
|
+import checkSchedule from "@/components/check/checkSchedule";
|
|
|
|
|
|
export default {
|
|
|
name: "detail",
|
|
|
+ props: {
|
|
|
+ detailData: {
|
|
|
+ type: Object
|
|
|
+ }
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ check,
|
|
|
+ checkSchedule,
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
+ disabled: false,
|
|
|
pageLoading: false,
|
|
|
btnLoading: false,
|
|
|
form: {},
|
|
@@ -212,7 +298,7 @@ export default {
|
|
|
column: [
|
|
|
{
|
|
|
label: "日期",
|
|
|
- prop: "b",
|
|
|
+ prop: "claimDate",
|
|
|
span: 8,
|
|
|
type: "date",
|
|
|
format: "yyyy-MM-dd",
|
|
@@ -226,8 +312,8 @@ export default {
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
- label: "创建人",
|
|
|
- prop: "createUser",
|
|
|
+ label: "报销人",
|
|
|
+ prop: "userId",
|
|
|
rules: [
|
|
|
{
|
|
|
required: true,
|
|
@@ -240,7 +326,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
label: "所属部门",
|
|
|
- prop: "dept",
|
|
|
+ prop: "deptId",
|
|
|
rules: [
|
|
|
{
|
|
|
required: true,
|
|
@@ -266,7 +352,7 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
label: "职位",
|
|
|
- prop: "bb",
|
|
|
+ prop: "position",
|
|
|
rules: [
|
|
|
{
|
|
|
required: true,
|
|
@@ -279,13 +365,14 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
label: "No.",
|
|
|
- prop: "sysNo",
|
|
|
+ prop: "serialNo",
|
|
|
span: 8,
|
|
|
slot: true,
|
|
|
+ disabled: true,
|
|
|
},
|
|
|
{
|
|
|
label: "备注",
|
|
|
- prop: "orderRemark",
|
|
|
+ prop: "remarks",
|
|
|
type: "textarea",
|
|
|
minRows: 2,
|
|
|
span: 24,
|
|
@@ -316,10 +403,19 @@ export default {
|
|
|
placeholder: "请点击右边按钮选择",
|
|
|
dicData: []
|
|
|
},
|
|
|
+ oldForm: {},
|
|
|
+ oldDataList: [],
|
|
|
+ checkDisabled: false, // 审核状态
|
|
|
+ checker: false,
|
|
|
+ checkId: '',
|
|
|
+ batchNo:'',
|
|
|
+ checkDialog: false,
|
|
|
+ checkScheduleDialog: false,
|
|
|
+ checkData: {},
|
|
|
}
|
|
|
},
|
|
|
async created() {
|
|
|
- this.$set(this.form, 'b', getCurrentDate()); // 默认当前日期
|
|
|
+ this.$set(this.form, 'claimDate', getCurrentDate()); // 默认当前日期
|
|
|
this.tableOption = await this.getColumnData(
|
|
|
this.getColumnName(107),
|
|
|
tableOption
|
|
@@ -328,9 +424,12 @@ export default {
|
|
|
this.userList = res.data.data;
|
|
|
});
|
|
|
getUserInfo().then(res => {
|
|
|
- this.$set(this.form, 'createUser', res.data.data.realName);
|
|
|
- this.$set(this.form, 'dept', res.data.data.deptId);
|
|
|
- this.$set(this.form, 'postId', res.data.data.postId.split(','));
|
|
|
+ this.$set(this.form, 'userId', res.data.data.id);
|
|
|
+ this.$set(this.form, 'userName', res.data.data.realName);
|
|
|
+ this.$set(this.form, 'deptId', res.data.data.deptId);
|
|
|
+ this.$set(this.form, 'deptName', res.data.data.deptName);
|
|
|
+ this.$set(this.form, 'postId', res.data.data.postId.split(',')[0]);
|
|
|
+ this.$set(this.form, 'postName', res.data.data.postName.split(',')[0]);
|
|
|
this.loginUser = res.data.data.realName;
|
|
|
})
|
|
|
getDeptTree().then(res => {
|
|
@@ -351,6 +450,17 @@ export default {
|
|
|
this.getWorkDicts('unit').then(res => {
|
|
|
this.unitOption = res.data.data;
|
|
|
})
|
|
|
+ if (this.detailData.query) {
|
|
|
+ this.disabled = true;
|
|
|
+ this.option.column.map(e => {
|
|
|
+ this.$set(e, 'disabled', true)
|
|
|
+ })
|
|
|
+ this.queryData(this.detailData.id);
|
|
|
+ } else if (this.detailData.auditId) {
|
|
|
+ this.checker = true;
|
|
|
+ this.batchNo = this.detailData.check.batchNo
|
|
|
+ this.queryData(this.detailData.id);
|
|
|
+ }
|
|
|
},
|
|
|
filters: {
|
|
|
IntegerFormat(num) {
|
|
@@ -361,12 +471,42 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 查询
|
|
|
+ queryData(id) {
|
|
|
+ this.pageLoading = true;
|
|
|
+ dataDetail({id: id}).then(res => {
|
|
|
+ this.form = res.data.data;
|
|
|
+ this.dataList = this.form.itemList? this.form.itemList: [];
|
|
|
+ this.oldForm = {...this.form};
|
|
|
+ this.oldDataList = [...this.dataList];
|
|
|
+ delete this.form.itemList;
|
|
|
+ this.checkDisabled = this.form.status > 0? true: false;
|
|
|
+ if (this.form.status > 0) {
|
|
|
+ this.option.column.map(e => {
|
|
|
+ this.$set(e, 'disabled', true)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).finally(() => {
|
|
|
+ this.pageLoading = false;
|
|
|
+ })
|
|
|
+ },
|
|
|
//返回列表
|
|
|
backToList() {
|
|
|
this.$emit("goBack");
|
|
|
},
|
|
|
// 编辑按钮触发
|
|
|
- openEdit() {},
|
|
|
+ openEdit() {
|
|
|
+ this.disabled = false;
|
|
|
+ this.option.column.map(e => {
|
|
|
+ if (this.checkDisabled) {
|
|
|
+ this.$set(e, 'disabled', true)
|
|
|
+ } else {
|
|
|
+ if (e.prop != 'serialNo') {
|
|
|
+ this.$set(e, 'disabled', false)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 复制
|
|
|
copyDoc() {
|
|
|
this.$emit("copyOrder", this.form.id);
|
|
@@ -376,13 +516,14 @@ export default {
|
|
|
this.$refs["form"].validate((valid, done) => {
|
|
|
done();
|
|
|
if (valid) {
|
|
|
- // this.btnLoading = true;
|
|
|
- // typeSave(this.form).then(res => {
|
|
|
- // this.$message({type: "success", message: this.form.id ? "修改成功!" : "新增成功!"});
|
|
|
- // this.queryData(res.data.data.id);
|
|
|
- // }).finally(() => {
|
|
|
- // this.btnLoading = false;
|
|
|
- // })
|
|
|
+ this.$set(this.form, 'itemList', this.dataList)
|
|
|
+ this.btnLoading = true;
|
|
|
+ typeSave(this.form).then(res => {
|
|
|
+ this.$message({type: "success", message: this.form.id ? "修改成功!" : "新增成功!"});
|
|
|
+ this.queryData(res.data.data);
|
|
|
+ }).finally(() => {
|
|
|
+ this.btnLoading = false;
|
|
|
+ })
|
|
|
} else {
|
|
|
return false
|
|
|
}
|
|
@@ -447,13 +588,13 @@ export default {
|
|
|
type: "warning"
|
|
|
}).then(() => {
|
|
|
if (row.id) {
|
|
|
- // removeGoods(row.id).then(res => {
|
|
|
- // this.$message({
|
|
|
- // type: 'success',
|
|
|
- // message: '删除成功!'
|
|
|
- // })
|
|
|
- // this.dataList.splice(row.$index, 1);
|
|
|
- // })
|
|
|
+ removeGoods(row.id).then(res => {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '删除成功!'
|
|
|
+ })
|
|
|
+ this.dataList.splice(row.$index, 1);
|
|
|
+ })
|
|
|
} else {
|
|
|
this.$message({
|
|
|
type: "success",
|
|
@@ -466,8 +607,68 @@ export default {
|
|
|
getKHData(row) {},
|
|
|
//选择费用
|
|
|
selectValue(value, row) {
|
|
|
- this.$set(row, "feeName", value.cname);
|
|
|
- this.$set(row, "ename", value.ename);
|
|
|
+ console.log(value)
|
|
|
+ this.$set(row, "expenseItem", value.cname);
|
|
|
+ },
|
|
|
+ userHandle() {
|
|
|
+ this.form.userName = this.userList.find(item => item.id == this.form.userId).realName;
|
|
|
+ },
|
|
|
+ postHandle() {
|
|
|
+ this.form.postName = this.postDic.find(item => item.id == this.form.postId).postName;
|
|
|
+ },
|
|
|
+ // 验证新旧值对比
|
|
|
+ verification() {
|
|
|
+ if (contrastObj(this.form, this.oldForm) ||
|
|
|
+ contrastList(this.dataList, this.oldDataList)) {
|
|
|
+ this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ this.editCustomer();
|
|
|
+ }).catch(() => {
|
|
|
+ return false; //取消改动数据
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deptClick(data) {
|
|
|
+ this.$set(this.form, 'deptName', data.title)
|
|
|
+ },
|
|
|
+ //打开审核
|
|
|
+ openCheckDialog(){
|
|
|
+ this.checkData = this.detailData.check
|
|
|
+ this.checkDialog = true;
|
|
|
+ },
|
|
|
+ //关闭审核
|
|
|
+ choceCheckFun(){
|
|
|
+ this.checkDialog = false;
|
|
|
+ },
|
|
|
+ choceScheduleFun(){
|
|
|
+ this.checkScheduleDialog = false
|
|
|
+ },
|
|
|
+ // 请核
|
|
|
+ pleaseCheck() {
|
|
|
+ if (this.verification()) {
|
|
|
+ const data = {
|
|
|
+ id : this.form.id,
|
|
|
+ checkType: 'fybx',
|
|
|
+ url: '/reimbursement/index',
|
|
|
+ pageStatus:"this.$store.getters.reimbursementStatus",
|
|
|
+ pageLabel:"报销",
|
|
|
+ checkFlag: 1,
|
|
|
+ }
|
|
|
+ this.btnLoading = true;
|
|
|
+ pleaseCheck(data).then(res => {
|
|
|
+ this.$message.success('请核成功')
|
|
|
+ this.queryData(this.form.id)
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message.error('请核失败')
|
|
|
+ }).finally(() => {
|
|
|
+ this.btnLoading = false;
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
},
|
|
|
}
|