|
|
@@ -27,11 +27,13 @@
|
|
|
/>
|
|
|
</van-cell-group>
|
|
|
</div>
|
|
|
+ <!-- 搜索框 -->
|
|
|
+ <van-search v-model="itemName" class="van-hairline--bottom" placeholder="请输入检查项名称"/>
|
|
|
<!-- 检查项目 -->
|
|
|
<fieldset class="fieldset" :disabled="!enable">
|
|
|
<div class="card">
|
|
|
<p class="legend">检查项目 <span v-if="enable" @click="addCheck">添加检查内容</span></p>
|
|
|
- <van-collapse v-model="activeNames" v-for="v in checkList" :key="v.itemId">
|
|
|
+ <van-collapse v-model="activeNames" v-for="v in resultList" :key="v.itemId">
|
|
|
<van-collapse-item :title="v.itemName" :name="v.itemName">
|
|
|
<div v-for="(item, index) in v.pointList" :key="item.pointId">
|
|
|
<van-cell>
|
|
|
@@ -85,7 +87,7 @@
|
|
|
rows="1"
|
|
|
autosize
|
|
|
label="情况描述:"
|
|
|
- type="textarea"
|
|
|
+ type="textarea"
|
|
|
placeholder="请输入(255字以内)"
|
|
|
/>
|
|
|
<select-cell
|
|
|
@@ -118,9 +120,9 @@
|
|
|
</div>
|
|
|
<!-- 按钮 -->
|
|
|
<div v-if="enable" class="flex-box">
|
|
|
- <van-button type="default" style="width: 30%" plain @click="accredit">授权</van-button>
|
|
|
- <van-button type="info" style="width: 30%" plain hairline @click="saveData">保存</van-button>
|
|
|
- <van-button type="info" style="width: 30%" @click="submitData">提交</van-button>
|
|
|
+ <van-button type="default" plain @click="accredit" v-show="showGrantBtn">授权</van-button>
|
|
|
+ <van-button type="info" plain hairline @click="saveData">保存</van-button>
|
|
|
+ <van-button type="info" @click="submitData">提交</van-button>
|
|
|
</div>
|
|
|
|
|
|
<!-- <van-image-preview v-model="showPreView" :images="preViewImages.images" :startPosition="preViewImages.startPosition">-->
|
|
|
@@ -132,7 +134,7 @@
|
|
|
</div>
|
|
|
|
|
|
<!-- 添加检查内容 -->
|
|
|
- <AddCheck v-else @goBack="goBack" @addItem="addItem"></AddCheck>
|
|
|
+ <AddCheck v-else @goBack="goBack" @addItem="addItem" :orgType="taskInfo.beCheckOrgType"></AddCheck>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
@@ -173,6 +175,7 @@ export default {
|
|
|
enable: false,
|
|
|
stateList: [],
|
|
|
dayList: [],
|
|
|
+ itemName:null,
|
|
|
preViewImages: {
|
|
|
images: [],
|
|
|
startPosition: 0
|
|
|
@@ -188,7 +191,33 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapGetters(['dictionary'])
|
|
|
+ ...mapGetters(['dictionary',"roleList",'orgId']),
|
|
|
+ showGrantBtn(){
|
|
|
+ let userRoleIds = this.roleList.map((r) => r.roleId);
|
|
|
+ let taskRoleIds = this.taskInfo.checkRoles
|
|
|
+ ? this.taskInfo.checkRoles.map((r) => r.id)
|
|
|
+ : [];
|
|
|
+ return (
|
|
|
+ this.taskInfo.status != 3 &&
|
|
|
+ this.taskInfo.planType==3 &&
|
|
|
+ this.taskInfo.checkOrgId == this.orgId &&
|
|
|
+ userRoleIds.find((ur) => taskRoleIds.includes(ur))
|
|
|
+ );
|
|
|
+ },
|
|
|
+ resultList(){
|
|
|
+ if (!this.itemName) {
|
|
|
+ return this.checkList;
|
|
|
+ }
|
|
|
+ // 使用传入的值来过滤数据
|
|
|
+ const filteredData = this.checkList.map(item => ({
|
|
|
+ ...item,
|
|
|
+ pointList:
|
|
|
+ item.pointList.filter(point =>
|
|
|
+ (point.itemName.includes(this.itemName) || point.pointName.includes(this.itemName))
|
|
|
+ )
|
|
|
+ })).filter(item => item.pointList.length > 0);
|
|
|
+ return filteredData;
|
|
|
+ },
|
|
|
},
|
|
|
mounted() {
|
|
|
this.id = this.$route.query.id
|
|
|
@@ -377,14 +406,14 @@ export default {
|
|
|
},
|
|
|
//初始化数据
|
|
|
getData() {
|
|
|
- let taskId = this.$route.query.id
|
|
|
+ let taskId = this.$route.query.id;
|
|
|
registerDetail(taskId).then(res => {
|
|
|
console.log(res, 'res')
|
|
|
- this.taskInfo = res.data
|
|
|
- this.enable = this.taskInfo.status === 1 || this.taskInfo.status === 2 //是否可编辑
|
|
|
- this.checkList = res.data.checkList
|
|
|
+ this.taskInfo = res.data;
|
|
|
+ this.enable = this.taskInfo.status === 1 || this.taskInfo.status === 2; //是否可编辑
|
|
|
+ this.checkList = res.data.checkList;
|
|
|
//设置默认展开项
|
|
|
- this.activeNames = this.checkList.map(v => v.itemName)
|
|
|
+ this.activeNames = this.checkList.map(v => v.itemName);
|
|
|
})
|
|
|
},
|
|
|
//保存数据
|
|
|
@@ -507,6 +536,13 @@ export default {
|
|
|
> span {
|
|
|
margin: 0 20px;
|
|
|
}
|
|
|
+
|
|
|
+ >button{
|
|
|
+ flex:.45;
|
|
|
+ margin:0 10px;
|
|
|
+ /* min-width: 30%;
|
|
|
+ max-width: 50%; */
|
|
|
+ }
|
|
|
}
|
|
|
.legend {
|
|
|
background-color: #fff;
|