|
@@ -18,7 +18,10 @@
|
|
|
<el-form-item v-if="queryParams.orderType === '1'" label="【调整】资产编号" prop="adjustmentAssetNumber">
|
|
|
<template>
|
|
|
<el-select v-model="queryParams.adjustmentAssetNumber" filterable placeholder="请输入资产编号">
|
|
|
- <el-option v-for="item in informationList" :key="item.number" :label="item.name" :value="item.number"> </el-option>
|
|
|
+ <el-option v-for="item in informationList" :key="item.number" :label="item.name" :value="item.number">
|
|
|
+ <span style="float: left">{{ item.name }}</span>
|
|
|
+ <span style="float: right; color: #8492a6; font-size: 13px">{{ item.number }}</span>
|
|
|
+ </el-option>
|
|
|
</el-select>
|
|
|
</template>
|
|
|
</el-form-item>
|
|
@@ -175,67 +178,112 @@
|
|
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
|
|
|
|
|
<!-- 添加或修改资产单据对话框 -->
|
|
|
- <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
|
|
|
- <el-form ref="form" :model="form" :rules="rules" label-width="140px">
|
|
|
- <el-form-item label="单据编号" prop="orderNumber">
|
|
|
- <el-input v-model="form.orderNumber" placeholder="单据编号(系统自动生成)" disabled />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="单据类型" prop="orderType">
|
|
|
- <el-select v-model="form.orderType" placeholder="请选择单据类型" @change="onFormTypeChange">
|
|
|
- <el-option v-for="dict in dict.type.asset_order_type" :key="dict.value" :label="dict.label" :value="parseInt(dict.value)"></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
+ <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="150px">
|
|
|
+ <el-row :gutter="10">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="单据编号" prop="orderNumber">
|
|
|
+ <el-input v-model="form.orderNumber" placeholder="单据编号(系统自动生成)" disabled />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="单据类型" prop="orderType">
|
|
|
+ <el-select v-model="form.orderType" placeholder="请选择单据类型" @change="onFormTypeChange">
|
|
|
+ <el-option v-for="dict in dict.type.asset_order_type" :key="dict.value" :label="dict.label" :value="parseInt(dict.value)"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="申请日期" prop="applicationDate">
|
|
|
+ <el-date-picker clearable v-model="form.applicationDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择申请日期"> </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="申请部门" prop="applicationDepartment">
|
|
|
+ <treeselect v-model="form.applicationDepartment" :options="deptOptions" placeholder="请选择申请部门" @keyup.enter.native="handleQuery" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
<!-- <el-form-item v-if="form.orderType !== 1" label="资产总原值" prop="assetTotalOriginalValue">
|
|
|
<el-input v-model="form.assetTotalOriginalValue" placeholder="资产总原值(系统自动补充)" disabled/>
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="form.orderType !== 1" label="资产总净值" prop="assetTotalNetValue">
|
|
|
<el-input v-model="form.assetTotalNetValue" placeholder="资产总净值(系统自动补充)" disabled/>
|
|
|
</el-form-item> -->
|
|
|
- <el-form-item label="申请日期" prop="applicationDate">
|
|
|
- <el-date-picker clearable v-model="form.applicationDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择申请日期"> </el-date-picker>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="申请部门" prop="applicationDepartment">
|
|
|
- <treeselect v-model="form.applicationDepartment" :options="deptOptions" placeholder="请选择申请部门" @keyup.enter.native="handleQuery" />
|
|
|
- </el-form-item>
|
|
|
<el-form-item v-if="form.orderType === 1" label="【调整】资产编号" prop="adjustmentAssetNumber">
|
|
|
<template>
|
|
|
<el-select v-model="form.adjustmentAssetNumber" filterable placeholder="请输入资产编号">
|
|
|
- <el-option v-for="item in informationList" :key="item.number" :label="item.name" :value="item.number"> </el-option>
|
|
|
+ <el-option v-for="item in informationList" :key="item.number" :label="item.name" :value="item.number">
|
|
|
+ <span style="float: left">{{ item.name }}</span>
|
|
|
+ <span style="float: right; color: #8492a6; font-size: 13px">{{ item.number }}</span>
|
|
|
+ </el-option>
|
|
|
</el-select>
|
|
|
</template>
|
|
|
</el-form-item>
|
|
|
- <el-form-item v-if="form.orderType === 1" label="【调整】资产原信息" prop="adjustmentOriginalAssetInfo">
|
|
|
+ <el-row :gutter="10">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item v-if="form.orderType === 2" label="【调拨】调出部门" prop="allocationCallOutDepartment">
|
|
|
+ <treeselect v-model="form.allocationCallOutDepartment" :options="deptOptions" placeholder="请选择【调拨】调出部门" @keyup.enter.native="handleQuery" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item v-if="form.orderType === 2" label="【调拨】调出日期" prop="allocationCallOutDate">
|
|
|
+ <el-date-picker clearable v-model="form.allocationCallOutDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择【调拨】调出日期"> </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="10">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item v-if="form.orderType === 2" label="【调拨】调出经办人" prop="allocationCallOutBy">
|
|
|
+ <el-input v-model="form.allocationCallOutBy" placeholder="请输入【调拨】调出经办人" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <!-- <el-form-item v-if="form.orderType === 1" label="【调整】资产原信息" prop="adjustmentOriginalAssetInfo">
|
|
|
<el-input v-model="form.adjustmentOriginalAssetInfo" type="textarea" placeholder="系统自动补充" disabled />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item v-if="form.orderType === 2" label="【调拨】调出部门" prop="allocationCallOutDepartment">
|
|
|
- <treeselect v-model="form.allocationCallOutDepartment" :options="deptOptions" placeholder="请选择【调拨】调出部门" @keyup.enter.native="handleQuery" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item v-if="form.orderType === 2" label="【调拨】调出经办人" prop="allocationCallOutBy">
|
|
|
- <el-input v-model="form.allocationCallOutBy" placeholder="请输入【调拨】调出经办人" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item v-if="form.orderType === 2" label="【调拨】调出日期" prop="allocationCallOutDate">
|
|
|
- <el-date-picker clearable v-model="form.allocationCallOutDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择【调拨】调出日期"> </el-date-picker>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item v-if="form.orderType === 2" label="【调拨】调入部门" prop="allocationCallInDepartment">
|
|
|
- <treeselect v-model="form.allocationCallInDepartment" :options="deptOptions" placeholder="请选择【调拨】调入部门" @keyup.enter.native="handleQuery" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item v-if="form.orderType === 2" label="【调拨】调入经办人" prop="allocationCallInBy">
|
|
|
- <el-input v-model="form.allocationCallInBy" placeholder="请输入【调拨】调入经办人" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item v-if="form.orderType === 2" label="【调拨】调入日期" prop="allocationCallInDate">
|
|
|
- <el-date-picker clearable v-model="form.allocationCallInDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择【调拨】调入日期"> </el-date-picker>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item v-if="form.orderType === 3" label="【借出】借出部门" prop="lendDepartment">
|
|
|
- <treeselect v-model="form.lendDepartment" :options="deptOptions" placeholder="请选择【借出】借出部门" @keyup.enter.native="handleQuery" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item v-if="form.orderType === 3" label="【借出】经手人" prop="lendBySponsor">
|
|
|
- <el-input v-model="form.lendBySponsor" placeholder="请输入【借出】经手人" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item v-if="form.orderType === 3" label="【借出】往来单位" prop="lendPassingUnit">
|
|
|
- <treeselect v-model="form.lendPassingUnit" :options="deptOptions" placeholder="请选择【调拨】调入部门" @keyup.enter.native="handleQuery" />
|
|
|
- </el-form-item>
|
|
|
+ </el-form-item> -->
|
|
|
+ <el-row :gutter="10">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item v-if="form.orderType === 2" label="【调拨】调入部门" prop="allocationCallInDepartment">
|
|
|
+ <treeselect v-model="form.allocationCallInDepartment" :options="deptOptions" placeholder="请选择【调拨】调入部门" @keyup.enter.native="handleQuery" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item v-if="form.orderType === 2" label="【调拨】调入日期" prop="allocationCallInDate">
|
|
|
+ <el-date-picker clearable v-model="form.allocationCallInDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择【调拨】调入日期"> </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="10">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item v-if="form.orderType === 2" label="【调拨】调入经办人" prop="allocationCallInBy">
|
|
|
+ <el-input v-model="form.allocationCallInBy" placeholder="请输入【调拨】调入经办人" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="10">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item v-if="form.orderType === 3" label="【借出】借出部门" prop="lendDepartment">
|
|
|
+ <treeselect v-model="form.lendDepartment" :options="deptOptions" placeholder="请选择【借出】借出部门" @keyup.enter.native="handleQuery" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item v-if="form.orderType === 3" label="【借出】往来单位" prop="lendPassingUnit">
|
|
|
+ <treeselect v-model="form.lendPassingUnit" :options="deptOptions" placeholder="请选择【调拨】调入部门" @keyup.enter.native="handleQuery" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="10">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item v-if="form.orderType === 3" label="【借出】经手人" prop="lendBySponsor">
|
|
|
+ <el-input v-model="form.lendBySponsor" placeholder="请输入【借出】经手人" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
<el-form-item label="原因说明" prop="reason">
|
|
|
- <el-input v-model="form.reason" placeholder="请输入原因说明" />
|
|
|
+ <el-input type="textarea" v-model="form.reason" placeholder="请输入原因说明" />
|
|
|
</el-form-item>
|
|
|
<!-- <el-form-item label="制单人" prop="preparedBy">
|
|
|
<el-input v-model="form.preparedBy" placeholder="系统自动补充" disabled />
|
|
@@ -273,7 +321,7 @@
|
|
|
</el-dialog>
|
|
|
|
|
|
<el-dialog title="单据详细信息" :visible.sync="openDetail" width="1300px" append-to-body>
|
|
|
- <OrderDetail v-if="openDetail" :orderInfo="orderInfo" />
|
|
|
+ <OrderDetail v-if="openDetail" :orderInfo="orderInfo" @cancelByOrder="cancelByOrder"/>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -284,7 +332,7 @@ import { deptTreeSelect } from '@/api/system/user'
|
|
|
import Treeselect from '@riophae/vue-treeselect'
|
|
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
|
|
import { auditOrder } from '@/api/order/order'
|
|
|
-import { listInformation } from '@/api/asset/information'
|
|
|
+import { listInformation2 } from '@/api/asset/information'
|
|
|
export default {
|
|
|
name: 'Order',
|
|
|
dicts: ['asset_order_type', 'asset_record_status'],
|
|
@@ -354,27 +402,20 @@ export default {
|
|
|
form: {},
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
- // orderNumber: [
|
|
|
- // { required: true, message: "单据编号不能为空", trigger: "blur" }
|
|
|
- // ],
|
|
|
orderType: [{ required: true, message: '单据类型不能为空', trigger: 'change' }],
|
|
|
- // assetTotalOriginalValue: [
|
|
|
- // { required: true, message: "资产总原值不能为空", trigger: "blur" }
|
|
|
- // ],
|
|
|
- // assetTotalNetValue: [
|
|
|
- // { required: true, message: "资产总净值不能为空", trigger: "blur" }
|
|
|
- // ],
|
|
|
- // preparedBy: [
|
|
|
- // { required: true, message: "制单人不能为空", trigger: "blur" }
|
|
|
- // ],
|
|
|
- // preparedDepartment: [
|
|
|
- // { required: true, message: "制单部门不能为空", trigger: "blur" }
|
|
|
- // ],
|
|
|
- // corporation: [
|
|
|
- // { required: true, message: "所属公司不能为空", trigger: "blur" }
|
|
|
- // ],
|
|
|
+ applicationDate: [{ required: true, message: '申请日期不能为空', trigger: 'change' }],
|
|
|
+ applicationDepartment: [{ required: true, message: '申请部门不能为空', trigger: 'change' }],
|
|
|
+ adjustmentAssetNumber: [{ required: true, message: '【调整】资产编号不能为空', trigger: 'change' }],
|
|
|
+ allocationCallOutDepartment: [{ required: true, message: '【调拨】调出部门不能为空', trigger: 'change' }],
|
|
|
+ allocationCallOutBy: [{ required: true, message: '【调拨】调出经办人不能为空', trigger: 'blur' }],
|
|
|
+ allocationCallOutDate: [{ required: true, message: '【调拨】调出日期不能为空', trigger: 'change' }],
|
|
|
+ allocationCallInDepartment: [{ required: true, message: '【调拨】调入部门不能为空', trigger: 'change' }],
|
|
|
+ allocationCallInBy: [{ required: true, message: '【调拨】调入经办人不能为空', trigger: 'blur' }],
|
|
|
+ allocationCallInDate: [{ required: true, message: '【调拨】调入日期不能为空', trigger: 'change' }],
|
|
|
+ lendDepartment: [{ required: true, message: '【借出】借出部门不能为空', trigger: 'change' }],
|
|
|
+ lendBySponsor: [{ required: true, message: '【借出】经手人不能为空', trigger: 'blur' }],
|
|
|
+ lendPassingUnit: [{ required: true, message: '【借出】往来单位不能为空', trigger: 'change' }],
|
|
|
reason: [{ required: true, message: '原因说明不能为空', trigger: 'blur' }],
|
|
|
- recordStatus: [{ required: true, message: '记录状态不能为空', trigger: 'change' }],
|
|
|
},
|
|
|
}
|
|
|
},
|
|
@@ -383,12 +424,15 @@ export default {
|
|
|
this.getDeptTree()
|
|
|
this.getList()
|
|
|
},
|
|
|
+ beforeDestroy() {
|
|
|
+ this.$off('cancelByOrder')
|
|
|
+ },
|
|
|
methods: {
|
|
|
/** 查询资产单据列表 */
|
|
|
getList() {
|
|
|
this.loading = true
|
|
|
- listInformation().then((response) => {
|
|
|
- this.informationList = response.rows
|
|
|
+ listInformation2().then((response) => {
|
|
|
+ this.informationList = response.data
|
|
|
})
|
|
|
listOrder(this.queryParams).then((response) => {
|
|
|
this.orderList = response.rows
|
|
@@ -416,11 +460,9 @@ export default {
|
|
|
const json = JSON.parse(row.adjustmentOriginalAssetInfo)
|
|
|
this.adjustmentOriginalAssetInfo = json
|
|
|
this.openAdjustment = true
|
|
|
- console.log('资产原信息:', json)
|
|
|
},
|
|
|
onSelectopenDetail(order) {
|
|
|
this.orderInfo = order
|
|
|
- console.log('单据信息:', order)
|
|
|
this.openDetail = true
|
|
|
},
|
|
|
onQueryTypeChange() {
|
|
@@ -575,16 +617,27 @@ export default {
|
|
|
if (this.form.id != null) {
|
|
|
this.form.recordStatus = recordStatus
|
|
|
updateOrder(this.form).then((response) => {
|
|
|
- this.$modal.msgSuccess('修改成功')
|
|
|
+ if (recordStatus === 0) {
|
|
|
+ this.$modal.msgSuccess('保存成功')
|
|
|
+ } else {
|
|
|
+ this.$modal.msgSuccess('提交成功')
|
|
|
+ }
|
|
|
this.open = false
|
|
|
this.getList()
|
|
|
})
|
|
|
} else {
|
|
|
this.form.recordStatus = recordStatus
|
|
|
- addOrder(this.form).then((response) => {
|
|
|
- this.$modal.msgSuccess('新增成功')
|
|
|
+ addOrder(this.form).then((response) => {
|
|
|
this.open = false
|
|
|
this.getList()
|
|
|
+ if (response.data.orderType !== 1) {
|
|
|
+ this.onSelectopenDetail(response.data)
|
|
|
+ if (recordStatus === 0) {
|
|
|
+ this.$modal.msgSuccess('保存成功')
|
|
|
+ } else {
|
|
|
+ this.$modal.msgSuccess('提交成功')
|
|
|
+ }
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
}
|
|
@@ -614,6 +667,9 @@ export default {
|
|
|
`order_${new Date().getTime()}.xlsx`
|
|
|
)
|
|
|
},
|
|
|
+ cancelByOrder(value) {
|
|
|
+ this.openDetail = false
|
|
|
+ }
|
|
|
},
|
|
|
}
|
|
|
</script>
|