Commit 79c94119 authored by Morson's avatar Morson

Merge branch 'master' of https://git.banshouhui.com/lijundan/self-support

# Conflicts:
#	src/pages.json
parents 2287d568 85492f30
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
}, },
confirm() { confirm() {
if(this.pass) { if(this.pass) {
this.$emit('confirm') this.$emit('change')
} else { } else {
let data = this.listData.find((item, index) => { let data = this.listData.find((item, index) => {
return item.pass == false; return item.pass == false;
......
<!-- ******************* 单个下拉选择 ******************* --> <!-- ******************* 单个下拉选择 ******************* -->
<template> <template>
<view class="xh-select"> <view class="xh-select" :style="{'width': fieldsWidth}">
<u-input :value="text" disabled @click="show=true" :placeholder="placeholder" :placeholder-style="placeholderStyle" <u-input :value="text" disabled @click="show=true" :placeholder="placeholder" :placeholder-style="placeholderStyle"
:custom-style="customStyle" :clearable="false"></u-input> :custom-style="customStyle" :clearable="false"></u-input>
<u-select :list="settings" v-model="show" @confirm="actionSheetCallback" safe-area-inset-bottom></u-select> <u-select :list="settings" v-model="show" @confirm="actionSheetCallback" safe-area-inset-bottom></u-select>
...@@ -68,7 +68,10 @@ ...@@ -68,7 +68,10 @@
'font-size':'26rpx', 'font-size':'26rpx',
'height': '76rpx' 'height': '76rpx'
} }
} },
fieldsWidth() {
return this.item.fieldsWidth ? (this.item.fieldsWidth + 'rpx') : '100%'
},
}, },
watch: {}, watch: {},
mounted() {}, mounted() {},
......
<!-- ******************* 单级/多级 选择 ******************* --> <!-- ******************* 单级/多级 选择 ******************* -->
<template> <template>
<view class="picker-box"> <view class="picker-box" :style="{'width': fieldsWidth}">
<view class="u-flex u-row-between text-view" @click="openPicker"> <view class="u-flex u-row-between text-view" @click="openPicker">
<view class="txt u-flex-1 text-title">{{text||''}}</view> <view class="txt u-flex-1 text-title">{{text||''}}</view>
<u-icon class="input-icon" color="#2272FF" :name="showPicker ? 'arrow-up' : 'arrow-down'"></u-icon> <u-icon class="input-icon" color="#2272FF" :name="showPicker ? 'arrow-up' : 'arrow-down'"></u-icon>
...@@ -68,7 +68,10 @@ ...@@ -68,7 +68,10 @@
val = data[0].measureTypeName + "-" + data[0].measureName val = data[0].measureTypeName + "-" + data[0].measureName
} }
return val return val
} },
fieldsWidth() {
return this.item.fieldsWidth ? (this.item.fieldsWidth + 'rpx') : '100%'
},
}, },
watch: { watch: {
specificationId(val, oldVal){ specificationId(val, oldVal){
......
...@@ -99,7 +99,16 @@ ...@@ -99,7 +99,16 @@
return { return {
timeout: false, timeout: false,
timestamp: 0, timestamp: 0,
orderType: 0 /** orderType
0 待接单、
1 待预约、
2 待签到、
3 待完工、
4 审核中、
5 异常单、
6 已完工
*/
orderType: 0
}; };
}, },
computed: { computed: {
...@@ -124,7 +133,7 @@ ...@@ -124,7 +133,7 @@
return this.buttonStyles[2] return this.buttonStyles[2]
} }
}, },
showCountTime() { showCountTime() { // ((待预约、 待签到、 待完工) || (待接单 && 业务类型非抢单)) && 有超过时间点
return ([1, 2, 3].indexOf(this.orderType) != -1 || (this.orderType == 0 && this.orderData return ([1, 2, 3].indexOf(this.orderType) != -1 || (this.orderType == 0 && this.orderData
.orderBusinessType != 'R')) && this.orderData.currentOverTime .orderBusinessType != 'R')) && this.orderData.currentOverTime
}, },
......
...@@ -58,7 +58,7 @@ export default { ...@@ -58,7 +58,7 @@ export default {
imgList[res.fileIndex] imgList[res.fileIndex]
self.imgList = imgList self.imgList = imgList
// 多文件上传每个文件进度条 // 多文件上传每个文件进度条
console.log(res,'res---onProgressUpdate') //console.log(res,'res---onProgressUpdate')
}, },
onEachUpdate(res){ onEachUpdate(res){
// 多文件上传每个文件上传成功触发 // 多文件上传每个文件上传成功触发
...@@ -67,7 +67,7 @@ export default { ...@@ -67,7 +67,7 @@ export default {
imgList[res.fileIndex].src = uploader.qiniuTokenObj.visitPrefix + res.url imgList[res.fileIndex].src = uploader.qiniuTokenObj.visitPrefix + res.url
} }
self.imgList = imgList self.imgList = imgList
console.log(res,'res---onEachUpdate') //console.log(res,'res---onEachUpdate')
}, },
cardType: category, cardType: category,
...config ...config
...@@ -75,8 +75,8 @@ export default { ...@@ -75,8 +75,8 @@ export default {
// 不需要进度条等可直接获取 // 不需要进度条等可直接获取
let res = await uploader.qnImgUpload(options) let res = await uploader.qnImgUpload(options)
console.log(self.imgList,'self.imgList') // console.log(self.imgList,'self.imgList')
console.log(uploader,uploader.qiniuTokenObj,'qiniuTokenObj') // console.log(uploader,uploader.qiniuTokenObj,'qiniuTokenObj')
// let imgList = res.map(item=>{ // let imgList = res.map(item=>{
// return { // return {
// key:item, // key:item,
......
...@@ -91,11 +91,11 @@ export default { ...@@ -91,11 +91,11 @@ export default {
} }
qiniuUploader.upload(params, (res) => { qiniuUploader.upload(params, (res) => {
console.log(res,'res') console.log(res,'res111')
let inLen = self.maximum - fileList.length let inLen = self.maximum - fileList.length
if (inLen > 0) { if (inLen > 0) {
item.src = file item.src = file
item.key = res.key || res.src item.key = res.url
self.fileMaps.push(item); self.fileMaps.push(item);
self.keys.push(item.key) self.keys.push(item.key)
if(submit) { if(submit) {
......
...@@ -172,6 +172,16 @@ ...@@ -172,6 +172,16 @@
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationBarBackgroundColor":"#F4F5F7" "navigationBarBackgroundColor":"#F4F5F7"
} }
},
{
"path" : "material",
"style" :
{
"navigationBarTitleText": "勘察材料",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor":"#FFFFFF"
}
} }
] ]
}, },
......
...@@ -397,66 +397,63 @@ ...@@ -397,66 +397,63 @@
nextStep() { nextStep() {
if (this.tabIndex < this.list.length - 1) { if (this.tabIndex < this.list.length - 1) {
this.tabIndex++ this.tabIndex++
this.arr = [] this.arr = []
this.scrollRightTop = 0
this.leftMenuStatus(0)
this.$nextTick(function() { this.$nextTick(function() {
this.getMenuItemTop() this.getMenuItemTop()
}) })
} }
}, },
typeToComponentType(type) { typeToComponentType(type) {
let formType = '' // 将fieldType类型统一转换为公共组件判定类型
if (type) { let formType = ''
// 将fieldType类型统一转换为公共组件判定类型 type = type.toLocaleLowerCase()
type = type.toLocaleLowerCase() switch (type) {
switch (type) { case 'text':
case 'text': formType = 'input'
case 'password': break
case 'textarea': case 'password':
case 'number': case 'textarea':
case 'decimal': case 'number':
case 'double': case 'decimal':
case 'integer': case 'double':
formType = 'input' case 'integer':
break formType = 'input'
case 'multiinput': break
formType = 'multiinput' case 'multiinput':
break; formType = 'multiinput'
case 'select': break;
case 'specifications': case 'select':
formType = 'select' case 'specifications':
break formType = 'select'
case 'radio': break
formType = 'radio' case 'radio':
break formType = 'radio'
case 'checkbox': break
formType = 'checkbox' case 'checkbox':
break formType = 'checkbox'
case 'file': break
case 'photos': case 'file':
formType = 'file' case 'photos':
break formType = 'file'
case 'location': break
formType = 'location' case 'location':
break formType = 'location'
case 'scan': break
formType = 'scan' case 'scan':
break formType = 'scan'
case 'picker': break
case 'mutipicker': case 'picker':
formType = 'picker' case 'mutipicker':
break formType = 'picker'
case 'service_measures': break
formType = 'servicemeasure' case 'service_measures':
break formType = 'servicemeasure'
case 'time': break
case 'date': case 'time':
formType = 'time' case 'date':
break formType = 'time'
} break
} }
return formType return formType
}, },
// ------------------------- 以下方法为展示滚动切换 ------------------------- // ------------------------- 以下方法为展示滚动切换 -------------------------
......
<template>
<view class="mtr-content">
<view class="content-view">
<!-- 材料列表 -->
<view class="mtr-tab">
<u-table align="center" border-color="#FFFFFF" color="#333333" font-size="rpx" :th-style="thStyle"
padding="0">
<u-tr class="u-tr">
<u-th class="u-th content-tab-th" v-for="(value, key) in titles" :key="key" width="auto">
<text :class="['tab-th-txt', {'left': key == firstKey}]">{{value}}</text>
</u-th>
</u-tr>
<view class="line-view"></view>
<u-tr class="u-tr" v-for="(item, index) in list" :key="index">
<u-td class="u-td" v-for="(value, key) in titles" :key="key">
<text :class="['tab-th-txt', {'left': key == firstKey}]">{{item[key]}}</text>
</u-td>
</u-tr>
</u-table>
</view>
<!-- 其他 -->
<view class="mtr-other">
<view class="line-view"></view>
<view class="other-space">
<text>其他</text>
<image class="image-view" :src="addImage" @click="handleAdd"></image>
</view>
<view v-if="other.length > 0" class="other-content">
<view class="other-space" v-for="(item, index) in other" :key="index">
<view class="input-view">
<view class="other-space">
<text class="input-title">说明:</text>
<view class="input-content">
<u-input v-model="item.title" :clearable="false" placeholder-style="color:#999999;font-size:26rpx" />
</view>
</view>
<view class="other-space">
<text class="input-title">金额:</text>
<view class="input-content">
<u-input v-model="item.value" type="number" :clearable="false" placeholder-style="color:#999999;font-size:26rpx" />
</view>
</view>
</view>
<image class="image-view" :src="subtractImage" @click="handleSubtract"></image>
</view>
</view>
<view class="other-space">
<text>超出金额</text>
<text>{{money}}</text>
</view>
</view>
</view>
<!-- 底部确定按钮 -->
<view class="bottom-view">
<u-button class="sure-button" type="primary" shape="circle" @click="handleSure" :custom-style="buttonStyle">
确定
</u-button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
list: [], // 材料列表
other: [], // 其他列表
};
},
computed: {
buttonStyle() {
return {
width: "600rpx",
height: "104rpx",
"font-size": "32rpx",
"font-weight": "bold",
};
},
titles() {
return {
name: '材料名称',
unit: '单位',
freeAmount: '免费量',
price: '单价/元',
consumption: '预计用量'
}
},
thStyle() {
return {
'font-weight': 'bold'
}
},
firstKey() {
return Object.keys(this.titles)[0]
},
subtractImage() {
return process.uniEnv.qn_base_url + 'qxiao.png'
},
addImage() {
return process.uniEnv.qn_base_url + 'tianjia.png'
},
money() { // 总额
var amount = 0
for (var item of this.list) {
if (Number(item.consumption) && Number(item.freeAmount) && Number(item.price)) {
amount += Math.max(Number(item.consumption) - Number(item.freeAmount), 0) * Number(item.price)
}
}
for (var item of this.other) {
if (item.value && Number(item.value)) {
amount += Number(item.value)
}
}
return amount
}
},
created() {
// 测试数据
console.log('0000')
for (var i = 0; i < 20; i++) {
this.list.push({
name: '开关发大法师放大范德萨发大水',
unit: '个',
freeAmount: '1',
price: '45.0',
consumption: '4',
})
}
},
methods: {
/* 其他添加新的 */
handleAdd() {
this.other.push({
title: '',
value: ''
})
},
/* 其他删除某个 */
handleSubtract(index) {
this.other.splice(index, 1)
},
handleSure() {
// 返回总额money
}
}
}
</script>
<style lang="scss" scoped>
.mtr-content {
display: flex;
flex-direction: column;
background-color: #F4F5F7;
height: 100vh;
.content-view {
padding: 30rpx 30rpx 60rpx 30rpx;
margin: 20rpx 30rpx;
border-radius: 12rpx;
background-color: #FFFFFF;
height: 100%;
overflow: auto;
.line-view {
background-color: #F4F5F7;
height: 2rpx;
margin: 20rpx 0;
}
.mtr-tab {
.tab-th-txt {
background-color: #FFFFFF;
padding: 10rpx 0;
&.left {
text-align: left;
}
}
}
.mtr-other {
.other-space {
display: flex;
justify-content: space-between;
align-items: center;
}
.other-content {
margin-bottom: 30rpx;
}
.input-view {
padding: 10rpx 30rpx;
width: 100%;
border-radius: 12rpx;
border: 1px #F4F5F7 solid;
margin-bottom: 30rpx;
.input-title {
width: 80rpx;
flex-shrink: 0;
color: #333333;
font-size: 26rpx;
}
.input-content {
width: 100%;
}
}
.image-view {
width: 52rpx;
height: 52rpx;
flex-shrink: 0;
margin: 30rpx 0 30rpx 30rpx;
}
}
}
.bottom-view {
margin-bottom: 44rpx;
margin-top: 10rpx;
height: 104rpx;
}
}
</style>
...@@ -39,7 +39,7 @@ uploader.getQnToken = function(params) { ...@@ -39,7 +39,7 @@ uploader.getQnToken = function(params) {
*region: 地区 默认为:ECN *region: 地区 默认为:ECN
*/ */
resolve({ resolve({
visitPrefix: data.host || globalUrl.qn_asset_url, visitPrefix: data.host,
token: data.token || '', token: data.token || '',
folderPath: data.folderPath || '', folderPath: data.folderPath || '',
region: "ECN" region: "ECN"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment