Commit ed0e5ab3 by xinla

修改智能表单状态问题

1 parent 13e40869
...@@ -11,20 +11,9 @@ ...@@ -11,20 +11,9 @@
<div class="g-card tab-content form1" v-show="currentActive === 1"> <div class="g-card tab-content form1" v-show="currentActive === 1">
<el-row> <el-row>
<el-col :span="10"> <el-col :span="10">
<el-form <el-form ref="baseForm" :rules="baseRules" :model="baseForm" label-position="left" label-width="150px">
ref="baseForm"
:rules="baseRules"
:model="baseForm"
label-position="left"
label-width="150px"
>
<el-form-item label="表单名称" prop="surveyName"> <el-form-item label="表单名称" prop="surveyName">
<el-input <el-input v-model="baseForm.surveyName" maxlength="15" show-word-limit clearable></el-input>
v-model="baseForm.surveyName"
maxlength="15"
show-word-limit
clearable
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="表单分组" prop="groupId"> <el-form-item label="表单分组" prop="groupId">
<el-select v-model="baseForm.groupId"> <el-select v-model="baseForm.groupId">
...@@ -32,17 +21,11 @@ ...@@ -32,17 +21,11 @@
v-for="item in codeCategoryList" v-for="item in codeCategoryList"
:key="item.id" :key="item.id"
:label="item.name" :label="item.name"
:value="item.id" :value="item.id"></el-option>
>
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="表单说明"> <el-form-item label="表单说明">
<el-switch <el-switch v-model="ifFormDescription" :active-value="1" :inactive-value="0"></el-switch>
v-model="ifFormDescription"
:active-value="1"
:inactive-value="0"
></el-switch>
<div v-if="ifFormDescription == 1"> <div v-if="ifFormDescription == 1">
<div class="sub-des">开启后,表单首页或表单顶部会有说明文案</div> <div class="sub-des">开启后,表单首页或表单顶部会有说明文案</div>
<el-input <el-input
...@@ -53,25 +36,20 @@ ...@@ -53,25 +36,20 @@
show-word-limit show-word-limit
placeholder="请填写表单说明" placeholder="请填写表单说明"
:autosize="{ minRows: 5, maxRows: 20 }" :autosize="{ minRows: 5, maxRows: 20 }"
clearable clearable />
/>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="表单logo"> <el-form-item label="表单logo">
<el-switch v-model="ifFormLogo" :active-value="1" :inactive-value="0"></el-switch> <el-switch v-model="ifFormLogo" :active-value="1" :inactive-value="0"></el-switch>
<div v-if="ifFormLogo == 1"> <div v-if="ifFormLogo == 1">
<div class="sub-des">开启后,表单首页或表单顶部会有logo图</div> <div class="sub-des">开启后,表单首页或表单顶部会有logo图</div>
<upload <upload :fileUrl.sync="baseForm.FormLogo" class="image-uploader" @update:file="handleUploadedHeadImage">
:fileUrl.sync="baseForm.FormLogo"
class="image-uploader"
@update:file="handleUploadedHeadImage"
>
<div slot="tip">建议大小2M以内,仅支持png/jpg等图片类型</div> <div slot="tip">建议大小2M以内,仅支持png/jpg等图片类型</div>
</upload> </upload>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button plain @click.stop="CancelTheNewOne">取消新建</el-button> <el-button plain @click.stop="CancelTheNewOne">取消</el-button>
<el-button type="primary" @click.stop="nextStep(2)">下一步</el-button> <el-button type="primary" @click.stop="nextStep(2)">下一步</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -86,8 +64,7 @@ ...@@ -86,8 +64,7 @@
:ifFormLogo="ifFormLogo" :ifFormLogo="ifFormLogo"
:logoUrl="baseForm.FormLogo" :logoUrl="baseForm.FormLogo"
:FormIdY="formIdN" :FormIdY="formIdN"
:id="'y'" :id="'y'"></FormsDetail>
></FormsDetail>
<div style="display: flex; justify-content: center"> <div style="display: flex; justify-content: center">
<el-radio v-model="visibility" label="0">独立首页</el-radio> <el-radio v-model="visibility" label="0">独立首页</el-radio>
</div> </div>
...@@ -103,19 +80,14 @@ ...@@ -103,19 +80,14 @@
:ifFormLogo="ifFormLogo" :ifFormLogo="ifFormLogo"
:logoUrl="baseForm.FormLogo" :logoUrl="baseForm.FormLogo"
:FormIdY="formIdN" :FormIdY="formIdN"
:id="'y'" :id="'y'"></FormsDetail>
></FormsDetail>
<div style="display: flex; justify-content: center"> <div style="display: flex; justify-content: center">
<el-radio v-model="visibility" label="1">表单首页</el-radio> <el-radio v-model="visibility" label="1">表单首页</el-radio>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<div <div class="g-card tab-content" style="height: calc(100vh - 216px)" v-show="currentActive === 2">
class="g-card tab-content"
style="height: calc(100vh - 216px)"
v-show="currentActive === 2"
>
<!-- <el-form <!-- <el-form
ref="codeForm" ref="codeForm"
:rules="codeRules" :rules="codeRules"
...@@ -126,7 +98,7 @@ ...@@ -126,7 +98,7 @@
</el-form> --> </el-form> -->
<Build :pageDataAll="pageDataAll" v-on:toStyles="toStyles"></Build> <Build :pageDataAll="pageDataAll" v-on:toStyles="toStyles"></Build>
<div class="ar"> <div class="ar">
<el-button plain @click.stop="CancelTheNewOne">取消新建</el-button> <el-button plain @click.stop="CancelTheNewOne">取消</el-button>
<el-button @click.stop="currentActive = 1">上一步</el-button> <el-button @click.stop="currentActive = 1">上一步</el-button>
<el-button type="primary" @click.stop="nextStep(3)">下一步</el-button> <el-button type="primary" @click.stop="nextStep(3)">下一步</el-button>
</div> </div>
...@@ -146,15 +118,12 @@ ...@@ -146,15 +118,12 @@
range-separator="-" range-separator="-"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
:picker-options="pickerOptions" :picker-options="pickerOptions"></el-date-picker>
></el-date-picker>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="只允许在微信中填写"> <el-form-item label="只允许在微信中填写">
<el-switch v-model="baseForm.anAuth" :active-value="1" :inactive-value="0"></el-switch> <el-switch v-model="baseForm.anAuth" :active-value="1" :inactive-value="0"></el-switch>
<div class="sub-des" style="margin-left: 120px"> <div class="sub-des" style="margin-left: 120px">开启后会授权登录,提供微信昵称、性别、城市信息</div>
开启后会授权登录,提供微信昵称、性别、城市信息
</div>
</el-form-item> </el-form-item>
<el-form-item label="每人限制填写1次"> <el-form-item label="每人限制填写1次">
<el-switch v-model="One" :active-value="1" :inactive-value="0"></el-switch> <el-switch v-model="One" :active-value="1" :inactive-value="0"></el-switch>
...@@ -164,7 +133,7 @@ ...@@ -164,7 +133,7 @@
<div class="sub-des" style="">填写并提交成功后重复打开问卷时则直接跳转结束页</div> <div class="sub-des" style="">填写并提交成功后重复打开问卷时则直接跳转结束页</div>
</el-form-item> </el-form-item>
<el-form-item style="margin-left: auto !important; width: 280px; text-align: right"> <el-form-item style="margin-left: auto !important; width: 280px; text-align: right">
<el-button plain @click.stop="CancelTheNewOne">取消新建</el-button> <el-button plain @click.stop="CancelTheNewOne">取消</el-button>
<el-button @click.stop="currentActive = 2">上一步</el-button> <el-button @click.stop="currentActive = 2">上一步</el-button>
<el-button type="primary" @click.stop="nextStep(4)">下一步</el-button> <el-button type="primary" @click.stop="nextStep(4)">下一步</el-button>
</el-form-item> </el-form-item>
...@@ -178,13 +147,7 @@ ...@@ -178,13 +147,7 @@
<el-form-item label="表单链接"> <el-form-item label="表单链接">
<div style="display: flex"> <div style="display: flex">
<div> <div>
<el-input <el-input style="width: 400px" v-model="baseFormUrl4" disabled show-word-limit clearable></el-input>
style="width: 400px"
v-model="baseFormUrl4"
disabled
show-word-limit
clearable
></el-input>
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
...@@ -193,8 +156,7 @@ ...@@ -193,8 +156,7 @@
style="color: #2c8cf0; cursor: pointer" style="color: #2c8cf0; cursor: pointer"
type="button" type="button"
class="copy-btn" class="copy-btn"
:data-clipboard-text="baseFormUrl4" :data-clipboard-text="baseFormUrl4">
>
复制 复制
</div> </div>
</div> </div>
...@@ -216,8 +178,7 @@ ...@@ -216,8 +178,7 @@
color: #2c8cf0; color: #2c8cf0;
cursor: pointer; cursor: pointer;
margin-left: 10px; margin-left: 10px;
" ">
>
下载二维码 下载二维码
</div> </div>
</div> </div>
...@@ -229,11 +190,7 @@ ...@@ -229,11 +190,7 @@
<div> <div>
<div> <div>
<div> <div>
<el-switch <el-switch v-model="ifChannelsName" :active-value="1" :inactive-value="0"></el-switch>
v-model="ifChannelsName"
:active-value="1"
:inactive-value="0"
></el-switch>
</div> </div>
<div class="sub-des" style="position: relative; top: -10px"> <div class="sub-des" style="position: relative; top: -10px">
开启后将会在默认链接基础上增加渠道标识 开启后将会在默认链接基础上增加渠道标识
...@@ -246,71 +203,40 @@ ...@@ -246,71 +203,40 @@
</div> </div>
<div class="add_form4_qd_ul" v-for="(item, index) in ChannelsList" :key="index"> <div class="add_form4_qd_ul" v-for="(item, index) in ChannelsList" :key="index">
<div class="add_form4_qd_li1 add_form4_qd_li"> <div class="add_form4_qd_li1 add_form4_qd_li">
<div <div style="display: flex; justify-content: center; :flex ; justify-content: center">
style="
display: flex;
justify-content: center;
:flex ;
justify-content: center;
"
>
<el-input <el-input
style="width: 80%" style="width: 80%"
type="text" type="text"
placeholder="请输入渠道标识" placeholder="请输入渠道标识"
v-model="ChannelsList[index]" v-model="ChannelsList[index]" />
/>
</div> </div>
</div> </div>
<div class="add_form4_qd_li2 add_form4_qd_li"> <div class="add_form4_qd_li2 add_form4_qd_li">
{{ baseFormUrl4 + '&dataSource=' {{ baseFormUrl4 + '&dataSource=' }}
}}<el-input <el-input type="text" placeholder="请输入渠道标识" v-model="channelsPathList[index]" />
type="text" <label for=""></label>
placeholder="请输入渠道标识"
v-model="channelsPathList[index]"
/><label for=""></label>
</div> </div>
<div class="add_form4_qd_li3 add_form4_qd_li"> <div class="add_form4_qd_li3 add_form4_qd_li">
<span <span style="color: blue; cursor: pointer" @click.stop="deletChannels(item, index)">取消</span>
style="color: blue; cursor: pointer"
@click.stop="deletChannels(item, index)"
>取消</span
>
</div> </div>
</div> </div>
</div> </div>
<div <div v-if="ifChannelsName" style="color: #2c8cf0; cursor: pointer" @click.stop="addChannels">
v-if="ifChannelsName"
style="color: #2c8cf0; cursor: pointer"
@click.stop="addChannels"
>
+继续添加 +继续添加
</div> </div>
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button v-if="!$route.query.currentActiveA" plain @click.stop="removeFn" <el-button v-if="!$route.query.currentActiveA" plain @click.stop="removeFn">取消新建</el-button>
>取消新建</el-button <el-button v-if="$route.query.currentActiveA" plain @click.stop="cancelFn">取消</el-button>
> <el-button v-if="!$route.query.currentActiveA" type="primary" @click.stop="nextStep(3, 4)">
<el-button v-if="$route.query.currentActiveA" plain @click.stop="cancelFn" 上一步
>取消</el-button </el-button>
> <el-button v-if="!$route.query.currentActiveA" type="primary" @click.stop="addFormS('fb')">
<el-button 确认发布
v-if="!$route.query.currentActiveA" </el-button>
type="primary" <el-button v-if="$route.query.currentActiveA" type="primary" @click.stop="addFormS()">确认修改</el-button>
@click.stop="nextStep(3, 4)"
>上一步</el-button
>
<el-button
v-if="!$route.query.currentActiveA"
type="primary"
@click.stop="addFormS('fb')"
>确认发布</el-button
>
<el-button v-if="$route.query.currentActiveA" type="primary" @click.stop="addFormS()"
>确认修改</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-col> </el-col>
...@@ -324,9 +250,7 @@ ...@@ -324,9 +250,7 @@
<SelectTag <SelectTag
:visible.sync="dialogVisibleSelectTag" :visible.sync="dialogVisibleSelectTag"
:defaultValues="selectedTagList" :defaultValues="selectedTagList"
@success="submitSelectTag" @success="submitSelectTag"></SelectTag>
>
</SelectTag>
<!-- 选择使用员工弹窗 --> <!-- 选择使用员工弹窗 -->
<SelectUser <SelectUser
...@@ -336,8 +260,7 @@ ...@@ -336,8 +260,7 @@
title="选择使用员工" title="选择使用员工"
:isOnlyLeaf="true" :isOnlyLeaf="true"
:isSigleSelect="codeForm.qrType == 1" :isSigleSelect="codeForm.qrType == 1"
@success="selectedUser" @success="selectedUser"></SelectUser>
></SelectUser>
</div> </div>
</template> </template>
<script> <script>
...@@ -360,7 +283,6 @@ import SelectMaterial from '@/components/SelectMaterial' ...@@ -360,7 +283,6 @@ import SelectMaterial from '@/components/SelectMaterial'
import WelcomeContent from '@/components/WelcomeContent.vue' import WelcomeContent from '@/components/WelcomeContent.vue'
import Build from './build/index' import Build from './build/index'
import { dateFormat } from '@/utils/index' import { dateFormat } from '@/utils/index'
import { saveForm } from '@/api/communityOperating/groupSOP'
export default { export default {
components: { components: {
PhoneDialog, PhoneDialog,
...@@ -610,8 +532,8 @@ export default { ...@@ -610,8 +532,8 @@ export default {
this.baseForm.channelsPath = 'Default' this.baseForm.channelsPath = 'Default'
this.channelsPathList = ['Default'] this.channelsPathList = ['Default']
} }
console.log('this.baseForm', this.baseForm) // console.log('this.baseForm', this.baseForm)
console.log('this.isRepeat(this.channelsPathList)', this.isRepeat(this.channelsPathList)) // console.log('this.isRepeat(this.channelsPathList)', this.isRepeat(this.channelsPathList))
if (this.isRepeat(this.ChannelsList)) { if (this.isRepeat(this.ChannelsList)) {
this.msgError('渠道"' + this.isRepeat(this.ChannelsList) + '"重复') this.msgError('渠道"' + this.isRepeat(this.ChannelsList) + '"重复')
return return
...@@ -652,8 +574,6 @@ export default { ...@@ -652,8 +574,6 @@ export default {
} }
} }
console.log('this.baseForm', this.baseForm)
this.baseForm.styles = JSON.stringify(stylesx) this.baseForm.styles = JSON.stringify(stylesx)
//生成各渠道二维码 //生成各渠道二维码
// var childs = this.$refs.ewmTAddEwm.childNodes; // var childs = this.$refs.ewmTAddEwm.childNodes;
...@@ -683,9 +603,9 @@ export default { ...@@ -683,9 +603,9 @@ export default {
// return // return
if (xx == 'fb') { if (xx == 'fb') {
that.updateSurveyStatus(that.dataFormList.id, 1, that.dataFormList) that.updateSurveyStatus(that.dataFormList.id, 1, that.dataFormList)
delete that.baseForm.surveyState
} }
updateInfoToSurvey(that.baseForm).then((response) => { updateInfoToSurvey(that.baseForm).then((response) => {
console.log('更新表单返回值2', response)
if (xx == 'to3') { if (xx == 'to3') {
return return
} }
...@@ -747,7 +667,6 @@ export default { ...@@ -747,7 +667,6 @@ export default {
id: id, id: id,
timingStart: dateFormat(new Date()), timingStart: dateFormat(new Date()),
} }
console.log('data', data)
this.updateInfoToSurvey(data) this.updateInfoToSurvey(data)
} else { } else {
let newData = new Date() let newData = new Date()
...@@ -905,14 +824,12 @@ export default { ...@@ -905,14 +824,12 @@ export default {
let userList = [] // 当前重复人员 let userList = [] // 当前重复人员
let passList = [] // 当前之前的人员 不包含默认的第一条 let passList = [] // 当前之前的人员 不包含默认的第一条
let current = this.codeForm.empleCodeRosterDto[this.operationIndex].weEmpleCodeUseScops.map( let current = this.codeForm.empleCodeRosterDto[this.operationIndex].weEmpleCodeUseScops.map((i) => {
(i) => { return {
return { userId: i.businessId,
userId: i.businessId, name: i.businessName,
name: i.businessName,
}
} }
) })
this.codeForm.empleCodeRosterDto.forEach((data, key) => { this.codeForm.empleCodeRosterDto.forEach((data, key) => {
data.weEmpleCodeUseScops.map((i, index) => { data.weEmpleCodeUseScops.map((i, index) => {
if (key != this.operationIndex) { if (key != this.operationIndex) {
...@@ -954,15 +871,11 @@ export default { ...@@ -954,15 +871,11 @@ export default {
ddd.goto1 = this.checkAuditTime( ddd.goto1 = this.checkAuditTime(
start, start,
end, end,
this.codeForm.empleCodeRosterDto[this.operationIndex].startDate this.codeForm.empleCodeRosterDto[this.operationIndex].startDate,
) )
} }
if (this.codeForm.empleCodeRosterDto[this.operationIndex].endDate) { if (this.codeForm.empleCodeRosterDto[this.operationIndex].endDate) {
ddd.goto2 = this.checkAuditTime( ddd.goto2 = this.checkAuditTime(start, end, this.codeForm.empleCodeRosterDto[this.operationIndex].endDate)
start,
end,
this.codeForm.empleCodeRosterDto[this.operationIndex].endDate
)
} }
} }
} }
...@@ -987,14 +900,12 @@ export default { ...@@ -987,14 +900,12 @@ export default {
if (this.operationIndex === 0) { if (this.operationIndex === 0) {
return true return true
} }
let current = this.codeForm.empleCodeRosterDto[this.operationIndex].weEmpleCodeUseScops.map( let current = this.codeForm.empleCodeRosterDto[this.operationIndex].weEmpleCodeUseScops.map((i) => {
(i) => { return {
return { userId: i.businessId,
userId: i.businessId, name: i.businessName,
name: i.businessName,
}
} }
) })
let first = this.codeForm.empleCodeRosterDto[0].weEmpleCodeUseScops.map((i) => { let first = this.codeForm.empleCodeRosterDto[0].weEmpleCodeUseScops.map((i) => {
return { return {
userId: i.businessId, userId: i.businessId,
...@@ -1134,9 +1045,7 @@ export default { ...@@ -1134,9 +1045,7 @@ export default {
} }
for (let w = 0; w < styles[i][q].options.length; w++) { for (let w = 0; w < styles[i][q].options.length; w++) {
if (!styles[i][q].options[w].label) { if (!styles[i][q].options[w].label) {
this.msgError( this.msgError('第' + styles[i][q].page + '页,' + label + ',[下拉选择]名称不能为空')
'第' + styles[i][q].page + '页,' + label + ',[下拉选择]名称不能为空'
)
return return
} }
} }
...@@ -1228,8 +1137,7 @@ export default { ...@@ -1228,8 +1137,7 @@ export default {
this.msgError('渠道标识不能为空!') this.msgError('渠道标识不能为空!')
return return
} }
this.baseForm.channelsPath = this.baseForm.channelsPath = this.baseForm.channelsPath + ',' + this.channelsPathList[i]
this.baseForm.channelsPath + ',' + this.channelsPathList[i]
} else { } else {
this.baseForm.channelsName = this.ChannelsList[i] this.baseForm.channelsName = this.ChannelsList[i]
this.baseForm.channelsPath = this.channelsPathList[i] this.baseForm.channelsPath = this.channelsPathList[i]
...@@ -1271,14 +1179,14 @@ export default { ...@@ -1271,14 +1179,14 @@ export default {
return return
} }
this.$refs[form].validate((validate) => { this.$refs[form].validate((validate) => {
console.log('validate', validate) // console.log('validate', validate)
if (validate) { // if (validate) {
console.log('nextStep', nextStep) // console.log('nextStep', nextStep)
if (nextStep == 2) { // if (nextStep == 2) {
console.log('this.ifFormDescription', this.ifFormDescription) // console.log('this.ifFormDescription', this.ifFormDescription)
// this.currentActive = nextStep // // this.currentActive = nextStep
} // }
} // }
}) })
}, },
isRepeat(ary) { isRepeat(ary) {
...@@ -1405,8 +1313,7 @@ export default { ...@@ -1405,8 +1313,7 @@ export default {
this.codeForm.weEmpleCodeUseScops = selectedUserList this.codeForm.weEmpleCodeUseScops = selectedUserList
} else { } else {
// 自动排班 // 自动排班
this.codeForm.empleCodeRosterDto[this.selectedRosterIndex].weEmpleCodeUseScops = this.codeForm.empleCodeRosterDto[this.selectedRosterIndex].weEmpleCodeUseScops = selectedUserList
selectedUserList
this.checkStartEnd(null, this.selectedRosterIndex) this.checkStartEnd(null, this.selectedRosterIndex)
} }
}, },
...@@ -1417,15 +1324,13 @@ export default { ...@@ -1417,15 +1324,13 @@ export default {
if (this.codeForm.qrRuleType == 2) { if (this.codeForm.qrRuleType == 2) {
this.selectedRosterIndex = index this.selectedRosterIndex = index
let arr = [] let arr = []
arr = this.codeForm.empleCodeRosterDto[this.selectedRosterIndex].weEmpleCodeUseScops.map( arr = this.codeForm.empleCodeRosterDto[this.selectedRosterIndex].weEmpleCodeUseScops.map((dd) => {
(dd) => { return {
return { userId: dd.businessId,
userId: dd.businessId, // id: dd.businessIdType === 1 ? dd.businessId:'',
// id: dd.businessIdType === 1 ? dd.businessId:'', name: dd.businessName,
name: dd.businessName,
}
} }
) })
this.selectedUserList = arr this.selectedUserList = arr
// this.selectedUserList = [...this.codeForm.weEmpleCodeUseScops[index]] // this.selectedUserList = [...this.codeForm.weEmpleCodeUseScops[index]]
} else { } else {
...@@ -1523,9 +1428,7 @@ export default { ...@@ -1523,9 +1428,7 @@ export default {
if (this.codeForm.qrRuleType === 1) { if (this.codeForm.qrRuleType === 1) {
let obj = { let obj = {
type: 0, type: 0,
scopeId: this.codeForm.weEmpleCodeUseScops[0].scopeId scopeId: this.codeForm.weEmpleCodeUseScops[0].scopeId ? this.codeForm.weEmpleCodeUseScops[0].scopeId : '',
? this.codeForm.weEmpleCodeUseScops[0].scopeId
: '',
userIds: this.codeForm.weEmpleCodeUseScops.map((dd) => dd.businessId), userIds: this.codeForm.weEmpleCodeUseScops.map((dd) => dd.businessId),
} }
this.codeForm.qrUserInfos = [obj] this.codeForm.qrUserInfos = [obj]
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!