|
@@ -4,12 +4,16 @@
|
|
|
<van-action-sheet v-model:show="sheetShow" :closeable='false' :title="$t('device.enterAnyInformationToSearch')">
|
|
|
<div class="content">
|
|
|
<van-form @submit="onSubmit">
|
|
|
+ <!-- 设备编号 -->
|
|
|
<van-field v-model="clientId" name="clientId" :label="$t('device.equipmentNoLabel')"
|
|
|
:placeholder="$t('device.equipmentNoPlaceholder')" />
|
|
|
+ <!-- 设备名称 -->
|
|
|
<van-field v-model="equipmentName" name="equipmentName" :label="$t('device.equipmentNameLabel')"
|
|
|
:placeholder="$t('device.equipmentNamePlaceholder')" />
|
|
|
+ <!-- 商家名 -->
|
|
|
<van-field v-model="adminName" name="adminName" :label="$t('device.merchantNameLabel')"
|
|
|
:placeholder="$t('device.merchantNamePlaceholder')" />
|
|
|
+ <!-- 公司平台 -->
|
|
|
<div v-if="isShowCompany()">
|
|
|
<van-field label-width="86" v-model="companyTypeText" is-link readonly :label="$t('device.companyTypeLabel')"
|
|
|
:placeholder="$t('device.companyTypePlaceholder')" @click="companyTypeShow = true" class="field" />
|
|
@@ -64,6 +68,17 @@
|
|
|
</van-popup>
|
|
|
</van-col>
|
|
|
</van-row>
|
|
|
+
|
|
|
+ <!-- 设备标签分组 -->
|
|
|
+ <div>
|
|
|
+ <van-field label-width="86" v-model="deviceGroupText" is-link readonly :label="$t('device.deviceGrouping')"
|
|
|
+ :placeholder="$t('device.plzSelectDeviceGroup')" @click="deviceGroupShow = true" class="field" />
|
|
|
+ <van-popup v-model:show="deviceGroupShow" round position="bottom">
|
|
|
+ <van-cascader v-model="deviceGroup" :title="$t('device.deviceGroupPlaceholder')"
|
|
|
+ :options="deviceGroupOptions" @close="deviceGroupShow = false" @finish="deviceGroupFinish" />
|
|
|
+ </van-popup>
|
|
|
+ </div>
|
|
|
+
|
|
|
<!-- 支付方式、信道 -->
|
|
|
<van-row>
|
|
|
<!-- <van-col span="12">
|
|
@@ -121,9 +136,10 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { ref } from 'vue';
|
|
|
+import { ref, onMounted } from 'vue';
|
|
|
import { useI18n } from 'vue-i18n';
|
|
|
import { getLoginUser, styleUrl } from "../../common/js/utils";
|
|
|
+import { Api_getLabelList } from "../../service/labelMan";
|
|
|
|
|
|
export default {
|
|
|
setup(prop, context) {
|
|
@@ -137,9 +153,14 @@ export default {
|
|
|
const machineTypeText = ref(''); // 设备类型 - 页面显示
|
|
|
const machineTypeShow = ref(false); // 设备类型级联状态
|
|
|
const companyType = ref(''); // 公司平台
|
|
|
+ const deviceGroup = ref(''); // 设备分组
|
|
|
const companyTypeText = ref(''); // 公司平台 - 页面显示
|
|
|
+ const deviceGroupText = ref(''); // 设备分组 - 页面显示
|
|
|
const companyTypeShow = ref(false); // 公司平台级联状态
|
|
|
+ const deviceGroupShow = ref(false); // 设备分组级联状态
|
|
|
const user = getLoginUser(); // 获取登录用户
|
|
|
+ const labelId = ref(""); // 设备标签id
|
|
|
+
|
|
|
const machineTypeOptions = ref([
|
|
|
{
|
|
|
text: t('device.spunSugar'),
|
|
@@ -164,15 +185,30 @@ export default {
|
|
|
value: '1',
|
|
|
}
|
|
|
]);
|
|
|
+
|
|
|
+
|
|
|
+ const deviceGroupOptions = ref([
|
|
|
+
|
|
|
+ ]);
|
|
|
+
|
|
|
const machineTypeFinish = ({ selectedOptions }) => {
|
|
|
machineTypeShow.value = false;
|
|
|
machineTypeText.value = selectedOptions.map((option) => option.text).join('/');
|
|
|
}; // 设备类型级联选择
|
|
|
+
|
|
|
const companyTypeFinish = ({ selectedOptions }) => {
|
|
|
companyTypeShow.value = false;
|
|
|
companyTypeText.value = selectedOptions.map((option) => option.text).join('/');
|
|
|
}; // 公司平台级联选择
|
|
|
|
|
|
+ const deviceGroupFinish = async ({ selectedOptions }) => {
|
|
|
+ const selectedLabel = selectedOptions[selectedOptions.length - 1];
|
|
|
+ labelId.value = selectedLabel.value;
|
|
|
+ // console.log("labelId >>>", labelId.value);
|
|
|
+ deviceGroupShow.value = false;
|
|
|
+ deviceGroupText.value = selectedOptions.map((option) => option.text).join('/');
|
|
|
+ }; // 设备分组级联选择
|
|
|
+
|
|
|
const equimentType = ref(''); // 设备机型
|
|
|
const equimentTypeText = ref(''); // 设备机型 - 页面显示
|
|
|
const equimentTypeShow = ref(false); // 设备机型级联状态
|
|
@@ -296,6 +332,7 @@ export default {
|
|
|
isUsing: isUsing.value,
|
|
|
payType: payType.value,
|
|
|
channel: channel.value,
|
|
|
+ labelId: labelId.value,
|
|
|
};
|
|
|
context.emit('search', searchParam);
|
|
|
sheetShow.value = false;
|
|
@@ -310,6 +347,8 @@ export default {
|
|
|
machineTypeText.value = '';
|
|
|
companyType.value = '';
|
|
|
companyTypeText.value = '';
|
|
|
+ deviceGroup.value = '';
|
|
|
+ deviceGroupText.value = '';
|
|
|
equimentType.value = '';
|
|
|
equimentTypeText.value = '';
|
|
|
eqeStatus.value = '';
|
|
@@ -322,6 +361,25 @@ export default {
|
|
|
channelText.value = '';
|
|
|
};
|
|
|
|
|
|
+ onMounted(() => {
|
|
|
+ // 获取标签分组
|
|
|
+ getLabelList();
|
|
|
+ });
|
|
|
+ // 获取设备标签
|
|
|
+ const getLabelList = async () => {
|
|
|
+ // console.log("adminId>>>>", user.id);
|
|
|
+ Api_getLabelList({
|
|
|
+ adminId: user.id,
|
|
|
+ type: "1"
|
|
|
+ }).then((res) => {
|
|
|
+ const { data } = res.data;
|
|
|
+ deviceGroupOptions.value = data.map((label) => ({
|
|
|
+ text: label.name,
|
|
|
+ value: label.id,
|
|
|
+ }));
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
// 加载样式
|
|
|
styleUrl('deviceSearch');
|
|
|
|
|
@@ -355,6 +413,13 @@ export default {
|
|
|
companyTypeOptions,
|
|
|
companyTypeFinish,
|
|
|
|
|
|
+ deviceGroup,
|
|
|
+ deviceGroupText,
|
|
|
+ deviceGroupShow,
|
|
|
+ deviceGroupFinish,
|
|
|
+ deviceGroupOptions,
|
|
|
+ labelId,
|
|
|
+
|
|
|
eqeStatus,
|
|
|
eqeStatusText,
|
|
|
eqeStatusShow,
|