zhangjie 1 year ago
parent
commit
f9df9c810a

+ 2 - 2
src/utils/filter.js

@@ -55,8 +55,8 @@ export function timestampFilter(val, fmt = 'mm') {
   // fmt: dd or yyyy-MM-dd
   const formats = {
     dd: 'yyyy-MM-dd',
-    mm: 'yyyy-MM-dd hh:mm',
-    ss: 'yyyy-MM-dd hh:mm:ss',
+    mm: 'yyyy/MM/dd hh:mm',
+    ss: 'yyyy/MM/dd hh:mm:ss',
   };
   return val ? dateFormat(val, formats[fmt] || fmt) : DEFAULT_FIELD;
 }

+ 10 - 4
src/utils/request.js

@@ -10,10 +10,16 @@ import router from '@/router';
 import { initSyncTime, fetchTime } from './syncServerTime';
 import { cookie } from '@/utils/tool';
 
-if (!cookie.get('deviceId')) {
-  cookie.set('deviceId', MD5(Math.random() + '-' + Date.now()));
+function getDeviceId() {
+  let deviceId = cookie.get('deviceId');
+  if (deviceId) return deviceId;
+
+  if (!deviceId) {
+    deviceId = MD5(Math.random() + '-' + Date.now());
+    cookie.set('deviceId', deviceId);
+    return deviceId;
+  }
 }
-const DEVICE_ID = cookie.get('deviceId');
 
 function setAuth(config) {
   let userSession = sessionStorage.getItem('user');
@@ -144,7 +150,7 @@ function createRequest(service) {
     const env = import.meta.env;
     let headers = {
       'platform': 'WEB',
-      'deviceId': DEVICE_ID,
+      'deviceId': getDeviceId(),
       ...(config.headers || {}),
       'Content-Type': get(
         config,

+ 10 - 2
src/views/sop/components/dynamic-form-item/device-table/edit-column-dialog.vue

@@ -30,7 +30,14 @@
         ></t-select>
       </t-form-item>
       <t-form-item v-if="!isOutType" label="总扫描量" name="scanCount">
-        <t-input v-model="formData.inOutType"></t-input>
+        <t-input-number
+          v-model="formData.scanCount"
+          theme="column"
+          :decimalPlaces="1"
+          :max="100000000"
+          :min="0"
+          style="width: 120px"
+        ></t-input-number>
       </t-form-item>
       <t-form-item
         v-if="isOutType"
@@ -80,7 +87,7 @@ const formData = reactive({
   deviceNo: '',
   supplierName: '',
   deviceStatus: '',
-  scanCount: '',
+  scanCount: null,
   location: '',
   address: '',
   addressArr: ['', '', ''],
@@ -147,6 +154,7 @@ const imgChange = (fileRes) => {
 const deviceChange = (val, { option }) => {
   formData.supplierName = option.supplierName;
   formData.deviceStatus = option.deviceStatus;
+  formData.deviceBrand = option.deviceBrand;
   formData.scanCount = option.scanCount;
   formData.location = option.location;
   if (!props.isOutType) {

+ 1 - 0
src/views/sop/components/dynamic-form-item/device-table/index.vue

@@ -129,6 +129,7 @@ const handleAdd = () => {
     deviceNo: '',
     supplierName: '',
     deviceStatus: '',
+    deviceBrand: '',
     scanCount: '',
     location: '',
     address: '',