|
@@ -129,95 +129,108 @@
|
|
|
<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view class="container" style="border-bottom: 1px solid #f8f8f8;">
|
|
|
+ <view class="uni-common-mt" style="width: 100%;">
|
|
|
+ <text class="uni-title uni-common-pl">施工内容</text>
|
|
|
+ <view style="width: 100%;box-sizing: border-box;">
|
|
|
+ <textarea class="textarea" placeholder="请输入施工内容" maxlength="100"
|
|
|
+ placeholder-style="padding: 10rpx;"
|
|
|
+ style="width: 100%;height: 100%;border: 1rpx solid #cccccc; border-radius: 15rpx;padding: 10rpx;line-height:normal;"
|
|
|
+ auto-height v-model="projectContent"></textarea>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
|
|
|
- <span
|
|
|
- style="color: blue;font-size: 14px; display: flex;justify-content:flex-end;margin: 30rpx 10px;"
|
|
|
- @click="change">切换</span>
|
|
|
- <view class="uni-list">
|
|
|
- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
|
|
|
+ <view v-for="(a,index) in czggslList" :key="index" class="num-style">
|
|
|
+ <span
|
|
|
+ style="color: blue;font-size: 14px; display: flex;justify-content:flex-end;margin: 30rpx 10px;"
|
|
|
+ @click="change(index)">切换</span>
|
|
|
+ <view class="uni-list">
|
|
|
+ <view class="container" style="border-bottom: 1px solid #f8f8f8;">
|
|
|
|
|
|
- <view>
|
|
|
- 材 质
|
|
|
- </view>
|
|
|
- <block v-if="isNew==false">
|
|
|
- <view v-if="this.isEmpty(this.materialValue.id)" @click="pickerShow('cz')">
|
|
|
- <span style="color: darkgray;">请选择材质</span>
|
|
|
- <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
|
|
|
+ <view>
|
|
|
+ 材 质
|
|
|
</view>
|
|
|
- <view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('cz')">
|
|
|
- <span style="color: black;">{{materialValue.name}}</span>
|
|
|
- <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
|
|
|
+ <block v-if="a.isNew==false">
|
|
|
+ <view class="uni-list-cell-db" @click="pickerShow('cz',index)">
|
|
|
+ <span style="color: black;">{{a.cz.id==''?'请选择材质':a.cz.name}}</span>
|
|
|
+ <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
|
|
|
+ </view>
|
|
|
+ </block>
|
|
|
+ <view v-else-if="a.isNew==true">
|
|
|
+
|
|
|
+ <input class="uni-input" maxlength="50" type="text" v-model="a.cz.id"
|
|
|
+ placeholder="请输入材质" style="margin-left: 10px;text-align: right;"></input>
|
|
|
</view>
|
|
|
- </block>
|
|
|
- <view v-else-if="isNew==true">
|
|
|
-
|
|
|
- <input class="uni-input" maxlength="50" type="text" v-model="materialNewValue" placeholder="请输入材质"
|
|
|
- style="margin-left: 10px;text-align: right;"></input>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
- <view class="uni-list">
|
|
|
- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
|
|
|
+ <view class="uni-list">
|
|
|
+ <view class="container" style="border-bottom: 1px solid #f8f8f8;">
|
|
|
|
|
|
- <view>
|
|
|
- 规 格
|
|
|
- </view>
|
|
|
- <block v-if="isNew==false">
|
|
|
- <view v-if="this.isEmpty(this.specificationValue.id)" @click="pickerShow('gg')">
|
|
|
- <span style="color: darkgray;">请选择规格</span>
|
|
|
- <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
|
|
|
+ <view>
|
|
|
+ 规 格
|
|
|
</view>
|
|
|
- <view v-else class="uni-list-cell-db" @click="pickerShow('gg')">
|
|
|
- <span style="color: black;">{{specificationValue.name}}</span>
|
|
|
- <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
|
|
|
+ <block v-if="a.isNew==false">
|
|
|
+ <view class="uni-list-cell-db" @click="pickerShow('gg',index)">
|
|
|
+ <span style="color: black;">{{a.gg.id==''?'请选择规格':a.gg.name}}</span>
|
|
|
+ <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
|
|
|
+ </view>
|
|
|
+ </block>
|
|
|
+ <view v-else-if="a.isNew==true">
|
|
|
+
|
|
|
+ <input class="uni-input" maxlength="50" type="text" v-model="a.gg.id"
|
|
|
+ placeholder="请输入规格" style="margin-left: 10px;text-align: right;"></input>
|
|
|
</view>
|
|
|
- </block>
|
|
|
- <view v-else-if="isNew==true">
|
|
|
-
|
|
|
- <input class="uni-input" maxlength="50"type="text" v-model="specificationNewValue" placeholder="请输入规格"
|
|
|
- style="margin-left: 10px;text-align: right;"></input>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
|
|
|
- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
|
|
|
- <text>米 数</text>
|
|
|
- <!-- style="margin-left: 10px;text-align: right;" -->
|
|
|
- <view style="display: flex; justify-content: right; width: 70%;">
|
|
|
- <input class="uni-input" type="number" v-model="inputIntegerNumberValue" maxlength="6"
|
|
|
- style="text-align: center; border: 1px solid #00aaff; border-radius: 20rpx; "></input>
|
|
|
- <text style="font-weight:bold;margin-left: 10px;margin-right: 10px;">.</text>
|
|
|
- <input class="uni-input" type="number" v-model="inputDecimalNumberValue" maxlength="1"
|
|
|
- style="text-align: center; border: 1px solid #00aaff; border-radius: 20rpx;"></input>
|
|
|
+ <view class="container" style="border-bottom: 1px solid #f8f8f8;">
|
|
|
+ <text>米 数</text>
|
|
|
+ <!-- style="margin-left: 10px;text-align: right;" -->
|
|
|
+ <view style="display: flex; justify-content: right; width: 70%;">
|
|
|
+ <input class="uni-input" type="number" v-model="a.sl.inputIntegerNumberValue"
|
|
|
+ maxlength="6"
|
|
|
+ style="text-align: center; border: 1px solid #00aaff; border-radius: 20rpx;"></input>
|
|
|
+ <text style="font-weight:bold;margin-left: 10px;margin-right: 10px;">.</text>
|
|
|
+ <input class="uni-input" type="number" v-model="a.sl.inputDecimalNumberValue"
|
|
|
+ maxlength="1"
|
|
|
+ style="text-align: center; border: 1px solid #00aaff; border-radius: 20rpx;"></input>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
+ <button v-if="index!=0" @click="this.czggslList.splice(index,1)" class="sc-btn">删除</button>
|
|
|
</view>
|
|
|
+ <button @click="this.czggslList.push({cz:{id: '',name: ''},isNew:false,gg:{id: '',name: ''},sl: {
|
|
|
+ inputIntegerNumberValue: '',
|
|
|
+ inputDecimalNumberValue: ''
|
|
|
+ }})" class="tj-btn">添加</button>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
|
|
|
- <view class="align-items" style="margin-top: 20px;margin-bottom: 20px;">
|
|
|
- <view class="container" style="color: #b2b2b2;">*请上传照片</view>
|
|
|
- <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
|
|
|
- <image :src="loadImgSrc('updateimg.png')" mode=""
|
|
|
- style="width: 200rpx; height: 150rpx; margin: 0 12rpx; " @click="choose()"></image>
|
|
|
- <view v-for="(item,index) in imgArr" :key="index" style="position: relative;">
|
|
|
- <view
|
|
|
- v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg'||item.substring(item.length-4)=='jpeg' ">
|
|
|
- <image :src="item" mode="" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
|
|
|
- @click="showPhoto(index)">
|
|
|
- </image>
|
|
|
- </view>
|
|
|
- <view v-else>
|
|
|
- <video :src="item" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
|
|
|
- </view>
|
|
|
- <view @click="remove(index)"
|
|
|
- style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
|
|
|
- <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
|
|
|
- </image>
|
|
|
- </view>
|
|
|
+ <view class="align-items" style="margin-top: 20px;margin-bottom: 20px;">
|
|
|
+ <view class="container" style="color: #b2b2b2;">*请上传照片</view>
|
|
|
+ <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
|
|
|
+ <image :src="loadImgSrc('updateimg.png')" mode=""
|
|
|
+ style="width: 200rpx; height: 150rpx; margin: 0 12rpx; " @click="choose()"></image>
|
|
|
+ <view v-for="(item,index) in imgArr" :key="index" style="position: relative;">
|
|
|
+ <view
|
|
|
+ v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg'||item.substring(item.length-4)=='jpeg' ">
|
|
|
+ <image :src="item" mode="" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
|
|
|
+ @click="showPhoto(index)">
|
|
|
+ </image>
|
|
|
+ </view>
|
|
|
+ <view v-else>
|
|
|
+ <video :src="item" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
|
|
|
+ </view>
|
|
|
+ <view @click="remove(index)" style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
|
|
|
+ <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
|
|
|
+ </image>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ </view>
|
|
|
<view class="action-btn">
|
|
|
<button @click="submit" class="btn cu-btn block bg-blue lg round">确认上传</button>
|
|
|
</view>
|
|
@@ -294,16 +307,31 @@
|
|
|
|
|
|
kgsjValue: '', //开工时间
|
|
|
jhgqValue: '', //计划工期
|
|
|
-
|
|
|
+ projectContent: '', //描述
|
|
|
jgsjValue: '', //竣工时间
|
|
|
gcnrValue: '', //工程内容
|
|
|
id: '', //工程id
|
|
|
fileUrl: '', //点击的文件地址
|
|
|
fileName: '', //点击的文件名称
|
|
|
zEngineeringMaterialBo: [], //给后台传的值 用料列表
|
|
|
- isNew: false, //是否新增
|
|
|
+ SelectIndex: '', //选择的索引值
|
|
|
specificationNewValue: '', //规格新增内容
|
|
|
materialNewValue: '', //材质新增内容
|
|
|
+ czggslList: [{
|
|
|
+ isNew: false, //是否新增
|
|
|
+ cz: {
|
|
|
+ id: '',
|
|
|
+ name: ''
|
|
|
+ },
|
|
|
+ gg: {
|
|
|
+ id: '',
|
|
|
+ name: ''
|
|
|
+ },
|
|
|
+ sl: {
|
|
|
+ inputIntegerNumberValue: '',
|
|
|
+ inputDecimalNumberValue: ''
|
|
|
+ }
|
|
|
+ }, ],
|
|
|
|
|
|
}
|
|
|
},
|
|
@@ -326,8 +354,13 @@
|
|
|
|
|
|
},
|
|
|
|
|
|
- change() {
|
|
|
- this.isNew = !this.isNew;
|
|
|
+ change(index) {
|
|
|
+ //this.isNew = !this.isNew;
|
|
|
+ this.czggslList[index].isNew = !this.czggslList[index].isNew;
|
|
|
+ this.czggslList[index].materialQuality = '';
|
|
|
+ this.czggslList[index].materialQualityName = '';
|
|
|
+ this.czggslList[index].specifications = '';
|
|
|
+ this.czggslList[index].specificationsName = '';
|
|
|
},
|
|
|
handleSubmit(e) {
|
|
|
|
|
@@ -593,8 +626,9 @@
|
|
|
|
|
|
|
|
|
},
|
|
|
- pickerShow(e) {
|
|
|
+ pickerShow(e, index) {
|
|
|
this.type = e; //赋值类型
|
|
|
+ this.SelectIndex = index;
|
|
|
if (e == 'gcmc') {
|
|
|
this.open = true;
|
|
|
getInfrastructureNameList().then(response => {
|
|
@@ -608,9 +642,9 @@
|
|
|
});
|
|
|
|
|
|
} else if (e == 'gg') { //规格
|
|
|
- if (this.isEmpty(this.materialValue.id)) {
|
|
|
+ if (this.isEmpty(this.czggslList[index].cz.id)) {
|
|
|
this.$modal.msg('请选择材质')
|
|
|
-
|
|
|
+ // this.czggslList[index].cz = this.materialValue.id
|
|
|
} else {
|
|
|
this.open = true;
|
|
|
this.selectList = this.materialList;
|
|
@@ -668,10 +702,13 @@
|
|
|
//根据材质ID 获取规格数据
|
|
|
getEnginSpecificationsList(item.id).then(res => {
|
|
|
this.materialList = res.data
|
|
|
+ this.czggslList[this.SelectIndex].cz.id = this.materialValue.id
|
|
|
+ this.czggslList[this.SelectIndex].cz.name = this.materialValue.name
|
|
|
})
|
|
|
} else if (this.type == 'gg') {
|
|
|
this.specificationValue = item;
|
|
|
-
|
|
|
+ this.czggslList[this.SelectIndex].gg.id = this.specificationValue.id
|
|
|
+ this.czggslList[this.SelectIndex].gg.name = this.specificationValue.name
|
|
|
}
|
|
|
|
|
|
},
|
|
@@ -704,29 +741,67 @@
|
|
|
this.$modal.msg('请选择工程名称')
|
|
|
return
|
|
|
}
|
|
|
- if (this.isNew) {
|
|
|
- if (this.isEmpty(this.materialNewValue)) {
|
|
|
- this.$modal.msg("请输入材质")
|
|
|
- return
|
|
|
- }
|
|
|
- if (this.isEmpty(this.specificationNewValue)) {
|
|
|
- this.$modal.msg("请输入规格")
|
|
|
- return
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (this.isEmpty(this.materialValue.id)) {
|
|
|
- this.$modal.msg("请选择材质")
|
|
|
- return
|
|
|
- }
|
|
|
- if (this.isEmpty(this.specificationValue.id)) {
|
|
|
- this.$modal.msg("请选择规格")
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
- if (this.isEmpty(this.inputIntegerNumberValue)) {
|
|
|
- this.$modal.msg("请输入米数")
|
|
|
- return
|
|
|
+ // if (this.isNew) {
|
|
|
+ // if (this.isEmpty(this.materialNewValue)) {
|
|
|
+ // this.$modal.msg("请输入材质")
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // if (this.isEmpty(this.specificationNewValue)) {
|
|
|
+ // this.$modal.msg("请输入规格")
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // if (this.isEmpty(this.materialValue.id)) {
|
|
|
+ // this.$modal.msg("请选择材质")
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // if (this.isEmpty(this.specificationValue.id)) {
|
|
|
+ // this.$modal.msg("请选择规格")
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // if (this.isEmpty(this.inputIntegerNumberValue)) {
|
|
|
+ // this.$modal.msg("请输入米数")
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ try {
|
|
|
+ this.czggslList.forEach((list) => {
|
|
|
+ if (this.isEmpty(list.cz.id)) {
|
|
|
+ this.$modal.msg('材质不能为空')
|
|
|
+
|
|
|
+
|
|
|
+ throw new Error('End Loop')
|
|
|
+
|
|
|
+ }
|
|
|
+ if (this.isEmpty(list.gg.id)) {
|
|
|
+ this.$modal.msg('规格不能为空')
|
|
|
+ throw new Error('End Loop')
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.isEmpty(list.sl.inputIntegerNumberValue)) {
|
|
|
+ this.$modal.msg("请输入米数")
|
|
|
+ throw new Error('End Loop')
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ })
|
|
|
+ } catch (e) {
|
|
|
+ if (e.message === 'End Loop') throw e
|
|
|
}
|
|
|
+ this.zEngineeringMaterialBo = [];
|
|
|
+
|
|
|
+ this.czggslList.forEach((list) => {
|
|
|
+ this.zEngineeringMaterialBo.push({
|
|
|
+ materialQuality: list.cz.id,
|
|
|
+ specifications: list.gg.id,
|
|
|
+ number: list.sl.inputIntegerNumberValue + (list.sl
|
|
|
+ .inputDecimalNumberValue ==
|
|
|
+ '' ?
|
|
|
+ '' : "." + list.sl.inputDecimalNumberValue)
|
|
|
+ })
|
|
|
+ })
|
|
|
if (this.imgArr.length <= 0) {
|
|
|
this.$modal.msg('请上传照片或视频')
|
|
|
return
|
|
@@ -742,21 +817,21 @@
|
|
|
} else {
|
|
|
this.inputNumberValue = this.inputIntegerNumberValue + "." + this.inputDecimalNumberValue;
|
|
|
}
|
|
|
- if (this.isNew) {
|
|
|
- //新增
|
|
|
- this.zEngineeringMaterialBo.push({
|
|
|
- specifications: this.specificationNewValue,
|
|
|
- materialQuality: this.materialNewValue,
|
|
|
- number: this.inputNumberValue,
|
|
|
- })
|
|
|
- } else {
|
|
|
- //选择的
|
|
|
- this.zEngineeringMaterialBo.push({
|
|
|
- materialQuality: this.materialValue.id, //材质
|
|
|
- specifications: this.specificationValue.id, //规格
|
|
|
- number: this.inputNumberValue //数量
|
|
|
- })
|
|
|
- }
|
|
|
+ // if (this.isNew) {
|
|
|
+ // //新增
|
|
|
+ // this.zEngineeringMaterialBo.push({
|
|
|
+ // specifications: this.specificationNewValue,
|
|
|
+ // materialQuality: this.materialNewValue,
|
|
|
+ // number: this.inputNumberValue,
|
|
|
+ // })
|
|
|
+ // } else {
|
|
|
+ // //选择的
|
|
|
+ // this.zEngineeringMaterialBo.push({
|
|
|
+ // materialQuality: this.materialValue.id, //材质
|
|
|
+ // specifications: this.specificationValue.id, //规格
|
|
|
+ // number: this.inputNumberValue //数量
|
|
|
+ // })
|
|
|
+ // }
|
|
|
let param = {
|
|
|
|
|
|
enginName: this.projectName.name,
|
|
@@ -771,6 +846,7 @@
|
|
|
zEngineeringNodeBo: {
|
|
|
type: this.objValue.value,
|
|
|
zEngineeringInfoBo: {
|
|
|
+ remark: this.projectContent,
|
|
|
constructTime: this.time,
|
|
|
zEngiineeringPhotoBoList: this.imgArr,
|
|
|
zEngineeringMaterialBo: this.zEngineeringMaterialBo
|