|
@@ -6,6 +6,8 @@
|
|
|
|
|
|
<!-- 出库单详情 -->
|
|
<!-- 出库单详情 -->
|
|
<view class="details">
|
|
<view class="details">
|
|
|
|
+ <p class="itemp">项目信息</p>
|
|
|
|
+
|
|
<view class="item">
|
|
<view class="item">
|
|
<view class="name">
|
|
<view class="name">
|
|
所属项目<span style="color: red;">*</span>
|
|
所属项目<span style="color: red;">*</span>
|
|
@@ -34,33 +36,28 @@
|
|
<u-input v-model="endTime" @click="show=true,showText='endTime'" @clear="showText='endTime',change('')" placeholder="请输入使用周期" type="select" />
|
|
<u-input v-model="endTime" @click="show=true,showText='endTime'" @clear="showText='endTime',change('')" placeholder="请输入使用周期" type="select" />
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view class="item" v-if="false">
|
|
|
|
|
|
+ <view class="item" >
|
|
<view class="name">
|
|
<view class="name">
|
|
所属项目部<span style="color: red;">*</span>
|
|
所属项目部<span style="color: red;">*</span>
|
|
</view>
|
|
</view>
|
|
<view class="value">
|
|
<view class="value">
|
|
|
|
|
|
- <u-input v-model="project" @click="show2=true,showText='project'" @clear="showText='project',change('')" placeholder="请选择所属项目部" type="select" />
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- <view class="item" v-if="false">
|
|
|
|
- <view class="name">
|
|
|
|
- 第一步审批<span style="color: red;">*</span>
|
|
|
|
- </view>
|
|
|
|
- <view class="value">
|
|
|
|
-
|
|
|
|
- <u-input v-model="approve1" @click="show2=true,showText='approve1'" @clear="showText='approve1',change('')" placeholder="请选择第一步审批人" type="select" />
|
|
|
|
|
|
+ <u-input v-model="xmbId" @click="show3=true,showText='xmbId'" @clear="showText='xmbId',change('')" placeholder="请选择所属项目部" type="select" />
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view class="item" v-if="false">
|
|
|
|
|
|
+ <p class="itemp">选择审批人</p>
|
|
|
|
+ <view class="item" v-for="(item,i) in approveProcessList" :key="i" >
|
|
<view class="name">
|
|
<view class="name">
|
|
- 第二步审批<span style="color: red;">*</span>
|
|
|
|
|
|
+ {{item.name}}<span style="color: red;">*</span>
|
|
</view>
|
|
</view>
|
|
<view class="value">
|
|
<view class="value">
|
|
|
|
|
|
- <u-input v-model="approve2" @click="show2=true,showText='approve2'" @clear="showText='approve2',change('')" placeholder="请选择第二步审批人" type="select" />
|
|
|
|
|
|
+ <u-input v-model="item.approveName" @click="show2=true,showIndex=i"
|
|
|
|
+ @clear="showIndex=i,change2('')"
|
|
|
|
+ :placeholder="'请选择'+item.name+'审批人'" type="select" />
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
+
|
|
|
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
@@ -182,7 +179,9 @@
|
|
</view>
|
|
</view>
|
|
<ujp-calendar v-model="show" mode="date" max-date="2099-01-01" @change="change"></ujp-calendar>
|
|
<ujp-calendar v-model="show" mode="date" max-date="2099-01-01" @change="change"></ujp-calendar>
|
|
|
|
|
|
- <u-select v-model="show2" :list="list2" @confirm="confirm" ></u-select>
|
|
|
|
|
|
+ <u-select v-model="show3" :list="projectList" @confirm="confirm" ></u-select>
|
|
|
|
+
|
|
|
|
+ <u-select v-model="show2" :list="list2" @confirm="confirm2" ></u-select>
|
|
<!-- -sync -sync -->
|
|
<!-- -sync -sync -->
|
|
<u-popup v-model="showpopup" mode="bottom"
|
|
<u-popup v-model="showpopup" mode="bottom"
|
|
border-radius="14"
|
|
border-radius="14"
|
|
@@ -236,11 +235,13 @@
|
|
needTime:"",
|
|
needTime:"",
|
|
endTime:"",
|
|
endTime:"",
|
|
projectName:"",
|
|
projectName:"",
|
|
|
|
+ xmbId:"",
|
|
},
|
|
},
|
|
|
|
|
|
show:false,
|
|
show:false,
|
|
- project:"",
|
|
|
|
|
|
+ xmbId:"",
|
|
showText:"",
|
|
showText:"",
|
|
|
|
+ showIndex:0,
|
|
showpopup:false,
|
|
showpopup:false,
|
|
endTime:'',
|
|
endTime:'',
|
|
needTime:'',
|
|
needTime:'',
|
|
@@ -249,36 +250,17 @@
|
|
queryContent:'',
|
|
queryContent:'',
|
|
list:[],
|
|
list:[],
|
|
show2:false,//审批人 步骤1
|
|
show2:false,//审批人 步骤1
|
|
|
|
+ show3:false,//审批人 步骤1
|
|
//list2:[],
|
|
//list2:[],
|
|
approveList1:[
|
|
approveList1:[
|
|
- {
|
|
|
|
- value: '1',
|
|
|
|
- label: '江1'
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- value: '2',
|
|
|
|
- label: '湖1'
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
],
|
|
],
|
|
approveList2:[
|
|
approveList2:[
|
|
- {
|
|
|
|
- value: '1',
|
|
|
|
- label: '江2'
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- value: '2',
|
|
|
|
- label: '湖2'
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
],
|
|
],
|
|
|
|
+ approveProcessList:[],
|
|
projectList:[
|
|
projectList:[
|
|
- {
|
|
|
|
- value: '1',
|
|
|
|
- label: '江3'
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- value: '2',
|
|
|
|
- label: '湖3'
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
],
|
|
],
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -288,19 +270,71 @@
|
|
computed:{
|
|
computed:{
|
|
list2(){
|
|
list2(){
|
|
var list=[];
|
|
var list=[];
|
|
- if(this.showText=='approve1'){
|
|
|
|
- list=this.approveList1
|
|
|
|
|
|
+ if(this.approveProcessList.length){
|
|
|
|
+ list=this.approveProcessList[this.showIndex].approveUserList.map(item=>{
|
|
|
|
+ return {
|
|
|
|
+ value: item.id,
|
|
|
|
+ label: item.name
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
- if(this.showText=='approve2'){
|
|
|
|
- list=this.approveList2
|
|
|
|
- }
|
|
|
|
- if(this.showText=='project'){
|
|
|
|
- list=this.projectList
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
return list
|
|
return list
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ onReady() {
|
|
|
|
+ this.createOutRecord();
|
|
|
|
+ },
|
|
methods:{
|
|
methods:{
|
|
|
|
+ createOutRecord(){
|
|
|
|
+ uni.showLoading({
|
|
|
|
+ title: "加载中",
|
|
|
|
+ mask: true,
|
|
|
|
+ })
|
|
|
|
+ API.createOutRecord({
|
|
|
|
+
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ uni.hideLoading();
|
|
|
|
+ if(res.data.departmentList){
|
|
|
|
+ this.projectList=res.data.departmentList.map(item=>{
|
|
|
|
+ return {
|
|
|
|
+ value: item.id,
|
|
|
|
+ label: item.name
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ if(this.projectList.length==1){
|
|
|
|
+ this.form.xmbId=this.projectList[0].value;
|
|
|
|
+ this.xmbId=this.projectList[0].label
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(res.data.approveProcessList.length){
|
|
|
|
+ this.approveProcessList=res.data.approveProcessList;
|
|
|
|
+ for(var i in this.approveProcessList){
|
|
|
|
+ var obj=this.approveProcessList[i];
|
|
|
|
+ if(obj.approveUserList.length==1){
|
|
|
|
+ var e=obj.approveUserList
|
|
|
|
+ obj.approveId=e[0].id;
|
|
|
|
+ obj.approveName=e[0].name;
|
|
|
|
+ // this.approveProcessList[i]=obj
|
|
|
|
+ // console.log("ok",obj)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }else{
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: "审批流未配置,请联系管理员",
|
|
|
|
+ icon: "none"
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }).catch(error => {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: error,
|
|
|
|
+ icon: "none"
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ },
|
|
confirm(e) {
|
|
confirm(e) {
|
|
if(e==''){
|
|
if(e==''){
|
|
this.form[this.showText]='';
|
|
this.form[this.showText]='';
|
|
@@ -310,7 +344,16 @@
|
|
this[this.showText]=e[0].label
|
|
this[this.showText]=e[0].label
|
|
}
|
|
}
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
+ confirm2(e) {
|
|
|
|
+ if(e==''){
|
|
|
|
+
|
|
|
|
+ }else{
|
|
|
|
+ var obj=this.approveProcessList[this.showIndex];
|
|
|
|
+ obj.approveId=e[0].value;
|
|
|
|
+ obj.approveName=e[0].label;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ },
|
|
showpopupBtn(){
|
|
showpopupBtn(){
|
|
|
|
|
|
|
|
|
|
@@ -333,7 +376,50 @@
|
|
this[this.showText]=e.year+"年"+e.month+"月"+e.day+"日"
|
|
this[this.showText]=e.year+"年"+e.month+"月"+e.day+"日"
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ change2(e){
|
|
|
|
+ if(e==''){
|
|
|
|
+ this.form[this.showText]='';
|
|
|
|
+ this[this.showText]=''
|
|
|
|
+ }else{
|
|
|
|
+ this.form[this.showText]=e.result;
|
|
|
|
+ this[this.showText]=e.year+"年"+e.month+"月"+e.day+"日"
|
|
|
|
+ }
|
|
|
|
+ },
|
|
submit(){
|
|
submit(){
|
|
|
|
+ var sprData=[]
|
|
|
|
+ if(this.approveProcessList.length){
|
|
|
|
+ var bl=false;
|
|
|
|
+ var k =0
|
|
|
|
+ for(var i in this.approveProcessList){
|
|
|
|
+ k++;
|
|
|
|
+ var obj=this.approveProcessList[i]
|
|
|
|
+ if(obj.approveId){
|
|
|
|
+ sprData.push({
|
|
|
|
+ no:k,
|
|
|
|
+ userId:obj.approveId
|
|
|
|
+ })
|
|
|
|
+ }else{
|
|
|
|
+ bl=true;
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: '请选择'+obj.name+'审批人',
|
|
|
|
+ icon: "none"
|
|
|
|
+ })
|
|
|
|
+ break
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ if(bl){
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: "审批流未配置,请联系管理员",
|
|
|
|
+ icon: "none"
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
if(!this.form.projectName){
|
|
if(!this.form.projectName){
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: "请填写所属项目"
|
|
title: "请填写所属项目"
|
|
@@ -360,8 +446,8 @@
|
|
delete obj.obj
|
|
delete obj.obj
|
|
return obj
|
|
return obj
|
|
})
|
|
})
|
|
- this.form.deviceData=list
|
|
|
|
-
|
|
|
|
|
|
+ this.form.deviceData=list;
|
|
|
|
+ this.form.sprData=sprData;
|
|
uni.showLoading({
|
|
uni.showLoading({
|
|
title: "加载中",
|
|
title: "加载中",
|
|
mask: true,
|
|
mask: true,
|
|
@@ -562,7 +648,12 @@
|
|
background-color: #fff;
|
|
background-color: #fff;
|
|
margin-top: 24rpx;
|
|
margin-top: 24rpx;
|
|
padding: 0 32rpx;
|
|
padding: 0 32rpx;
|
|
-
|
|
|
|
|
|
+ .itemp{
|
|
|
|
+ margin: 3px 0px;
|
|
|
|
+
|
|
|
|
+ font-size: 16px;
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ }
|
|
.item {
|
|
.item {
|
|
display: flex;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
justify-content: space-between;
|