|
|
|
|
@ -102,13 +102,15 @@
|
|
|
|
|
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>
|
|
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
|
@ -368,7 +370,7 @@
|
|
|
|
|
</el-upload>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="扫机身码" prop="isScanCode">
|
|
|
|
|
<el-switch v-model="form.isScanCode" active-value="1" inactive-value="0" active-color="#13ce66"
|
|
|
|
|
<el-switch v-model="form.isScanCode" :active-value="1" :inactive-value="0" active-color="#13ce66"
|
|
|
|
|
inactive-color="#DCDCDC">
|
|
|
|
|
</el-switch>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
@ -421,15 +423,61 @@
|
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
<!-- 编辑小程序可见标签 -->
|
|
|
|
|
<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 {listInstrument, getInstrument, delInstrument, addInstrument, updateInstrument} from "@/api/system/instrument";
|
|
|
|
|
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 {
|
|
|
|
|
// 遮罩层
|
|
|
|
|
@ -512,6 +560,20 @@ export default {
|
|
|
|
|
uploadHide: false,
|
|
|
|
|
fileList: [],
|
|
|
|
|
},
|
|
|
|
|
/* 小程序可见标签 */
|
|
|
|
|
miniProgramTag: {
|
|
|
|
|
userId: null,
|
|
|
|
|
selectTagList: null,
|
|
|
|
|
visible: false,
|
|
|
|
|
optionTree: [],
|
|
|
|
|
},
|
|
|
|
|
/* 企微可见标签 */
|
|
|
|
|
wecomTag: {
|
|
|
|
|
userId: null,
|
|
|
|
|
selectTagList: null,
|
|
|
|
|
visible: false,
|
|
|
|
|
optionTree: [],
|
|
|
|
|
},
|
|
|
|
|
// 表单参数
|
|
|
|
|
form: {},
|
|
|
|
|
// 表单校验
|
|
|
|
|
@ -611,7 +673,7 @@ export default {
|
|
|
|
|
iotVersion: null,
|
|
|
|
|
iotUpgradeData: null,
|
|
|
|
|
isScanCode: 0,
|
|
|
|
|
isPurchase: null,
|
|
|
|
|
isPurchase: 0,
|
|
|
|
|
shoppingAppid: null,
|
|
|
|
|
shoppingPath: null,
|
|
|
|
|
bluetoothConnecting: null,
|
|
|
|
|
@ -764,12 +826,11 @@ 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 {
|
|
|
|
|
addInstrument(this.form).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
|
|
@ -923,12 +984,57 @@ export default {
|
|
|
|
|
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();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|