|
@@ -7,15 +7,37 @@
|
|
<div class="block3 flex-col"></div>
|
|
<div class="block3 flex-col"></div>
|
|
<span class="info2">{{ $t('device.equipmentName') }}:{{ deviceDetal ? deviceDetal.name : '' }}</span>
|
|
<span class="info2">{{ $t('device.equipmentName') }}:{{ deviceDetal ? deviceDetal.name : '' }}</span>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div v-if="machineType === null || machineType === '0'">
|
|
|
|
+ <van-field v-model="fieldValue" is-link readonly :label="$t('device.clickToSelectPattern')"
|
|
|
|
+ :placeholder="$t('device.pleaseSelectAPattern')" @click="show = true" />
|
|
|
|
+ <van-popup v-model:show="show" round position="bottom">
|
|
|
|
+ <van-cascader v-model="cascaderValue" :title="$t('device.pleaseSelectAPattern')" :options="options"
|
|
|
|
+ @close="show = false" @finish="onFinish">
|
|
|
|
+ <template #option="{ option }">
|
|
|
|
+ <div class="cascader-item">
|
|
|
|
+ <van-image :src="option.imgUrl" width="55px" height="55px"></van-image>
|
|
|
|
+ <div class="cascader-label">{{ option.value }}</div>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </van-cascader>
|
|
|
|
+ </van-popup>
|
|
|
|
+ <div class="textRow o-pr-20">
|
|
|
|
+ <span @click="pushToDaySugarList">{{ $t('device.todaysSugarList') }}>></span>
|
|
|
|
+ </div>
|
|
|
|
+ <div v-if="!doSugartData" class="block5 flex-col" @click="submitDoSugar"><span class="txt3">{{
|
|
|
|
+ $t('device.submitToMakeSugar') }}</span></div>
|
|
|
|
+ <van-button v-if="doSugartData" style="padding: 1em;" round type="primary" class="block5 flex-col"
|
|
|
|
+ :disabled="doSugartType" @click="checkData()">{{ $t('device.viewResults') }}</van-button>
|
|
|
|
+ </div>
|
|
<div v-if="machineType === '1'">
|
|
<div v-if="machineType === '1'">
|
|
<van-field v-model="fieldValue" is-link readonly :label="$t('device.clickToSelectTaste')"
|
|
<van-field v-model="fieldValue" is-link readonly :label="$t('device.clickToSelectTaste')"
|
|
:placeholder="$t('device.pleaseSelectTaste')" @click="show = true" />
|
|
:placeholder="$t('device.pleaseSelectTaste')" @click="show = true" />
|
|
<van-popup v-model:show="show" round position="bottom">
|
|
<van-popup v-model:show="show" round position="bottom">
|
|
- <van-cascader v-model="cascaderValue" :title="$t('device.pleaseSelectAPattern')" :options="options"
|
|
|
|
|
|
+ <van-cascader v-model="cascaderValue" :title="$t('device.pleaseSelectTaste')" :options="options"
|
|
@close="show = false" @finish="onFinish">
|
|
@close="show = false" @finish="onFinish">
|
|
<template #option="{ option }">
|
|
<template #option="{ option }">
|
|
<div class="cascader-item">
|
|
<div class="cascader-item">
|
|
- <van-image :src="option.imgUrl" width="50px" height="50px"></van-image>
|
|
|
|
|
|
+ <van-image :src="option.imgUrl" width="55px" height="55px"></van-image>
|
|
<div class="cascader-label">{{ option.value }}</div>
|
|
<div class="cascader-label">{{ option.value }}</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -29,28 +51,27 @@
|
|
<van-button v-if="doSugartData" round type="primary" class="volumeChangeButton" :disabled="doSugartType"
|
|
<van-button v-if="doSugartData" round type="primary" class="volumeChangeButton" :disabled="doSugartType"
|
|
@click="checkData()">{{ $t('device.viewResults') }}</van-button>
|
|
@click="checkData()">{{ $t('device.viewResults') }}</van-button>
|
|
</div>
|
|
</div>
|
|
- <div v-else>
|
|
|
|
- <van-field v-model="fieldValue" is-link readonly :label="$t('device.clickToSelectPattern')"
|
|
|
|
- :placeholder="$t('device.pleaseSelectAPattern')" @click="show = true" />
|
|
|
|
|
|
+ <div v-if="machineType === '2'">
|
|
|
|
+ <van-field v-model="fieldValue" is-link readonly :label="$t('device.clickToSelectTaste')"
|
|
|
|
+ :placeholder="$t('device.pleaseSelectTaste')" @click="show = true" />
|
|
<van-popup v-model:show="show" round position="bottom">
|
|
<van-popup v-model:show="show" round position="bottom">
|
|
- <van-cascader v-model="cascaderValue" :title="$t('device.pleaseSelectAPattern')" :options="options"
|
|
|
|
|
|
+ <van-cascader v-model="cascaderValue" :title="$t('device.pleaseSelectTaste')" :options="options"
|
|
@close="show = false" @finish="onFinish">
|
|
@close="show = false" @finish="onFinish">
|
|
<template #option="{ option }">
|
|
<template #option="{ option }">
|
|
<div class="cascader-item">
|
|
<div class="cascader-item">
|
|
- <van-image :src="option.imgUrl" width="50px" height="50px"></van-image>
|
|
|
|
|
|
+ <van-image :src="option.imgUrl" width="55px" height="55px"></van-image>
|
|
<div class="cascader-label">{{ option.value }}</div>
|
|
<div class="cascader-label">{{ option.value }}</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</van-cascader>
|
|
</van-cascader>
|
|
</van-popup>
|
|
</van-popup>
|
|
<div class="textRow o-pr-20">
|
|
<div class="textRow o-pr-20">
|
|
- <span @click="pushToDaySugarList">{{ $t('device.todaysSugarList') }}>></span>
|
|
|
|
|
|
+ <span @click="pushToDaySugarList">{{ $t('device.todaysMakeList') }}>></span>
|
|
</div>
|
|
</div>
|
|
<div v-if="!doSugartData" class="block5 flex-col" @click="submitDoSugar"><span class="txt3">{{
|
|
<div v-if="!doSugartData" class="block5 flex-col" @click="submitDoSugar"><span class="txt3">{{
|
|
$t('device.submitToMakeSugar') }}</span></div>
|
|
$t('device.submitToMakeSugar') }}</span></div>
|
|
- <van-button v-if="doSugartData" style="padding: 1em;" round type="primary" class="block5 flex-col" :disabled="doSugartType"
|
|
|
|
|
|
+ <van-button v-if="doSugartData" round type="primary" class="volumeChangeButton" :disabled="doSugartType"
|
|
@click="checkData()">{{ $t('device.viewResults') }}</van-button>
|
|
@click="checkData()">{{ $t('device.viewResults') }}</van-button>
|
|
-
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -106,13 +127,57 @@ export default {
|
|
const getProduct = async () => {
|
|
const getProduct = async () => {
|
|
const { data } = await selectProducts({ equipmentId: deviceId });
|
|
const { data } = await selectProducts({ equipmentId: deviceId });
|
|
if (data.code) {
|
|
if (data.code) {
|
|
- options.value = data.data.map(item => {
|
|
|
|
- return {
|
|
|
|
- text: item.productName,
|
|
|
|
- value: item.productName,
|
|
|
|
- imgUrl: showSugarPhoto(item.no),
|
|
|
|
- };
|
|
|
|
- })
|
|
|
|
|
|
+ if(machineType != '2') {
|
|
|
|
+ options.value = data.data.map(item => {
|
|
|
|
+ return {
|
|
|
|
+ text: item.productName,
|
|
|
|
+ value: item.productName,
|
|
|
|
+ imgUrl: showSugarPhoto(item.no),
|
|
|
|
+ };
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ // data.data.map(item => {
|
|
|
|
+ // console.log("编号", item.no);
|
|
|
|
+ // if (item.no == 'I01') {
|
|
|
|
+ // return {
|
|
|
|
+ // text: item.productName,
|
|
|
|
+ // value: item.productName,
|
|
|
|
+ // imgUrl: showSugarPhoto(item.no),
|
|
|
|
+ // };
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
+ data.data.forEach(item => {
|
|
|
|
+ if (item.no == 'I01') {
|
|
|
|
+ options.value.push(
|
|
|
|
+ {
|
|
|
|
+ text: item.productName,
|
|
|
|
+ value: item.productName,
|
|
|
|
+ imgUrl: showSugarPhoto(item.no),
|
|
|
|
+ children: []
|
|
|
|
+ }
|
|
|
|
+ )
|
|
|
|
+ } else if (item.no.includes('J')) {
|
|
|
|
+ options.value[0].children.push(
|
|
|
|
+ {
|
|
|
|
+ text: item.productName,
|
|
|
|
+ value: item.productName,
|
|
|
|
+ imgUrl: showSugarPhoto(item.no),
|
|
|
|
+ children: [],
|
|
|
|
+ }
|
|
|
|
+ )
|
|
|
|
+ } else if (item.no.includes('C')) {
|
|
|
|
+ options.value[0].children.forEach(item1 => {
|
|
|
|
+ item1.children.push(
|
|
|
|
+ {
|
|
|
|
+ text: item.productName,
|
|
|
|
+ value: item.productName,
|
|
|
|
+ imgUrl: showSugarPhoto(item.no),
|
|
|
|
+ }
|
|
|
|
+ )
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
} else { showFailToast(data.message); }
|
|
} else { showFailToast(data.message); }
|
|
console.log(options.value);
|
|
console.log(options.value);
|
|
}
|
|
}
|
|
@@ -131,10 +196,24 @@ export default {
|
|
const checkData = async () => {
|
|
const checkData = async () => {
|
|
const { data } = await selectSugarStatus({ no: doSugartData.value.no });
|
|
const { data } = await selectSugarStatus({ no: doSugartData.value.no });
|
|
if (data.code) {
|
|
if (data.code) {
|
|
- showSuccessToast(data.message);
|
|
|
|
|
|
+ if (data.data == '1') {
|
|
|
|
+ showSuccessToast(t('device.receiveInstruction'));
|
|
|
|
+ } else {
|
|
|
|
+ showSuccessToast(data.message);
|
|
|
|
+ }
|
|
doSugartData.value = null;
|
|
doSugartData.value = null;
|
|
doSugartType.value = true;
|
|
doSugartType.value = true;
|
|
- } else { showToast(t('device.notUploadData')); }
|
|
|
|
|
|
+ } else {
|
|
|
|
+ if (data.data == '0') {
|
|
|
|
+ showToast(t('device.notUploadData'));
|
|
|
|
+ } else if (data.data == '2') {
|
|
|
|
+ showToast(t('device.machineException'));
|
|
|
|
+ } else if (data.data == '3') {
|
|
|
|
+ showToast(t('device.netException'));
|
|
|
|
+ } else {
|
|
|
|
+ showToast(data.message);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
};
|
|
};
|
|
|
|
|
|
const pushToDaySugarList = async () => {
|
|
const pushToDaySugarList = async () => {
|