1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141 |
- <template>
- <div class="app-container">
- <el-form
- :model="queryParams"
- ref="queryForm"
- size="small"
- :inline="true"
- v-show="showSearch"
- label-width="140px"
- class="queryForm"
- >
- <el-form-item label="单据类型" prop="orderType">
- <el-select
- v-model="queryParams.orderType"
- placeholder="请选择单据类型"
- @change="onQueryTypeChange"
- >
- <el-option
- v-for="dict in dict.type.asset_order_type"
- :key="dict.value"
- :label="dict.label"
- :value="dict.value"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="单据编号" prop="orderNumber">
- <el-input
- v-model="queryParams.orderNumber"
- placeholder="请输入单据编号"
- clearable
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="申请日期" prop="applicationDate">
- <el-date-picker
- clearable
- v-model="queryParams.applicationDate"
- type="date"
- value-format="yyyy-MM-dd"
- placeholder="请选择申请日期"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item label="申请部门" prop="applicationDepartment">
- <treeselect
- v-model="queryParams.applicationDepartment"
- :options="deptOptions"
- placeholder="请选择申请部门"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <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-select>
- </template>
- </el-form-item>
- <el-form-item
- v-if="queryParams.orderType === '2'"
- label="【调拨】调出部门"
- prop="allocationCallOutDepartment"
- >
- <treeselect
- v-model="queryParams.allocationCallOutDepartment"
- :options="deptOptions"
- placeholder="请选择【调拨】调出部门"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item
- v-if="queryParams.orderType === '2'"
- label="【调拨】调出经办人"
- prop="allocationCallOutBy"
- >
- <el-input
- v-model="queryParams.allocationCallOutBy"
- placeholder="请输入【调拨】调出经办人"
- clearable
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item
- v-if="queryParams.orderType === '2'"
- label="【调拨】调出日期"
- prop="allocationCallOutDate"
- >
- <el-date-picker
- clearable
- v-model="queryParams.allocationCallOutDate"
- type="date"
- value-format="yyyy-MM-dd"
- placeholder="请选择【调拨】调出日期"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item
- v-if="queryParams.orderType === '2'"
- label="【调拨】调入部门"
- prop="allocationCallInDepartment"
- >
- <treeselect
- v-model="queryParams.allocationCallInDepartment"
- :options="deptOptions"
- placeholder="请选择【调拨】调入部门"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item
- v-if="queryParams.orderType === '2'"
- label="【调拨】调入经办人"
- prop="allocationCallInBy"
- >
- <el-input
- v-model="queryParams.allocationCallInBy"
- placeholder="请输入【调拨】调入经办人"
- clearable
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item
- v-if="queryParams.orderType === '2'"
- label="【调拨】调入日期"
- prop="allocationCallInDate"
- >
- <el-date-picker
- clearable
- v-model="queryParams.allocationCallInDate"
- type="date"
- value-format="yyyy-MM-dd"
- placeholder="请选择【调拨】调入日期"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item
- v-if="queryParams.orderType === '3'"
- label="【借出】借出部门"
- prop="lendDepartment"
- >
- <treeselect
- v-model="queryParams.lendDepartment"
- :options="deptOptions"
- placeholder="请选择【借出】借出部门"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item
- v-if="queryParams.orderType === '3'"
- label="【借出】经手人"
- prop="lendBySponsor"
- >
- <el-input
- v-model="queryParams.lendBySponsor"
- placeholder="请输入【借出】经手人"
- clearable
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item
- v-if="queryParams.orderType === '3'"
- label="【借出】往来单位"
- prop="lendPassingUnit"
- >
- <el-input
- v-model="queryParams.lendPassingUnit"
- placeholder="请输入【借出】往来单位"
- clearable
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <!-- <el-form-item label="原因说明" prop="reason">
- <el-input
- v-model="queryParams.reason"
- placeholder="请输入原因说明"
- clearable
- @keyup.enter.native="handleQuery"
- />
- </el-form-item> -->
- <el-form-item label="制单人" prop="preparedBy">
- <el-input
- v-model="queryParams.preparedBy"
- placeholder="请输入制单人"
- clearable
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="制单部门" prop="preparedDepartment">
- <treeselect
- v-model="queryParams.preparedDepartment"
- :options="deptOptions"
- placeholder="请选择制单部门"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="所属公司" prop="corporation">
- <treeselect
- v-model="queryParams.corporation"
- :options="deptOptions"
- placeholder="请选择所属公司"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="记录状态" prop="recordStatus">
- <el-select
- v-model="queryParams.recordStatus"
- placeholder="请选择记录状态"
- clearable
- >
- <el-option
- v-for="dict in dict.type.asset_record_status"
- :key="dict.value"
- :label="dict.label"
- :value="dict.value"
- />
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-button
- type="primary"
- icon="el-icon-search"
- size="mini"
- @click="handleQuery"
- >搜索</el-button
- >
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
- >重置</el-button
- >
- </el-form-item>
- </el-form>
- <el-row :gutter="10" class="mb8">
- <el-col :span="1.5">
- <el-button
- type="primary"
- plain
- icon="el-icon-plus"
- size="mini"
- @click="handleAdd"
- v-hasPermi="['order:order:add']"
- >新增</el-button
- >
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="success"
- plain
- icon="el-icon-edit"
- size="mini"
- :disabled="single"
- @click="handleUpdate"
- v-hasPermi="['order:order:edit']"
- >修改</el-button
- >
- </el-col>
- <el-col :span="1.5">
- <el-dropdown
- size="mini"
- split-button
- type="primary"
- @click="handleAudit"
- @command="handleCommand"
- v-hasPermi="['order:order:aduit']"
- >
- 审批
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item
- @click="handleWithdraw"
- v-hasPermi="['order:order:audit']"
- command="a"
- >撤回</el-dropdown-item
- >
- </el-dropdown-menu>
- </el-dropdown>
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="danger"
- plain
- icon="el-icon-delete"
- size="mini"
- :disabled="multiple"
- @click="handleDelete"
- v-hasPermi="['order:order:remove']"
- >删除</el-button
- >
- </el-col>
- <el-col :span="1.5">
- <el-button
- type="warning"
- plain
- icon="el-icon-download"
- size="mini"
- @click="handleExport"
- v-hasPermi="['order:order:export']"
- >导出</el-button
- >
- </el-col>
- <right-toolbar
- :showSearch.sync="showSearch"
- @queryTable="getList"
- ></right-toolbar>
- </el-row>
- <el-table
- ref="table"
- v-loading="loading"
- :data="orderList"
- @selection-change="handleSelectionChange"
- >
- <el-table-column type="selection" width="55" align="center" />
- <el-table-column label="序号" type="index" width="50"> </el-table-column>
- <!-- <el-table-column label="编号" align="center" prop="id" /> -->
- <el-table-column label="单据编号" align="center" prop="orderNumber" />
- <el-table-column label="单据类型" align="center" prop="orderType">
- <template slot-scope="scope">
- <dict-tag
- :options="dict.type.asset_order_type"
- :value="scope.row.orderType"
- />
- </template>
- </el-table-column>
- <el-table-column
- label="申请日期"
- align="center"
- prop="applicationDate"
- width="180"
- >
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.applicationDate, "{y}-{m}-{d}") }}</span>
- </template>
- </el-table-column>
- <el-table-column
- label="申请部门"
- align="center"
- prop="applicationDepartmentName"
- />
- <el-table-column
- v-if="queryParams.orderType !== '1'"
- label="资产总原值"
- align="center"
- prop="assetTotalOriginalValue"
- >
- <template slot-scope="scope">
- <div>{{ scope.row.assetTotalOriginalValue }}</div>
- </template>
- </el-table-column>
- <el-table-column
- v-if="queryParams.orderType !== '1'"
- label="资产总净值"
- align="center"
- prop="assetTotalNetValue"
- >
- <template slot-scope="scope">
- <div>{{ scope.row.assetTotalNetValue }}</div>
- </template>
- </el-table-column>
- <el-table-column
- v-if="queryParams.orderType === '1'"
- label="【调整】资产编号"
- align="center"
- prop="adjustmentAssetNumber"
- >
- <template slot-scope="scope">
- <span>{{ scope.row.adjustmentAssetNumber != null ? getAssetName(scope.row.adjustmentAssetNumber) : ""}}</span>
- </template>
- </el-table-column>
- <el-table-column
- v-if="queryParams.orderType === '1'"
- label="【调整】资产原信息"
- align="center"
- prop="adjustmentOriginalAssetInfo"
- >
- <template slot-scope="scope">
- <el-button
- v-if="queryParams.orderType === '1'"
- type="text"
- icon="el-icon-search"
- @click="onSelectOriginalAssetInfo(scope.row)"
- >查看</el-button
- >
- </template>
- </el-table-column>
- <el-table-column
- v-if="queryParams.orderType === '2'"
- label="【调拨】调出部门"
- align="center"
- prop="allocationCallOutDepartmentName"
- />
- <el-table-column
- v-if="queryParams.orderType === '2'"
- label="【调拨】调出经办人"
- align="center"
- prop="allocationCallOutBy"
- />
- <el-table-column
- v-if="queryParams.orderType === '2'"
- label="【调拨】调出日期"
- align="center"
- prop="allocationCallOutDate"
- width="180"
- >
- <template slot-scope="scope">
- <span>{{
- parseTime(scope.row.allocationCallOutDate, "{y}-{m}-{d}")
- }}</span>
- </template>
- </el-table-column>
- <el-table-column
- v-if="queryParams.orderType === '2'"
- label="【调拨】调入部门"
- align="center"
- prop="allocationCallInDepartmentName"
- />
- <el-table-column
- v-if="queryParams.orderType === '2'"
- label="【调拨】调入经办人"
- align="center"
- prop="allocationCallInBy"
- />
- <el-table-column
- v-if="queryParams.orderType === '2'"
- label="【调拨】调入日期"
- align="center"
- prop="allocationCallInDate"
- width="180"
- >
- <template slot-scope="scope">
- <span>{{
- parseTime(scope.row.allocationCallInDate, "{y}-{m}-{d}")
- }}</span>
- </template>
- </el-table-column>
- <el-table-column
- v-if="queryParams.orderType === '3'"
- label="【借出】借出部门"
- align="center"
- prop="lendDepartmentName"
- />
- <el-table-column
- v-if="queryParams.orderType === '3'"
- label="【借出】经手人"
- align="center"
- prop="lendBySponsor"
- />
- <el-table-column
- v-if="queryParams.orderType === '3'"
- label="【借出】往来单位"
- align="center"
- prop="lendPassingUnitName"
- />
- <el-table-column label="原因说明" align="center" prop="reason" />
- <el-table-column label="制单人" align="center" prop="preparedBy" />
- <el-table-column
- label="制单部门"
- align="center"
- prop="preparedDepartmentName"
- />
- <el-table-column label="所属公司" align="center" prop="corporationName" />
- <el-table-column label="记录状态" align="center" prop="recordStatus">
- <template slot-scope="scope">
- <dict-tag
- :options="dict.type.asset_record_status"
- :value="scope.row.recordStatus"
- />
- </template>
- </el-table-column>
- <el-table-column
- label="操作"
- align="center"
- class-name="small-padding fixed-width"
- fixed="right"
- >
- <template slot-scope="scope">
- <el-button
- v-if="queryParams.orderType !== '1'"
- size="mini"
- type="text"
- icon="el-icon-document"
- @click="onSelectopenDetail(scope.row)"
- v-hasPermi="['order:order:edit']"
- >明细</el-button
- >
- <el-button
- :disabled="scope.row.recordStatus > 0"
- size="mini"
- type="text"
- icon="el-icon-edit"
- @click="handleUpdate(scope.row)"
- v-hasPermi="['order:order:edit']"
- >修改</el-button
- >
- <el-button
- :disabled="scope.row.recordStatus > 0"
- size="mini"
- type="text"
- icon="el-icon-delete"
- @click="handleDelete(scope.row)"
- v-hasPermi="['order:order:remove']"
- >删除</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- <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-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-select>
- </template>
- </el-form-item>
- <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 label="原因说明" prop="reason">
- <el-input v-model="form.reason" placeholder="请输入原因说明" />
- </el-form-item>
- <!-- <el-form-item label="制单人" prop="preparedBy">
- <el-input v-model="form.preparedBy" placeholder="系统自动补充" disabled />
- </el-form-item>
- <el-form-item label="制单部门" prop="preparedDepartment">
- <el-input v-model="form.preparedDepartment" placeholder="系统自动补充" disabled />
- </el-form-item>
- <el-form-item label="所属公司" prop="corporation">
- <el-input v-model="form.corporation" placeholder="系统自动补充" disabled />
- </el-form-item> -->
- <!-- <el-form-item label="记录状态" prop="recordStatus">
- <el-select v-model="form.recordStatus" placeholder="请选择记录状态">
- <el-option
- v-for="dict in dict.type.asset_record_status"
- :key="dict.value"
- :label="dict.label"
- :value="parseInt(dict.value)"
- ></el-option>
- </el-select>
- </el-form-item> -->
- </el-form>
- <p class="msg" v-if="form.orderType !== 1">
- <i class="el-icon-info"></i> 保存生成单据后,记得完善单据明细后再提交哦
- </p>
- <div slot="footer" class="dialog-footer">
- <el-button
- v-if="form.orderType === 1 || form.existDetail"
- type="warning"
- @click="submitForm(1)"
- >提 交</el-button
- >
- <el-button type="primary" @click="submitForm(0)">保 存</el-button>
- <el-button @click="cancel">取 消</el-button>
- </div>
- </el-dialog>
- <!-- 【调整】资产信息 -->
- <el-dialog
- title="资产调整信息"
- :visible.sync="openAdjustment"
- width="900px"
- append-to-body
- >
- <AssetInfo
- :title="'现资产信息'"
- :assetInfo="adjustmentAssetInformation"
- />
- <div style="height: 20px"></div>
- <AssetInfo
- :title="'资产原信息'"
- :assetInfo="adjustmentOriginalAssetInfo"
- />
- </el-dialog>
- <el-dialog
- title="单据详细信息"
- :visible.sync="openDetail"
- width="1300px"
- append-to-body
- >
- <OrderDetail v-if="openDetail" :orderInfo="orderInfo" />
- </el-dialog>
- </div>
- </template>
- <script>
- import {
- listOrder,
- getOrder,
- delOrder,
- addOrder,
- updateOrder,
- auditMoreOrder,
- withdrawMoreOrder
- } from "@/api/order/order";
- 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";
- export default {
- name: "Order",
- dicts: ["asset_order_type", "asset_record_status"],
- components: {
- AssetInfo: () => import("@/components/asset/assetCard.vue"),
- OrderDetail: () => import("@/views/order/detail/index.vue"),
- Treeselect,
- },
- data() {
- return {
- // 遮罩层
- loading: true,
- // 选中数组
- ids: [],
- // 非单个禁用
- single: true,
- // 非多个禁用
- multiple: true,
- // 显示搜索条件
- showSearch: true,
- // 总条数
- total: 0,
- // 资产信息表格数据
- informationList: [],
- // 资产单据表格数据
- orderList: [],
- orderType: 1,
- // 资产原信息
- openAdjustment: false,
- adjustmentOriginalAssetInfo: null,
- adjustmentAssetInformation: null,
- // 单据详细
- openDetail: false,
- orderInfo: null,
- // 部门树选项
- deptOptions: [],
- // 弹出层标题
- title: "",
- // 是否显示弹出层
- open: false,
- // 查询参数
- queryParams: {
- pageNum: 1,
- pageSize: 10,
- orderNumber: null,
- orderType: "1",
- applicationDate: null,
- applicationDepartment: null,
- adjustmentAssetNumber: null,
- allocationCallOutDepartment: null,
- allocationCallOutBy: null,
- allocationCallOutDate: null,
- allocationCallInDepartment: null,
- allocationCallInBy: null,
- allocationCallInDate: null,
- lendDepartment: null,
- lendBySponsor: null,
- lendPassingUnit: null,
- reason: null,
- preparedBy: null,
- preparedDepartment: null,
- corporation: null,
- recordStatus: null,
- },
- orderType: null,
- // 表单参数
- 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" }
- // ],
- reason: [
- { required: true, message: "原因说明不能为空", trigger: "blur" },
- ],
- recordStatus: [
- { required: true, message: "记录状态不能为空", trigger: "change" },
- ],
- },
- };
- },
- created() {
- this.orderType = 1;
- this.getDeptTree();
- this.getList();
- },
- methods: {
- /** 查询资产单据列表 */
- getList() {
- this.loading = true;
- listInformation().then((response) => {
- this.informationList = response.rows;
- });
- listOrder(this.queryParams).then((response) => {
- this.orderList = response.rows;
- console.log("单据列表", this.orderList);
- this.total = response.total;
- this.loading = false;
- });
- },
- /** 查询部门下拉树结构 */
- getDeptTree() {
- deptTreeSelect().then((response) => {
- this.deptOptions = response.data;
- });
- },
- getAssetName(val){
- let arr = this.informationList.filter(item => item.number===val);
- return arr[0].name
- },
- // 取消按钮
- cancel() {
- this.open = false;
- this.reset();
- },
- onSelectOriginalAssetInfo(row) {
- this.adjustmentAssetInformation = row.adjustmentAssetInformation;
- 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() {
- this.orderType = Number(this.queryParams.orderType);
- (this.queryParams.assetTotalOriginalValue = null),
- (this.queryParams.assetTotalNetValue = null),
- (this.queryParams.adjustmentAssetNumber = null),
- (this.queryParams.adjustmentOriginalAssetInfo = null),
- (this.queryParams.allocationCallOutDepartment = null),
- (this.queryParams.allocationCallOutBy = null),
- (this.queryParams.allocationCallOutDate = null),
- (this.queryParams.allocationCallInDepartment = null),
- (this.queryParams.allocationCallInBy = null),
- (this.queryParams.allocationCallInDate = null),
- (this.queryParams.allocationNewResponsiblePerson = null),
- (this.queryParams.allocationNewLocationNumber = null),
- (this.queryParams.lendDepartment = null),
- (this.queryParams.lendBySponsor = null),
- (this.queryParams.lendPassingUnit = null);
- this.handleQuery();
- },
- onFormTypeChange() {
- (this.form.assetTotalOriginalValue = null),
- (this.form.assetTotalNetValue = null),
- (this.form.adjustmentAssetNumber = null),
- (this.form.adjustmentOriginalAssetInfo = null),
- (this.form.allocationCallOutDepartment = null),
- (this.form.allocationCallOutBy = null),
- (this.form.allocationCallOutDate = null),
- (this.form.allocationCallInDepartment = null),
- (this.form.allocationCallInBy = null),
- (this.form.allocationCallInDate = null),
- (this.form.allocationNewResponsiblePerson = null),
- (this.form.allocationNewLocationNumber = null),
- (this.form.lendDepartment = null),
- (this.form.lendBySponsor = null),
- (this.form.lendPassingUnit = null);
- },
- // 表单重置
- reset() {
- this.form = {
- id: null,
- orderNumber: null,
- orderType: null,
- assetTotalOriginalValue: null,
- assetTotalNetValue: null,
- applicationDate: null,
- applicationDepartment: null,
- adjustmentAssetNumber: null,
- adjustmentOriginalAssetInfo: null,
- allocationCallOutDepartment: null,
- allocationCallOutBy: null,
- allocationCallOutDate: null,
- allocationCallInDepartment: null,
- allocationCallInBy: null,
- allocationCallInDate: null,
- allocationNewResponsiblePerson: null,
- allocationNewLocationNumber: null,
- lendDepartment: null,
- lendBySponsor: null,
- lendPassingUnit: null,
- reason: null,
- preparedBy: null,
- preparedDepartment: null,
- corporation: null,
- recordStatus: null,
- };
- this.resetForm("form");
- },
- /** 搜索按钮操作 */
- handleQuery() {
- this.queryParams.pageNum = 1;
- this.getList();
- },
- /** 重置按钮操作 */
- resetQuery() {
- this.resetForm("queryForm");
- this.handleQuery();
- },
- // 多选框选中数据
- handleSelectionChange(selection) {
- selection.forEach((item) => {
- if (item.recordStatus > 0) {
- this.$modal.msgWarning("已提交单据不可修改/删除");
- //this.$refs.table.toggleRowSelection(item, false);
- }
- });
- //selection = selection.filter((item) => item.recordStatus < 1);
- this.ids = selection.map((item) => item.id);
- this.single = selection.length !== 1;
- this.multiple = !selection.length;
- },
- /** 新增按钮操作 */
- handleAdd() {
- this.reset();
- this.form.orderType = this.orderType;
- // 默认未提交
- this.form.recordStatus = 0;
- this.open = true;
- this.title = "添加资产单据";
- },
- /** 修改按钮操作 */
- handleUpdate(row) {
- this.reset();
- const id = row.id || this.ids;
- getOrder(id).then((response) => {
- this.form = response.data;
- console.log("修改表单信息:", this.form);
- if (response.data.recordStatus > 0) {
- this.$modal.msgWarning("已提交单据不可修改");
- return;
- }
- this.open = true;
- this.title = "修改资产单据";
- });
- },
- /**审批撤回按钮 */
- handleAudit() {
- this.reset();
- console.log( this.ids)
- auditMoreOrder(this.ids).then((response) => {
- this.$modal.msgSuccess("审批通过");
- this.getList();
- });
- },
- handleWithdraw() {
- this.reset();
- console.log( this.ids)
- withdrawMoreOrder(this.ids).then((response) => {
- this.$modal.msgSuccess("撤回成功");
- this.getList();
- });
- },
- handleCommand(command){
- if(command === 'a'){
- this.handleWithdraw()
- }
- },
- /** 提交按钮 */
- submitForm(recordStatus) {
- this.$refs["form"].validate((valid) => {
- if (valid) {
- if (this.form.id != null) {
- this.form.recordStatus = recordStatus;
- updateOrder(this.form).then((response) => {
- this.$modal.msgSuccess("修改成功");
- this.open = false;
- this.getList();
- });
- } else {
- this.form.recordStatus = recordStatus;
- addOrder(this.form).then((response) => {
- this.$modal.msgSuccess("新增成功");
- this.open = false;
- this.getList();
- });
- }
- }
- });
- },
- /** 删除按钮操作 */
- handleDelete(row) {
- const ids = row.id || this.ids;
- this.$modal
- .confirm('是否确认删除资产单据编号为"' + ids + '"的数据项?')
- .then(function () {
- return delOrder(ids);
- })
- .then(() => {
- this.getList();
- this.$modal.msgSuccess("删除成功");
- })
- .catch(() => {});
- },
- /** 导出按钮操作 */
- handleExport() {
- this.download(
- "order/order/export",
- {
- ...this.queryParams,
- },
- `order_${new Date().getTime()}.xlsx`
- );
- },
- },
- };
- </script>
- <style lang="less" scoped>
- /deep/ .vue-treeselect {
- display: inline-block;
- }
- .queryForm {
- /deep/ .vue-treeselect {
- width: 205px;
- height: 32px;
- }
- }
- .msg {
- text-align: center;
- color: red;
- }
- </style>
|