合并冲突

master
blak-kong 2 years ago
commit 12f2cce3ec

@ -1,5 +1,7 @@
package com.flossom.common.core.domain.entity;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
@ -74,14 +76,14 @@ public class WxInstrument extends BaseEntity {
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd")
private Date startTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime startTime;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd")
private Date endTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime endTime;
/**
* ID(xxxx,xxxx,xxx)
@ -116,8 +118,8 @@ public class WxInstrument extends BaseEntity {
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd")
private Date nursingTime;
@JsonFormat(pattern = "HH:mm:ss")
private LocalTime nursingTime;
/**
* iot
@ -264,19 +266,19 @@ public class WxInstrument extends BaseEntity {
return extraClockCredit;
}
public void setStartTime(Date startTime) {
public void setStartTime(LocalDateTime startTime) {
this.startTime = startTime;
}
public Date getStartTime() {
public LocalDateTime getStartTime() {
return startTime;
}
public void setEndTime(Date endTime) {
public void setEndTime(LocalDateTime endTime) {
this.endTime = endTime;
}
public Date getEndTime() {
public LocalDateTime getEndTime() {
return endTime;
}
@ -328,11 +330,11 @@ public class WxInstrument extends BaseEntity {
return sceneNames;
}
public void setNursingTime(Date nursingTime) {
public void setNursingTime(LocalTime nursingTime) {
this.nursingTime = nursingTime;
}
public Date getNursingTime() {
public LocalTime getNursingTime() {
return nursingTime;
}

@ -0,0 +1,388 @@
package com.flossom.common.core.domain.req;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.flossom.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.Date;
import java.util.List;
/**
* wx_instrument
*
* @author flossom
* @date 2024-01-06
*/
public class WxInstrumentSaveReq {
/**
* ID
*/
private Long id;
/**
*
*/
@NotBlank(message = "请输入仪器名称")
@Length(min = 1, message = "请输入仪器名称")
private String name;
/**
* 1 2iot
*/
@NotBlank(message = "请选择仪器类型")
private Integer type;
/**
* iot
*/
@NotBlank(message = "请输入仪器型号")
@Length(min = 1, message = "请输入仪器型号")
private String model;
/**
*
*/
@NotBlank(message = "请上传仪器封面")
private String banner;
/**
* logo
*/
@NotBlank(message = "请上传仪器logo")
private String logo;
/**
*
*/
@NotBlank(message = "请上传仪器序列号图片")
private String serial;
/**
*
*/
@NotNull(message = "请输入保修日期")
private Long guarantee;
/**
*
*/
@NotNull(message = "请输入日常打卡获得积分")
private Long dailyClockCredit;
/**
*
*/
private Long extraClockCredit;
/**
*
*/
@NotNull(message = "请选择是否开启额外打卡奖励")
private Long isExtraClock;
@NotNull(message = "请选择额外打卡时间范围")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private List<LocalDateTime> extraClockTimeRange;
/**
* ID(xxxx,xxxx,xxx)
*/
private String sceneIds;
/**
* (xxx,xxx,xxx)
*/
private String sceneNames;
/**
*
*/
@NotNull(message = "请选择护理时间")
@JsonFormat(pattern = "HH:mm:ss")
private LocalTime nursingTime;
/**
* iot
*/
private String iotVersion;
/**
* iot
*/
private String iotUpgradeData;
/**
* 0 1
*/
private Integer isScanCode;
/**
* 0 1
*/
@NotNull(message = "请选择是否支持购买")
private Integer isPurchase;
/**
* appid
*/
private String shoppingAppid;
/**
* path
*/
private String shoppingPath;
/**
*
*/
private String bluetoothConnecting;
/**
*
*/
private String bluetoothClosed;
/**
* iot
*/
private String iotVersionUpgrade;
/**
* :
*/
@NotNull(message = "请输入排序")
private Long sortNo;
/**
*
*/
private String manualCodeBinding;
/**
*
*/
private String scanCodeBinding;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}
public String getBanner() {
return banner;
}
public void setBanner(String banner) {
this.banner = banner;
}
public String getLogo() {
return logo;
}
public void setLogo(String logo) {
this.logo = logo;
}
public String getSerial() {
return serial;
}
public void setSerial(String serial) {
this.serial = serial;
}
public Long getGuarantee() {
return guarantee;
}
public void setGuarantee(Long guarantee) {
this.guarantee = guarantee;
}
public Long getDailyClockCredit() {
return dailyClockCredit;
}
public void setDailyClockCredit(Long dailyClockCredit) {
this.dailyClockCredit = dailyClockCredit;
}
public Long getExtraClockCredit() {
return extraClockCredit;
}
public void setExtraClockCredit(Long extraClockCredit) {
this.extraClockCredit = extraClockCredit;
}
public Long getIsExtraClock() {
return isExtraClock;
}
public void setIsExtraClock(Long isExtraClock) {
this.isExtraClock = isExtraClock;
}
public List<LocalDateTime> getExtraClockTimeRange() {
return extraClockTimeRange;
}
public void setExtraClockTimeRange(List<LocalDateTime> extraClockTimeRange) {
this.extraClockTimeRange = extraClockTimeRange;
}
public String getSceneIds() {
return sceneIds;
}
public void setSceneIds(String sceneIds) {
this.sceneIds = sceneIds;
}
public String getSceneNames() {
return sceneNames;
}
public void setSceneNames(String sceneNames) {
this.sceneNames = sceneNames;
}
public LocalTime getNursingTime() {
return nursingTime;
}
public void setNursingTime(LocalTime nursingTime) {
this.nursingTime = nursingTime;
}
public String getIotVersion() {
return iotVersion;
}
public void setIotVersion(String iotVersion) {
this.iotVersion = iotVersion;
}
public String getIotUpgradeData() {
return iotUpgradeData;
}
public void setIotUpgradeData(String iotUpgradeData) {
this.iotUpgradeData = iotUpgradeData;
}
public Integer getIsScanCode() {
return isScanCode;
}
public void setIsScanCode(Integer isScanCode) {
this.isScanCode = isScanCode;
}
public Integer getIsPurchase() {
return isPurchase;
}
public void setIsPurchase(Integer isPurchase) {
this.isPurchase = isPurchase;
}
public String getShoppingAppid() {
return shoppingAppid;
}
public void setShoppingAppid(String shoppingAppid) {
this.shoppingAppid = shoppingAppid;
}
public String getShoppingPath() {
return shoppingPath;
}
public void setShoppingPath(String shoppingPath) {
this.shoppingPath = shoppingPath;
}
public String getBluetoothConnecting() {
return bluetoothConnecting;
}
public void setBluetoothConnecting(String bluetoothConnecting) {
this.bluetoothConnecting = bluetoothConnecting;
}
public String getBluetoothClosed() {
return bluetoothClosed;
}
public void setBluetoothClosed(String bluetoothClosed) {
this.bluetoothClosed = bluetoothClosed;
}
public String getIotVersionUpgrade() {
return iotVersionUpgrade;
}
public void setIotVersionUpgrade(String iotVersionUpgrade) {
this.iotVersionUpgrade = iotVersionUpgrade;
}
public Long getSortNo() {
return sortNo;
}
public void setSortNo(Long sortNo) {
this.sortNo = sortNo;
}
public String getManualCodeBinding() {
return manualCodeBinding;
}
public void setManualCodeBinding(String manualCodeBinding) {
this.manualCodeBinding = manualCodeBinding;
}
public String getScanCodeBinding() {
return scanCodeBinding;
}
public void setScanCodeBinding(String scanCodeBinding) {
this.scanCodeBinding = scanCodeBinding;
}
}

