Commit 7e6a265a authored by 高宇's avatar 高宇

调整 cascader 的筛选结果顺序;

parent 15545c98
...@@ -109,10 +109,11 @@ ...@@ -109,10 +109,11 @@
} }
}, },
toView (item) { toView (item) {
// console.log(item)
let obj = { let obj = {
name: 'ofClient', name: 'ofClient',
params: { params: {
clientId: item.client_id id: item.client_id
} }
} }
return obj return obj
......
...@@ -55,18 +55,21 @@ ...@@ -55,18 +55,21 @@
:pager.sync="pagenation" :pager.sync="pagenation"
:total="totalcount"> :total="totalcount">
</Pagenation> </Pagenation>
<leave-message
v-click-outside="lmClose"
ref="leaveMessage"
:lmTemplate="lmTemplate"
:type="19">
</leave-message>
<!--<el-button type="primary" @click="showLeave">测试</el-button>--> <!--<el-button type="primary" @click="showLeave">测试</el-button>-->
</div> </div>
</div> </div>
<div class="images clearfix" style="display: none;"> <div class="images clearfix" style="display: none;">
<img v-for="(source, index) in images" :key="index" :src="source" class="image"> <img v-for="(source, index) in images" :key="index" :src="source" class="image">
</div> </div>
<leave-message <side-popup ref="sidePopup" :title="operationTitle">
v-click-outside="lmClose" <component :is="operationPage" :ref="operationPage" @close="close"></component>
ref="leaveMessage" </side-popup>
:lmTemplate="lmTemplate"
:type="2">
</leave-message>
</section> </section>
</template> </template>
...@@ -74,9 +77,10 @@ ...@@ -74,9 +77,10 @@
import ScheduleItem from '../common/scheduleItem' import ScheduleItem from '../common/scheduleItem'
import Pagenation from './schedulePagenation' import Pagenation from './schedulePagenation'
import clientHeader from '../common/clientHeader' import clientHeader from '../common/clientHeader'
import LeaveMessage from '../common/leaveMessage'
import clientForm from './workLogListForm' import clientForm from './workLogListForm'
import clickOutside from '@/lib/bind' import clickOutside from '@/lib/bind'
import addLog from './work/addLog'
import editLog from './work/editLog'
import { import {
requestAPI, requestAPI,
api api
...@@ -91,7 +95,8 @@ ...@@ -91,7 +95,8 @@
clientForm, clientForm,
ScheduleItem, ScheduleItem,
Pagenation, Pagenation,
LeaveMessage addLog,
editLog
}, },
directives: { directives: {
clickOutside clickOutside
...@@ -105,32 +110,40 @@ ...@@ -105,32 +110,40 @@
default: '未设置' default: '未设置'
}, },
{ {
name: '内容', name: '开始时间',
value: 'description' value: 'start_at'
}, },
{ {
name: '待办时间', name: '结束时间',
value: 'schedule_week_display' value: 'end_at'
}, },
{ {
name: '状态', name: '用时',
value: 'schedule_status_display' value: 'hours_spent_display'
}, },
{ {
name: '开始时间', name: '陪同人员',
value: 'start_at' value: 'escort'
}, },
{ {
name: '结束时间', name: '日志类型',
value: 'end_at' value: 'scenarios.name'
},
{
name: '工作内容',
value: 'scenarioOption.name'
},
{
name: '情况说明',
value: 'description'
}, },
{ {
name: '重复', name: '客户经理',
value: 'repeatSchedule' value: 'client.salesRep.name'
}, },
{ {
name: '负责人', name: '录入人',
value: 'repeatSchedule' value: 'createdBy.name'
}, },
{ {
name: '创建时间', name: '创建时间',
...@@ -152,17 +165,19 @@ ...@@ -152,17 +165,19 @@
page: 1 page: 1
}, },
totalcount: 0, totalcount: 0,
operationPage: '',
operationTitle: '',
loading: false, loading: false,
images: [] images: []
} }
}, },
methods: { methods: {
leaveMessageSch (item) { leaveMessageSch (item) {
this.$refs.leaveMessage.isShow(item) this.$refs.leaveMessage.btnShow(item)
}, },
lmClose () { lmClose () {
this.$refs.leaveMessage && this.$refs.leaveMessage &&
this.$refs.leaveMessage.isClose() this.$refs.leaveMessage.btnClose()
}, },
setImage (imgs) { setImage (imgs) {
this.images = imgs this.images = imgs
...@@ -177,7 +192,16 @@ ...@@ -177,7 +192,16 @@
}) })
}, },
editLog (row) { editLog (row) {
this.$router.push({name: 'workLogEdit', params: {id: row.id}}) // this.$router.push({name: 'workLogEdit', params: {id: row.id}})
this.operationPage = 'editLog'
this.operationTitle = '编辑工作日志'
// this.$router.push({name: 'editProject', params: {id: row.id}})
this.$nextTick(() => {
this.$refs.sidePopup.show(this.$refs[this.operationPage].init(row.id))
})
},
close () {
this.$refs.sidePopup.close()
}, },
delLog (id) { delLog (id) {
this.$confirm('确认删除吗?', '提示').then(() => { this.$confirm('确认删除吗?', '提示').then(() => {
...@@ -202,8 +226,13 @@ ...@@ -202,8 +226,13 @@
}) })
}, },
addNewLog () { addNewLog () {
this.$router.push({name: 'workLogAdd'}) // this.$router.push({name: 'workLogAdd'})
// this.$refs.leaveModule.isShow('新建客户', 'clientAdd') this.operationPage = 'addLog'
this.operationTitle = '新建工作日志'
// this.$router.push({name: 'editProject', params: {id: row.id}})
this.$nextTick(() => {
this.$refs.sidePopup.show(this.$refs[this.operationPage].init())
})
}, },
searchKeyword (search) { searchKeyword (search) {
this.updateForm(search) this.updateForm(search)
......
...@@ -49,8 +49,17 @@ ...@@ -49,8 +49,17 @@
:pager.sync="pagenation" :pager.sync="pagenation"
:total="totalcount"> :total="totalcount">
</Pagenation> </Pagenation>
<leave-message
v-click-outside="lmClose"
ref="leaveMessage"
:lmTemplate="lmTemplate"
:type="19">
</leave-message>
</div> </div>
</div> </div>
<side-popup ref="sidePopup" :title="operationTitle">
<component :is="operationPage" :ref="operationPage" @close="close"></component>
</side-popup>
</section> </section>
</template> </template>
...@@ -62,12 +71,63 @@ ...@@ -62,12 +71,63 @@
import ScheduleItem from '../../common/scheduleItem' import ScheduleItem from '../../common/scheduleItem'
import clientHeader from '../../common/clientHeader' import clientHeader from '../../common/clientHeader'
import Pagenation from '../schedulePagenation' import Pagenation from '../schedulePagenation'
import clickOutside from '@/lib/bind'
import addLog from '../work/addLog'
import editLog from '../work/editLog'
export default { export default {
name: '', name: '',
data () { data () {
return { return {
lmTemplate: [
{
name: '客户名称',
value: 'client.name',
default: '未设置'
},
{
name: '开始时间',
value: 'start_at'
},
{
name: '结束时间',
value: 'end_at'
},
{
name: '用时',
value: 'hours_spent_display'
},
{
name: '陪同人员',
value: 'start_at'
},
{
name: '日志类型',
value: 'scenarios.name'
},
{
name: '工作内容',
value: 'scenarioOption.name'
},
{
name: '情况说明',
value: 'description'
},
{
name: '客户经理',
value: 'created_at'
},
{
name: '录入人',
value: 'created_at'
},
{
name: '创建时间',
value: 'created_at'
}
],
client_id: '', client_id: '',
operationPage: '',
operationTitle: '',
loading: false, loading: false,
clientName: '', clientName: '',
model: { model: {
...@@ -84,17 +144,66 @@ ...@@ -84,17 +144,66 @@
tableList: [] tableList: []
} }
}, },
directives: {
clickOutside
},
components: { components: {
ScheduleItem, ScheduleItem,
clientHeader, clientHeader,
Pagenation Pagenation,
addLog,
editLog
}, },
methods: { methods: {
leaveMessageSch (item) {
this.$refs.leaveMessage.btnShow(item)
},
lmClose () {
this.$refs.leaveMessage &&
this.$refs.leaveMessage.btnClose()
},
editWorkLog (row) { editWorkLog (row) {
this.$router.push({name: 'workLogEdit', params: {id: row.id}}) // this.$router.push({name: 'workLogEdit', params: {id: row.id}})
this.operationPage = 'editLog'
this.operationTitle = '编辑工作日志'
// this.$router.push({name: 'editProject', params: {id: row.id}})
this.$nextTick(() => {
this.$refs.sidePopup.show(this.$refs[this.operationPage].init(row.id))
})
},
close () {
this.$refs.sidePopup.close()
},
delLog (id) {
this.$confirm('确认删除吗?', '提示').then(() => {
requestAPI(api.delWorkLog, {
data: {
id
}
}).then(() => {
this.$message('删除成功!')
this.getList()
}, error => {
if (Array.isArray(error.msg)) {
error.msg.forEach(item => {
this.$notify.error({
title: '错误',
message: item.error
})
})
}
})
}).catch(_ => {
})
}, },
addWorkLog () { addWorkLog () {
this.$router.push({name: 'workLogClientAdd', params: {clientId: this.$route.params.id}}) // this.$router.push({name: 'workLogClientAdd', params: {clientId: this.$route.params.id}})
this.operationPage = 'addLog'
this.operationTitle = '新建工作日志'
// this.$router.push({name: 'editProject', params: {id: row.id}})
this.$nextTick(() => {
this.$refs.sidePopup.show(this.$refs[this.operationPage].init(this.$route.params.id))
})
}, },
updatePage (pager) { updatePage (pager) {
Object.assign(this.pagenation, pager) Object.assign(this.pagenation, pager)
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
cancelButtonText: '否', cancelButtonText: '否',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.saveFun(Object.assign({}, subData, {is_draft: 1})) this.saveFun(Object.assign({}, subData, {'WorkLogs[is_draft]': 1}))
}).catch(_ => { }).catch(_ => {
this.saveFun(subData) this.saveFun(subData)
}) })
...@@ -67,16 +67,19 @@ ...@@ -67,16 +67,19 @@
message: '保存成功!', message: '保存成功!',
type: 'success' type: 'success'
}) })
this.close(true)
}, error => { }, error => {
error.msg.forEach(item => { error.msg.forEach(item => {
this.$set(this.errorData, item.name, item.error) this.$set(this.errorData, item.name, item.error)
}) })
}) })
}, },
close () {} close (getList) {
this.$emit('close', getList)
}, },
mounted () { init (id) {
this.$refs.operationWorkLog.initAdd() this.$refs.operationWorkLog.initAdd(id)
}
} }
} }
</script> </script>
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
cancelButtonText: '否', cancelButtonText: '否',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.saveFun(Object.assign({}, subData, {is_draft: 1})) this.saveFun(Object.assign({}, subData, {'WorkLogs[is_draft]': 1}))
}).catch(_ => { }).catch(_ => {
this.saveFun(subData) this.saveFun(subData)
}) })
...@@ -66,17 +66,19 @@ ...@@ -66,17 +66,19 @@
message: '保存成功!', message: '保存成功!',
type: 'success' type: 'success'
}) })
this.close(true)
}, error => { }, error => {
error.msg.forEach(item => { error.msg.forEach(item => {
this.$set(this.errorData, item.name, item.error) this.$set(this.errorData, item.name, item.error)
}) })
}) })
}, },
close () { close (getList) {
} this.$emit('close', getList)
}, },
mounted () { init (id) {
this.$refs.operationWorkLog.initEdit() this.$refs.operationWorkLog.initEdit(id)
}
} }
} }
</script> </script>
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
label="工作日志类型" label="工作日志类型"
:required="true" :required="true"
:form-item="WorkLogs.scenario_id" :form-item="WorkLogs.scenario_id"
:options-list="getOptions('WorkLogSearch[scenario_id]')" :options-list="getOptions('WorkLogs[scenario_id]')"
:set-option="setScenarioOption" :set-option="setScenarioOption"
@update:item="val => {WorkLogs.scenario_id = val}"> @update:item="val => {WorkLogs.scenario_id = val}">
<span slot="formError" class="el-form-item__error"> <span slot="formError" class="el-form-item__error">
...@@ -218,26 +218,26 @@ ...@@ -218,26 +218,26 @@
// this.WorkLogs.scenario_id = 1 // this.WorkLogs.scenario_id = 1
this.setScenarioOption(this.WorkLogs.scenario_id) this.setScenarioOption(this.WorkLogs.scenario_id)
}, },
initAdd () { initAdd (id) {
if (this.$route.params.clientId) { if (id) {
this.WorkLogs.client_id = this.$route.params.clientId this.WorkLogs.client_id = id
requestAPI(api.getClient, { requestAPI(api.getClient, {
data: { data: {
id: this.$route.params.clientId id: id
} }
}).then(res => { }).then(res => {
this.searchText = res.model.name this.searchText = res.model.name
}) })
requestAPI(api.searchContactByClientId, { requestAPI(api.searchContactByClientId, {
data: { data: {
client_id: this.$route.params.clientId client_id: id
} }
}).then(res => { }).then(res => {
this.options['WorkLogs[workLogContacts]'].value = res this.options['WorkLogs[workLogContacts]'].value = res
}) })
requestAPI(api.searchProjectByClientId, { requestAPI(api.searchProjectByClientId, {
data: { data: {
client_id: this.$route.params.clientId client_id: id
} }
}).then(res => { }).then(res => {
this.options['WorkLogs[project_id]'].value = res this.options['WorkLogs[project_id]'].value = res
...@@ -259,10 +259,10 @@ ...@@ -259,10 +259,10 @@
}) })
}) })
}, },
initEdit () { initEdit (id) {
requestAPI(api.getWorkLogEdit, { requestAPI(api.getWorkLogEdit, {
data: { data: {
id: this.$route.params.id id
} }
}).then(res => { }).then(res => {
Object.keys(res.options).forEach(item => { Object.keys(res.options).forEach(item => {
......
...@@ -79,8 +79,8 @@ ...@@ -79,8 +79,8 @@
let keys = findWhere(item.value, item.default, 'key') let keys = findWhere(item.value, item.default, 'key')
if (keys.node) { if (keys.node) {
if (keys.parentNode) { if (keys.parentNode) {
this.clientForm[item.itemKey] = keys.parentNode.key this.clientForm[item.itemKey] = keys.node.key
this.clientForm[item.key] = keys.node.key this.clientForm[item.key] = keys.parentNode.key
item.cascader = [keys.parentNode.key, keys.node.key] item.cascader = [keys.parentNode.key, keys.node.key]
} else { } else {
this.clientForm[item.itemKey] = '' this.clientForm[item.itemKey] = ''
......
...@@ -96,7 +96,6 @@ export default { ...@@ -96,7 +96,6 @@ export default {
'formItem': { 'formItem': {
handler (val) { handler (val) {
if (Array.isArray(val)) { if (Array.isArray(val)) {
console.log(val)
this.items = val this.items = val
} else { } else {
this.item = val this.item = val
......
...@@ -13044,7 +13044,7 @@ html.iframe { ...@@ -13044,7 +13044,7 @@ html.iframe {
body { body {
padding-bottom: 0; padding-bottom: 0;
min-height: 100%; min-height: 100%;
font-size: 12px; font-size: 1rem;
background-color: #F1F2F7; background-color: #F1F2F7;
} }
body:before { body:before {
...@@ -13111,9 +13111,8 @@ input[type=file] { ...@@ -13111,9 +13111,8 @@ input[type=file] {
padding: 15px 15px 0; padding: 15px 15px 0;
} }
.el-form--label-top .el-form-item__label { .el-form--label-top .el-form-item__label {
font-size: .875rem; line-height: 1.5!important;
line-height: 14px!important; font-weight: 400;
font-weight: normal;
} }
.el-form--label-top .el-form-item__label { .el-form--label-top .el-form-item__label {
padding: 0!important; padding: 0!important;
...@@ -13174,7 +13173,8 @@ input[type=file] { ...@@ -13174,7 +13173,8 @@ input[type=file] {
.form-content .el-col { .form-content .el-col {
padding: 0 15px; padding: 0 15px;
} }
.form-content .el-col .el-select { .form-content .el-col .el-select,
.form-content .el-col .el-cascader {
width: 100%; width: 100%;
} }
/*--------Page Components--------*/ /*--------Page Components--------*/
...@@ -16424,4 +16424,21 @@ table { ...@@ -16424,4 +16424,21 @@ table {
.ec-icon-uncollapse:before { .ec-icon-uncollapse:before {
content: '\F139'; } content: '\F139'; }
.portal-content {
position: fixed;
top: 100px;
right: 0;
bottom: 0;
width: 60%;
background-color: #333744;
color: white;
font-size: 14px; }
.portal-content .content {
width: 100%; }
.portal-content i[class~=fa-angle-double-right] {
cursor: pointer;
font-size: 20px;
margin-top: 6px;
margin-left: 10px; }
/*# sourceMappingURL=vupVueSdk.css.map*/ /*# sourceMappingURL=vupVueSdk.css.map*/
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
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