|
|
|
|
@ -172,48 +172,25 @@
|
|
|
|
|
class-name="small-padding fixed-width"
|
|
|
|
|
>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
|
type="text"
|
|
|
|
|
icon="el-icon-edit"
|
|
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
|
|
v-hasPermi="['system:instrument:edit']"
|
|
|
|
|
>编辑
|
|
|
|
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
|
|
|
|
v-hasPermi="['system:instrument:edit']">编辑
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
|
type="text"
|
|
|
|
|
icon="el-icon-edit"
|
|
|
|
|
@click="editMiniProgramTags(scope.row)"
|
|
|
|
|
>设置小程序可见标签
|
|
|
|
|
<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"
|
|
|
|
|
@click="editWecomTags(scope.row)"
|
|
|
|
|
>设置企微可见标签
|
|
|
|
|
<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" @click="editInstrumentNameVisible(scope.row)">正品控名称配置
|
|
|
|
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="editInstrumentNameVisible(scope.row)">
|
|
|
|
|
正品控名称配置
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button size="mini" type="text" icon="el-icon-edit">配置说明书</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 == 0"
|
|
|
|
|
>隐藏
|
|
|
|
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="editInstrumentInstructionVisible(scope.row)">
|
|
|
|
|
配置说明书
|
|
|
|
|
</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 size="mini" type="text" 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>
|
|
|
|
|
@ -469,6 +446,9 @@
|
|
|
|
|
>
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="仪器绑定积分" prop="bindingCredit">
|
|
|
|
|
<el-input-number :min="0" :precision="0" v-model="form.bindingCredit" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="仪器类型" prop="type">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="form.type"
|
|
|
|
|
@ -489,7 +469,16 @@
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="模式ID" prop="sceneIds">
|
|
|
|
|
<el-input v-model="form.sceneIds" placeholder="请输入模式ID"/>
|
|
|
|
|
<!-- <el-input v-model="form.sceneIds" placeholder="请输入模式ID"/> -->
|
|
|
|
|
<el-select v-model="sceneIdsValue" multiple placeholder="请选择模式ID">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in sceneIdsOptions"
|
|
|
|
|
:key="item.value"
|
|
|
|
|
:label="item.label"
|
|
|
|
|
:value="item.value">
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
<span v-if="sceneIdsValue.length > 1" style="cursor: pointer;color:#1890ff;margin-left:10px" @click="openSceneDialog()">排序</span>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="模式名称" prop="sceneNames">
|
|
|
|
|
<el-input v-model="form.sceneNames" placeholder="请输入模式名称"/>
|
|
|
|
|
@ -835,12 +824,74 @@
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button size="mini" type="text" icon="el-icon-save" @click="saveInstrumentName(scope.row)">保存</el-button>
|
|
|
|
|
<el-button size="mini" type="text" icon="el-icon-save" @click="saveInstrumentName(scope.row)">保存
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="delInstrumentName(scope)">删除</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
<el-dialog title="产品说明书配置" :visible.sync="instrumentInstructions.visible" width="50%">
|
|
|
|
|
<el-button size="mini" type="primary" icon="el-icon-add" @click="addInstrumentInstructionLine()">添加说明书
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-table v-loading="loading" :data="instrumentInstructions.instructionList">
|
|
|
|
|
<el-table-column align="center" prop="name" width="200" label="说明书类型">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-input placeholder="请输入说明书类型" v-model="scope.row.name" clearable/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column align="center" prop="link" width="250" label="说明书(每个类型只能上传一个说明书)">
|
|
|
|
|
<!-- scope.row.link -->
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-upload
|
|
|
|
|
class="upload-demo"
|
|
|
|
|
:action="uploadUrl"
|
|
|
|
|
:headers="headers"
|
|
|
|
|
:limit="1"
|
|
|
|
|
:on-exceed="instructionUploadExceed"
|
|
|
|
|
:on-success="(response, file, fileList) => {
|
|
|
|
|
return instructionUploadSuccess(response, file, fileList, scope.$index);
|
|
|
|
|
}"
|
|
|
|
|
:on-error="uploadError"
|
|
|
|
|
:file-list="scope.row.fileList"
|
|
|
|
|
accept=".pdf,.PDF"
|
|
|
|
|
>
|
|
|
|
|
<el-button size="small" type="primary">点击上传</el-button>
|
|
|
|
|
</el-upload>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="操作">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button size="mini" type="text" icon="el-icon-save" @click="viewInstrumentInstruction(scope.row)">查看
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button size="mini" type="text" icon="el-icon-save" @click="saveInstrumentInstruction(scope.row)">保存
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="delInstrumentInstruction(scope)">删除
|
|
|
|
|
</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
<el-dialog
|
|
|
|
|
title="排序"
|
|
|
|
|
:visible.sync="isSceneIdsVisible"
|
|
|
|
|
width="50%"
|
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
|
:before-close="handleCloseScene">
|
|
|
|
|
<div>
|
|
|
|
|
<draggable v-model="sceneIdsValue" draggable=".itemTag">
|
|
|
|
|
<template v-for="element in sceneIdsValue">
|
|
|
|
|
<el-tag :key="element" class="itemTag"> {{element}}</el-tag>
|
|
|
|
|
</template>
|
|
|
|
|
</draggable>
|
|
|
|
|
</div>
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button @click="isSceneIdsVisible = false">取 消</el-button>
|
|
|
|
|
<el-button type="primary" @click="isSceneIdsVisible = false">确 定</el-button>
|
|
|
|
|
</span>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
@ -852,7 +903,15 @@ import {
|
|
|
|
|
addInstrument,
|
|
|
|
|
updateInstrument,
|
|
|
|
|
getMiniProgramTagTree,
|
|
|
|
|
getWecomTagTree, listRelate, delRelate, updateRelate, addRelate,
|
|
|
|
|
getWecomTagTree,
|
|
|
|
|
listRelate,
|
|
|
|
|
delRelate,
|
|
|
|
|
updateRelate,
|
|
|
|
|
addRelate,
|
|
|
|
|
listInstructions,
|
|
|
|
|
delInstructions,
|
|
|
|
|
addInstructions,
|
|
|
|
|
updateInstructions,
|
|
|
|
|
} from '@/api/system/instrument'
|
|
|
|
|
import {getToken} from '@/utils/auth'
|
|
|
|
|
import Treeselect from '@riophae/vue-treeselect'
|
|
|
|
|
@ -860,9 +919,11 @@ import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
|
|
|
|
|
|
|
|
|
import {upload} from "@/api/upload";
|
|
|
|
|
|
|
|
|
|
import draggable from 'vuedraggable'
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: 'Instrument',
|
|
|
|
|
components: {Treeselect},
|
|
|
|
|
components: {Treeselect,draggable},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
// 遮罩层
|
|
|
|
|
@ -983,6 +1044,13 @@ export default {
|
|
|
|
|
isExtraClock: [
|
|
|
|
|
{required: true, message: '请选择是否开启额外打卡奖励'},
|
|
|
|
|
],
|
|
|
|
|
bindingCredit: [
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
message: '仪器绑定奖励积分',
|
|
|
|
|
trigger: 'blur',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
extraClockCredit: [
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
@ -1046,6 +1114,36 @@ export default {
|
|
|
|
|
// 预览弹窗
|
|
|
|
|
previewSrc: '', // 预览地址
|
|
|
|
|
isPreviewVideo: true, // 预览开关
|
|
|
|
|
/* 仪器说明书 */
|
|
|
|
|
instrumentInstructions: {
|
|
|
|
|
visible: false,
|
|
|
|
|
instrumentId: null,
|
|
|
|
|
instructionList: [{
|
|
|
|
|
id: null,
|
|
|
|
|
fileList: [],
|
|
|
|
|
instrumentId: null,
|
|
|
|
|
name: null,
|
|
|
|
|
link: null,
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
isSceneIdsVisible: false,
|
|
|
|
|
sceneIdsValue: [], // value
|
|
|
|
|
sceneIdsValueTemp: [],
|
|
|
|
|
sceneIdsOptions: [
|
|
|
|
|
{
|
|
|
|
|
value: '黄金糕',
|
|
|
|
|
label: '黄金糕'
|
|
|
|
|
}, {
|
|
|
|
|
value: '双皮奶',
|
|
|
|
|
label: '双皮奶'
|
|
|
|
|
}, {
|
|
|
|
|
value: '蚵仔煎',
|
|
|
|
|
label: '蚵仔煎'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
@ -1098,6 +1196,7 @@ export default {
|
|
|
|
|
extraClockCredit: 0,
|
|
|
|
|
/* 额外打卡时间范围 */
|
|
|
|
|
extraClockTimeRange: [],
|
|
|
|
|
bindingCredit: 0,
|
|
|
|
|
miniTagIds: null,
|
|
|
|
|
miniTagNames: null,
|
|
|
|
|
wecomTagIds: null,
|
|
|
|
|
@ -1180,6 +1279,13 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
|
resetQuery() {
|
|
|
|
|
this.queryParams = {
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
id: null,
|
|
|
|
|
name: null,
|
|
|
|
|
type: null,
|
|
|
|
|
};
|
|
|
|
|
this.resetForm('queryForm')
|
|
|
|
|
this.handleQuery()
|
|
|
|
|
},
|
|
|
|
|
@ -1313,7 +1419,7 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
.then(() => {
|
|
|
|
|
this.getList()
|
|
|
|
|
this.$modal.msgSuccess('隐藏成功')
|
|
|
|
|
this.$modal.msgSuccess('操作成功');
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
})
|
|
|
|
|
@ -1645,6 +1751,104 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/* 仪器说明书 */
|
|
|
|
|
addInstrumentInstructionLine() {
|
|
|
|
|
this.instrumentInstructions.instructionList.push({
|
|
|
|
|
id: null,
|
|
|
|
|
fileList: [],
|
|
|
|
|
instrumentId: this.instrumentInstructions.instrumentId,
|
|
|
|
|
name: null,
|
|
|
|
|
link: null,
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
editInstrumentInstructionVisible(row) {
|
|
|
|
|
this.instrumentInstructions.instrumentId = row.id;
|
|
|
|
|
// 查询现有的仪器说明书
|
|
|
|
|
listInstructions({
|
|
|
|
|
instrumentId: row.id
|
|
|
|
|
}).then((response) => {
|
|
|
|
|
if (response.data != null && response.data.length > 0) {
|
|
|
|
|
this.instrumentInstructions.instructionList = response.data;
|
|
|
|
|
for (let i = 0; i < response.data.length; i++) {
|
|
|
|
|
this.instrumentInstructions.instructionList[i].fileList = [{
|
|
|
|
|
name: response.data[i].name + ".pdf",
|
|
|
|
|
url: response.data[i].url,
|
|
|
|
|
}];
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.instrumentInstructions.instructionList = [{
|
|
|
|
|
id: null,
|
|
|
|
|
fileList: [],
|
|
|
|
|
instrumentId: this.instrumentInstructions.instrumentId,
|
|
|
|
|
name: null,
|
|
|
|
|
link: null,
|
|
|
|
|
}];
|
|
|
|
|
}
|
|
|
|
|
this.instrumentInstructions.visible = true;
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
delInstrumentInstruction(item) {
|
|
|
|
|
// 获取 id,删除关联的仪器说明书
|
|
|
|
|
if (item.row.id != null) {
|
|
|
|
|
// 执行删除
|
|
|
|
|
delInstructions(item.row.id).then((response) => {
|
|
|
|
|
this.$modal.msgSuccess('删除成功');
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
this.instrumentInstructions.instructionList.splice(item.$index, 1)
|
|
|
|
|
if (this.instrumentInstructions.instructionList.length == 0) {
|
|
|
|
|
this.addInstrumentInstructionLine();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
saveInstrumentInstruction(item) {
|
|
|
|
|
if (item.instrumentId == null) {
|
|
|
|
|
this.$modal.msgError('参数异常');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (item.name == null) {
|
|
|
|
|
this.$modal.msgError('请输入说明书名称');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (item.link == null) {
|
|
|
|
|
this.$modal.msgError('请上传说明书');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (item.id != null) {
|
|
|
|
|
updateInstructions(item).then((response) => {
|
|
|
|
|
this.$modal.msgSuccess('修改成功');
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
addInstructions(item).then((response) => {
|
|
|
|
|
this.$modal.msgSuccess('新增成功');
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
instructionUploadExceed(files, fileList) {
|
|
|
|
|
this.$message.warning(`您已上传了文件,如需更换,请先删除原上传的文件`)
|
|
|
|
|
},
|
|
|
|
|
instructionUploadSuccess(response, file, fileList, index) {
|
|
|
|
|
if (response.code == 200) {
|
|
|
|
|
this.instrumentInstructions.instructionList[index].link = response.data.url;
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error('图片插入失败')
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
viewInstrumentInstruction(item) {
|
|
|
|
|
window.open(item.link, '_blank');
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
openSceneDialog() {
|
|
|
|
|
this.sceneIdsValueTemp = JSON.parse(JSON.stringify(this.sceneIdsValue))
|
|
|
|
|
this.isSceneIdsVisible = true;
|
|
|
|
|
},
|
|
|
|
|
handleCloseScene() {
|
|
|
|
|
this.isSceneIdsVisible = false;
|
|
|
|
|
},
|
|
|
|
|
handleSaveScene() {
|
|
|
|
|
this.sceneIdsValue = JSON.parse(JSON.stringify(this.sceneIdsValueTemp))
|
|
|
|
|
this.handleCloseScene()
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
@ -1665,4 +1869,10 @@ export default {
|
|
|
|
|
video {
|
|
|
|
|
object-fit: fill;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.itemTag {
|
|
|
|
|
margin-top: 20px;
|
|
|
|
|
margin-right: 10px;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|