Commit 596cc1e0 by xuyl

更新mixin文件,使用另外接口请求

1 parent 571a9396
import request from './request'
import Vue from 'vue'
const path = 'merchants.api.'
const addNamelistApi = {
// 根据商户名称和渠道类型查询商户列表
getMerchantsList(data = {}) {
data.method = 'merchants.api.open.findMerchantList'
return request(
data,
'merchants.api.open.findMerchantList',
[],
Vue.prototype.otherUrl
)
}
}
export { addNamelistApi }
export const nearlyAMonth = {
data(){
return{
defalutStartTime:'',
defalutEndTime:''
}
},
created() {
let date = new Date()
let year = date.getFullYear()
let month = date.getMonth() + 1
let day = date.getDate()
let aheadOfMonth = month == '12' ? '1' : month - 1
this.defalutStartTime = year + '-' + aheadOfMonth + '-' + day
this.defalutEndTime = year + '-' + month + '-' + day
}
}
import App from './index' import App from './index.vue'
import base from '@/base' import base from '@/base'
import GlsxVueCommon from 'glsx-vue-common' import GlsxVueCommon from 'glsx-vue-common'
import Vue from 'vue'
base.getConfig().then(data => { base.getConfig().then(data => {
const { vue, config } = data const { vue, config } = data
Vue.prototype.otherUrl = config.axios.otherURL
vue.use(GlsxVueCommon, config) vue.use(GlsxVueCommon, config)
base.render(App) base.render(App)
}) })
...@@ -22,30 +22,26 @@ ...@@ -22,30 +22,26 @@
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label='所属业务场景'> <el-form-item label='所属业务场景'>
<el-select v-model='profitSearchForm.businessScene' placeholder='请选择状态'> <el-select v-model='profitSearchForm.businessScene' placeholder='所属业务场景'>
<el-option label='全部' value=''></el-option> <el-option label='全部' value=''></el-option>
<el-option label='未同步' value='0'></el-option>
<!-- <el-option label="同步中" value="1"></el-option> -->
<el-option label='已同步' value='2'></el-option>
<el-option label='同步失败' value='3'></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label='所属商户:'> <el-form-item label='所属商户:'>
<el-input <el-input
clearable clearable
v-model='profitSearchForm.merchantName' v-model='profitSearchForm.merchantName'
placeholder='请输入员工手机号' placeholder='请输入所属商户'
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label='所属活动/产品:'> <el-form-item label='所属活动/产品:'>
<el-input <el-input
clearable clearable
v-model='profitSearchForm.activityName' v-model='profitSearchForm.activityName'
placeholder='请输入员工手机号' placeholder='请输入所属活动/产品'
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label='发放渠道:'> <el-form-item label='发放渠道:'>
<el-select v-model='profitSearchForm.channel' placeholder='请选择状态'> <el-select v-model='profitSearchForm.channel' placeholder='请选择发放渠道'>
<el-option label='全部' value=''></el-option> <el-option label='全部' value=''></el-option>
<el-option label='广联' value='0'></el-option> <el-option label='广联' value='0'></el-option>
<el-option label='服务商' value='2'></el-option> <el-option label='服务商' value='2'></el-option>
...@@ -53,12 +49,11 @@ ...@@ -53,12 +49,11 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label='关联任务:'> <el-form-item label='关联任务:'>
<el-select v-model='profitSearchForm.missionName' placeholder='请选择状态'> <el-input
<el-option label='全部' value=''></el-option> clearable
<el-option label='未同步' value='0'></el-option> v-model='profitSearchForm.activityName'
<el-option label='已同步' value='2'></el-option> placeholder='请输入关联任务'
<el-option label='同步失败' value='3'></el-option> ></el-input>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label='奖励时间'> <el-form-item label='奖励时间'>
<el-date-picker <el-date-picker
...@@ -81,11 +76,13 @@ ...@@ -81,11 +76,13 @@
</template> </template>
<script> <script>
import { nearlyAMonth } from '@/mixin/nearlyAMonth'
export default { export default {
name: 'ProfitSearch', name: 'ProfitSearch',
mixins:[nearlyAMonth],
data() { data() {
return { return {
profitSearchForm: {} profitSearchForm: {},
} }
}, },
methods: { methods: {
...@@ -94,16 +91,20 @@ export default { ...@@ -94,16 +91,20 @@ export default {
this.profitSearchForm.rewardBeginTime = this.profitSearchForm.rewardTime[0] this.profitSearchForm.rewardBeginTime = this.profitSearchForm.rewardTime[0]
this.profitSearchForm.rewardEndTime = this.profitSearchForm.rewardTime[1] this.profitSearchForm.rewardEndTime = this.profitSearchForm.rewardTime[1]
} }
this.$emit('sendSearchForm',this.profitSearchForm) this.$emit('sendSearchForm', this.profitSearchForm)
}, },
reset() { reset() {
Object.keys(this.profitSearchForm).forEach((key) => { Object.keys(this.profitSearchForm).forEach((key) => {
this.profitSearchForm[key] = '' this.profitSearchForm[key] = ''
}) })
this.$set(this.profitSearchForm, 'rewardTime', [this.defalutStartTime, this.defalutEndTime])
this.$nextTick(() => { this.$nextTick(() => {
this.handleSearch() this.handleSearch()
}) })
} }
},
created() {
this.$set(this.profitSearchForm, 'rewardTime', [this.defalutStartTime, this.defalutEndTime])
} }
} }
</script> </script>
......
...@@ -97,7 +97,7 @@ export default { ...@@ -97,7 +97,7 @@ export default {
this.profitSearchForm = val this.profitSearchForm = val
this.$refs.withdrawalTable.refreshTable() this.$refs.withdrawalTable.refreshTable()
} }
} },
} }
</script> </script>
......
...@@ -64,13 +64,18 @@ ...@@ -64,13 +64,18 @@
</template> </template>
<script> <script>
import { nearlyAMonth } from '@/mixin/nearlyAMonth'
export default { export default {
name: 'WithdrawalSearch', name: 'WithdrawalSearch',
mixins:[nearlyAMonth],
data() { data() {
return { return {
withdrawalSearchForm: {} withdrawalSearchForm: {}
} }
}, },
created() {
this.$set(this.withdrawalSearchForm,'withdrawalTime',[this.defalutStartTime,this.defalutEndTime])
},
methods: { methods: {
handleSearch() { handleSearch() {
if (this.withdrawalSearchForm && this.withdrawalSearchForm.withdrawalTime) { if (this.withdrawalSearchForm && this.withdrawalSearchForm.withdrawalTime) {
...@@ -87,6 +92,7 @@ export default { ...@@ -87,6 +92,7 @@ export default {
Object.keys(this.withdrawalSearchForm).forEach((key) => { Object.keys(this.withdrawalSearchForm).forEach((key) => {
this.withdrawalSearchForm[key] = '' this.withdrawalSearchForm[key] = ''
}) })
this.$set(this.withdrawalSearchForm,'withdrawalTime',[this.defalutStartTime,this.defalutEndTime])
this.$nextTick(() => { this.$nextTick(() => {
this.handleSearch() this.handleSearch()
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!