|
|
@@ -54,6 +54,21 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
+ <template slot-scope="{row}" slot="menu">
|
|
|
+ <el-button v-if="[1,2].indexOf(row.status) > -1" type="text" size="mini" @click="handleChangeStatus(row, 0)">恢复</el-button>
|
|
|
+ <el-button v-if="row.status === 0" type="text" size="mini" @click="handleChangeStatus(row, 1)">停用</el-button>
|
|
|
+ <el-button v-if="row.status === 0" type="text" size="mini" @click="handleChangeStatus(row, 2)">已足额折旧</el-button>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template slot="gl" slot-scope="{row}">
|
|
|
+ <span v-if="'软件,专利,非专利技术'.indexOf(row.zclb) > -1">/</span>
|
|
|
+ <span v-else>{{ row.gl }}</span>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <!-- <template slot="glForm" slot-scope="{row}">
|
|
|
+ <el-input-number v-if="'软件,专利,非专利技术'.indexOf(row.zclb) === -1" type="number" />
|
|
|
+ </template> -->
|
|
|
+
|
|
|
<!-- 开始时间 -->
|
|
|
<template slot="kssjSearch">
|
|
|
<el-date-picker
|
|
|
@@ -140,6 +155,22 @@ export default window.$crudCommon({
|
|
|
};
|
|
|
},
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ let newOption = { ...this.option };
|
|
|
+ // 资产类别下拉框,设置监听事件
|
|
|
+ newOption.column.forEach(item => {
|
|
|
+ if (item.prop == "zclb") {
|
|
|
+ item.change = ({ item }) => {
|
|
|
+ if (!!item && "软件,专利权,非专利技术".indexOf(item.dictValue) > -1) {
|
|
|
+ newOption.column[3].display = false;
|
|
|
+ } else {
|
|
|
+ newOption.column[3].display = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.option = { ...newOption };
|
|
|
+ },
|
|
|
methods: {
|
|
|
searchChange(params, done) {
|
|
|
if (done) done();
|
|
|
@@ -210,6 +241,30 @@ export default window.$crudCommon({
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
+ handleChangeStatus(rowData, status) {
|
|
|
+ let msgText = '';
|
|
|
+ if (status === 0) {
|
|
|
+ msgText = `确认恢复资产“${rowData.zcmc}”吗?`
|
|
|
+ } else if (status === 1) {
|
|
|
+ msgText = `确认停用资产“${rowData.zcmc}”吗?`
|
|
|
+ } else if (status === 2) {
|
|
|
+ msgText = `确认将资产“${rowData.zcmc}”设置为已足额折旧吗?`
|
|
|
+ }
|
|
|
+
|
|
|
+ this.$confirm(msgText, "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ const params = { ...rowData, status };
|
|
|
+ this.api.update(params).then(({ data }) => {
|
|
|
+ if (data.success) {
|
|
|
+ this.$message.success("操作成功!");
|
|
|
+ this.getList(this.page);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
/**
|
|
|
* 打印表格
|
|
|
* @param isLandscape 是否横向打印
|