Commit fc872363 by 前端

Merge branch 'SAAS+V4.51.1-0415' of http://192.168.3.233:8090/saas_plus/dj-car-l…

…ife-system into SAAS+V4.51.1-0415
2 parents e348a68b ac7e9eb8
......@@ -481,4 +481,10 @@ export function updateStaffDailyReportConfigApi(data) {
export function deleteStaffDailyReportConfigApi(data) {
data.method = `${path2}staffDailyReportConfig.delete`
return request(data, 'post')
}
\ No newline at end of file
}
// 更新指定员工记录项内容
export function updateTmlpStaffItem(data) {
data.method = `${path2}digital.management.staff.item.update`
return request(data, 'post')
}
......@@ -291,8 +291,8 @@ export default {
1: "视频",
2: "PDF",
3: "富文本",
4: "excel",
5: "word"
4: "Excel",
5: "Word"
}[cellValue.type]
}
},
......
......@@ -85,6 +85,12 @@ export default {
fileName: this.basicInfo.goodsCreateExcel.split('/')[this.basicInfo.goodsCreateExcel.split('/').length - 1]
})
}
if (this.basicInfo.submitGoodsCreateExcel) {
item.fileList.push({
url: this.basicInfo.submitGoodsCreateExcel,
fileName: this.basicInfo.submitGoodsCreateExcel.split('/')[this.basicInfo.goodsCreateExcel.split('/').length - 1]
})
}
// console.log(item.value, 'item.value')
const valueList = item.value ? item.value.split(',') : []
valueList.forEach((k, kIdx) => {
......
......@@ -5,43 +5,18 @@
<span>流量方信息</span>
</div>
<div style="padding: 20px">
<glsx-combi-form
class="edit-form-container"
ref="editFormRef"
label-width="150px"
default-width="314px"
:form-ref="editChildRef"
:form-obj="editData"
:form-data="editFormData"
:form-rules="formRules"
>
<glsx-combi-form class="edit-form-container" ref="editFormRef" label-width="250px" default-width="314px"
:form-ref="editChildRef" :form-obj="editData" :form-data="editFormData" :form-rules="formRules">
<div slot="merchantId" slot-scope="scope">
<el-select
v-model="editData[scope.scope.name]"
disabled
:placeholder="scope.scope.placeholder"
@change="scope.scope.changeAttr"
style="width: 274px"
filterable
remote
reserve-keyword
@visible-change="(event) => selectVisibleChange(event, scope.scope)"
:remote-method="
(event) => remoteMethod(event, scope.scope.searchKey, 'store')
"
v-el-select-loadmore="interestsLoadmoreMerchant"
>
<el-option
v-for="subItem in scope.scope.optionList"
:key="subItem[scope.scope.optionId]"
:label="subItem[scope.scope.optionLabel]"
:value="subItem[scope.scope.optionId]"
>
<el-select v-model="editData[scope.scope.name]" disabled :placeholder="scope.scope.placeholder"
@change="scope.scope.changeAttr" style="width: 274px" filterable remote reserve-keyword
@visible-change="(event) => selectVisibleChange(event, scope.scope)" :remote-method="(event) => remoteMethod(event, scope.scope.searchKey, 'store')
" v-el-select-loadmore="interestsLoadmoreMerchant">
<el-option v-for="subItem in scope.scope.optionList" :key="subItem[scope.scope.optionId]"
:label="subItem[scope.scope.optionLabel]" :value="subItem[scope.scope.optionId]">
</el-option>
</el-select>
<el-button type="text" class="add-mer-btn" @click="handleAddMerchant"
>新建</el-button
>
<el-button type="text" class="add-mer-btn" @click="handleAddMerchant">新建</el-button>
</div>
</glsx-combi-form>
</div>
......@@ -69,7 +44,7 @@ export default {
props: {
editData: {
type: Object,
default: () => {}
default: () => { }
}
},
......@@ -369,7 +344,7 @@ export default {
hasAll &&
this.baseData[item.optionsName].length &&
this.baseData[item.optionsName][0][
this[formName][index].optionLabel
this[formName][index].optionLabel
] !== "全部"
) {
const temp = {}
......@@ -392,7 +367,7 @@ export default {
hasAll &&
this.baseData[item.optionsName].length &&
this.baseData[item.optionsName][0][
this[formName][index].optionLabel
this[formName][index].optionLabel
] !== "全部"
) {
const temp = {}
......
......@@ -35,7 +35,7 @@
</div>
</div>
<div class="d2-container-content">
<div class="view">
<div class="view" v-if="!templateDealList.map(k => k.name).includes(searchFormSearch.typeName)">
<div class="view-item">
<div class="label">应收日报数<el-button v-if="showEdit" type="text" class="btn" @click="openDrawer(1)">修改名单</el-button></div>
<div class="value"><span class="orange">{{summaryData.totalCount}}</span>份</div>
......@@ -87,6 +87,11 @@
<div class="text-box" slot="textarea" slot-scope="scope">
{{scope.scope[scope.prop] || '-'}}
</div>
<div slot="upload" class="upload-box" slot-scope="scope">
<div class="uploade-btn" v-show="!scope.scope['assessmentResult' + trainTmlpSuffix]" @click="handleUpload(scope.scope)">上传</div>
<div class="uploade-btn" v-show="scope.scope['assessmentResult' + trainTmlpSuffix]" @click="handleDelete(scope.scope)">删除</div>
<a v-show="scope.scope['assessmentResult' + trainTmlpSuffix]" class="uploade-btn" :href="scope.scope['assessmentResult' + trainTmlpSuffix]" target="_blank">查看</a>
</div>
<div class="text-box" slot="link" slot-scope="scope">
<template v-if="scope.scope[scope.prop]">
<a :href="scope.scope[scope.prop]" target="_blank">查看</a>
......@@ -106,6 +111,36 @@
</div>
<Drawer :drawerVisible="drawer" :type="contentType" :templateData="templateData" @handleClose="handleClose" @handleSubmit="handleSubmit">
</Drawer>
<d2-dialog :title="'上传文件'"
:is-visible="fileVisible"
@closeDialog="handleBatchImport"
@confirmDialog="handleConfirmImport">
<slot>
<el-form :model="fileForm"
ref="fileRuleForm"
:rules="fileRules"
label-width="120px">
<el-form-item label="导入文件:"
prop="fileName">
<el-col :span="16">
<el-input readonly
v-model="fileForm.fileName" />
</el-col>
<el-col :span="4"
class="m-l-md">
<el-button class="import-btn">
导入文件
<input type="file"
id="fileUpload"
class="import-input"
accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel,application/pdf,image/png,image/jpeg"
@change="importFile($event)">
</el-button>
</el-col>
</el-form-item>
</el-form>
</slot>
</d2-dialog>
</d2-container>
</div>
</template>
......@@ -113,7 +148,8 @@
<script>
import { Util, deepClone } from '@/common/util'
import { mapActions, mapState } from 'vuex'
import { getTemplateList, getStaffList, getRecordPage, getTemplateDetail, getSummary, updateStaff } from "@api/resident"
import { getTemplateList, getStaffList, getRecordPage, getTemplateDetail, getSummary, updateStaff, updateTmlpStaffItem } from "@api/resident"
import { uploadFile } from "@/api/sys.base"
import Drawer from './drawer.vue';
// import mockData from '../data.json'
// import recordData from './record.json'
......@@ -127,6 +163,20 @@ export default {
data() {
return {
labelWidth: '100px',
templateDealList: [{
name: '导师培训日报模板',
searchTxt: '导师'
}, {
name: '督导培训日报模板',
searchTxt: '督导'
}],
// 适配不同“带教配置”模版字段,organizeTraining/organizeTraining_1/organizeTraining_2
trainTmlpSuffix: '',
fileVisible: false,
fileForm: {},
fileRules: {
fileName: [{ required: true, message: '请上传文件', trigger: 'change' }]
},
searchForm: {
createdDate: [new Date(), new Date()],
startTime: '',
......@@ -155,6 +205,11 @@ export default {
}
],
changeAttr: (value, targetItem) => {
let staffIdx = this.showFormData.findIndex(item => item.name == 'merchantIds')
this.showFormData[staffIdx].label = '员工'
if(this.templateDealList.map(k => k.name).includes(value)) {
this.showFormData[staffIdx].label = this.templateDealList.find(k => k.name == value).searchTxt
}
this.searchForm.merchantIds = ''
this.getStaff()
}
......@@ -293,14 +348,28 @@ export default {
}
this.getTableList()
},
/**
* 适配“带教培训”模版
*/
fitTraninTmlp(tabName) {
let matchStr = 'organizeTraining'
let afterMatch = ''
let index = tabName.indexOf(matchStr);
if (index !== -1) {
// 获取匹配字符串后面的所有字符
afterMatch = tabName.substring(index + matchStr.length);
}
return afterMatch
},
// 改变表头
changeTable(norefresh = false) {
this.tableData = []
let colums = []
this.sortObj = {}
this.trainTmlpSuffix = this.fitTraninTmlp(this.activeName)
console.log(this.trainTmlpSuffix)
this.tabList.find(item => item.key == this.activeName).items.forEach(i => {
const frontRule = JSON.parse(i.frontRule)
// console.log(frontRule);
const obj = {
label: i.name,
prop: i.key
......@@ -332,7 +401,12 @@ export default {
weekRate: n.weekRate,
suffix: n.suffix
}
} else {
} else if (frontRule && frontRule.addHtml == 'upload') {
console.log(obj, 'obj---------------------')
console.log(n.key)
obj[n.key] = n.value
obj.id = n.id
} else {
obj[n.key] = n.value
}
})
......@@ -349,6 +423,7 @@ export default {
pageSize: 10,
currentPage: 1
}
this.searchFormSearch = { ...this.getParams() }
const { createdDate, merchantIds } = this.searchForm
// this.showEdit = dayjs(this.searchForm.createdDate).format('YYYY-MM-DD') == dayjs(new Date()).format('YYYY-MM-DD')
this.showEdit = dayjs(createdDate[0]).format('YYYY-MM-DD') == dayjs(new Date()).format('YYYY-MM-DD')
......@@ -369,7 +444,9 @@ export default {
this.tabList = r1.types
this.activeName = this.tabList[0].key
// 总览
this.summaryData = await getSummary(params1)
if(!this.templateDealList.map(k => k.name).includes(this.searchForm.typeName)) {
this.summaryData = await getSummary(params1)
}
this.templateData.staffUuidList = this.searchForm.merchantIds
this.getTableList()
},
......@@ -422,6 +499,93 @@ export default {
this.handleSearch()
},
handleUpload(scope) {
console.log(scope)
this.fileForm.id = scope.id
this.fileVisible = !this.fileVisible
},
handleBatchImport() {
this.fileVisible = !this.fileVisible
this.$refs.fileRuleForm && this.$refs.fileRuleForm.resetFields()
},
handleDelete(scope) {
this.$confirm('删除后不可恢复,是否删除?', '提示', {
confirmButtonText: '确定',
type: 'warning'
}).then(() => {
var params = {
id: scope.id,
value: ''
}
updateTmlpStaffItem(params).then(res => {
this.notice.okTips()
this.notice.okTips('删除成功')
this.handleSearch()
})
}).catch(err => {
console.log(err)
})
},
handleConfirmImport() {
this.$refs.fileRuleForm.validate(valid => {
if (valid) {
var params = {
...this.fileForm
}
updateTmlpStaffItem(params).then(res => {
if (res) {
document.getElementById('fileUpload').value = ''
this.fileForm.fileName = ''
this.fileVisible = false
this.notice.okTips('提交成功')
this.handleSearch()
}
})
}
})
},
// 上传文件,转码为base64
importFile(e) {
console.log(e, 'e000')
const size = e.target.files[0].size / 1024 / 1024
const fileTypeKey = {
"application/pdf": "pdf",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
"excel",
"application/vnd.ms-excel": "excel",
"application/msword": "doc",
"application/vnd.openxmlformats-officedocument.wordprocessingml.document":
"doc",
"image/png": "image",
"image/jpeg": "image"
}
if (size < 9) {
this.$set(this.fileForm, 'fileName', e.target.files[0].name)
// // 转码base64
const reader = new FileReader()
reader.readAsDataURL(e.target.files[0])
reader.onload = event => {
const imgFile = event.target.result
const arrBase64 = imgFile.split(',')
const fileInfo = e.target.files[0].name.split('.')[e.target.files[0].name.split('.')?.length - 1] + '@' + arrBase64[1]
// document.getElementById('fileUpload').value = ''
console.log(uploadFile, 'uploadFile')
uploadFile({
file: fileInfo,
fileType: fileTypeKey[e.target.files[0].type],
})
.then((res) => {
this.fileForm.value = res
})
.catch(() => {
})
}
} else {
this.notice.errorTips('上传文件不可超过9M')
}
},
handleExport() {
// var params = this.searchFormSearch
const { merchantIds } = this.searchForm
......@@ -582,4 +746,30 @@ export default {
padding-left: 0;
}
}
.upload-box {
display: flex;
justify-content: center;
align-items: center;
}
.uploade-btn {
cursor: pointer;
margin-left: 6px;
color: #5850ff;
}
.import-btn {
position: relative;
margin-left: 10px !important;
}
.import-input {
opacity: 0;
position: absolute;
right: 0;
top: 0;
width: 98px;
height: 36px;
cursor: pointer;
font-size: 0;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!