吕天方 1 year ago
commit 9f96ff7f8a

@ -4,7 +4,7 @@
* @Author: JC9527
* @Date: 2023-09-11 15:38:21
* @LastEditors: JC9527
* @LastEditTime: 2023-09-13 17:14:29
* @LastEditTime: 2023-09-19 15:27:12
*/
import request from '@/utils/request'
@ -54,5 +54,11 @@ export default {
method:'get',
params
});
}
},
bPlanEnterprise(){
return request({
url: `/pharmaceuticals/bPlanEnterprise`,
method:'get',
});
},
};

@ -76,13 +76,6 @@
</el-option>
</el-select>
</div>
<!-- <div class="select-input">
<div class="select-span">行业类型:</div>
<el-radio-group v-model="form.isPoint">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
</div> -->
<div class="select-input">
<div class="select-span">是否重点:</div>
<el-select v-model="form.isPoint" placeholder="请选择">
@ -124,7 +117,6 @@
<div class="btns">
<div class="select-btn" @click="filtrate"></div>
<div class="select-btn reset" @click="reset"></div>
<!-- <div class="select-btn select-btn1">导入</div> -->
</div>
<!-- </div> -->
</div>
@ -136,7 +128,7 @@
ref="multipleTable"
tooltip-effect="light"
@selection-change="handleSelectionChange"
row-key="id"
row-key="uscCode"
:row-class-name="tableRowClassName"
>
<el-table-column
@ -187,34 +179,20 @@
</div>
</template>
</el-table-column>
<!-- <el-table-column prop="" label="选择" header-align="center">
<template slot-scope="scope">
<div class="look" @click="chec(scope.row)">
<el-checkbox v-model="scope.row.is"></el-checkbox>
</div>
</template>
</el-table-column> -->
</el-table>
</div>
<div class="pagination">
<my-pagination
:total="total"
@pagesChange="pagesChange"
></my-pagination>
>
<div>重点企业数<span :class="count == unCount ? 'selectedNumber' : 'unselectedNumber' ">{{ unCount }}</span>/<span class="sum">{{ count }}</span></div>
</my-pagination>
</div>
</div>
<div v-else class="release-planning">
<div class="inputs centered">
<div class="inputs-span">计划年份:</div>
<!-- <el-select v-model="form2.year" placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select> -->
<el-date-picker
v-model="form2.plannedYear"
type="month"
@ -223,7 +201,6 @@
value-format="yyyy-MM"
placeholder="请选择年份">
</el-date-picker>
<!-- <img class="data_icon" src="@/assets/images/down2.png" alt=""> -->
</div>
<div class="inputs centered">
<div class="inputs-span">计划标题:</div>
@ -279,6 +256,7 @@
<script>
import myPagination from "@/views/components/myPagination/index.vue";
import { Loading } from "element-ui";
import { mapState } from "vuex";
export default {
components: { myPagination },
data() {
@ -321,8 +299,17 @@ export default {
loading:false,
isamend:false,
amendId:'',
count:0,
unCount:0,
unselected:0,
selectList:[],
};
},
computed:{
...mapState({
dept: (state) => state.user.dept,
}),
},
methods: {
//
filtrate(){
@ -341,16 +328,42 @@ export default {
},
// checkBox
checkSelectable(row){
console.log(row)
return row
row['unselected'] = true;
this.selectList.map((item)=>{
if(item.enterpriseId == row.uscCode) {
row['unselected'] = false;
}
})
// console.log(row)
return row.unselected
},
//
async bPlanEnterprise(){
let count = 0
let data = await this.$api.yingji.bPlanEnterprise();
this.selectList = data.data;
data.data.map((item)=>{
item['uscCode'] = item.enterpriseId
this.$nextTick(()=>{
this.$refs.multipleTable.toggleRowSelection(item,false)
})
if(item.isPoint == 1) {
count += 1
}
})
// console.log(count,'count')
this.unselected = count;
},
//
async open(item) {
this.dialogVisible = true;
if(item == 'newlyIncreased') {
if(this.dept.deptName !== '市局') {
this.bPlanEnterprise();
}
this.getTable(this.pages);
} else {
this.amendId = item.id
this.amendId = item.id;
this.isamend = true;
this.getList(item);
this.getTable(this.pages);
@ -359,15 +372,19 @@ export default {
//
Close(item) {
this.dialogVisible = false;
this.tableData = [];
this.multipleSelection = [];
this.isamend = false;
this.nextStep = false;
this.nextText = "下一步";
Object.keys(this.form).forEach(key=>this.form[key]='')
Object.keys(this.form2).forEach(key=>this.form2[key]='')
Object.keys(this.form).forEach(key=>this.form[key]='');
Object.keys(this.form2).forEach(key=>this.form2[key]='');
this.unCount = 0;
this.pages.pageNum = 1;
this.pages.pageSize = 10;
this.selected = 0;
// this.getTable(this.pages);
this.unselected = 0;
this.count = 0;
if(item == 'newsuccess') {
this.$emit('close')
}
@ -393,7 +410,9 @@ export default {
async getTable(pages){
this.loading = true;
let data = await this.$api.yingji.basicList(pages);
// console.log(data.data.count, '');
this.count = data.data.count;
this.unCount = data.data.count - this.unselected;
this.total = data.data.total;
if(data.code == 200) {
this.loading = false;
@ -409,8 +428,6 @@ export default {
handleSelectionChange(val) {
this.multipleSelection = val;
this.selected = this.multipleSelection.length;
// console.log(val)
console.log(this.multipleSelection)
},
//
getData(){
@ -426,9 +443,32 @@ export default {
},
//
async next() {
let arr = [];
let arr2 = [];
let keyCount = 0;
this.multipleSelection.map((item)=>{
arr.push(item.subdistrict);
arr2.push(item.uscCode);
if(item.isPoint == '1') {
keyCount++;
}
})
if (this.$refs.next.innerText == "下一步") {
this.nextStep = true;
this.nextText = "发布计划";
if(this.multipleSelection.length == 0) {
this.$message.error('请至少选择一家企业');
return
}
if(this.dept.deptName == '乡镇'){
if(this.count == (this.unselected + keyCount)) {
this.nextStep = true;
this.nextText = "发布计划";
} else {
this.$message.error('请将重点企业全选');
}
} else {
this.nextStep = true;
this.nextText = "发布计划";
}
} else {
let downloadLoadingInstance = Loading.service({
text: this.isamend ? "正在修改计划,请稍后" : "正在发布计划,请稍后",
@ -436,17 +476,8 @@ export default {
background: "rgba(0, 0, 0, 0.7)",
});
// console.log(this.form2);
console.log(this.multipleSelection);
let arr = [];
let arr2 = [];
let keyCount = 0;
this.multipleSelection.map((item)=>{
arr.push(item.subdistrict);
arr2.push(item.uscCode);
if(item.isPoint == '1') {
keyCount++;
}
})
// console.log(this.multipleSelection);
let district = arr.join(',');
let enterpriseId = arr2.join(',');
let createTime = this.getData();
@ -718,7 +749,7 @@ export default {
// }
}
.tables {
background-color: #eaf2fd;
// background-color: #eaf2fd;
::v-deep .el-table {
.success-row {
background-color: rgba(234, 242, 253, 0.25);
@ -753,6 +784,15 @@ export default {
}
.pagination {
margin-top: 10px;
.unselectedNumber {
color: #F71052;
}
.selectedNumber {
color: #48E1BB;
}
.sum {
color: #48E1BB;
}
}
.release-planning {
padding: 0 10px 0 0;

@ -4,31 +4,34 @@
* @Author: JC9527
* @Date: 2023-09-04 13:11:33
* @LastEditors: JC9527
* @LastEditTime: 2023-09-14 14:06:10
* @LastEditTime: 2023-09-20 09:31:57
-->
<template>
<div class="pagination">
<span class="custom"
>{{ total }}显示{{
total == 0
? "0"
: pageNum == 1
? "1"
: pageSize * (pageNum - 1) + 1
}}-{{ numberMap() }}</span
>
<el-pagination
background
:small="true"
:page-sizes="[10, 15]"
:total="total"
layout=" prev, pager, next, sizes, jumper"
@current-change="currentChange"
@size-change="sizeChange"
:current-page.sync="pageNum"
:page-size.sync="pageSize"
>
</el-pagination>
<slot></slot>
<div class="right">
<span class="custom"
>{{ total }}显示{{
total == 0
? "0"
: pageNum == 1
? "1"
: pageSize * (pageNum - 1) + 1
}}-{{ numberMap() }}</span
>
<el-pagination
background
:small="true"
:page-sizes="[10, 15]"
:total="total"
layout=" prev, pager, next, sizes, jumper"
@current-change="currentChange"
@size-change="sizeChange"
:current-page.sync="pageNum"
:page-size.sync="pageSize"
>
</el-pagination>
</div>
</div>
</template>
<script>
@ -86,7 +89,13 @@ export default {
// margin-top: vh(20);
display: flex;
align-items: center;
justify-content: flex-end;
justify-content: space-between;
.right {
flex: 1;
display: flex;
align-items: center;
justify-content: flex-end;
}
// padding-bottom: vh(20);
::v-deep .el-pagination__jump {
margin: 0;

@ -4,7 +4,7 @@
* @Author: JC9527
* @Date: 2023-09-04 10:20:06
* @LastEditors: JC9527
* @LastEditTime: 2023-09-15 09:40:29
* @LastEditTime: 2023-09-20 11:25:04
-->
<template>
<div class="plan-management">
@ -207,10 +207,10 @@
//
exportFile(){
this.$confirm(`确认根据您的搜索条件导出搜索之后的数据吗?`, "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.download(
"/pharmaceuticals/bPlanManage/export",
@ -293,7 +293,7 @@
async getList(pages){
this.loading = true;
let res = await this.$api.yingji.bPlanManage('get',_,pages);
console.log(res);
// console.log(res);
if(res.code == 200) {
this.loading = false;
}

Loading…
Cancel
Save