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

调整 cascader 的筛选结果顺序;

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