@ -60,7 +60,7 @@ public interface WxInstrumentMapper {
* @param ids
* @return
*/
public int deleteWxInstrumentByIds(Long[] ids);
public int deleteWxInstrumentByIds(Long id);
}

@ -233,10 +233,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
delete from wx_instrument where id = #{id}
</delete>
<delete id="deleteWxInstrumentByIds" parameterType="String">
delete from wx_instrument where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
<delete id="deleteWxInstrumentByIds" parameterType="Long">
UPDATE wx_instrument SET status = IF(status = 1, 0, 1) where id = #{id}
</delete>
</mapper>

@ -2,12 +2,16 @@ package com.flossom.system.controller;
import com.flossom.common.core.domain.entity.WxInstrument;
import com.flossom.common.core.domain.req.WxInstrumentReq;
import com.flossom.common.core.domain.req.WxInstrumentSaveReq;
import com.flossom.common.core.exception.ServiceException;
import com.flossom.common.core.utils.StringUtils;
import com.flossom.common.core.web.controller.BaseController;
import com.flossom.common.core.web.domain.AjaxResult;
import com.flossom.common.core.web.page.TableDataInfo;
import com.flossom.common.log.annotation.Log;
import com.flossom.common.log.enums.BusinessType;
import com.flossom.common.security.annotation.RequiresPermissions;
import com.flossom.common.security.utils.SecurityUtils;
import com.flossom.system.service.IWxInstrumentService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -61,7 +65,43 @@ public class WxInstrumentController extends BaseController {
@RequiresPermissions("system:instrument:add")
@Log(title = "仪器列", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WxInstrument wxInstrument) {
public AjaxResult add(@RequestBody WxInstrumentSaveReq wxInstrumentSaveReq) {
// 开启额外打开奖励
if (wxInstrumentSaveReq.getIsExtraClock() == 1) {
if (wxInstrumentSaveReq.getExtraClockCredit() == null
|| wxInstrumentSaveReq.getExtraClockTimeRange() == null
|| wxInstrumentSaveReq.getExtraClockTimeRange().size() != 2) {
throw new ServiceException("请输入额外打卡奖励或者选择额外打卡时间");
}
} else {
wxInstrumentSaveReq.setExtraClockCredit(null);
wxInstrumentSaveReq.setExtraClockTimeRange(null);
}
// 仪器类型:IOT仪器
if (wxInstrumentSaveReq.getType() == 2) {
if (StringUtils.isBlank(wxInstrumentSaveReq.getModel())) {
throw new ServiceException("请选择仪器类型");
}
} else {
wxInstrumentSaveReq.setModel(null);
}
// 支持购买
if (wxInstrumentSaveReq.getIsPurchase() == 1) {
if (StringUtils.isBlank(wxInstrumentSaveReq.getShoppingAppid())
|| StringUtils.isBlank(wxInstrumentSaveReq.getShoppingPath())) {
throw new ServiceException("请输入购买商城APPID和商城PATH");
}
} else {
wxInstrumentSaveReq.setShoppingAppid(null);
wxInstrumentSaveReq.setShoppingPath(null);
}
WxInstrument wxInstrument = new WxInstrument();
BeanUtils.copyProperties(wxInstrumentSaveReq, wxInstrument);
wxInstrument.setStartTime(wxInstrumentSaveReq.getExtraClockTimeRange().get(0));
wxInstrument.setEndTime(wxInstrumentSaveReq.getExtraClockTimeRange().get(1));
wxInstrument.setCreateBy(SecurityUtils.getUsername());
return toAjax(wxInstrumentService.insertWxInstrument(wxInstrument));
}
@ -76,12 +116,12 @@ public class WxInstrumentController extends BaseController {
}
/**
*
*
*/
@RequiresPermissions("system:instrument:remove")
@Log(title = "仪器列", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(wxInstrumentService.deleteWxInstrumentByIds(ids));
@DeleteMapping("/{id}")
public AjaxResult remove(@PathVariable Long id) {
return toAjax(wxInstrumentService.deleteWxInstrumentByIds(id));
}
}

@ -58,7 +58,7 @@ public interface IWxInstrumentService {
* @param ids
* @return
*/
public int deleteWxInstrumentByIds(Long[] ids);
public int deleteWxInstrumentByIds(Long id);
/**
*

@ -1,9 +1,12 @@
package com.flossom.system.service.impl;
import java.util.Arrays;
import java.util.List;
import com.flossom.common.core.domain.entity.SysTag;
import com.flossom.common.core.domain.entity.WxInstrument;
import com.flossom.common.core.domain.req.WxInstrumentReq;
import com.flossom.common.core.mapper.SysTagMapper;
import com.flossom.common.core.mapper.WxInstrumentMapper;
import com.flossom.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -22,6 +25,9 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService {
@Autowired
private WxInstrumentMapper wxInstrumentMapper;
@Autowired
private SysTagMapper sysTagMapper;
/**
*
*
@ -69,6 +75,31 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService {
*/
@Override
public int updateWxInstrument(WxInstrument wxInstrument) {
// 处理小程序标签和企微标签
if (wxInstrument.getMiniTagIds() != null) {
List<String> tagIdList = Arrays.asList(wxInstrument.getMiniTagIds().split(","));
StringBuilder tagNames = new StringBuilder();
for (int i = 0; i < tagIdList.size(); i++) {
SysTag sysTag = sysTagMapper.selectDeptById(Long.valueOf(tagIdList.get(i)));
tagNames.append(sysTag.getTagName());
if (i < tagIdList.size() - 1) {
tagNames.append(",");
}
}
wxInstrument.setMiniTagNames(tagNames.toString());
}
if (wxInstrument.getWecomTagIds() != null) {
List<String> tagIdList = Arrays.asList(wxInstrument.getWecomTagIds().split(","));
StringBuilder tagNames = new StringBuilder();
for (int i = 0; i < tagIdList.size(); i++) {
SysTag sysTag = sysTagMapper.selectDeptById(Long.valueOf(tagIdList.get(i)));
tagNames.append(sysTag.getTagName());
if (i < tagIdList.size() - 1) {
tagNames.append(",");
}
}
wxInstrument.setWecomTagNames(tagNames.toString());
}
wxInstrument.setUpdateTime(DateUtils.getNowDate());
return wxInstrumentMapper.updateWxInstrument(wxInstrument);
}
@ -80,8 +111,8 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService {
* @return
*/
@Override
public int deleteWxInstrumentByIds(Long[] ids) {
return wxInstrumentMapper.deleteWxInstrumentByIds(ids);
public int deleteWxInstrumentByIds(Long id) {
return wxInstrumentMapper.deleteWxInstrumentByIds(id);
}
/**

@ -42,3 +42,25 @@ export function delInstrument(id) {
method: 'delete'
})
}
/* 获取小程序标签树 */
export function getMiniProgramTagTree() {
return request({
url: '/system/tagInfo/tagTree',
method: 'get',
params: {
type: 1
}
})
}
/* 获取企微标签树 */
export function getWecomTagTree() {
return request({
url: '/system/tagInfo/tagTree',
method: 'get',
params: {
type: 2
}
})
}

@ -135,10 +135,7 @@
width="150px"
>
<template slot-scope="scope">
<el-tag
v-for="item in getSplitList(scope.row.miniTagNames)"
:key="item"
>
<el-tag v-for="item in getSplitList(scope.row.miniTagNames)">
{{ item }}
</el-tag>
</template>
@ -150,10 +147,7 @@
width="150px"
>
<template slot-scope="scope">
<el-tag
v-for="item in getSplitList(scope.row.miniTagNames)"
:key="item"
>
<el-tag v-for="item in getSplitList(scope.row.wecomTagNames)">
{{ item }}
</el-tag>
</template>
@ -184,11 +178,19 @@
v-hasPermi="['system:instrument:edit']"
>编辑
</el-button>
<el-button size="mini" type="text" icon="el-icon-edit"
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="editMiniProgramTags(scope.row)"
>设置小程序可见标签
</el-button>
<el-button size="mini" type="text" icon="el-icon-edit"
>设置微信可见标签
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="editWecomTags(scope.row)"
>设置企微可见标签
</el-button>
<el-button size="mini" type="text" icon="el-icon-edit"
>正品控名称配置
@ -202,8 +204,18 @@
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:instrument:remove']"
v-if="scope.row.status == 0"
>隐藏
</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:instrument:remove']"
v-if="scope.row.status == 1"
>解除隐藏
</el-button>
</template>
</el-table-column>
</el-table>
@ -427,6 +439,7 @@
:inactive-value="0"
active-color="#13ce66"
inactive-color="#DCDCDC"
@change="isExtraClockChange"
>
</el-switch>
</el-form-item>
@ -458,7 +471,11 @@
</el-date-picker>
</el-form-item>
<el-form-item label="仪器类型" prop="type">
<el-select v-model="form.type" style="width: 50%">
<el-select
v-model="form.type"
style="width: 50%"
@change="typeChange"
>
<el-option label="非IOT仪器" :value="1"></el-option>
<el-option label="IOT仪器" :value="2"></el-option>
</el-select>
@ -507,15 +524,19 @@
<el-form-item label="扫机身码" prop="isScanCode">
<el-switch
v-model="form.isScanCode"
active-value="1"
inactive-value="0"
:active-value="1"
:inactive-value="0"
active-color="#13ce66"
inactive-color="#DCDCDC"
>
</el-switch>
</el-form-item>
<el-form-item label="是否支持购买" prop="isPurchase">
<el-select v-model="form.isPurchase" style="width: 50%">
<el-select
v-model="form.isPurchase"
style="width: 50%"
@change="isPurchaseChang"
>
<el-option label="是" :value="1"></el-option>
<el-option label="否" :value="0"></el-option>
</el-select>
@ -576,7 +597,10 @@
</template>
<template v-else>
<div style="width: 80px; height: 80px">
<video style="width: 100%; height: 100%;" :src="scope.row.file"></video>
<video
style="width: 100%; height: 100%"
:src="scope.row.file"
></video>
</div>
</template>
</template>
@ -584,7 +608,11 @@
</el-table-column>
<el-table-column prop="message" label="规则提示内容">
<template slot-scope="scope">
<el-input placeholder="请输入" v-model="scope.row.message" clearable></el-input>
<el-input
placeholder="请输入"
v-model="scope.row.message"
clearable
></el-input>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="80">
@ -641,7 +669,10 @@
</template>
<template v-else>
<div style="width: 80px; height: 80px">
<video style="width: 100%; height: 100%;" :src="scope.row.file"></video>
<video
style="width: 100%; height: 100%"
:src="scope.row.file"
></video>
</div>
</template>
</template>
@ -649,7 +680,11 @@
</el-table-column>
<el-table-column prop="message" label="规则提示内容">
<template slot-scope="scope">
<el-input placeholder="请输入" v-model="scope.row.message" clearable></el-input>
<el-input
placeholder="请输入"
v-model="scope.row.message"
clearable
></el-input>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="80">
@ -717,23 +752,91 @@
</div>
</el-dialog>
<!-- <VideoPreview :src="previewSrc" :isDialog="isPreviewDialog" /> -->
<!-- 编辑小程序可见标签 -->
<el-dialog
title="编辑小程序可见标签"
:visible.sync="miniProgramTag.visible"
width="50%"
>
<el-form ref="miniProgramTag" :model="miniProgramTag" label-width="150px">
<el-row>
<el-col :span="100">
<el-form-item
label="小程序标签"
prop="selectTagList"
label-width="100px"
>
<treeselect
v-model="miniProgramTag.selectTagList"
:options="miniProgramTag.optionTree"
:multiple="true"
:show-count="true"
placeholder="请选择小程序标签"
:disable-branch-nodes="true"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="miniProgramTag.visible = false"> </el-button>
<el-button type="primary" @click="submitMiniProgramTagList"
> </el-button
>
</div>
</el-dialog>
<!-- 编辑企微可见标签 -->
<el-dialog
title="编辑企微可见标签"
:visible.sync="wecomTag.visible"
width="50%"
>
<el-form :model="wecomTag" label-width="150px">
<el-row>
<el-col :span="100">
<el-form-item
label="小程序标签"
prop="tagIdArray"
label-width="100px"
>
<treeselect
v-model="wecomTag.selectTagList"
:options="wecomTag.optionTree"
:multiple="true"
:show-count="true"
placeholder="请选择小程序标签"
:disable-branch-nodes="true"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="wecomTag.visible = false"> </el-button>
<el-button type="primary" @click="submitWecomTagList"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { upload } from '@/api/upload'
import {
listInstrument,
getInstrument,
delInstrument,
addInstrument,
updateInstrument,
getMiniProgramTagTree,
getWecomTagTree,
} from '@/api/system/instrument'
import { getToken } from '@/utils/auth'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default {
name: 'Instrument',
components: { Treeselect },
data() {
return {
//
@ -816,6 +919,20 @@ export default {
uploadHide: false,
fileList: [],
},
/* 小程序可见标签 */
miniProgramTag: {
userId: null,
selectTagList: null,
visible: false,
optionTree: [],
},
/* 企微可见标签 */
wecomTag: {
userId: null,
selectTagList: null,
visible: false,
optionTree: [],
},
//
form: {},
//
@ -898,7 +1015,6 @@ export default {
//
previewSrc: '', //
isPreviewVideo: true, //
// isPreviewImage: true, //
}
},
created() {
@ -945,7 +1061,7 @@ export default {
iotVersion: null,
iotUpgradeData: null,
isScanCode: 0,
isPurchase: null,
isPurchase: 0,
shoppingAppid: null,
shoppingPath: null,
bluetoothConnecting: null,
@ -957,56 +1073,56 @@ export default {
scanCodeBinding: null,
}
/* 仪器封面 */
;(this.bannerFile = {
this.bannerFile = {
uploadHide: false,
dialogImageUrl: '',
dialogVisible: false,
disabled: false,
fileList: [],
}),
/* 仪器logo */
(this.logoFile = {
uploadHide: false,
dialogImageUrl: '',
dialogVisible: false,
disabled: false,
fileList: [],
}),
/* 序列号图片 */
(this.serialFile = {
uploadHide: false,
dialogImageUrl: '',
dialogVisible: false,
disabled: false,
fileList: [],
}),
/* 手写绑定介绍视频/图片 */
(this.manualFile = {
uploadHide: false,
fileList: [],
}),
/* 扫码绑定介绍视频/图片 */
(this.scanFile = {
uploadHide: false,
fileList: [],
}),
/* iot升级数据文件 */
(this.iotUpgradeFile = {
uploadHide: false,
fileList: [],
}),
/* 蓝牙连接文件 */
(this.bluetoothConnectFile = {
uploadHide: false,
fileList: [],
}),
/* 蓝牙断开连接文件 */
(this.bluetoothClosedFile = {
uploadHide: false,
fileList: [],
}),
// this.form.iotVersionUpgrade = null,
this.resetForm('form')
}
/* 仪器logo */
this.logoFile = {
uploadHide: false,
dialogImageUrl: '',
dialogVisible: false,
disabled: false,
fileList: [],
}
/* 序列号图片 */
this.serialFile = {
uploadHide: false,
dialogImageUrl: '',
dialogVisible: false,
disabled: false,
fileList: [],
}
/* 手写绑定介绍视频/图片 */
this.manualFile = {
uploadHide: false,
fileList: [],
}
/* 扫码绑定介绍视频/图片 */
this.scanFile = {
uploadHide: false,
fileList: [],
}
/* iot升级数据文件 */
this.iotUpgradeFile = {
uploadHide: false,
fileList: [],
}
/* 蓝牙连接文件 */
this.bluetoothConnectFile = {
uploadHide: false,
fileList: [],
}
/* 蓝牙断开连接文件 */
this.bluetoothClosedFile = {
uploadHide: false,
fileList: [],
}
// this.form.iotVersionUpgrade = null,
this.resetForm('form')
},
/** 搜索按钮操作 */
handleQuery() {
@ -1036,6 +1152,72 @@ export default {
const id = row.id || this.ids
getInstrument(id).then((response) => {
this.form = response.data
//
this.bannerFile = {
uploadHide: true,
dialogImageUrl: this.form.banner,
dialogVisible: false,
disabled: false,
fileList: [{ name: '', url: this.form.banner }],
}
/* 仪器logo */
this.logoFile = {
uploadHide: true,
dialogImageUrl: this.form.logo,
dialogVisible: false,
disabled: false,
fileList: [{ name: '', url: this.form.logo }],
}
/* 序列号图片 */
this.serialFile = {
uploadHide: true,
dialogImageUrl: this.form.serial,
dialogVisible: false,
disabled: false,
fileList: [{ name: '', url: this.form.serial }],
}
/* 手写绑定介绍视频/图片 */
this.manualFile = {
uploadHide: true,
fileList: [
{ name: '手写绑定介绍视频/图片', url: this.form.manualCodeBinding },
],
}
/* 扫码绑定介绍视频/图片 */
this.scanFile = {
uploadHide: true,
fileList: [
{ name: '扫码绑定介绍视频/图片', url: this.form.scanCodeBinding },
],
}
/* iot升级数据文件 */
this.iotUpgradeFile = {
uploadHide: true,
fileList: [
{ name: 'iot升级数据文件', url: this.form.iotUpgradeData },
],
}
/* 蓝牙连接文件 */
this.bluetoothConnectFile = {
uploadHide: true,
fileList: [
{ name: '蓝牙连接文件', url: this.form.bluetoothConnecting },
],
}
/* 蓝牙断开连接文件 */
this.bluetoothClosedFile = {
uploadHide: false,
fileList: [
{ name: '蓝牙断开连接文件', url: this.form.bluetoothClosed },
],
}
//
if (this.form.isExtraClock == 1) {
this.form.extraClockTimeRange = [
response.data.startTime,
response.data.endTime,
]
}
this.open = true
this.title = '修改仪器列'
})
@ -1045,34 +1227,32 @@ export default {
this.$refs['form'].validate((valid) => {
if (valid) {
if (this.form.id != null) {
this.$modal.msgSuccess('修改成功')
// updateInstrument(this.form).then(response => {
// this.$modal.msgSuccess("");
// this.open = false;
// this.getList();
// });
updateInstrument(this.form).then((response) => {
this.$modal.msgSuccess('修改成功')
this.open = false
this.getList()
})
} else {
console.log(this.form)
/*addInstrument(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});*/
addInstrument(this.form).then((response) => {
this.$modal.msgSuccess('新增成功')
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids
const ids = row.id
this.$modal
.confirm('是否确认删除仪器列编号为"' + ids + '"的数据项?')
.confirm('是否确认隐藏仪器列编号为"' + ids + '"的数据项?')
.then(function () {
return delInstrument(ids)
})
.then(() => {
this.getList()
this.$modal.msgSuccess('删除成功')
this.$modal.msgSuccess('隐藏成功')
})
.catch(() => {})
},
@ -1195,6 +1375,72 @@ export default {
this.$message.error('图片插入失败')
}
},
/* 是否开启额外打卡奖励 */
isExtraClockChange() {
if (this.form.isExtraClock == 0) {
this.form.extraClockCredit = 0
this.form.extraClockTimeRange = []
}
},
/* 仪器类型切换 */
typeChange() {
if (this.form.type == 1) {
this.form.model = 'WL200'
}
},
/* 是否购买切换 */
isPurchaseChang() {
if (this.form.isPurchase == 0) {
this.form.shoppingAppid = null
this.form.shoppingPath = null
}
},
/* 设置小程序可见标签 */
editMiniProgramTags(row) {
//
getMiniProgramTagTree().then((Response) => {
this.miniProgramTag.optionTree = Response.data
this.miniProgramTag.visible = true
if (row.miniTagIds != null && row.miniTagIds.length > 0) {
this.miniProgramTag.selectTagList = row.miniTagIds
.split(',')
.map(Number)
}
this.miniProgramTag.userId = row.id
})
},
/* 设置企微可见标签 */
editWecomTags(row) {
//
getWecomTagTree().then((response) => {
this.wecomTag.optionTree = response.data
this.wecomTag.visible = true
if (row.wecomTagIds != null && row.wecomTagIds.length > 0) {
this.wecomTag.selectTagList = row.wecomTagIds.split(',').map(Number)
}
this.wecomTag.userId = row.id
})
},
/* 保存小程序标签 */
submitMiniProgramTagList() {
this.form.id = this.miniProgramTag.userId
this.form.miniTagIds = this.miniProgramTag.selectTagList.join(',')
updateInstrument(this.form).then((response) => {
this.$modal.msgSuccess('修改成功')
this.miniProgramTag.visible = false
this.getList()
})
},
/* 保存企微标签 */
submitWecomTagList() {
this.form.id = this.wecomTag.userId
this.form.wecomTagIds = this.wecomTag.selectTagList.join(',')
updateInstrument(this.form).then((response) => {
this.$modal.msgSuccess('修改成功')
this.wecomTag.visible = false
this.getList()
})
},
/* 初次护理弹窗 */
addNurse() {
@ -1300,7 +1546,7 @@ export default {
height: 1px;
left: -100px;
}
video{
object-fit:fill;
}
video {
object-fit: fill;
}
</style>

Loading…
Cancel
Save