فهرست منبع

feat:“冰淇淋SI320添加远程制作功能,优化首页其他选择单日统计功能”

soobin 1 سال پیش
والد
کامیت
c7430f44df

+ 6 - 2
src/assets/language/en.json

@@ -405,6 +405,9 @@
     "submitToMakeSugar": "Submit",
     "viewResults": "View Results",
     "notUploadData": "The machine did not upload data !",
+    "machineException": "The machine is abnormal, Please check the machine status.",
+    "netException": "Network exception !",
+    "receiveInstruction": "The machine has received instructions to make sugar.",
     "dataOverview": "Data Overview",
     "search": "search",
     "totalNumberOfRuns": "Total number of runs",
@@ -630,8 +633,9 @@
       "clientIdPlace": "Please select the equipment code",
       "myDistProport": "My distribution proportion",
       "distInof": "Distribution Information",
-      "platDistRange": "The distribution proportion range of the platform is0-100",
-      "distPropRange": "The distribution proportion range is0-100",
+      "platDistRange": "The distribution proportion range of the platform is 1-100",
+      "distPropRange": "The distribution proportion range is 0-100",
+      "noZero": "Platform distribution is a minimum of 1%",
       "notDelMore": "Can't delete any more",
       "submitSuccess": "Submit successfully",
       "submitFailed": "Submit failed",

+ 5 - 1
src/assets/language/zh.json

@@ -406,6 +406,9 @@
     "submitToMakeSugar": "提交",
     "viewResults": "查看结果",
     "notUploadData": "机器未上传数据",
+    "machineException": "机器异常,请检查机器状态",
+    "netException": "网络异常",
+    "receiveInstruction": "机器已接收到做糖指令",
     "dataOverview": "设备管理",
     "search": "搜索",
     "totalNumberOfRuns": "运行总数",
@@ -634,8 +637,9 @@
       "clientIdPlace": "请选择设备编码",
       "myDistProport": "我的分销比例",
       "distInof": "分销信息",
-      "platDistRange": "平台分销比例范围为0-100",
+      "platDistRange": "平台分销比例范围为1-100",
       "distPropRange": "分销比例范围为0-100",
+      "noZero": "平台分销比例最低为1%",
       "notDelMore": "不能再删除了",
       "submitSuccess": "提交成功",
       "submitFailed": "提交失败",

+ 1 - 1
src/components/dateSelectList/index.vue

@@ -115,7 +115,7 @@ export default {
         const diffDate = Math.abs(firstday - lastday);
         const totalDays = Math.floor(diffDate / (1000 * 3600 * 24));
         if (totalDays === 0) {
-          params.chartType = "days";
+          params.chartType = "day";
         } else if (dateUtil.isSameWeek(calendarDate[0], calendarDate[1])) {
           params.chartType = "week";
         } else {

+ 1 - 1
src/views/device/deviceOper.vue

@@ -64,7 +64,7 @@
         <div class="operText">{{ $t("device.remoteDoorOpening") }}</div>
       </div>
       <!-- 远程做糖 -->
-      <div class="operItem" @click="doSugar()" v-if="device.equimentType != 'SI320'">
+      <div class="operItem" @click="doSugar()">
         <div class="operIcon">
           <img class="operImg" src="../../assets/device/operIcon/doSugar.png" />
         </div>

+ 98 - 19
src/views/device/doSugar.vue

@@ -7,15 +7,37 @@
         <div class="block3 flex-col"></div>
         <span class="info2">{{ $t('device.equipmentName') }}:{{ deviceDetal ? deviceDetal.name : '' }}</span>
       </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'">
         <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-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">
             <template #option="{ option }">
               <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>
             </template>
@@ -29,28 +51,27 @@
         <van-button v-if="doSugartData" round type="primary" class="volumeChangeButton" :disabled="doSugartType"
           @click="checkData()">{{ $t('device.viewResults') }}</van-button>
       </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-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">
             <template #option="{ option }">
               <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>
             </template>
           </van-cascader>
         </van-popup>
         <div class="textRow o-pr-20">
-          <span @click="pushToDaySugarList">{{ $t('device.todaysSugarList') }}>></span>
+          <span @click="pushToDaySugarList">{{ $t('device.todaysMakeList') }}>></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"
+        <van-button v-if="doSugartData" round type="primary" class="volumeChangeButton" :disabled="doSugartType"
           @click="checkData()">{{ $t('device.viewResults') }}</van-button>
-
       </div>
     </div>
   </div>
@@ -106,13 +127,57 @@ export default {
     const getProduct = async () => {
       const { data } = await selectProducts({ equipmentId: deviceId });
       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); }
       console.log(options.value);
     }
@@ -131,10 +196,24 @@ export default {
     const checkData = async () => {
       const { data } = await selectSugarStatus({ no: doSugartData.value.no });
       if (data.code) {
-        showSuccessToast(data.message);
+        if (data.data == '1') {
+          showSuccessToast(t('device.receiveInstruction'));
+        } else {
+          showSuccessToast(data.message);
+        }
         doSugartData.value = null;
         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 () => {

+ 4 - 0
src/views/distributionSet/detail.vue

@@ -176,6 +176,10 @@ export default {
     ])
     // 点击提交审批按钮
     const onSubmit = () => {
+      if (cofficentForm.distProp == '0') {
+        showToast(t('distributionSet.addDist.noZero'));
+        return;
+      }
       let param = {
         adminId: user.id,
         clientId: cofficentForm.clientId,