|
|
|
@ -57,6 +57,11 @@
|
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="名称" align="center" prop="name" /> |
|
|
|
|
<el-table-column label="保管人" align="center" prop="custodianId" > |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<span> {{custodianUserList.find(t=>t.id == scope.row.custodianId ).name}} </span> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="单位" align="center" prop="unit" /> |
|
|
|
|
<el-table-column label="数量" align="center" prop="number" /> |
|
|
|
|
<!-- <el-table-column label="征文" align="center" prop="content" /> --> |
|
|
|
@ -77,18 +82,12 @@
|
|
|
|
|
<span>{{ parseTime(scope.row.validityEndTime) }}</span> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="唯一占用" align="center" prop="solo" > |
|
|
|
|
<el-table-column label="唯一" align="center" prop="solo" > |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-button type="danger" v-if="scope.row.solo">唯一</el-button> |
|
|
|
|
<el-button type="success" v-if="!scope.row.solo">任意</el-button> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="占用状态" align="center" prop="occupied" > |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-button type="danger" v-if="scope.row.occupied">已被占用</el-button> |
|
|
|
|
<el-button type="success" v-if="!scope.row.occupied">未被占用</el-button> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="" align="center" prop="createTime" width="180"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<span>{{ parseTime(scope.row.createTime) }}</span> |
|
|
|
@ -118,6 +117,11 @@
|
|
|
|
|
<el-form-item label="资源名称:" prop="name"> |
|
|
|
|
<el-input v-model="form.name" placeholder="请输入" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="保管人" prop="custodianId"> |
|
|
|
|
<el-select v-model="form.custodianId" placeholder="请选择"> |
|
|
|
|
<el-option v-for="item in custodianUserList" :label="item.name" :value="item.id" :key="item.id" /> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="单位" prop="unit"> |
|
|
|
|
<el-input v-model="form.unit" placeholder="请输入" /> |
|
|
|
|
</el-form-item> |
|
|
|
@ -155,6 +159,7 @@
|
|
|
|
|
<script> |
|
|
|
|
import { createResource, updateResource, deleteResource, getResource, getResourcePage, exportResourceExcel } from "@/api/farm/resource"; |
|
|
|
|
import { getResourceTypePage } from "@/api/farm/resourceType"; |
|
|
|
|
import { getCpUserPage } from "@/api/system/cpUser"; |
|
|
|
|
import ImageUpload from '@/components/ImageUpload'; |
|
|
|
|
import Editor from '@/components/Editor'; |
|
|
|
|
|
|
|
|
@ -202,11 +207,13 @@ export default {
|
|
|
|
|
validityStartTime: [{ required: true, message: "有效期开始不能为空", trigger: "blur" }], |
|
|
|
|
validityEndTime: [{ required: true, message: "有效期结束不能为空", trigger: "blur" }], |
|
|
|
|
}, |
|
|
|
|
resourceTypeList:[] |
|
|
|
|
resourceTypeList:[], |
|
|
|
|
custodianUserList:[], //保管人 |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
created() { |
|
|
|
|
this.getResourceType(); |
|
|
|
|
this.getCustodianUser(); |
|
|
|
|
this.getList(); |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
@ -228,13 +235,20 @@ export default {
|
|
|
|
|
getResourceType(){ |
|
|
|
|
getResourceTypePage({ |
|
|
|
|
pageNo: 1, |
|
|
|
|
pageSize: 10, |
|
|
|
|
pageSize: 20, |
|
|
|
|
name: null, |
|
|
|
|
}).then(res=>{ |
|
|
|
|
this.resourceTypeList = res.data.list; |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
getCustodianUser(){ |
|
|
|
|
getCpUserPage({ |
|
|
|
|
pageNo: 1, |
|
|
|
|
pageSize: 100 |
|
|
|
|
}).then(res =>{ |
|
|
|
|
this.custodianUserList = res.data.list; |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
/** 取消按钮 */ |
|
|
|
|
cancel() { |
|
|
|
|
this.open = false; |
|
|
|
|