|
@@ -17,14 +17,14 @@
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="调整单号" prop="orderNumber">
|
|
|
+ <!-- <el-form-item label="调整单号" prop="orderNumber">
|
|
|
<el-input
|
|
|
v-model="queryParams.orderNumber"
|
|
|
placeholder="请输入调整单号"
|
|
|
clearable
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
- </el-form-item>
|
|
|
+ </el-form-item> -->
|
|
|
<el-form-item label="制单人" prop="preparedBy">
|
|
|
<el-input
|
|
|
v-model="queryParams.preparedBy"
|
|
@@ -33,14 +33,14 @@
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="制单部门" prop="preparedDepartment">
|
|
|
+ <!-- <el-form-item label="制单部门" prop="preparedDepartment">
|
|
|
<el-input
|
|
|
v-model="queryParams.preparedDepartment"
|
|
|
placeholder="请输入制单部门"
|
|
|
clearable
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
- </el-form-item>
|
|
|
+ </el-form-item> -->
|
|
|
<el-form-item label="记录状态" prop="recordStatus">
|
|
|
<el-select v-model="queryParams.recordStatus" placeholder="请选择记录状态" clearable>
|
|
|
<el-option
|
|
@@ -81,6 +81,28 @@
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
|
+ type="info"
|
|
|
+ plain
|
|
|
+ icon="el-icon-position"
|
|
|
+ size="mini"
|
|
|
+ :disabled="single"
|
|
|
+ @click="submit"
|
|
|
+ v-hasPermi="['asset:adjustment:submit']"
|
|
|
+ >提交</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ plain
|
|
|
+ icon="el-icon-check"
|
|
|
+ size="mini"
|
|
|
+ :disabled="single"
|
|
|
+ @click="audit"
|
|
|
+ v-hasPermi="['asset:adjustment:audit']"
|
|
|
+ >审核</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
type="danger"
|
|
|
plain
|
|
|
icon="el-icon-delete"
|
|
@@ -103,15 +125,27 @@
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
|
|
|
- <el-table v-loading="loading" :data="adjustmentList" @selection-change="handleSelectionChange">
|
|
|
+ <el-table v-loading="loading" :data="adjustmentList" @selection-change="handleSelectionChange" v-if="arr">
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
<el-table-column label="编号" align="center" prop="id" />
|
|
|
- <el-table-column label="资产编号" align="center" prop="assetNumber" />
|
|
|
- <el-table-column label="资产原信息" align="center" prop="originalAssetInfo" />
|
|
|
+ <el-table-column label="资产编号" align="center" prop="assetNumber" >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.assetNumber != null ? assetName(scope.row.assetNumber) : ""}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="资产原信息" align="center" prop="originalAssetInfo" >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>{{test(scope.row.originalAssetInfo) }}</div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="调整原因" align="center" prop="reason" />
|
|
|
- <el-table-column label="调整单号" align="center" prop="orderNumber" />
|
|
|
+ <!-- <el-table-column label="调整单号" align="center" prop="orderNumber" /> -->
|
|
|
<el-table-column label="制单人" align="center" prop="preparedBy" />
|
|
|
- <el-table-column label="制单部门" align="center" prop="preparedDepartment" />
|
|
|
+ <el-table-column label="制单部门" align="center" prop="preparedDepartment">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.preparedDepartment">{{ scope.row.preparedDepartment != null ? deptName(scope.row.preparedDepartment) : ""}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="记录状态" align="center" prop="recordStatus">
|
|
|
<template slot-scope="scope">
|
|
|
<dict-tag :options="dict.type.asset_record_status" :value="scope.row.recordStatus"/>
|
|
@@ -149,24 +183,36 @@
|
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
<el-form-item label="资产编号" prop="assetNumber">
|
|
|
- <el-input v-model="form.assetNumber" placeholder="请输入资产编号" />
|
|
|
+ <el-select v-model="form.assetNumber" filterable placeholder="请选择资产编号">
|
|
|
+ <el-option
|
|
|
+ v-for="item in informationList"
|
|
|
+ :key="item.number"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.number"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
- <!-- <el-form-item label="资产原信息" prop="originalAssetInfo">
|
|
|
+ <el-form-item label="资产原信息" prop="originalAssetInfo">
|
|
|
<el-input v-model="form.originalAssetInfo" type="textarea" placeholder="请输入内容" />
|
|
|
- </el-form-item> -->
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="调整原因" prop="reason">
|
|
|
<el-input v-model="form.reason" placeholder="请输入调整原因" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="调整单号" prop="orderNumber">
|
|
|
+ <!-- <el-form-item label="调整单号" prop="orderNumber">
|
|
|
<el-input v-model="form.orderNumber" placeholder="请输入调整单号" />
|
|
|
- </el-form-item>
|
|
|
+ </el-form-item> -->
|
|
|
<el-form-item label="制单人" prop="preparedBy">
|
|
|
<el-input v-model="form.preparedBy" placeholder="请输入制单人" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="制单部门" prop="preparedDepartment">
|
|
|
- <el-input v-model="form.preparedDepartment" placeholder="请输入制单部门" />
|
|
|
+ <treeselect
|
|
|
+ v-model="form.preparedDepartment"
|
|
|
+ :options="deptOptions"
|
|
|
+ :normalizer="normalizer"
|
|
|
+ placeholder="选择制单部门"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="记录状态" prop="recordStatus">
|
|
|
+ <!-- <el-form-item label="记录状态" prop="recordStatus">
|
|
|
<el-select v-model="form.recordStatus" placeholder="请选择记录状态">
|
|
|
<el-option
|
|
|
v-for="dict in dict.type.asset_record_status"
|
|
@@ -175,7 +221,7 @@
|
|
|
:value="parseInt(dict.value)"
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
- </el-form-item>
|
|
|
+ </el-form-item> -->
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
@@ -186,11 +232,18 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listAdjustment, getAdjustment, delAdjustment, addAdjustment, updateAdjustment } from "@/api/asset/adjustment";
|
|
|
+import { listAdjustment, getAdjustment, delAdjustment, addAdjustment, updateAdjustment, submitAdjustment, auditAdjustment } from "@/api/asset/adjustment";
|
|
|
+import { listDept } from "@/api/system/dept";
|
|
|
+import { listInformation } from "@/api/asset/information";
|
|
|
+import Treeselect from "@riophae/vue-treeselect";
|
|
|
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
|
|
|
export default {
|
|
|
name: "Adjustment",
|
|
|
dicts: ['asset_record_status'],
|
|
|
+ components:{
|
|
|
+ Treeselect
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
// 遮罩层
|
|
@@ -205,8 +258,13 @@ export default {
|
|
|
showSearch: true,
|
|
|
// 总条数
|
|
|
total: 0,
|
|
|
+ // 部门树选项
|
|
|
+ deptOptions: [],
|
|
|
+ arr: [],
|
|
|
// 资产调整表格数据
|
|
|
adjustmentList: [],
|
|
|
+ // 资产信息表格数据
|
|
|
+ informationList: [],
|
|
|
// 弹出层标题
|
|
|
title: "",
|
|
|
// 是否显示弹出层
|
|
@@ -227,9 +285,9 @@ export default {
|
|
|
form: {},
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
- assetNumber: [
|
|
|
- { required: true, message: "资产编号不能为空", trigger: "blur" }
|
|
|
- ],
|
|
|
+ // assetNumber: [
|
|
|
+ // { required: true, message: "资产编号不能为空", trigger: "blur" }
|
|
|
+ // ],
|
|
|
originalAssetInfo: [
|
|
|
{ required: true, message: "资产原信息", trigger: "blur" }
|
|
|
],
|
|
@@ -249,15 +307,50 @@ export default {
|
|
|
this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
+ test(val) {
|
|
|
+ const json = JSON.parse(val)
|
|
|
+ console.log(json)
|
|
|
+ },
|
|
|
/** 查询资产调整列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
+ listDept().then((response) => {
|
|
|
+ this.deptOptions = this.handleTree(response.data, "deptId");
|
|
|
+ this.arr = response.data
|
|
|
+ });
|
|
|
+ listInformation().then(response => {
|
|
|
+ this.informationList = response.rows;
|
|
|
+ });
|
|
|
listAdjustment(this.queryParams).then(response => {
|
|
|
this.adjustmentList = response.rows;
|
|
|
this.total = response.total;
|
|
|
this.loading = false;
|
|
|
});
|
|
|
},
|
|
|
+ /** 转换部门数据结构 */
|
|
|
+ normalizer(node) {
|
|
|
+ if (node.children && !node.children.length) {
|
|
|
+ delete node.children;
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ id: node.deptId,
|
|
|
+ label: node.deptName,
|
|
|
+ children: node.children,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ //获取公司名
|
|
|
+ deptName(val){
|
|
|
+ let num = parseInt(val)
|
|
|
+ let arr2 = this.arr.filter(item => item.deptId===num);
|
|
|
+ if (arr2) {
|
|
|
+ return arr2[0].deptName
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //获取资产名
|
|
|
+ assetName(val){
|
|
|
+ let arr2 = this.informationList.filter(item => item.number===val);
|
|
|
+ return arr2[0].name
|
|
|
+ },
|
|
|
// 取消按钮
|
|
|
cancel() {
|
|
|
this.open = false;
|
|
@@ -309,6 +402,29 @@ export default {
|
|
|
this.title = "修改资产调整";
|
|
|
});
|
|
|
},
|
|
|
+ submit(row){
|
|
|
+ this.reset();
|
|
|
+ const id = row.id || this.ids
|
|
|
+ getAdjustment(id).then(response => {
|
|
|
+ submitAdjustment(response.data).then(response => {
|
|
|
+ this.$modal.msgSuccess("提交成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /**审核按钮 */
|
|
|
+ audit(row){
|
|
|
+ this.reset();
|
|
|
+ const id = row.id || this.ids
|
|
|
+ getAdjustment(id).then(response => {
|
|
|
+ auditAdjustment(response.data).then(response => {
|
|
|
+ this.$modal.msgSuccess("审核成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
/** 提交按钮 */
|
|
|
submitForm() {
|
|
|
this.$refs["form"].validate(valid => {
|