Commit 3d745e5d by 前端

3月版本功能代码提交

1 parent df799594
import { Util } from "@/common/util" import {
import { reportTrack } from "@api/resident" Util
} from "@/common/util"
import {
reportTrack
} from "@api/resident"
export default { export default {
data () { data() {
return { return {
prePagePath: '', prePagePath: "",
track_timerFlag: false, track_timerFlag: false,
track_batchId: null, track_batchId: null,
track_page_view_flag: false, track_page_view_flag: false,
track_timer_out: null track_timer_out: null
} }
}, },
beforeRouteEnter (to, from, next) { beforeRouteEnter(to, from, next) {
next(vm => { next((vm) => {
vm.prePagePath = from.path vm.prePagePath = from.path
}) })
}, },
computed: { computed: {
loginAccount () { loginAccount() {
return this.$store.state.d2admin.user.info.loginAccount return this.$store.state.d2admin.user.info.loginAccount
} }
}, },
methods: { methods: {
setReportTrackData (eventType, eventCode = '', businessParam = '', batchId = '') { setReportTrackData(
let recordList = localStorage.getItem('recordList'), eventType,
route = this.$route, eventCode = "",
{ loginAccout, uuid, userType } = this.loginAccount, businessParam = "",
{ prePagePath } = this, batchId = ""
item = { ) {
loginAccount: loginAccout, let recordList = localStorage.getItem("recordList")
uuid, const route = this.$route
userType, const {
systemSource: 1, loginAccout,
eventTime: Util.dateFormate(Date.now(), "YYYY-MM-DD HH:mm:ss"), uuid,
eventType, userType
pagePath: route.path, } = this.loginAccount
} let {
prePagePath
} = this
const item = {
loginAccount: loginAccout,
uuid,
userType,
systemSource: 1,
eventTime: Util.dateFormate(Date.now(), "YYYY-MM-DD HH:mm:ss"),
eventType,
pagePath: route.path
}
if (!prePagePath) prePagePath = this.getPrePagePath(this) if (!prePagePath) prePagePath = this.getPrePagePath(this)
item.prePagePath = prePagePath || '/index' item.prePagePath = prePagePath || "/index"
if (batchId) item.batchId = batchId if (batchId) item.batchId = batchId
if (eventCode) item.eventCode = eventCode if (eventCode) item.eventCode = eventCode
if (businessParam) item.businessParam = JSON.stringify(businessParam) if (businessParam) item.businessParam = JSON.stringify(businessParam)
...@@ -46,26 +61,31 @@ export default { ...@@ -46,26 +61,31 @@ export default {
recordList = JSON.parse(recordList) recordList = JSON.parse(recordList)
recordList.push(item) recordList.push(item)
} }
localStorage.setItem('recordList', JSON.stringify(recordList)) localStorage.setItem("recordList", JSON.stringify(recordList))
if (recordList.length > 9) { if (recordList.length > 9) {
reportTrack({ reportTrack({
recordList recordList
}).then(res => { }).then((res) => {
if (res) localStorage.removeItem('recordList') if (res) localStorage.removeItem("recordList")
}) })
} }
}, },
getRandomString (length = 30) { getRandomString(length = 30) {
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; const characters =
let result = ''; "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
let result = ""
for (let i = 0; i < length; i++) { for (let i = 0; i < length; i++) {
result += characters.charAt(Math.floor(Math.random() * characters.length)); result += characters.charAt(
Math.floor(Math.random() * characters.length)
)
} }
return result; return result
}, },
onPageShow () { onPageShow() {
if (this.track_page_view_flag) return if (this.track_page_view_flag) return
if (!this.track_batchId) this.track_batchId = `DJ_${this.getRandomString()}_${Date.now()}` if (!this.track_batchId) {
this.track_batchId = `DJ_${this.getRandomString()}_${Date.now()}`
}
this.track_timerFlag = true this.track_timerFlag = true
this.track_page_view_flag = true this.track_page_view_flag = true
if (this.track_timer_out) { if (this.track_timer_out) {
...@@ -76,44 +96,52 @@ export default { ...@@ -76,44 +96,52 @@ export default {
this.setBrowseTrackData() this.setBrowseTrackData()
}, 300) }, 300)
}, },
onPageHide () { onPageHide() {
this.track_timerFlag = false this.track_timerFlag = false
this.track_batchId = null this.track_batchId = null
this.track_page_view_flag = false this.track_page_view_flag = false
clearTimeout(this.track_timer_out) clearTimeout(this.track_timer_out)
this.track_timer_out = null this.track_timer_out = null
}, },
setBrowseTrackData () { setBrowseTrackData() {
try { try {
if (!this.track_timerFlag || this.$route.path != '/qualityControlList') return if (!this.track_timerFlag || (this.$route.path != "/qualityControlList" && this.$route.path != "/shopConfig")) {
else this.track_timer_out = setTimeout(() => { return
this.setBrowseTrackData() } else {
}, 10e3) this.track_timer_out = setTimeout(() => {
this.setReportTrackData(2, this.track_event_code, this[this.track_businessParam_key], this.track_batchId) this.setBrowseTrackData()
}, 10e3)
}
this.setReportTrackData(
2,
this.track_event_code,
this[this.track_businessParam_key],
this.track_batchId
)
} catch (error) { } catch (error) {
console.log(error) console.log(error)
} }
}, },
getPrePagePath (_this) { getPrePagePath(_this) {
let current = _this; let current = _this
const visited = new Set(); const visited = new Set()
while (current) { while (current) {
if (visited.has(current)) { if (visited.has(current)) {
// 防止无限循环 // 防止无限循环
console.error('Detected circular reference in parent chain'); console.error("Detected circular reference in parent chain")
return ''; return ""
} }
visited.add(current); visited.add(current)
if (current.$parent && current.$parent.prePagePath) { if (current.$parent && current.$parent.prePagePath) {
return current.$parent.prePagePath; return current.$parent.prePagePath
} }
current = current.$parent; current = current.$parent
} }
return ''; return ""
} }
} }
}
\ No newline at end of file \ No newline at end of file
}
...@@ -111,9 +111,11 @@ import { limitPrice, rangePickerOptions_deliveryQuantity } from '@/common/format ...@@ -111,9 +111,11 @@ import { limitPrice, rangePickerOptions_deliveryQuantity } from '@/common/format
import { getList } from "@api/merchant" import { getList } from "@api/merchant"
import { outputValue_operTypeOpt } from "@/common/constants.js" import { outputValue_operTypeOpt } from "@/common/constants.js"
import { insertDeliverTargeConfig, updateDeliverTargeConfig, getById_deliver, getCarBrand } from '@api/shopConfig' import { insertDeliverTargeConfig, updateDeliverTargeConfig, getById_deliver, getCarBrand } from '@api/shopConfig'
// import reportTrackFunMixin from '@/mixins/reportTrackFunMixin'
export default { export default {
name: 'EditDialog', name: 'EditDialog',
// mixins: [reportTrackFunMixin],
directives: { directives: {
'el-select-loadmore': { 'el-select-loadmore': {
bind(el, binding) { bind(el, binding) {
...@@ -201,6 +203,8 @@ export default { ...@@ -201,6 +203,8 @@ export default {
operTypeOpt: deepClone(outputValue_operTypeOpt), operTypeOpt: deepClone(outputValue_operTypeOpt),
currentPage: 1, currentPage: 1,
pageSize: 20 pageSize: 20
// track_event_code: 'shopConfig_merchantDeliverTargeConfig_add',
// track_businessParam_key: 'searchForm'
} }
}, },
...@@ -223,17 +227,18 @@ export default { ...@@ -223,17 +227,18 @@ export default {
computed: { computed: {
dialogShow: { dialogShow: {
get() { get() {
// this.setCode()
// this.onPageShow()
return this.visible return this.visible
}, },
set(newVal) { set(newVal) {
this.$emit('dialogClose', { flag: newVal, attrName: 'visible' }) // this.onPageHide()
this.$emit('dialogClose', { flag: 'dialogClose' })
} }
} }
}, },
mounted() { mounted() {
console.log('this.paramsObj', this.paramsObj)
console.log('this.operationType', this.operationType)
if (this.paramsObj) { if (this.paramsObj) {
this.getInfo(this.paramsObj.id) this.getInfo(this.paramsObj.id)
if (this.operationType == 'edit') { if (this.operationType == 'edit') {
...@@ -248,6 +253,17 @@ export default { ...@@ -248,6 +253,17 @@ export default {
}, },
methods: { methods: {
// setCode() {
// if (this.paramsObj) {
// if (this.operationType == 'edit') {
// this.track_event_code = 'shopConfig_merchantDeliverTargeConfig_edit'
// } else {
// this.track_event_code = 'shopConfig_merchantDeliverTargeConfig_detail'
// }
// } else {
// this.track_event_code = 'shopConfig_merchantDeliverTargeConfig_add'
// }
// },
// 获取4S门店数据 // 获取4S门店数据
remoteMethod(query) { remoteMethod(query) {
this.merchantName = query this.merchantName = query
...@@ -299,7 +315,6 @@ export default { ...@@ -299,7 +315,6 @@ export default {
this.formData = deepClone(res) this.formData = deepClone(res)
this.tableData = deepClone(res.logList) this.tableData = deepClone(res.logList)
this.formData.brand = [this.formData.brandId, this.formData.childId] this.formData.brand = [this.formData.brandId, this.formData.childId]
console.log('this.formData', this.formData)
const obj = { merchantId: this.formData.merchantId, merchantName: this.formData.merchantName } const obj = { merchantId: this.formData.merchantId, merchantName: this.formData.merchantName }
this.getSelectingList(obj) this.getSelectingList(obj)
this.getCarBrand(this.formData.merchantId) this.getCarBrand(this.formData.merchantId)
...@@ -311,7 +326,6 @@ export default { ...@@ -311,7 +326,6 @@ export default {
}, },
choose4S(merchantId) { choose4S(merchantId) {
console.log('merchantId', merchantId)
this.formData.brand = [] this.formData.brand = []
this.formData.brandId = '' this.formData.brandId = ''
this.formData.brandName = '' this.formData.brandName = ''
...@@ -332,8 +346,6 @@ export default { ...@@ -332,8 +346,6 @@ export default {
}, },
chooseBrand(value) { chooseBrand(value) {
console.log('value', value)
console.log('getCheckedNodes', this.$refs.cascader.getCheckedNodes())
const checkedNode = this.$refs.cascader.getCheckedNodes()[0] const checkedNode = this.$refs.cascader.getCheckedNodes()[0]
const brandNode = checkedNode.pathNodes[0] const brandNode = checkedNode.pathNodes[0]
const childNode = checkedNode.pathNodes[1] const childNode = checkedNode.pathNodes[1]
...@@ -356,20 +368,23 @@ export default { ...@@ -356,20 +368,23 @@ export default {
}, },
handleAddConfirm() { handleAddConfirm() {
if (this.operationType == 'detail') {
this.dialogShow = false
return
}
this.$refs.infoForm.validate(valid => { this.$refs.infoForm.validate(valid => {
if (valid) { if (valid) {
var params = deepClone(this.formData) var params = deepClone(this.formData)
params.merchantName = this.baseData.merchantList.find(item => item.merchantId == params.merchantId).merchantName params.merchantName = this.baseData.merchantList.find(item => item.merchantId == params.merchantId).merchantName
// return console.log('params', params)
if (params.id) { if (params.id) {
updateDeliverTargeConfig(params).then(res => { updateDeliverTargeConfig(params).then(res => {
this.notice.okTips('操作成功') this.notice.okTips('操作成功')
this.dialogShow = true this.dialogShow = false
}) })
} else { } else {
insertDeliverTargeConfig(params).then(res => { insertDeliverTargeConfig(params).then(res => {
this.notice.okTips('操作成功') this.notice.okTips('操作成功')
this.dialogShow = true this.dialogShow = false
}) })
} }
} }
......
...@@ -42,7 +42,8 @@ ...@@ -42,7 +42,8 @@
@click="handleClickIcon" @click="handleClickIcon"
class="el-icon-circle-close"></i> class="el-icon-circle-close"></i>
</div> </div>
<!----><!----> <div class="errorTips"
v-if="tipsShow">最大交付数需大于最小交付数</div>
</div> </div>
</template> </template>
<script> <script>
...@@ -56,7 +57,8 @@ export default { ...@@ -56,7 +57,8 @@ export default {
oldVal: { oldVal: {
startInput: '', startInput: '',
endInput: '' endInput: ''
} },
tipsShow: false
} }
}, },
...@@ -76,31 +78,18 @@ export default { ...@@ -76,31 +78,18 @@ export default {
}, },
methods: { methods: {
handleStartInput(event) { handleStartInput(event) {
// const isNumber = /^\d+$/.test(event)
// if (!isNumber) {
// event = null
// }
// if (event > 100) event = 100
// this.userInput[0] = event
this.userInput[0] = limitPrice(event, this.oldVal.startInput, 20, 2) this.userInput[0] = limitPrice(event, this.oldVal.startInput, 20, 2)
this.oldVal.startInput = this.userInput[0] this.oldVal.startInput = this.userInput[0]
}, },
handleEndInput(event) { handleEndInput(event) {
// const isNumber = /^\d+$/.test(event)
// if (!isNumber) {
// event = null
// }
// if (event > 100) event = 100
// this.userInput[1] = event
this.userInput[1] = limitPrice(event, this.oldVal.endInput, 20, 2) this.userInput[1] = limitPrice(event, this.oldVal.endInput, 20, 2)
this.oldVal.endInput = this.userInput[1] this.oldVal.endInput = this.userInput[1]
}, },
handleClickIcon(event) { handleClickIcon(event) {
this.userInput[0] = null this.userInput[0] = null
this.userInput[1] = null this.userInput[1] = null
this.tipsShow = false
}, },
valueIsEmpty() { valueIsEmpty() {
const val = this.userInput const val = this.userInput
...@@ -138,6 +127,9 @@ export default { ...@@ -138,6 +127,9 @@ export default {
if (Array.isArray(val)) { if (Array.isArray(val)) {
if (+val[0] > +val[1]) { if (+val[0] > +val[1]) {
val[1] = null val[1] = null
this.tipsShow = true
} else {
this.tipsShow = false
} }
} }
} }
...@@ -169,5 +161,10 @@ export default { ...@@ -169,5 +161,10 @@ export default {
} }
} }
} }
.errorTips {
color: red;
text-align: center;
font-size: 12px;
}
} }
</style> </style>
...@@ -36,8 +36,8 @@ ...@@ -36,8 +36,8 @@
</el-date-picker> </el-date-picker>
</div> </div>
<div slot="targetValueHtml"> <div slot="targetValueHtml">
<input-range start-placeholder="最小产值" <input-range start-placeholder="最小交付数"
end-placeholder="最大产值" end-placeholder="最大交付数"
:display-value="searchForm.targetValue"></input-range> :display-value="searchForm.targetValue"></input-range>
</div> </div>
</d2-search> </d2-search>
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
</div> </div>
</d2-table> </d2-table>
</div> </div>
<d2-dialog :title="'产值导入'" <d2-dialog :title="'交付数导入'"
:is-visible="fileVisible" :is-visible="fileVisible"
@closeDialog="handleImport" @closeDialog="handleImport"
@confirmDialog="handleConfirmImport"> @confirmDialog="handleConfirmImport">
...@@ -138,8 +138,10 @@ import editDialog from "./components/editDialog" ...@@ -138,8 +138,10 @@ import editDialog from "./components/editDialog"
import { listWithPage_deliver, deliverTargeConfigImport, deleteById_deliver, distinctAllBrand } from '@api/shopConfig' import { listWithPage_deliver, deliverTargeConfigImport, deleteById_deliver, distinctAllBrand } from '@api/shopConfig'
import { getList } from "@api/merchant" import { getList } from "@api/merchant"
import { outputValue_businessOpt } from "@/common/constants.js" import { outputValue_businessOpt } from "@/common/constants.js"
import reportTrackFunMixin from '@/mixins/reportTrackFunMixin'
export default { export default {
name: "DeliveryQuantity", name: "DeliveryQuantity",
mixins: [reportTrackFunMixin], // 导入混入
directives: { directives: {
'el-select-loadmore': { 'el-select-loadmore': {
bind(el, binding) { bind(el, binding) {
...@@ -219,7 +221,7 @@ export default { ...@@ -219,7 +221,7 @@ export default {
{ {
label: "品牌", label: "品牌",
prop: "brandName", prop: "brandName",
width: "300", width: "500",
formatter: (cellValue) => { formatter: (cellValue) => {
return cellValue.brandName + ' - ' + cellValue.childName return cellValue.brandName + ' - ' + cellValue.childName
} }
...@@ -232,7 +234,10 @@ export default { ...@@ -232,7 +234,10 @@ export default {
{ {
label: "交付数", label: "交付数",
prop: "targetValue", prop: "targetValue",
width: "200" width: "200",
formatter: (cellValue) => {
return (cellValue.targetValue || cellValue.targetValue == 0) ? cellValue.targetValue : "-"
}
}, },
{ {
label: "导入时间", label: "导入时间",
...@@ -268,7 +273,9 @@ export default { ...@@ -268,7 +273,9 @@ export default {
pageSize: 20, pageSize: 20,
fileVisible: false, fileVisible: false,
fileForm: {}, fileForm: {},
editVisible: false editVisible: false,
track_event_code: 'shopConfig_merchantDeliverTargeConfig_list',
track_businessParam_key: 'searchForm'
} }
}, },
...@@ -283,6 +290,7 @@ export default { ...@@ -283,6 +290,7 @@ export default {
}) })
}, },
mounted() { mounted() {
this.onPageShow()
this.getBaseData() this.getBaseData()
}, },
...@@ -342,7 +350,6 @@ export default { ...@@ -342,7 +350,6 @@ export default {
const resArr = [...res.list] const resArr = [...res.list]
const arr = this.baseData.merchantList.concat(resArr) const arr = this.baseData.merchantList.concat(resArr)
this.baseData.merchantList = arr this.baseData.merchantList = arr
console.log('this.baseData.merchantList', this.baseData.merchantList)
this.getOptionsList() this.getOptionsList()
}).catch(() => { }).catch(() => {
}) })
...@@ -543,6 +550,9 @@ export default { ...@@ -543,6 +550,9 @@ export default {
console.log(err) console.log(err)
}) })
} }
},
beforeDestroy() {
this.onPageHide()
} }
} }
</script> </script>
......
...@@ -116,9 +116,11 @@ import { limitPrice, rangePickerOptions_outputValue } from '@/common/format' ...@@ -116,9 +116,11 @@ import { limitPrice, rangePickerOptions_outputValue } from '@/common/format'
import { getList } from "@api/merchant" import { getList } from "@api/merchant"
import { outputValue_businessOpt, outputValue_operTypeOpt } from "@/common/constants.js" import { outputValue_businessOpt, outputValue_operTypeOpt } from "@/common/constants.js"
import { insertOutputTargeConfig, updateOutputTargeConfig, getById } from '@api/shopConfig' import { insertOutputTargeConfig, updateOutputTargeConfig, getById } from '@api/shopConfig'
// import reportTrackFunMixin from '@/mixins/reportTrackFunMixin'
export default { export default {
name: 'EditDialog', name: 'EditDialog',
// mixins: [reportTrackFunMixin],
directives: { directives: {
'el-select-loadmore': { 'el-select-loadmore': {
bind(el, binding) { bind(el, binding) {
...@@ -204,6 +206,8 @@ export default { ...@@ -204,6 +206,8 @@ export default {
operTypeOpt: deepClone(outputValue_operTypeOpt), operTypeOpt: deepClone(outputValue_operTypeOpt),
currentPage: 1, currentPage: 1,
pageSize: 20 pageSize: 20
// track_event_code: 'shopConfig_merchantOutputTargeConfig_add',
// track_businessParam_key: 'searchForm'
} }
}, },
...@@ -226,17 +230,18 @@ export default { ...@@ -226,17 +230,18 @@ export default {
computed: { computed: {
dialogShow: { dialogShow: {
get() { get() {
// this.setCode()
// this.onPageShow()
return this.visible return this.visible
}, },
set(newVal) { set(newVal) {
this.$emit('dialogClose', { flag: newVal, attrName: 'visible' }) // this.onPageHide()
this.$emit('dialogClose', { flag: 'dialogClose' })
} }
} }
}, },
mounted() { mounted() {
console.log('this.paramsObj', this.paramsObj)
console.log('this.operationType', this.operationType)
if (this.paramsObj) { if (this.paramsObj) {
this.getInfo(this.paramsObj.id) this.getInfo(this.paramsObj.id)
if (this.operationType == 'edit') { if (this.operationType == 'edit') {
...@@ -251,6 +256,17 @@ export default { ...@@ -251,6 +256,17 @@ export default {
}, },
methods: { methods: {
// setCode() {
// if (this.paramsObj) {
// if (this.operationType == 'edit') {
// this.track_event_code = 'shopConfig_merchantOutputTargeConfig_edit'
// } else {
// this.track_event_code = 'shopConfig_merchantOutputTargeConfig_detail'
// }
// } else {
// this.track_event_code = 'shopConfig_merchantOutputTargeConfig_add'
// }
// },
// 获取商品数据 // 获取商品数据
remoteMethod(query) { remoteMethod(query) {
this.merchantName = query this.merchantName = query
...@@ -301,7 +317,6 @@ export default { ...@@ -301,7 +317,6 @@ export default {
}).then(res => { }).then(res => {
this.formData = deepClone(res) this.formData = deepClone(res)
this.tableData = deepClone(res.logList) this.tableData = deepClone(res.logList)
console.log('this.formData', this.formData)
const obj = { merchantId: this.formData.merchantId, merchantName: this.formData.merchantName } const obj = { merchantId: this.formData.merchantId, merchantName: this.formData.merchantName }
this.getSelectingList(obj) this.getSelectingList(obj)
this.formData.createdDateShow = this.formData.createdDate this.formData.createdDateShow = this.formData.createdDate
...@@ -336,6 +351,10 @@ export default { ...@@ -336,6 +351,10 @@ export default {
}, },
handleAddConfirm() { handleAddConfirm() {
if (this.operationType == 'detail') {
this.dialogShow = false
return
}
this.$refs.infoForm.validate(valid => { this.$refs.infoForm.validate(valid => {
if (valid) { if (valid) {
var params = deepClone(this.formData) var params = deepClone(this.formData)
...@@ -343,12 +362,12 @@ export default { ...@@ -343,12 +362,12 @@ export default {
if (params.id) { if (params.id) {
updateOutputTargeConfig(params).then(res => { updateOutputTargeConfig(params).then(res => {
this.notice.okTips('操作成功') this.notice.okTips('操作成功')
this.dialogShow = true this.dialogShow = false
}) })
} else { } else {
insertOutputTargeConfig(params).then(res => { insertOutputTargeConfig(params).then(res => {
this.notice.okTips('操作成功') this.notice.okTips('操作成功')
this.dialogShow = true this.dialogShow = false
}) })
} }
} }
......
...@@ -42,7 +42,8 @@ ...@@ -42,7 +42,8 @@
@click="handleClickIcon" @click="handleClickIcon"
class="el-icon-circle-close"></i> class="el-icon-circle-close"></i>
</div> </div>
<!----><!----> <div class="errorTips"
v-if="tipsShow">最大产值需大于最小产值</div>
</div> </div>
</template> </template>
<script> <script>
...@@ -56,7 +57,8 @@ export default { ...@@ -56,7 +57,8 @@ export default {
oldVal: { oldVal: {
startInput: '', startInput: '',
endInput: '' endInput: ''
} },
tipsShow: false
} }
}, },
...@@ -76,31 +78,18 @@ export default { ...@@ -76,31 +78,18 @@ export default {
}, },
methods: { methods: {
handleStartInput(event) { handleStartInput(event) {
// const isNumber = /^\d+$/.test(event) this.userInput[0] = limitPrice(event, this.oldVal.startInput, 11, 2)
// if (!isNumber) {
// event = null
// }
// if (event > 100) event = 100
// this.userInput[0] = event
this.userInput[0] = limitPrice(event, this.oldVal.startInput, 20, 2)
this.oldVal.startInput = this.userInput[0] this.oldVal.startInput = this.userInput[0]
}, },
handleEndInput(event) { handleEndInput(event) {
// const isNumber = /^\d+$/.test(event) this.userInput[1] = limitPrice(event, this.oldVal.endInput, 11, 2)
// if (!isNumber) {
// event = null
// }
// if (event > 100) event = 100
// this.userInput[1] = event
this.userInput[1] = limitPrice(event, this.oldVal.endInput, 20, 2)
this.oldVal.endInput = this.userInput[1] this.oldVal.endInput = this.userInput[1]
}, },
handleClickIcon(event) { handleClickIcon(event) {
this.userInput[0] = null this.userInput[0] = null
this.userInput[1] = null this.userInput[1] = null
this.tipsShow = false
}, },
valueIsEmpty() { valueIsEmpty() {
const val = this.userInput const val = this.userInput
...@@ -138,6 +127,9 @@ export default { ...@@ -138,6 +127,9 @@ export default {
if (Array.isArray(val)) { if (Array.isArray(val)) {
if (+val[0] > +val[1]) { if (+val[0] > +val[1]) {
val[1] = null val[1] = null
this.tipsShow = true
} else {
this.tipsShow = false
} }
} }
} }
...@@ -169,5 +161,10 @@ export default { ...@@ -169,5 +161,10 @@ export default {
} }
} }
} }
.errorTips {
color: red;
text-align: center;
font-size: 12px;
}
} }
</style> </style>
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
</d2-container> </d2-container>
</template> </template>
<script> <script type='text/ecmascript-6'>
import { mapActions, mapState } from "vuex" import { mapActions, mapState } from "vuex"
import { Util, deepClone } from "@/common/util" import { Util, deepClone } from "@/common/util"
import inputRange from './components/inputRange' import inputRange from './components/inputRange'
...@@ -144,10 +144,10 @@ import editDialog from "./components/editDialog" ...@@ -144,10 +144,10 @@ import editDialog from "./components/editDialog"
import { listWithPage, targeConfigImport, deleteById } from '@api/shopConfig' import { listWithPage, targeConfigImport, deleteById } from '@api/shopConfig'
import { getList } from "@api/merchant" import { getList } from "@api/merchant"
import { outputValue_businessOpt } from "@/common/constants.js" import { outputValue_businessOpt } from "@/common/constants.js"
import reportTrackPageMixin from "@/mixins/reportTrackPageMixin" import reportTrackFunMixin from '@/mixins/reportTrackFunMixin'
export default { export default {
mixins: [reportTrackPageMixin],
name: "QutputValue", name: "QutputValue",
mixins: [reportTrackFunMixin], // 导入混入
directives: { directives: {
'el-select-loadmore': { 'el-select-loadmore': {
bind(el, binding) { bind(el, binding) {
...@@ -227,7 +227,7 @@ export default { ...@@ -227,7 +227,7 @@ export default {
{ {
label: "业务类型", label: "业务类型",
addHtml: "typeHtml", addHtml: "typeHtml",
width: "100" width: "150"
}, },
{ {
label: "产值目标月份", label: "产值目标月份",
...@@ -237,7 +237,10 @@ export default { ...@@ -237,7 +237,10 @@ export default {
{ {
label: "产值", label: "产值",
prop: "targetValue", prop: "targetValue",
width: "200" width: "200",
formatter: (cellValue) => {
return (cellValue.targetValue || cellValue.targetValue == 0) ? cellValue.targetValue : "-"
}
}, },
{ {
label: "导入时间", label: "导入时间",
...@@ -272,7 +275,9 @@ export default { ...@@ -272,7 +275,9 @@ export default {
pageSize: 20, pageSize: 20,
fileVisible: false, fileVisible: false,
fileForm: {}, fileForm: {},
editVisible: false editVisible: false,
track_event_code: 'shopConfig_merchantOutputTargeConfig_list',
track_businessParam_key: 'searchForm'
} }
}, },
...@@ -287,6 +292,7 @@ export default { ...@@ -287,6 +292,7 @@ export default {
}) })
}, },
mounted() { mounted() {
this.onPageShow()
this.getBaseData() this.getBaseData()
}, },
...@@ -339,7 +345,6 @@ export default { ...@@ -339,7 +345,6 @@ export default {
const resArr = [...res.list] const resArr = [...res.list]
const arr = this.baseData.merchantList.concat(resArr) const arr = this.baseData.merchantList.concat(resArr)
this.baseData.merchantList = arr this.baseData.merchantList = arr
console.log('this.baseData.merchantList', this.baseData.merchantList)
this.getOptionsList() this.getOptionsList()
}).catch(() => { }).catch(() => {
}) })
...@@ -366,25 +371,6 @@ export default { ...@@ -366,25 +371,6 @@ export default {
this.getSelectingList() this.getSelectingList()
}, 10) }, 10)
}, },
// showOperate(row) {
// const show = false
// if (row.targetMonth) {
// const targetDate = new Date(row.targetMonth)
// console.log('targetDate', targetDate)
// const nowDate = new Date()
// console.log('nowDate', nowDate)
// // 判断是否同年
// if (targetDate.getFullYear() === nowDate.getFullYear()) {
// console.log('当前年')
// } else {
// console.log(this.monthsBetween(targetDate, nowDate))
// }
// }
// },
// monthsBetween(date1, date2) {
// const monthsDiff = (date2.getFullYear() - date1.getFullYear()) * 12 + date2.getMonth() - date1.getMonth()
// return Math.abs(monthsDiff)
// },
handleReset() { handleReset() {
this.searchForm = { this.searchForm = {
merchantIdList: [], merchantIdList: [],
...@@ -545,6 +531,9 @@ export default { ...@@ -545,6 +531,9 @@ export default {
console.log(err) console.log(err)
}) })
} }
},
beforeDestroy() {
this.onPageHide()
} }
} }
</script> </script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!