|
@@ -14,6 +14,8 @@ export default {
|
|
|
RecordModel: () => import("./record/index.vue"),
|
|
|
DeleteModel: () => import("./delete/index.vue"),
|
|
|
TerminationModel: () => import("./termination/index.vue"),
|
|
|
+ PigeonholeModel: () => import("./pigeonhole/index.vue"),
|
|
|
+ AlterationModel: () => import("./alteration/index.vue"),
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -22,7 +24,7 @@ export default {
|
|
|
searchColumns: SearchColumns,
|
|
|
params: initParams(SearchColumns),
|
|
|
tableData: [],
|
|
|
- currentData: [],
|
|
|
+ selectData: [],
|
|
|
tableColumns: FormColumns,
|
|
|
page: { pageNum: 1, pageSize: 10, total: 0 },
|
|
|
};
|
|
@@ -57,6 +59,7 @@ export default {
|
|
|
},
|
|
|
// 查 询
|
|
|
useQuery(prop, page) {
|
|
|
+ this.selectData = [];
|
|
|
this.fetchList(prop, page);
|
|
|
},
|
|
|
// 重 置
|
|
@@ -67,7 +70,7 @@ export default {
|
|
|
},
|
|
|
// 选 择
|
|
|
useSelect(prop) {
|
|
|
- this.currentData = [prop];
|
|
|
+ this.selectData = prop;
|
|
|
},
|
|
|
// 新 增
|
|
|
async useAdd() {
|
|
@@ -80,15 +83,29 @@ export default {
|
|
|
const { open } = this.$refs.DeleteModel;
|
|
|
await open(id);
|
|
|
},
|
|
|
+ hasPowerDelete(prop) {
|
|
|
+ if (prop.length === 1) {
|
|
|
+ const [{ status }] = prop;
|
|
|
+ if (status !== "2") return true;
|
|
|
+ else return false;
|
|
|
+ }
|
|
|
+ },
|
|
|
// 编 辑
|
|
|
async useEdit(prop) {
|
|
|
const [{ id }] = prop;
|
|
|
const { open } = this.$refs.EditModel;
|
|
|
await open(id);
|
|
|
},
|
|
|
+ hasPowerEdit(prop) {
|
|
|
+ if (prop.length === 1) {
|
|
|
+ const [{ status }] = prop;
|
|
|
+ if (status !== "2") return true;
|
|
|
+ else return false;
|
|
|
+ }
|
|
|
+ },
|
|
|
// 明 细
|
|
|
async useSee(prop) {
|
|
|
- const [{ id }] = prop;
|
|
|
+ const { id } = prop;
|
|
|
const { open } = this.$refs.SeeModel;
|
|
|
await open(id);
|
|
|
},
|
|
@@ -98,6 +115,38 @@ export default {
|
|
|
const { open } = this.$refs.TerminationModel;
|
|
|
await open(id);
|
|
|
},
|
|
|
+ hasPowerTermination(prop) {
|
|
|
+ if (prop.length === 1) {
|
|
|
+ const [{ status }] = prop;
|
|
|
+ if (status === "2") return true;
|
|
|
+ else return false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 归 档
|
|
|
+ async usePigeonhole(prop) {
|
|
|
+ const [{ id }] = prop;
|
|
|
+ const { open } = this.$refs.PigeonholeModel;
|
|
|
+ await open(id);
|
|
|
+ },
|
|
|
+ hasPowerPigeonhole(prop) {
|
|
|
+ if (prop.length === 1) {
|
|
|
+ const [{ status }] = prop;
|
|
|
+ if (status === "2") return true;
|
|
|
+ else return false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 变 更
|
|
|
+ async useAlteration(prop) {
|
|
|
+ const { open } = this.$refs.AlterationModel;
|
|
|
+ await open(prop[0]);
|
|
|
+ },
|
|
|
+ hasPowerAlteration(prop) {
|
|
|
+ if (prop.length === 1) {
|
|
|
+ const [{ status }] = prop;
|
|
|
+ if (status === "2") return true;
|
|
|
+ else return false;
|
|
|
+ }
|
|
|
+ },
|
|
|
// 导 出
|
|
|
async useExport(prop) {
|
|
|
const { pageNum, pageSize } = this.page;
|
|
@@ -143,6 +192,14 @@ export default {
|
|
|
ref="TerminationModel"
|
|
|
@success="useQuery(params, page)"
|
|
|
></termination-model>
|
|
|
+ <pigeonhole-model
|
|
|
+ ref="PigeonholeModel"
|
|
|
+ @success="useQuery(params, page)"
|
|
|
+ ></pigeonhole-model>
|
|
|
+ <alteration-model
|
|
|
+ ref="AlterationModel"
|
|
|
+ @success="useQuery(params, page)"
|
|
|
+ ></alteration-model>
|
|
|
<el-form
|
|
|
:size="size"
|
|
|
:model="params"
|
|
@@ -175,35 +232,37 @@ export default {
|
|
|
<el-button :size="size" @click="useAdd"> 新 增 </el-button>
|
|
|
<el-button :size="size" @click="useRecord"> 期初补录 </el-button>
|
|
|
<el-button
|
|
|
+ v-show="hasPowerDelete(selectData)"
|
|
|
:size="size"
|
|
|
- :disabled="!currentData.length"
|
|
|
- @click="useEdit(currentData)"
|
|
|
+ @click="useDelete(selectData)"
|
|
|
>
|
|
|
- 编 辑
|
|
|
+ 删 除
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
+ v-show="hasPowerTermination(selectData)"
|
|
|
:size="size"
|
|
|
- :disabled="!currentData.length"
|
|
|
- @click="useDelete(currentData)"
|
|
|
+ :disabled="!selectData.length"
|
|
|
+ @click="useTermination(selectData)"
|
|
|
>
|
|
|
- 删 除
|
|
|
+ 终 止
|
|
|
</el-button>
|
|
|
<el-button
|
|
|
+ v-show="hasPowerPigeonhole(selectData)"
|
|
|
:size="size"
|
|
|
- :disabled="!currentData.length"
|
|
|
- @click="useTermination(currentData)"
|
|
|
+ @click="usePigeonhole(selectData)"
|
|
|
>
|
|
|
- 终 止
|
|
|
+ 归 档
|
|
|
</el-button>
|
|
|
- <el-button :size="size" :disabled="!currentData.length">
|
|
|
+ <el-button
|
|
|
+ v-show="hasPowerAlteration(selectData)"
|
|
|
+ :size="size"
|
|
|
+ @click="useAlteration(selectData)"
|
|
|
+ >
|
|
|
变 更
|
|
|
</el-button>
|
|
|
- <el-button :size="size" :disabled="!currentData.length">
|
|
|
- 归 档
|
|
|
- </el-button>
|
|
|
<el-button
|
|
|
:size="size"
|
|
|
- :disabled="!currentData.length"
|
|
|
+ :disabled="!selectData.length"
|
|
|
@click="useExport(params)"
|
|
|
>
|
|
|
导 出
|
|
@@ -214,10 +273,13 @@ export default {
|
|
|
:size="size"
|
|
|
:data="tableData"
|
|
|
highlight-current-row
|
|
|
- @row-click="useSelect"
|
|
|
@row-dblclick="useSee"
|
|
|
+ @selection-change="useSelect"
|
|
|
+ @row-click="useSelect([$event])"
|
|
|
style="width: 100%; margin: 20px 0 0 0"
|
|
|
>
|
|
|
+ <el-table-column fixed width="55" align="center" type="selection">
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
v-for="(column, index) in tableColumns"
|
|
|
:key="index"
|
|
@@ -240,45 +302,6 @@ export default {
|
|
|
<span v-else>{{ scope.row[column.key] }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <!-- <el-table-column fixed="right" label="操作" width="150">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- size="small"
|
|
|
- @click.native.prevent="useEdit(scope.row)"
|
|
|
- >
|
|
|
- 编 辑
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- size="small"
|
|
|
- @click.native.prevent="useEdit(scope.row)"
|
|
|
- >
|
|
|
- 变 更
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- size="small"
|
|
|
- @click.native.prevent="useEdit(scope.row)"
|
|
|
- >
|
|
|
- 归 档
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- size="small"
|
|
|
- @click.native.prevent="useTermination(scope.row)"
|
|
|
- >
|
|
|
- 终 止
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- size="small"
|
|
|
- @click.native.prevent="useDelete(scope.row)"
|
|
|
- >
|
|
|
- 删 除
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- </el-table-column> -->
|
|
|
</el-table>
|
|
|
<pagination
|
|
|
:total="page.total"
|