|
|
|
@ -2,15 +2,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<el-dialog :title="!dataForm.id ? '新建' :'编辑'"
|
|
|
|
|
:close-on-click-modal="false" append-to-body
|
|
|
|
|
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
|
|
|
|
width="600px">
|
|
|
|
|
<el-row :gutter="15" class="">
|
|
|
|
|
<transition name="el-zoom-in-center">
|
|
|
|
|
<div class="JNPF-preview-main">
|
|
|
|
|
<div class="JNPF-common-page-header">
|
|
|
|
|
<el-page-header @back="goBack"
|
|
|
|
|
:content="!dataForm.id ? '新建':'编辑'"/>
|
|
|
|
|
<div class="options">
|
|
|
|
|
<el-dropdown class="dropdown" placement="bottom">
|
|
|
|
|
<el-button style="width:70px">
|
|
|
|
|
更 多<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
|
|
<template v-if="dataForm.id">
|
|
|
|
|
<el-dropdown-item @click.native="prev" :disabled='prevDis'>
|
|
|
|
|
{{'上一条'}}
|
|
|
|
|
</el-dropdown-item>
|
|
|
|
|
<el-dropdown-item @click.native="next" :disabled='nextDis'>
|
|
|
|
|
{{'下一条'}}
|
|
|
|
|
</el-dropdown-item>
|
|
|
|
|
</template>
|
|
|
|
|
<el-dropdown-item type="primary" @click.native="dataFormSubmit(2)"
|
|
|
|
|
:loading="continueBtnLoading" :disabled='btnLoading'>
|
|
|
|
|
{{!dataForm.id ?'确定并新增':'确定并继续'}}</el-dropdown-item>
|
|
|
|
|
</el-dropdown-menu>
|
|
|
|
|
</el-dropdown>
|
|
|
|
|
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading" :disabled='continueBtnLoading'> 保 存</el-button>
|
|
|
|
|
<el-button @click="goBack"> 取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<el-row :gutter="15" class=" main" :style="{margin: '0 auto',width: '100%'}">
|
|
|
|
|
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px" label-position="right" >
|
|
|
|
|
<template v-if="!loading">
|
|
|
|
|
<!-- 具体表单 -->
|
|
|
|
|
<el-col :span="24" >
|
|
|
|
|
<el-col :span="8" >
|
|
|
|
|
<jnpf-form-tip-item
|
|
|
|
|
label="设备编码" prop="deviceCode" >
|
|
|
|
|
<JnpfInput v-model="dataForm.deviceCode" @change="changeData('deviceCode',-1)"
|
|
|
|
@ -18,7 +42,7 @@
|
|
|
|
|
</JnpfInput>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24" >
|
|
|
|
|
<el-col :span="8" >
|
|
|
|
|
<jnpf-form-tip-item
|
|
|
|
|
label="设备名称" tipLabel="设备名称" prop="deviceName" >
|
|
|
|
|
<JnpfInput v-model="dataForm.deviceName" @change="changeData('deviceName',-1)"
|
|
|
|
@ -26,7 +50,7 @@
|
|
|
|
|
</JnpfInput>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24" >
|
|
|
|
|
<el-col :span="8" >
|
|
|
|
|
<jnpf-form-tip-item
|
|
|
|
|
label="所在城市" prop="city" >
|
|
|
|
|
<JnpfAreaSelect v-model="dataForm.city" @change="changeData('city',-1)"
|
|
|
|
@ -34,7 +58,7 @@
|
|
|
|
|
</JnpfAreaSelect>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24" >
|
|
|
|
|
<el-col :span="8" >
|
|
|
|
|
<jnpf-form-tip-item
|
|
|
|
|
label="地址" prop="address" >
|
|
|
|
|
<JnpfInput v-model="dataForm.address" @change="changeData('address',-1)"
|
|
|
|
@ -42,7 +66,7 @@
|
|
|
|
|
</JnpfInput>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24" >
|
|
|
|
|
<el-col :span="8" >
|
|
|
|
|
<jnpf-form-tip-item
|
|
|
|
|
label="投用状态" prop="useStatus" >
|
|
|
|
|
<JnpfRadio v-model="dataForm.useStatus" @change="changeData('useStatus',-1)"
|
|
|
|
@ -50,7 +74,7 @@
|
|
|
|
|
</JnpfRadio>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24" >
|
|
|
|
|
<el-col :span="8" >
|
|
|
|
|
<jnpf-form-tip-item
|
|
|
|
|
label="设备状态" prop="status" >
|
|
|
|
|
<JnpfRadio v-model="dataForm.status" @change="changeData('status',-1)"
|
|
|
|
@ -58,24 +82,40 @@
|
|
|
|
|
</JnpfRadio>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24" >
|
|
|
|
|
<el-col :span="8" >
|
|
|
|
|
<jnpf-form-tip-item
|
|
|
|
|
label="分配商户" tipLabel="绑定商户" prop="beLongCompanyId" >
|
|
|
|
|
<JnpfPopupSelect v-model="dataForm.beLongCompanyId" @change="changeData('beLongCompanyId',-1)"
|
|
|
|
|
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.beLongCompanyId" placeholder="请选择商户" propsValue="f_id" popupWidth="800px" popupTitle="绑定商户" popupType="dialog" relationField='f_full_name' field='beLongCompanyId' interfaceId="563706688754953029" :pageSize="20" :columnOptions="beLongCompanyIdcolumnOptions" clearable :style='{"width":"100%"}'>
|
|
|
|
|
</JnpfPopupSelect>
|
|
|
|
|
label="所属商户" prop="beLongCompanyId" >
|
|
|
|
|
<JnpfOrganizeSelect v-model="dataForm.beLongCompanyId" @change="changeData('beLongCompanyId',-1)"
|
|
|
|
|
placeholder="请选择" selectType="all" :ableIds="ableAll.beLongCompanyIdableIds" clearable :style='{"width":"100%"}'>
|
|
|
|
|
</JnpfOrganizeSelect>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24" >
|
|
|
|
|
<el-col :span="8" >
|
|
|
|
|
<jnpf-form-tip-item
|
|
|
|
|
label="分配回收站" tipLabel="分配回收站" prop="beLongStationId" >
|
|
|
|
|
<JnpfCascader v-model="dataForm.beLongStationId" @change="changeData('beLongStationId',-1)"
|
|
|
|
|
placeholder="请选择" show-all-levels clearable :style='{"width":"100%"}' separator="/" :options="beLongStationIdOptions" :props="beLongStationIdProps" >
|
|
|
|
|
</JnpfCascader>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8" >
|
|
|
|
|
<jnpf-form-tip-item
|
|
|
|
|
label="所属清运员" prop="beLongRecyclerPhone" >
|
|
|
|
|
<JnpfSelect v-model="dataForm.beLongRecyclerPhone" @change="changeData('beLongRecyclerPhone',-1)"
|
|
|
|
|
placeholder="请选择" clearable :style='{"width":"100%"}' :options="beLongRecyclerPhoneOptions" :props="beLongRecyclerPhoneProps" >
|
|
|
|
|
</JnpfSelect>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24" >
|
|
|
|
|
<jnpf-form-tip-item
|
|
|
|
|
label="设备码二维码" prop="deviceCodeQr" >
|
|
|
|
|
<JnpfUploadImg v-model="dataForm.deviceCodeQr" @change="changeData('deviceCodeQr',-1)"
|
|
|
|
|
:fileSize="100" sizeUnit="MB" :limit="1" pathType="defaultPath" :isAccount="0" >
|
|
|
|
|
</JnpfUploadImg>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8" >
|
|
|
|
|
<jnpf-form-tip-item
|
|
|
|
|
label="设备总重" prop="boxWeight" >
|
|
|
|
|
<JnpfInput v-model="dataForm.boxWeight" @change="changeData('boxWeight',-1)"
|
|
|
|
|
placeholder="请选择" clearable :style='{"width":"100%"}'>
|
|
|
|
@ -104,21 +144,8 @@
|
|
|
|
|
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm"
|
|
|
|
|
ref="selectDialog" @select="addForSelect" @close="selectDialogVisible=false"/>
|
|
|
|
|
</el-row>
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
|
|
<div class="upAndDown-button" v-if="dataForm.id">
|
|
|
|
|
<el-button @click="prev" :disabled='prevDis'>
|
|
|
|
|
{{'上一条'}}
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button @click="next" :disabled='nextDis'>
|
|
|
|
|
{{'下一条'}}
|
|
|
|
|
</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<el-button type="primary" @click="dataFormSubmit(2)" :loading="continueBtnLoading">
|
|
|
|
|
{{!dataForm.id ?'确定并新增':'确定并继续'}}</el-button>
|
|
|
|
|
<el-button @click="visible = false"> 取 消</el-button>
|
|
|
|
|
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading"> 确 定</el-button>
|
|
|
|
|
</span>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
</transition>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -168,8 +195,10 @@
|
|
|
|
|
address : undefined,
|
|
|
|
|
useStatus : "0",
|
|
|
|
|
status : "0",
|
|
|
|
|
beLongCompanyId : undefined,
|
|
|
|
|
beLongCompanyId : [],
|
|
|
|
|
beLongStationId : [],
|
|
|
|
|
beLongRecyclerPhone : undefined,
|
|
|
|
|
deviceCodeQr : [],
|
|
|
|
|
ipAddress : undefined,
|
|
|
|
|
boxWeight : undefined,
|
|
|
|
|
latitude : undefined,
|
|
|
|
@ -216,9 +245,10 @@
|
|
|
|
|
useStatusProps:{"label":"fullName","value":"id" },
|
|
|
|
|
statusOptions:[{"fullName":"离线","id":"0"},{"fullName":"在线","id":"1"}],
|
|
|
|
|
statusProps:{"label":"fullName","value":"id" },
|
|
|
|
|
beLongCompanyIdcolumnOptions:[ {"label":"商户ID","value":"f_id"}, {"label":"商户名称","value":"f_full_name"},],
|
|
|
|
|
beLongStationIdOptions:[],
|
|
|
|
|
beLongStationIdProps:{"label":"station_name","value":"id" ,"children":"children" },
|
|
|
|
|
beLongRecyclerPhoneOptions:[],
|
|
|
|
|
beLongRecyclerPhoneProps:{"label":"staffs_name","value":"mobile_phone" },
|
|
|
|
|
childIndex:-1,
|
|
|
|
|
isEdit:false,
|
|
|
|
|
interfaceRes: {
|
|
|
|
@ -230,6 +260,8 @@
|
|
|
|
|
status:[] ,
|
|
|
|
|
beLongCompanyId:[] ,
|
|
|
|
|
beLongStationId:[{"dataType":"varchar","defaultValue":"默认","field":"company_id","fieldName":"","id":"ISgfx72","jnpfKey":"popupSelect","relationField":"beLongCompanyId","required":"0"}] ,
|
|
|
|
|
beLongRecyclerPhone:[] ,
|
|
|
|
|
deviceCodeQr:[] ,
|
|
|
|
|
ipAddress:[] ,
|
|
|
|
|
boxWeight:[] ,
|
|
|
|
|
latitude:[] ,
|
|
|
|
@ -331,6 +363,7 @@
|
|
|
|
|
},
|
|
|
|
|
dataAll(){
|
|
|
|
|
this.getbeLongStationIdOptions();
|
|
|
|
|
this.getbeLongRecyclerPhoneOptions();
|
|
|
|
|
},
|
|
|
|
|
getbeLongStationIdOptions() {
|
|
|
|
|
const index = this.childIndex
|
|
|
|
@ -357,6 +390,34 @@
|
|
|
|
|
this.changeDataFormData(1,'beLongStationId','beLongStationId',index,[])
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
getbeLongRecyclerPhoneOptions() {
|
|
|
|
|
const index = this.childIndex
|
|
|
|
|
let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.beLongRecyclerPhone))
|
|
|
|
|
for (let i = 0; i < templateJsonList.length; i++) {
|
|
|
|
|
let json = templateJsonList[i];
|
|
|
|
|
if(json.relationField){
|
|
|
|
|
let relationFieldAll = json.relationField.split("-");
|
|
|
|
|
let val = json.defaultValue;
|
|
|
|
|
if(relationFieldAll.length>1 && index>-1){
|
|
|
|
|
val = this.dataForm[relationFieldAll[0]+'List']&&this.dataForm[relationFieldAll[0]+'List'].length?this.dataForm[relationFieldAll[0]+'List'][index][relationFieldAll[1]]:''
|
|
|
|
|
}else {
|
|
|
|
|
val = this.dataForm[relationFieldAll]
|
|
|
|
|
}
|
|
|
|
|
json.defaultValue = val
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
let template ={
|
|
|
|
|
paramList:templateJsonList
|
|
|
|
|
}
|
|
|
|
|
getDataInterfaceRes('573108606942052421',template).then(res => {
|
|
|
|
|
let data = res.data
|
|
|
|
|
this.beLongRecyclerPhoneOptions = data
|
|
|
|
|
this.changeDataFormData(1,'beLongRecyclerPhone','beLongRecyclerPhone',index,'')
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
goBack() {
|
|
|
|
|
this.$emit('refresh')
|
|
|
|
|
},
|
|
|
|
|
clearData(){
|
|
|
|
|
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
|
|
|
|
|
},
|
|
|
|
|