| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272 |
- <template>
- <view class="content">
- <view class="param">
- <view class="all-text">创建项目需求</view>
- <view class="proName">项目标题</view>
- <input class="proINname" v-model="data.projectName" placeholder="请输入项目标题"/>
- <view class="proMiao">项目描述</view>
- <textarea class="proINname proIMi" v-model="data.projectContent" placeholder="请输入项目描述"/>
- <view class="proMiao">附件</view>
- <view class="upload-img">
- <uni-file-picker limit="3" :maxMb="2"
- @select='selectUpload'
- @delete="deleteHandle"
- :auto-upload='false'
- file-extname='pdf,docx,jpg,png,jpeg,doc,docm,dot,dotm,dotx,xlsx,xls,csv,xlsm,slxb,xlt,xltx'
- file-mediatype="all"
- @success='uploadSuccess'
- @fail='uploadFail'
- :list-styles='listStyles'
- v-model='fileList'
- ></uni-file-picker>
- </view>
- <span style="margin: 20rpx 0 0 20rpx;">支持pdf,docx,jpg,png,jpeg,doc,docm,dot,dotm,dotx,xlsx,xls,csv,xlsm,slxb,xlt,xltx格式,单个文件大小不超过2MB</span>
- <view class="proMiao">主办单位/主办人</view>
- <uni-data-picker placeholder="请选择主办单位" popup-title="请选择主办人" :localdata="range" v-model="value"
- @change="onchange" @nodeclick="onnodeclick" @popupopened="onpopupopened" @popupclosed="onpopupclosed">
- </uni-data-picker>
- <view class="proINname" style="height: 100%;">
- <view v-if="userListSelectwei1.length>0" class="tag-view" v-for="(value,key) in userListSelectwei1" :key="key" @click="clearTagAdminwei1(value)">
- <uni-tag :text="value.value+'/'+value.text[key]" type="primary" ></uni-tag>
- <uni-icons class="clearBtn" type="clear" size="15" color="#ccc" />
- </view>
- <view v-if="userListSelectwei1.length==0" class="tag-view" v-for="(value,key) in userListSelect1" :key="key" @click="clearTagAdmin1(value)">
- <uni-tag :text="value.parent_value.organize+'/'+value.text" type="primary" ></uni-tag>
- <!-- {{value.parent_value.organize}}/{{value.text}} -->
- <uni-icons class="clearBtn" type="clear" size="15" color="#ccc" />
- </view>
- </view>
- <!-- <view class="proMiao">主办单位</view>
- <uni-data-select class="proINname"
- v-model="value" placeholder="请选择主办单位"
- :localdata="range"
- @change="change"
- ></uni-data-select>
- <view class="proMiao">主办人</view>
- <uni-data-select class="proINname"
- v-model="peopleValue" placeholder="请选择主办人"
- :localdata="rangePeople"
- @change="change"
- ></uni-data-select> -->
- <view class="proMiao">协办单位/协办人</view>
- <uni-data-picker placeholder="请选择协办单位" popup-title="请选择协办人" :showSearch= "true" :localdata="range" v-model="value2"
- @change="onchange2" @nodeclick="onnodeclick2" @popupopened="onpopupopened2" @popupclosed="onpopupclosed2">
- </uni-data-picker>
- <view class="proINname" style="height: 100%;">
- <view v-if="userListSelectwei.length>0" class="tag-view" v-for="(value,key) in userListSelectwei" :key="key" @click="clearTagAdminwei(value)">
- <uni-tag :text="value.value+'/'+value.text[key]" type="primary" ></uni-tag>
- <uni-icons class="clearBtn" type="clear" size="15" color="#ccc" />
- </view>
- <view v-if="userListSelectwei.length==0" class="tag-view" v-for="(value,key) in userListSelect" :key="key" @click="clearTagAdmin(value)">
- <uni-tag :text="value.parent_value.organize+'/'+value.text" type="primary" ></uni-tag>
- <!-- {{value.parent_value.organize}}/{{value.text}} -->
- <uni-icons class="clearBtn" type="clear" size="15" color="#ccc" />
- </view>
- </view>
- <!-- <view class="proMiao">协办单位</view>
- <mySelectCheckbox class="proINname" placeholder="请选择协办单位" v-model="value2" multiple dataKey="label" dataValue="value" :localdata="data2"
- @change="changeXie"></mySelectCheckbox>
- <view class="proMiao">协办人</view>
- <mySelectCheckbox class="proINname" placeholder="请选择协办人" v-model="peopleValue2" multiple dataKey="label" dataValue="value" :localdata="dataPeople"
- @change="changeXiePeo"></mySelectCheckbox> -->
-
- <view class="proMiao">项目级别</view>
- <uni-data-select class="proINname"
- v-model="jibieValue" placeholder="请选择项目级别"
- :localdata="jibie"
- @change="change"
- ></uni-data-select>
- <view class="proMiao">项目来源</view>
- <uni-data-select class="proINname"
- v-model="fromValue" placeholder="请选择项目来源"
- :localdata="from"
- @change="change"
- ></uni-data-select>
- <view class="proMiao">项目评分人</view>
- <uni-combox class="proINname"
- :scorePeople="scorePeople" labelKey="label" valueKey="value"
- placeholder="请选择项目评分人"
- v-model="peoplescore"
- @input="comboxInput"
- ></uni-combox>
- </uni-forms-item>
- <view class="proINname" style="height: 100%;">
- <view v-if="userListSelectweiP.length>0" class="tag-view" v-for="(value,key) in userListSelectweiP" :key="key" @click="clearTagAdminweiP(value)">
- <uni-tag :text="value.text" type="primary" ></uni-tag>
- <uni-icons class="clearBtn" type="clear" size="15" color="#ccc" />
- </view>
- <view v-if="userListSelectweiP.length==0" class="tag-view" v-for="(value,key) in scorePeople22" :key="key" @click="clearTagAdminP(value)">
- <uni-tag :text="value" type="primary" ></uni-tag>
- <!-- {{value.parent_value.organize}}/{{value.text}} -->
- <uni-icons class="clearBtn" type="clear" size="15" color="#ccc" />
- </view>
- </view>
- <view class="proMiao jindu">完成进度</view>
- <view class="weidu">维度权重{{weidu}}%</view>
- <view class="addRen" @click="addRen" v-if="crerenwu==1&& (select==5 || select==3)">新增任务</view>
- <!-- 任务列表 -->
- <view style="width: 100%;margin: 50rpx 0 0 20rpx;">
- <view class="renwu" v-for="(item,index) in renwu" :key="index" @click="clickRenwu(item)">
- <view>{{item.taskName}}</view>
- <view>{{item.createTime}}</view>
- <view v-if="item.finishTime!=null">{{item.finishRemark}}</view>
- <view v-if="gengrenwu==1">{{item.weight}}</view>
- <view v-if="item.state==1">已完成</view>
- <view style="color: rgba(0, 97, 255, 1);" @click.stop="updateJin(item)" v-if="gengrenwu==1&& (select==5 || select==3|| select==4)">更新进度</view>
- <view style="color: rgba(0, 97, 255, 1);" @click.stop="cuirenwu2(item)" v-if="cuirenwu==1">催办</view>
- <view style="display: flex;">
- <view class="renwu-bu bianji" v-if="item.finishTime==null&&uprenwu==1&& (select==5 || select==3)" @click.stop="bianjiRenwu(item)">编辑</view>
- <view class="renwu-bu delete" @click.stop="deleteRenwu(item)" v-if="delerenwu==1&& (select==5 || select==3)">删除</view>
- </view>
- </view>
- </view>
-
- <!-- <view style="width: 100%;margin: 50rpx 0 0 20rpx;">
- <view class="renwu" v-for="(item,index) in renwu" :key="index">
- <view>{{item.taskName}}</view>
- <view>{{item.createTime}}</view>
- <view>{{item.weight}}</view>
- <view>{{item.scoreLimit}}</view>
- <view style="color: rgba(0, 97, 255, 1);" @click="updateJin(item)" v-if="gengrenwu==1">更新进度</view>
- <view style="color: rgba(0, 97, 255, 1);" @click="cuirenwu(item)" v-if="cuirenwu==1">催办</view>
- </view>
- </view> -->
- <view class="proMiao jindu" v-if="data.progress>0">进度详情</view>
- <!-- 进度 -->
- <view style="margin: 33rpx 0 0 19rpx;" v-if="data.progress>0">
- <view v-for="(item,index) in 5" :key="index" class="jindu-kuang">
- <view style="display: flex;">
- <view class="jindu-circle"></view>
- <view>
- <view style="width: 600rpx;display: flex;justify-content: space-between;margin-top: 20rpx;">
- <view style="display: flex;">
- <view style="margin-left: 28rpx;">{{item.createName}}</view>
- <view class="jindu-type lixiang">{{item.content}}</view>
- </view>
- <!-- <view class="jindu-type cuiban">已催办</view>
- <view class="jindu-type tijiao">已提交</view> -->
- <view>{{item.createTime}}</view>
- </view>
- <view style="margin:7rpx 0 0 28rpx;">项目名:{{item.projectName}}</view>
- </view>
- </view>
- <!-- <view class="jindu-line" v-if="index<4"></view> -->
-
- </view>
- </view>
- <view class="project">
- <view class="butt queren" @click="updatePro">保存</view>
- </view>
- <view style="width: 100%;height: 60rpx;"></view>
- </view>
- <!-- 图片压缩 -->
- <Compress ref="Compress" />
- </view>
- </template>
- <script>
- import configdata from '@/common/config.js'
- import mySelectCheckbox from '../../components/my-selectCheckbox.vue'
- // 引入压缩组件
- import Compress from '@/components/compress/compress.vue'
- export default {
- components:{
- mySelectCheckbox,
- Compress
- },
- data() {
- return {
- data:{},
- //主办单位
- value: '1-2',
- range: [],
- //主办人
- peopleValue:'',
- rangePeople:[],
- userListSelect1:[],
- userListSelectwei1:[
- {value:'',text:''},
- ],
- //协办
- value2:'',
- userListSelect:[],
- userListSelectwei:[
- {value:'',text:''},
- ],
- data2: [],
- xieban:[],//协办传入值数组
- xieValue:[],//协办传入id
- //协办人
- peopleValue2:[],
- dataPeople: [],
- xiebanPeople:[],//协办传入值数组
- xieValuePeople:[],//协办传入id
- //评分人
- peoplescore:[],
- scorePeople: [],
- scorePeople22:[],//协办传入值数组
- userListSelectweiP:[],
- scoreValuePeople:[],//协办传入id
- // 项目级别
- jibieValue:0,
- jibie:[
- { value: 0, text: "正常" },
- { value: 1, text: "紧急" },
- ],
- // 项目来源
- fromValue:0,
- from:[
- { value: 0, text: "涉内" },
- { value: 1, text: "涉外" },
- ],
- fileList: [],
- fileList2: [],
- fileList22:'',
- // fileList: [
- // {name:'111'},
- // {name:'333'}
- // ],
- listStyles: {
- "borderStyle": {
- "width": "0", // 边框宽度
- },
- "border": false, // 是否显示边框
- "dividline": false
- },
- renwu:[],
-
- weidu:'',
-
- crerenwu:1,//添加任务
- uprenwu:1,//修改任务
- delerenwu:1,//是否删除任务
- cuirenwu:1,//催办任务
- gengrenwu:1,//是否更新任务
- select:0,//状态
- }
- },
- onShow() {
- // console.log('aa',sessionStorage.getItem("crerenwu"))
- this.crerenwu=sessionStorage.getItem("crerenwu")
- this.uprenwu=sessionStorage.getItem("uprenwu")
- this.delerenwu=sessionStorage.getItem("delerenwu")
- this.cuirenwu=sessionStorage.getItem("cuirenwu")
- this.gengrenwu=sessionStorage.getItem("gengrenwu")
- this.getPeopleZhu()
- },
- onLoad(option) {
- this.select=option.select
-
- console.log(JSON.parse(decodeURIComponent(option.data)))
- var wei=JSON.parse(decodeURIComponent(option.weidu))
- this.data=JSON.parse(decodeURIComponent(option.data))
- this.weidu=(wei[2].configValue)
- // this.getDanwei()
- this.getPeople(this.data.organize)
- for(var i=0;i<this.jibie.length;i++){
- if(this.jibie[i].text==this.data.projectLevel){
- this.jibieValue=this.jibie[i].value
- }
- }
- for(var i=0;i<this.from.length;i++){
- if(this.from[i].text==this.data.projectFrom){
- this.fromValue=this.from[i].value
- }
- }
- var image=[]
- image=this.data.fileUrl.split(',')
- this.fileList =image.map(item =>{
- return {
- name: item
- }
- })
- this.fileList2=image
- this.fileList22=image.join(",")
- console.log(this.fileList)
- this.getRenwu()
-
- console.log(this.data.coOrganize.split(','))
- // this.userListSelect=
- this.userListSelectwei=[]
- this.userListSelectwei1=[]
- this.userListSelectweiP=[]
- var zhuban=[]
- var zhubanpeo=[]
- var zhubanV=[]
- zhuban=this.data.organize.split(',')
- zhubanpeo=this.data.sposonerName.split(',')
- zhubanV=this.data.sposoner.split(',')
- this.userListSelectwei1=zhuban.map(item =>{
- console.log(item)
- return {
- value: item,
- text:zhubanpeo,
- id:zhubanV
- }
- })
- var xieban=[]
- var xiebanpeo=[]
- var xiebanV=[]
- xieban=this.data.coOrganize.split(',')
- xiebanpeo=this.data.coSposonerName.split(',')
- xiebanV=this.data.coSposoner.split(',')
- this.userListSelectwei=xieban.map(item =>{
- console.log(item)
- return {
- value: item,
- text:xiebanpeo,
- id:xiebanV
- }
- })
- var pingpeo=[]
- var pingId=[]
- pingpeo=this.data.scorerName.split(',')
- pingId=this.data.scorer.split(',')
- this.userListSelectweiP=pingpeo.map(item =>{
- return {
- value: pingId,
- text:item,
- }
- })
- // for(var i=0;i<xieban.length;i++){
- // // for(var j=0;j<xiebanpeo.length;j++){
- // // this.userListSelectwei.push({value:xieban[0]},{text:xiebanpeo[0]})
- // // }
- // }
- // this.userListSelectwei.push({value:xieban[0]},{text:xiebanpeo[0]})
- // xieban.map(item =>{
- // tt.push({value:item})
- // // return {
- // // value: item2,
- // // text: item,
- // // }
- // })
- // this.userListSelectwei=tt
- console.log(this.userListSelectweiP,'t')
- // xiebanpeo.map(item =>{
- // this.userListSelectwei.push({text:item})
- // // return {
- // // value: item2,
- // // text: item,
- // // }
- // })
- // this.userListSelectwei=xiebanpeo.map(item =>{
- // return {
- // value: item,
- // }
- // })
- // this.userListSelectwei.push(xieban,xiebanpeo)
- console.log(this.userListSelectwei,'p')
- },
- methods: {
- change(e) {
- console.log("e:", e);
- },
- //主办人
- onnodeclick(data) {
- console.log(data);
- if(data.parent_value){//存在父级
- let dataId = data.value;
- this.userListSelect1.push(data);
- this.userListSelect1 = [...new Set(this.userListSelect1)]//es6数组去重
- this.userListSelectwei1=[]
- }
- console.log(this.userListSelectwei1,'多选',this.userListSelect1)
- },
- onpopupopened(e) {
- console.log('popupopened');
- },
- onpopupclosed(e) {
- console.log('popupclosed');
- },
- onchange(e) {
- console.log('---------onchange:', e);
- var acc=e.detail.value[0].text
- this.getPeople(acc)
- },
- //主办人
- clearTagAdmin(value){
- this.userListSelect1 = this.userListSelect1.filter(item => item != value);
- },
- clearTagAdminwei(value){
- this.userListSelectwei1 = this.userListSelectwei1.filter(item => item != value);
- },
- //协办人
- clearTagAdmin(value){
- this.userListSelect = this.userListSelect.filter(item => item != value);
- },
- clearTagAdminwei1(value){
- this.userListSelectwei = this.userListSelectwei.filter(item => item != value);
- },
- onnodeclick2(data) {
- console.log(data);
- if(data.parent_value){//存在父级
- let dataId = data.value;
- this.userListSelect.push(data);
- this.userListSelect = [...new Set(this.userListSelect)]//es6数组去重
- this.userListSelectwei=[]
- }
- console.log(this.userListSelectwei,'多选',this.userListSelect)
-
- },
- onpopupopened2(e) {
- console.log('popupopened');
- },
- onpopupclosed2(e) {
- console.log('popupclosed');
- },
- onchange2(e) {
- console.log('---------onchange:', e);
- },
- // @input combox输入事件 返回combox值
- comboxInput(e) {
- console.log('e:', e);
- // this.peoplescore=e
- // this.scorePeople22=[]
- // this.scoreValuePeople=[]
- for(var i=0;i<this.scorePeople.length;i++){
- if(e==this.scorePeople[i].value){
- this.userListSelectweiP=[]
- this.scorePeople22.push(this.scorePeople[i].label)
- this.scoreValuePeople.push(this.scorePeople[i].value)
- }
- }
- console.log(this.scorePeople22)
- },
- clearTagAdminP(value){
- this.scorePeople22 = this.scorePeople22.filter(item => item != value);
- },
- clearTagAdminweiP(value){
- this.userListSelectweiP = this.userListSelectweiP.filter(item => item != value);
- },
- //新增任务
- addRen(){
- var shuzu=[
- {userName:'',department:'',id:''}
- ]
- var xieban=[]
- var xiebanpeo=[]
- var tt=[]
- var xiebanV=[]
- var a1=this.data.sposonerName+','+this.data.coSposonerName
- var a2=this.data.organize+','+this.data.coOrganize
- var a3=this.data.sposoner+','+this.data.coSposoner
- xieban=a1.split(',')
- xiebanpeo=a2.split(',')
- xiebanV=a3.split(',')
- shuzu=xieban.map(item =>{
- console.log(item)
- return {
- userName: item,
- }
- })
- shuzu.forEach((item,index) => {
- console.log(item);
- this.$set(item,"department",xiebanpeo[index])
- this.$set(item,"id",xiebanV[index])
- })
- let t2=JSON.stringify(shuzu)
- //这里———————————————————————————
- let query2 = encodeURIComponent(t2)
- uni.navigateTo({
- url:'/pages/project/addRenwu?proId='+this.data.id+'&people='+query2
- })
- },
- //编辑任务
- bianjiRenwu(item){
- var shuzu=[
- {userName:'',department:'',id:''}
- ]
- var xieban=[]
- var xiebanpeo=[]
- var tt=[]
- var xiebanV=[]
- var a1=this.data.sposonerName+','+this.data.coSposonerName
- var a2=this.data.organize+','+this.data.coOrganize
- var a3=this.data.sposoner+','+this.data.coSposoner
- xieban=a1.split(',')
- xiebanpeo=a2.split(',')
- xiebanV=a3.split(',')
- shuzu=xieban.map(item =>{
- console.log(item)
- return {
- userName: item,
- }
- })
- shuzu.forEach((item,index) => {
- console.log(item);
- this.$set(item,"department",xiebanpeo[index])
- this.$set(item,"id",xiebanV[index])
- })
- let t2=JSON.stringify(shuzu)
- //这里———————————————————————————
- let query2 = encodeURIComponent(t2)
-
- //传参对象,使用encodeURIComponent编码
- let str = JSON.stringify(item)
- //注意这里——————————————————————
- str = str.replace(/%/g, '%25')
- //这里———————————————————————————
- let query = encodeURIComponent(str)
- uni.navigateTo({
- url:'/pages/project/changeRenwu?data='+query+'&people='+query2
- })
- },
- //删除任务
- deleteRenwu(item){
- let that = this
- uni.showModal({
- title: '提示',
- content: '确定删除任务吗?',
- success: function(res) {
- if (res.confirm) {
- console.log('用户点击确定');
- uni.showLoading({
- title: '加载中',
- mask: true, // 是否显示透明蒙层,防止触摸穿透
- });
- let data={
- id:item.id,
- }
- that.$Request.postT('/api/sysTask/del',data).then(res => {
- if (res.code==200) {
- uni.showToast({
- title: '删除成功',
- icon: 'none',
- duration:800
- });
- uni.hideLoading()
-
- setTimeout(function() {
- that.getRenwu()
- }, 1000)
- } else {
- uni.hideLoading();
- uni.showToast({
- title: res.message,
- icon: 'none',
- duration:800
- });
- }
- });
- } else if (res.cancel) {
- console.log('用户点击取消');
- }
- }
- })
- },
- //任务详情
- clickRenwu(item){
- var shuzu=[
- {userName:'',department:'',id:''}
- ]
- var xieban=[]
- var xiebanpeo=[]
- var tt=[]
- var xiebanV=[]
- var a1=this.data.sposonerName+','+this.data.coSposonerName
- var a2=this.data.organize+','+this.data.coOrganize
- var a3=this.data.sposoner+','+this.data.coSposoner
- xieban=a1.split(',')
- xiebanpeo=a2.split(',')
- xiebanV=a3.split(',')
- shuzu=xieban.map(item =>{
- console.log(item)
- return {
- userName: item,
- }
- })
- shuzu.forEach((item,index) => {
- console.log(item);
- this.$set(item,"department",xiebanpeo[index])
- this.$set(item,"id",xiebanV[index])
- })
- let t2=JSON.stringify(shuzu)
- //这里———————————————————————————
- let query2 = encodeURIComponent(t2)
-
- //传参对象,使用encodeURIComponent编码
- let str = JSON.stringify(item)
- //注意这里——————————————————————
- str = str.replace(/%/g, '%25')
- //这里———————————————————————————
- let query = encodeURIComponent(str)
- uni.navigateTo({
- url:'/pages/project/renwuX?data='+query+'&people='+query2
- })
- },
- //更新进度
- updateJin(item){
- //传参对象,使用encodeURIComponent编码
- let str = JSON.stringify(item)
- //注意这里——————————————————————
- str = str.replace(/%/g, '%25')
- //这里———————————————————————————
- let query = encodeURIComponent(str)
- uni.navigateTo({
- url:'/pages/project/renwuUpdateJin?data='+query
- })
- },
- //催办任务
- cuirenwu2(item){
- let that = this
- uni.showModal({
- title: '提示',
- content: '确定催办任务吗?',
- success: function(res) {
- if (res.confirm) {
- console.log('用户点击确定');
- uni.showLoading({
- title: '加载中',
- mask: true, // 是否显示透明蒙层,防止触摸穿透
- });
- let data={
- taskId:item.id,
- }
- that.$Request.postT('/api/sysTask/urge',data).then(res => {
- if (res.code==200) {
- uni.showToast({
- title: '催办成功',
- icon: 'none',
- duration:800
- });
- uni.hideLoading()
-
- setTimeout(function() {
- that.getRenwu()
- }, 1000)
- } else {
- uni.hideLoading();
- uni.showToast({
- title: res.message,
- icon: 'none',
- duration:800
- });
- }
- });
- } else if (res.cancel) {
- console.log('用户点击取消');
- }
- }
- })
- },
- //获取单位
- getDanwei(){
- this.range=[]
- this.data2=[]
- uni.showLoading({
- title: '加载中',
- mask: true, // 是否显示透明蒙层,防止触摸穿透
- });
- this.$Request.postT('/api/Organize/query').then(res => {
- if (res.code==200&&res.data) {
- this.range =res.data.map(item =>{
- return {
- value: item.id,
- text: item.oname,
- id:item.oid
- }
- })
- this.data2 =res.data.map(item =>{
- return {
- value: item.id,
- label: item.oname,
- id:item.oid
- }
- })
- for(var i=0;i<this.range.length;i++){
- if(this.range[i].text==this.data.organize){
- this.value=this.range[i].value
- }
- }
- // for(var i=0;i<this.data2.length;i++){
- // if(this.data2[i].label==this.data.){
- // this.value2=this.data2[i].value
- // }
- // }
- }
- uni.hideLoading();
-
- });
- },
- //获取主办协办人
- getPeopleZhu(){
- this.range=[]
- this.rangePeople=[]
- uni.showLoading({
- title: '加载中',
- mask: true, // 是否显示透明蒙层,防止触摸穿透
- });
- this.$Request.postJson('/api/sysProject/queryCoUsers',{}).then(res => {
- if (res.code==200) {
- var lianji=[]
- for(var i=0;i<res.data.length;i++){
- if(res.data[i].userList.length>0){
- lianji.push(res.data[i])
- }
- }
- this.range =lianji.map(item =>{
- return {
- value: item,
- text: item.organize,
- children:item.userList.map(item =>{
- return{
- value: item.id,
- text: item.userName,
- }
- })
- }
- })
-
- console.log(this.range,'人')
- this.value=parseInt(this.data.sposoner)//25
- this.userListSelect1={
- parent_value:{
- organize:this.data.organize
- }
- }
- }else{
- var ii=JSON.stringify(res)
- console.log(res,res.data)
- console.log(JSON.parse(res))
- console.log(JSON.parse(ii))
- }
- uni.hideLoading();
- });
- },
- //根据单位获取人员(评分人)
- getPeople(acc){
- console.log(this.userListSelect1)
- this.scorePeople=[]
- uni.showLoading({
- title: '加载中',
- mask: true, // 是否显示透明蒙层,防止触摸穿透
- });
- this.$Request.postT('/api/sysUser/queryScorer',{
- organizes:acc
- }).then(res => {
- if (res.code==200) {
- console.log(res,'评分')
- this.scorePeople =res.data.map(item =>{
- return {
- value: item.id,
- label: item.userName,
- }
- })
- console.log(this.scorePeople,'人')
-
- // var people=[]
- // people=this.data.scorerName.split(',')
- // for(var j=0;j<this.scorePeople.length;j++){
- // for(var i=0;i<people.length;i++){
- // console.log(this.scorePeople[j].label,'ll',people[i])
- // if(this.scorePeople[j].label==people[i]){
- // this.peoplescore.push(this.scorePeople[j].value)
- // this.scoreValuePeople.push(this.scorePeople[j].value)
- // }
- // }
- // }
- }else{
- var ii=JSON.stringify(res)
- console.log(res,res.data)
- console.log(JSON.parse(res))
- console.log(JSON.parse(ii))
- }
- uni.hideLoading();
- });
- },
- // 查找任务
- getRenwu(){
- let that = this
- that.renwu=[]
- uni.showLoading({
- title: '加载中',
- mask: true, // 是否显示透明蒙层,防止触摸穿透
- });
- var data={
- "projectId": that.data.id
- }
- that.$Request.postT('/api/sysTask/queryTaskByProject',data).then(res => {
- if (res.code==200) {
- that.renwu=res.data
- console.log(that.renwu,'任务')
- }
- uni.hideLoading();
- });
- },
- // 上传附件
- uploadSuccess(e) {
- console.log('上传成功', e)
- },
- uploadFail(e) {
- console.log('上传失败:', e)
- },
- //保存编辑项目
- updatePro(){
- console.log(this.userListSelectwei)
- var xieban=[]
- var xiebanValue=[]
- if(this.userListSelectwei.length>0){
- this.userListSelectwei.map(item =>{
- xieban.push(item.value)
- xiebanValue.push(item.id[0])
- })
- }else{
- this.userListSelect.map(item =>{
- xieban.push(item.parent_value.organize)
- xiebanValue.push(item.value)
- })
- }
- var zhuban=[]
- var zhubanValue=[]
- if(this.userListSelectwei1.length>0){
- this.userListSelectwei1.map(item =>{
- zhuban.push(item.value)
- zhubanValue.push(item.id[0])
- })
- }else{
- this.userListSelect1.map(item =>{
- zhuban.push(item.parent_value.organize)
- zhubanValue.push(item.value)
- })
- }
- var pinfen=[]
- if(this.userListSelectweiP.length>0){
- this.userListSelectweiP.map(item =>{
- pinfen.push(item.value)
- })
- }else{
- this.scorePeople22.map(item =>{
- pinfen.push(item)
- })
- }
- console.log(pinfen)
- let that = this
- if (!that.data.projectName) {
- that.$queue.showToast("请输入项目标题");
- }else if (!that.data.projectContent) {
- that.$queue.showToast("请输入项目描述");
- }else {
- uni.showLoading({
- title: '加载中',
- mask: true, // 是否显示透明蒙层,防止触摸穿透
- });
- that.$Request.postJson("/api/sysProject/update", {
- "id": that.data.id,
- "projectName": that.data.projectName, // 项目名称
- "projectFrom": that.from[that.fromValue].text, // 项目来源
- "projectLevel": that.jibie[that.jibieValue].text, // 项目等级
- "projectContent": that.data.projectContent, // 项目描述
- "fileUrl": that.fileList22, // 附件
- "organize": zhuban.join(","), // 主办单位-单选
- "sposoner": zhubanValue.join(","), // 主办人ID-单选
- "coOrganize": xieban.join(","), // 协办单位-多选
- "coSposoner": xiebanValue.join(",") ,// 协办人ID-多选
- "scorer": pinfen.join(",") // 评分人ID-多选
- }).then(res => {
- if (res.code == 200) {
- uni.showToast({
- title: '修改成功',
- icon: 'none',
- duration:800
- });
- uni.hideLoading()
-
- setTimeout(function() {
- uni.switchTab({
- url:'/pages/project/index'
- })
- }, 1000)
- } else {
- uni.hideLoading();
- uni.showToast({
- title: res.message,
- icon: 'none',
- duration:800
- });
- }
- });
- }
- },
- //删除文件
- deleteHandle(index){
- console.log(index)
- this.fileList2.splice(index.index,1)
- console.log(this.fileList2)
- this.fileList22=this.fileList2.join(",")
- },
- async selectUpload(e) {
- console.log('上传:', e)
- // console.log((e.tempFiles[0].size / 1024 > 1024 * 2),'大小')
- if(e.tempFiles.length>0){
- for (let i = 0; i < e.tempFilePaths.length; i++) {
- if ((e.tempFiles[i].size / 1024 > 1024 * 2)) {
- console.log('过大',e.tempFiles[i].extname)
- if(e.tempFiles[i].extname=='jpg' || e.tempFiles[i].extname=='png'||e.tempFiles[i].extname=='jpeg'){
- this.yaimg(e.tempFilePaths[i])
- }else{
- uni.showModal({
- title: '提示',
- content: '文件大于2M,无法上传',
- showCancel: false, // 是否显示取消按钮,默认为 true // 是否显示取消按钮,默认为 true
- success: function(res) {
- if (res.confirm) {
- }
- }
- });
- }
- }else{
- this.imgUpload(e.tempFiles[i].file);
- }
- }
- }
- },
- //上传图片
- async imgUpload(result){
- uni.showLoading({
- title: '上传中',
- mask: true, // 是否显示透明蒙层,防止触摸穿透
- });
- let data = new FormData();
- data.set("file", result);
- let res = await this.$axios({
- method: "post",
- url: this.config('APIHOST1') + "/api/sysFile/upload",
- headers: {
- tokenW: sessionStorage.getItem("token"),
- "Content-Type": "multipart/form-data"
- },
- data: data,
- });
- // return res
- console.log(res, "图片上传成功");
- if (res.data.code == 200) {
- console.log(this.fileList2)
- this.fileList2.push(res.data.data);
- this.fileList22=this.fileList2.join(",")
- // console.log(this.fileList2.join(","))
- uni.hideLoading();
- } else if(res.message=="登录凭证已过去,请重新登录"){
- sessionStorage.removeItem("token")
- sessionStorage.removeItem("roleId")
- uni.showModal({
- title: '提示',
- content: '用户信息失效,请重新登录!',
- showCancel: false, // 是否显示取消按钮,默认为 true // 是否显示取消按钮,默认为 true
- success: function(res) {
- if (res.confirm) {
- }
- }
- });
- uni.hideLoading();
- }else {
- uni.showToast({
- title: res.message,
- icon: 'none',
- duration:800
- });
- uni.hideLoading();
- }
- },
- /**
- * 压缩图片
- * @description 由组件处理,只需传入临时路径
- * @param {Object} url - 临时路径
- * @return void
- */
- yaimg(url) {
- uni.showLoading({
- title: '压缩中',
- mask: true, // 是否显示透明蒙层,防止触摸穿透
- });
- // 组件参数也有文档,详见文章的最底部!
- // const config = {
- // src: url,//要压缩的临时路径
- // maxSize: 800,//压缩后的最大尺寸
- // fileType: 'png',//压缩后的文件类型,可选值 jpg、png
- // quality: 0.6,//压缩后的质量(仅jpg类型有效,原因可自行阅读官方canvas文档),可选值 0 ~ 1,值越大越清晰(图片也越大)
- // }
- // console.log(config)
- // 调用压缩方法
- this.$refs.Compress.compress({
- src: url,//要压缩的临时路径
- maxSize: 800,//压缩后的最大尺寸
- fileType: '',//压缩后的文件类型,可选值 jpg、png
- quality: 0.6,//压缩后的质量(仅jpg类型有效,原因可自行阅读官方canvas文档),可选值 0 ~ 1,值越大越清晰(图片也越大)
- }).then((res) => {
- // console.log('返回的base64编码', res)
- this.base = res
-
- // 时间戳 + 随机数, 防止文件名重复
- let timestamp = new Date().getTime();
- let sunumber = Math.floor(Math.random()*999);
- // H5需要将base64转为file对象进行上传
- // 第一个参数是base64编码, 第二个是文件名
- var file = this.base64ToFile(res, timestamp + sunumber)
-
- // 最终压缩完毕的file对象
- console.log('压缩后的图片(File对象)', file)
- this.upload(file)
- this.file = file
-
- uni.hideLoading();
- //上传到服务器
- // this.upload(file)
- }).catch((err) => {
- console.log('压缩失败',err)
- uni.hideLoading();
- })
- },
- /**
- * 压缩后上传到服务器
- * @description 这块需要您自行处理
- * @param {Object} file - 要上传的file对象
- * @return void
- */
- async upload(file){
- uni.showLoading({
- title: '上传中',
- mask: true, // 是否显示透明蒙层,防止触摸穿透
- });
- let data = new FormData();
- data.set("file", file);
- console.log(data)
- let res = await this.$axios({
- method: "post",
- url: this.config('APIHOST1') + "/api/sysFile/upload",
- headers: {
- tokenW: sessionStorage.getItem("token"),
- "Content-Type": "multipart/form-data"
- },
- data: data,
- });
- // return res
- console.log(res, "图片上传成功",res.data.code == 200);
- if (res.data.code == 200) {
- this.fileList2.push(res.data.data);
- this.fileList22=this.fileList2.join(",")
- console.log(this.fileList22)
- uni.hideLoading();
- }else {
- uni.showToast({
- title: res.message,
- icon: 'none',
- duration:800
- });
- uni.hideLoading();
- }
- },
- /**
- * base64 → File
- * @description 转换函数
- * @param {String} base64- base64完整字符串
- * @param {String} name - 文件名
- * @return Object
- */
- base64ToFile(base64, name) {
- if (typeof base64 != 'string') { return; }
- var arr = base64.split(',')
- var type = arr[0].match(/:(.*?);/)[1]
- var fileExt = type.split('/')[1]
- var bstr = atob(arr[1])
- var n = bstr.length
- var u8arr = new Uint8Array(n)
- while (n--) {
- u8arr[n] = bstr.charCodeAt(n)
- }
- return new File([u8arr], `${name}.` + fileExt, {
- type: type
- })
- },
- config: function (name) {
- var info = null
- if (name) {
- var name2 = name.split('.') //字符分割
- if (name2.length > 1) {
- info = configdata[name2[0]][name2[1]] || null
- } else {
- info = configdata[name] || null
- }
- if (info == null) {
- let web_config = cache.get('web_config')
- if (web_config) {
- if (name2.length > 1) {
- info = web_config[name2[0]][name2[1]] || null
- } else {
- info = web_config[name] || null
- }
- }
- }
- }
- return info
- },
- }
- }
- </script>
- <style>
- .content {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- }
- .param{
- margin: 20rpx 0 0 0;
- width: 100%;
- background-color: rgba(255, 255, 255, 1);
- font-size: 28rpx;
- font-weight: 400;
- line-height: 41rpx;
- color: rgba(0, 0, 0, 1);
- }
- .all-text{
- margin: 22rpx 0 0 20rpx;
- font-size: 32rpx;
- font-weight: 500;
- color: rgba(0, 0, 0, 1);
- }
- .proName{
- margin: 23rpx 0 0 20rpx;
- }
- .proINname{
- margin: 25rpx 0 0 21rpx;
- width: 709rpx;
- height: 90rpx;
- border-radius: 13rpx;
- background: rgba(245, 248, 252, 1);
- border: 1rpx solid rgba(229, 229, 229, 1);
- font-size: 28rpx;
- line-height: 90rpx;
- /* 自动换行 */
- word-wrap: break-word;
- word-break: break-all;
- white-space: pre-line;
- /* color: rgba(179, 179, 179, 1); */
- }
- .proIMi{
- height: 315rpx;
- }
- .proMiao{
- margin: 31rpx 0 0 20rpx;
- }
- /* 上传附件 */
- .upload-img{
- /* width: 200rpx;
- height: 80rpx;
- opacity: 1;
- border-radius: 13rpx;
- background: rgba(0, 97, 255, 0.1);
- border: 1rpx solid rgba(0, 97, 255, 1); */
- }
- .jindu{
- font-size: 32rpx;
- font-weight: 500;
- line-height: 46rpx;
- }
- /* 进度 */
- .jindu-kuang{
- font-size: 24rpx;
- line-height: 35rpx;
- color: rgba(128, 128, 128, 1);
- }
- .jindu-circle{
- margin-top: 10rpx;
- width: 100rpx;
- height: 100rpx;
- border-radius: 50%;
- opacity: 1;
- background-color:rgba(204, 204, 204, 1);
- }
- .jindu-type{
- /* width: 103rpx; */
- height: 40rpx;
- border-radius: 71rpx;
- font-size: 24rpx;
- line-height: 40rpx;
- color: rgba(255, 255, 255, 1);
- text-align: center;
- margin: 0 0 0 20rpx;
- }
- .lixiang{
- background: linear-gradient(90deg, rgba(54, 111, 255, 1) 0%, rgba(93, 160, 252, 1) 100%);
- }
- .cuiban{
- background: linear-gradient(90deg, rgba(57, 167, 139, 1) 0%, rgba(126, 224, 203, 1) 100%);
- }
- .tijiao{
- background: linear-gradient(90deg, rgba(255, 112, 69, 1) 0%, rgba(247, 161, 114, 1) 100%);
- }
- .jindu-line{
- width: 4rpx;
- height: 100rpx;
- background-color: rgba(166, 166, 166, 1);
- }
- .weidu{
- margin: 7rpx 0 0 20rpx;
- font-size: 24rpx;
- line-height: 35rpx;
- color: rgba(128, 128, 128, 1);
- }
- .addRen{
- margin: -80rpx 0 0 581rpx;
- width: 149rpx;
- height: 59rpx;
- border-radius: 92rpx;
- background: rgba(0, 97, 255, 1);
- font-size: 28rpx;
- line-height: 59rpx;
- color: rgba(255, 255, 255, 1);
- text-align: center;
- }
- /* 任务列表 */
- .renwu{
- display: flex;
- margin-top: 6rpx;
- width: 709rpx;
- height: 90rpx;
- border-radius: 13rpx;
- background: rgba(245, 248, 252, 1);
- border: 1rpx solid rgba(229, 229, 229, 1);
- font-size: 28rpx;
- justify-content: space-evenly;
- align-items: center;
- }
- .renwu-bu{
- width: 105rpx;
- height: 50rpx;
- border-radius: 110rpx;
- line-height:50rpx;
- text-align: center;
- }
- .bianji{
- border: 1rpx solid rgba(0, 97, 255, 1);
- color: rgba(0, 97, 255, 1);
- }
- .delete{
- margin-left: 20rpx;
- border: 1rpx solid rgba(212, 48, 48, 1);
- color: rgba(212, 48, 48, 1);
- }
- .project{
- display: flex;
- margin: 61rpx 0 0 0;
- justify-content: space-evenly;
- }
- .butt{
- width: 330rpx;
- height: 90rpx;
- border-radius: 117rpx;
- font-size: 32rpx;
- line-height: 90rpx;
- text-align: center;
- }
- .quxiao{
- border: 1rpx solid rgba(0, 97, 255, 1);
- color: rgba(0, 97, 255, 1);
- }
- .queren{
- background: rgba(0, 97, 255, 1);
- color: rgba(255, 255, 255, 1);
- }
- </style>
|