Commit 21c8ae49 by chenwq

空数据,小数长度

1 parent 754fb6ff

5.33 KB | W: | H:

5.55 KB | W: | H:

src/assets/order-step-one.png
src/assets/order-step-one.png
src/assets/order-step-one.png
src/assets/order-step-one.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
<el-select <el-select
v-model="searchSelectObj[item.selectName].attr" v-model="searchSelectObj[item.selectName].attr"
style="width: 130px" style="width: 130px"
:popper-append-to-body="false"
slot="prepend" slot="prepend"
placeholder="请选择" placeholder="请选择"
@change="item.handleSelectChange" @change="item.handleSelectChange"
......
...@@ -3,19 +3,23 @@ ...@@ -3,19 +3,23 @@
<div class="box"> <div class="box">
<div class="container checked-box"> <div class="container checked-box">
<div class="title">已选项</div> <div class="title">已选项</div>
<div class="content"> <div v-show="!checkedList.trade.length && !checkedList.order.length" class="empty-box">
<img style="margin-top: 60px;" class="order-empty" src="@/assets/order-empty.png">
<div>暂无选项,请在下方数据列中选择</div>
</div>
<div v-show="checkedList.trade.length || checkedList.order.length" class="content">
<div class="block" v-for="(item, index) in tableFormData" :key="index"> <div class="block" v-for="(item, index) in tableFormData" :key="index">
<div class="row" v-for="(row, rowIdx) in checkedList[item.type]" :key="rowIdx"> <div class="row" v-for="(row, rowIdx) in checkedList[item.type]" :key="rowIdx">
<el-checkbox class="check-box" v-model="row.checked" @change="handleChecked(item.type, item.tableParams.uniqueKey, row, rowIdx, true)"></el-checkbox> <el-checkbox class="check-box" v-model="row.checked" @change="handleChecked(item.type, item.tableParams.uniqueKey, row, rowIdx, true)"></el-checkbox>
<div> <div>
<div v-for="(subItem, subIndex) in item.tableParams.tableColumns" :key="subIndex"> <div v-for="(subItem, subIndex) in item.tableParams.tableColumns" :key="subIndex">
<div> <div>
<span class="label">{{subItem.label}}:</span> <span class="label">{{subItem.label}}:</span>
{{row[subItem.prop]}} <span>{{subItem.prefix}}</span>{{row[subItem.prop]}}
</div>
</div> </div>
</div> </div>
</div> </div>
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -28,14 +32,18 @@ ...@@ -28,14 +32,18 @@
<d2-search ref="showSearch" class="search-box" :search-form="searchForm[item.type]" :search-select-obj="searchSelectObj" :form-data="searchFormData[item.type]" /> <d2-search ref="showSearch" class="search-box" :search-form="searchForm[item.type]" :search-select-obj="searchSelectObj" :form-data="searchFormData[item.type]" />
<el-button @click="handleSearch(item)" size="small" type="primary">搜索</el-button> <el-button @click="handleSearch(item)" size="small" type="primary">搜索</el-button>
</div> </div>
<div> <div v-show="!baseData[item.type].length" class="empty-box">
<img style="margin-top: 132px;" class="order-empty" src="@/assets/order-empty.png">
<div>没有找到相关结果</div>
</div>
<div v-show="baseData[item.type].length">
<div class="row" v-for="(row, rowIdx) in baseData[item.type]" :key="rowIdx"> <div class="row" v-for="(row, rowIdx) in baseData[item.type]" :key="rowIdx">
<el-checkbox :disabled="checkedList[item.type].length >= checkedMaxLen" class="check-box" v-model="row.checked" @change="handleChecked(item.type, item.tableParams.uniqueKey, row, rowIdx)"></el-checkbox> <el-checkbox :disabled="checkedList[item.type].length >= checkedMaxLen" class="check-box" v-model="row.checked" @change="handleChecked(item.type, item.tableParams.uniqueKey, row, rowIdx)"></el-checkbox>
<div> <div>
<div v-for="(subItem, subIndex) in item.tableParams.tableColumns" :key="subIndex"> <div v-for="(subItem, subIndex) in item.tableParams.tableColumns" :key="subIndex">
<div> <div>
<span class="label">{{subItem.label}}:</span> <span class="label">{{subItem.label}}:</span>
{{row[subItem.prop]}} <span>{{subItem.prefix}}</span>{{row[subItem.prop]}}
</div> </div>
</div> </div>
</div> </div>
...@@ -49,7 +57,7 @@ ...@@ -49,7 +57,7 @@
<div class="flex"> <div class="flex">
<div class="footer"> <div class="footer">
<el-button :disabled="!checkedList.trade.length || !checkedList.order.length || price.trade != price.order" type="primary" @click="handleNext">下一步</el-button> <el-button :disabled="!checkedList.trade.length || !checkedList.order.length || price.trade != price.order" type="primary" @click="handleNext">下一步</el-button>
<div v-if="checkedList.trade.length || checkedList.order.length" :class="[price.trade == price.order ? 'success-txt' : 'red-txt']">交易金额={{price.trade}},主订单金额={{price.order}},金额校验{{price.trade == price.order ? '通过' : '不通过'}}!</div> <div v-if="checkedList.trade.length || checkedList.order.length" :class="[price.trade == price.order ? 'success-txt' : 'red-txt']">交易金额=¥{{price.trade}},主订单金额=¥{{price.order}},金额校验{{price.trade == price.order ? '通过' : '不通过'}}!</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -81,7 +89,7 @@ export default { ...@@ -81,7 +89,7 @@ export default {
type: 'selectInput', type: 'selectInput',
selectName: 'trade', selectName: 'trade',
isClear: true, isClear: true,
maxlength: 20, maxlength: 50,
selectOption: [{ selectOption: [{
label: '交易参考号', label: '交易参考号',
name: 'tradeNo' name: 'tradeNo'
...@@ -97,7 +105,7 @@ export default { ...@@ -97,7 +105,7 @@ export default {
type: 'selectInput', type: 'selectInput',
selectName: 'order', selectName: 'order',
isClear: true, isClear: true,
maxlength: 20, maxlength: 50,
selectOption: [{ selectOption: [{
label: '主订单号', label: '主订单号',
name: 'orderCode' name: 'orderCode'
...@@ -123,7 +131,8 @@ export default { ...@@ -123,7 +131,8 @@ export default {
prop: 'accountDateTxt' prop: 'accountDateTxt'
}, { }, {
label: '交易金额', label: '交易金额',
prop: 'totalFee' prop: 'totalFee',
prefix: '¥'
}] }]
} }
}, { }, {
...@@ -140,7 +149,8 @@ export default { ...@@ -140,7 +149,8 @@ export default {
prop: 'orderTimeTxt' prop: 'orderTimeTxt'
}, { }, {
label: '交易金额', label: '交易金额',
prop: 'totalPrice' prop: 'totalPrice',
prefix: '¥'
}] }]
} }
}], }],
...@@ -207,16 +217,16 @@ export default { ...@@ -207,16 +217,16 @@ export default {
} }
this.price[type] = this.checkedList[type].length ? this.checkedList[type].map(item => item[addValNameObj[type]]).reduce((prev, cur) => { this.price[type] = this.checkedList[type].length ? this.checkedList[type].map(item => item[addValNameObj[type]]).reduce((prev, cur) => {
return prev + cur return prev + cur
}) : 0 }).toFixed(2) : 0
}, },
// 选中/取消 // 选中/取消
handleChecked(type, uniqueKey, row, rowIdx, changeListStatus) { handleChecked(type, uniqueKey, row, rowIdx, changeListStatus) {
let checkedIdx = this.checkedList[type].findIndex(k => k[uniqueKey] == row[uniqueKey]) let checkedIdx = this.checkedList[type].findIndex(k => k[uniqueKey] == row[uniqueKey])
checkedIdx == -1 ? this.checkedList[type].push(JSON.parse(JSON.stringify(row))) : this.checkedList[type].splice(checkedIdx, 1) checkedIdx == -1 ? this.checkedList[type].push(JSON.parse(JSON.stringify(row))) : this.checkedList[type].splice(checkedIdx, 1)
// 已选项,取消选项后,改变原来list的选中状态 // 已选项,取消选项后,改变原来list的选中状态
if(changeListStatus) { if (changeListStatus) {
let idx = this.baseData[type].findIndex(k => k[uniqueKey] == row[uniqueKey]) let idx = this.baseData[type].findIndex(k => k[uniqueKey] == row[uniqueKey])
if(idx != -1) { if (idx != -1) {
this.baseData[type][idx].checked = !this.baseData[type][idx].checked this.baseData[type][idx].checked = !this.baseData[type][idx].checked
} }
} }
...@@ -314,6 +324,17 @@ export default { ...@@ -314,6 +324,17 @@ export default {
overflow-y: scroll; overflow-y: scroll;
padding: 16px; padding: 16px;
} }
.empty-box {
width: 100%;
text-align: center;
color: #666666;
font-size: 14px;
.order-empty {
width: 64px;
height: 40px;
margin-bottom: 16px;
}
}
.checked-box .content { .checked-box .content {
display: flex; display: flex;
height: 256px; height: 256px;
...@@ -326,8 +347,8 @@ export default { ...@@ -326,8 +347,8 @@ export default {
height: 32px; height: 32px;
line-height: 32px; line-height: 32px;
margin-bottom: 16px; margin-bottom: 16px;
.el-input__inner { .el-input-group {
width: 220px; width: 350px;
} }
} }
.row { .row {
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
<!-- <el-button type="text" v-if="scope.scope.inputStatus == '1'" @click="orderDetail(scope.scope)"> <!-- <el-button type="text" v-if="scope.scope.inputStatus == '1'" @click="orderDetail(scope.scope)">
订单详情 订单详情
</el-button> --> </el-button> -->
<auth-button v-if="scope.scope.inputStatus == '1'" :show-btn-ids="['9040204']" :data="scope.scope" /> <!-- <auth-button v-if="scope.scope.inputStatus == '1'" :show-btn-ids="['9040204']" :data="scope.scope" /> -->
<!-- <el-button type="text" <!-- <el-button type="text"
v-if="scope.scope.inputStatus == '0'" v-if="scope.scope.inputStatus == '0'"
@click="relatActivityOrder(scope.scope)"> @click="relatActivityOrder(scope.scope)">
...@@ -478,7 +478,6 @@ export default { ...@@ -478,7 +478,6 @@ export default {
getOptionsList() { getOptionsList() {
this.showFormData.forEach((item, index) => { this.showFormData.forEach((item, index) => {
if (item.type === 'select') { if (item.type === 'select') {
console.log('this.baseData[item.optionsName]', item.optionsName)
if (this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部') { if (this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部') {
const temp = {} const temp = {}
temp[this.showFormData[index].optionId] = '' temp[this.showFormData[index].optionId] = ''
...@@ -508,7 +507,7 @@ export default { ...@@ -508,7 +507,7 @@ export default {
}, },
handleSearch() { handleSearch() {
this.$refs.recordTable.refreshTable() this.$refs.recordTable.refreshTable(false, true)
this.getCount() this.getCount()
}, },
handleReset() { handleReset() {
...@@ -530,7 +529,7 @@ export default { ...@@ -530,7 +529,7 @@ export default {
} }
} }
this.baseData.storeIdList = [] this.baseData.storeIdList = []
this.$refs.recordTable.refreshTable() this.$refs.recordTable.refreshTable(false, true)
this.getAllServiceStore() this.getAllServiceStore()
this.getCount() this.getCount()
}, },
...@@ -594,9 +593,8 @@ export default { ...@@ -594,9 +593,8 @@ export default {
}, },
setTableFinishFun(data) { setTableFinishFun(data) {
console.log(data, 'data---')
data.forEach(item => { data.forEach(item => {
item.inputtedOrderCodeList = item.inputtedOrderCode.split(',') || [] item.inputtedOrderCodeList = item.inputtedOrderCode ? item.inputtedOrderCode.split(',') : []
}) })
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!