sunyadv před 5 roky
rodič
revize
bf2ad61e7a

+ 5 - 0
ys_int/package-lock.json

@@ -8957,6 +8957,11 @@
       "integrity": "sha512-KmvZVtmM26BQOMK1rwUZsrqxEGeKiYSZGA7SNWE6uExx8UX/cj9hq2MRV/wWC3Cq6AoeDGk57rL9YMFRel/q+g==",
       "dev": true
     },
+    "vue-i18n": {
+      "version": "8.14.0",
+      "resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-8.14.0.tgz",
+      "integrity": "sha512-utI1Rvc8i+fmmUkkKRmHaf4QQ87s7rGVL5ZZLsKvvRzmgaIr1l+GfGxxxRmsZxHpPlgeB8OxoUZ4noqZgDL6xg=="
+    },
     "vue-loader": {
       "version": "11.3.4",
       "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-11.3.4.tgz",

+ 1 - 0
ys_int/package.json

@@ -17,6 +17,7 @@
     "nprogress": "^0.2.0",
     "vue": "^2.6.10",
     "vue-clipboard2": "^0.3.0",
+    "vue-i18n": "^8.14.0",
     "vue-router": "^2.3.0",
     "vuex": "^2.0.0-rc.6"
   },

+ 1 - 0
ys_int/src/common/js/util.js

@@ -55,6 +55,7 @@ export default {
         },
         dateDiff: function(sDate1, sDate2) {
             var aDate, oDate1, oDate2, iDays
+            sDate1 = sDate1.split(" ")[0];
             aDate = sDate1.split("-")
             oDate1 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0]);
             aDate = sDate2.split("-")

+ 2 - 1
ys_int/src/views/base/allocation.vue

@@ -312,7 +312,8 @@
                                 list[i].diffTime = "";
                             } else {
                                 list[i].diffTime = util.formatDate.dateDiff(
-                                    util.formatDate.format(new Date(list[i].endTime), 'yyyy-MM-dd'), 
+                                    // util.formatDate.format(new Date(list[i].endTime), 'yyyy-MM-dd'), 
+                                    list[i].endTime,
                                     util.formatDate.format(new Date(new Date()), 'yyyy-MM-dd')
                                 );
                             }

+ 1 - 1
ys_int/src/views/detection/detection.vue

@@ -63,7 +63,7 @@
       </el-table-column>
       <el-table-column label="处理" align="center" width="85">
         <template slot-scope="scope">
-          <el-button type="primary" @click="toMaintenance(scope.row.id)">详情</el-button>
+          <el-button size="small" type="primary" @click="toMaintenance(scope.row.id)">详情</el-button>
         </template>
       </el-table-column>
     </el-table>

+ 167 - 198
ys_int/src/views/detection/maintenance.vue

@@ -1,204 +1,173 @@
 <template>
-  <section>
-    <!--工具条-->
-    <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
-      <el-form :inline="true">
-        <el-form-item>
-          <el-button type="text" @click="backToDetection" icon="el-icon-back" class="back">返回</el-button>
-        </el-form-item>
-        <el-form-item class="divLine"></el-form-item>
-        <el-form-item>{{mouldName}}</el-form-item>
-        <el-form-item class="state" style="float: right;">
-          当前状态:
-          <span v-if="mouldState == 0">静止</span>
-          <span v-else-if="mouldState == 1">运行</span>
-          <!-- 因为目前还不知道mouldState的意义 -->
-          <span v-else>不明</span>
-        </el-form-item>
-      </el-form>
-    </el-col>
-    <!-- v-if="requirement" -->
-    <!-- 模具处理 -->
-    <el-col :span="24" class="title">模具处理</el-col>
-    <el-col :span="6" style="line-height: 32px; border-right: #c3c3c3 1px solid;">
-      当前保养状态:
-      <span v-if="requirement" style="color: #ff4949;">需要</span>
-      <span v-else style="color: black;">正常</span>
-      <el-button
-        size="small"
-        type="primary"
-        @click="showMaintenance"
-        v-if="!(user.parentId == 1 && user.subordinateType == 1) && requirement"
-        style="margin-left: 16px;"
-      >立即处理</el-button>
-    </el-col>
-    <el-col :span="8" :offset="2" style="line-height: 32px;">
-      云模盒告警:{{warningInfo}}
-      <el-button
-        size="small"
-        v-if="!(user.parentId == 1 && user.subordinateType == 1) && stage != 0"
-        @click="warningFormVisible = true"
-        type="primary"
-        style="margin-left: 16px;"
-      >立即处理</el-button>
-    </el-col>
+    <section>
+        <!--工具条-->
+        <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
+            <el-form :inline="true">
+                <el-form-item>
+                    <el-button type="text" @click="backToDetection" icon="el-icon-back" class="back">返回</el-button>
+                </el-form-item>
+                <el-form-item class="divLine"></el-form-item>
+                <el-form-item>{{mouldName}}</el-form-item>
+                <el-form-item class="state" style="float: right;">当前状态:
+                    <span v-if="mouldState == 0">静止</span>
+                    <span v-else-if="mouldState == 1">运行</span>
+                    <!-- 因为目前还不知道mouldState的意义 -->
+                    <span v-else>不明</span>
+                </el-form-item>
+            </el-form>
+        </el-col>
+        <!-- v-if="requirement" -->
+        <!-- 模具处理 -->
+        <el-col :span="24" class="title">模具处理</el-col>
+        <el-col :span="6" style="line-height: 32px; border-right: #c3c3c3 1px solid;">
+            当前保养状态:
+            <span v-if="requirement" style="color: #ff4949;">需要</span>
+            <span v-else style="color: black;">正常</span>
+            <el-button size="small" type="primary" 
+                @click="showMaintenance" 
+                v-if="!(user.parentId == 1 && user.subordinateType == 1) && requirement" style="margin-left: 16px;">
+                立即处理
+            </el-button>
+        </el-col>
+        <el-col :span="8" :offset="2" style="line-height: 32px;">
+            云模盒告警:{{warningInfo}}
+            <el-button size="small" type="primary"
+                v-if="!(user.parentId == 1 && user.subordinateType == 1) && stage != 0"
+                @click="warningFormVisible = true" style="margin-left: 16px;">
+                立即处理
+            </el-button>
+        </el-col>
 
-    <!-- 操作记录 -->
-    <el-col :span="24" class="title">处理记录</el-col>
-    <!-- 列表 -->
-    <el-table :data="records" highlight-current-row v-loading="listLoading" style="width: 100%;" :height="tableHeight">
-      <el-table-column type="index" width="60"></el-table-column>
-      <el-table-column prop="maintainUserName" label="保养人" width="100" sortable></el-table-column>
-      <el-table-column prop="maintainType" label="保养方案" sortable></el-table-column>
-      <el-table-column prop="fileName" label="保养照片" width="200" sortable>
-        <template slot-scope="scope" v-if="scope.row.fileUrl != null">
-          <a
-            style="color: #409EFF; cursor: pointer; text-decoration: none;"
-            :href="scope.row.fileUrl"
-            :download="scope.row.fileName"
-          >
-            <!-- 大图加载 -->
-            <div class="demo-image__preview">
-              <el-image
-                style="width: 100px; height: 100px"
-                :src="scope.row.fileUrl"
-                :preview-src-list="scope.row.fileUrl"
-              ></el-image>
-            </div>
-          </a>
-        </template>
-      </el-table-column>
-      <el-table-column prop="indate" label="关闭时间" width="200" sortable></el-table-column>
-    </el-table>
+        <!-- 操作记录 -->
+        <el-col :span="24" class="title">处理记录</el-col>
+        <!-- 列表 -->
+        <el-table :data="records" highlight-current-row v-loading="listLoading" style="width: 100%;" :height="tableHeight">
+            <el-table-column type="index" width="60"></el-table-column>
+            <el-table-column prop="maintainUserName" label="保养人" width="100" sortable></el-table-column>
+            <el-table-column prop="maintainType" label="保养方案" sortable></el-table-column>
+            <el-table-column prop="fileName" label="保养照片" width="200" sortable>
+                <template slot-scope="scope" v-if="scope.row.fileUrl != null">
+                    <a style="color: #409EFF; cursor: pointer; text-decoration: none;"
+                        :href="scope.row.fileUrl" :download="scope.row.fileName">
+                        <!-- 大图加载 -->
+                        <div class="demo-image__preview">
+                        <el-image style="width: 100px; height: 100px"
+                            :src="scope.row.fileUrl" :preview-src-list="scope.row.fileUrl"></el-image>
+                        </div>
+                    </a>
+                </template>
+            </el-table-column>
+            <el-table-column prop="indate" label="关闭时间" width="200" sortable></el-table-column>
+        </el-table>
 
-    <!--工具条-->
-    <el-col :span="24" class="toolbar">
-      <el-pagination
-        @size-change="handleSizeChange"
-        @current-change="handleCurrentChange"
-        :page-sizes="[20 , 50 , 80 , 100 , 200]"
-        :page-size="20"
-        layout="total, sizes, prev, pager, next"
-        :total="total"
-        style="float:right;"
-      ></el-pagination>
-    </el-col>
+        <!--工具条-->
+        <el-col :span="24" class="toolbar">
+            <el-pagination
+                @size-change="handleSizeChange"
+                @current-change="handleCurrentChange"
+                :page-sizes="[20 , 50 , 80 , 100 , 200]"
+                :page-size="20"
+                layout="total, sizes, prev, pager, next"
+                :total="total"
+                style="float:right;"
+            ></el-pagination>
+        </el-col>
 
-    <!--新增界面-->
-    <el-dialog
-      title="处理保养"
-      v-if="maintenanceFormVisible"
-      :visible.sync="maintenanceFormVisible"
-      :close-on-click-modal="false"
-      customClass="customWidth"
-    >
-      <el-form
-        :model="maintenanceForm"
-        label-width="100px"
-        :rules="formRules"
-        ref="addForm"
-        :inline="true"
-        class="demo-form-inline"
-      >
-        <el-form-item label="保养类型" prop="type">
-          <!-- 保养类型选择 -->
-          <el-select v-model="type.value" filterable placeholder="请选择保养类型" style="width:202px">
-            <el-option
-              v-for="item in type"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value"
-            ></el-option>
-          </el-select>
-        </el-form-item>
-        <!-- 保养类型为1时 选择易损件ID -->
-        <el-form-item v-if="type.value == 1" label="选择易损件" prop="vulnerable">
-          <el-select
-            v-model="vulnerable.value"
-            clearable
-            filterable
-            placeholder="请选择易损件"
-            style="width:202px"
-          >
-            <el-option
-              v-for="item in vulnerable"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value"
-            ></el-option>
-          </el-select>
-        </el-form-item>
-        <!-- 保养类型为0时 选择保养动作 -->
-        <el-form-item v-else label="选择动作" prop="action">
-          <el-select v-model="action.value" filterable placeholder="请选择动作" style="width:202px">
-            <el-option
-              v-for="item in action"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value"
-            ></el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="选择照片">
-          <el-upload
-            ref="upload"
-            action="customize"
-            :http-request="maintain"
-            :limit="1"
-            :auto-upload="false"
-            :before-upload="beforeUpload"
-          >
-            <el-button size="small" type="primary">上传</el-button>
-          </el-upload>
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button @click.native="maintenanceFormVisible = false">取消</el-button>
-        <el-button type="primary" @click.native="maintainConfirm" :loading="maintenanceLoading">立即处理</el-button>
-      </div>
-    </el-dialog>
+        <!--新增界面-->
+        <el-dialog title="处理保养" v-if="maintenanceFormVisible" :visible.sync="maintenanceFormVisible" :close-on-click-modal="false" customClass="customWidth">
+            <el-form :model="maintenanceForm" label-width="100px" :rules="formRules" ref="addForm" :inline="true" class="demo-form-inline">
+                <el-form-item label="保养类型" prop="type">
+                <!-- 保养类型选择 -->
+                <el-select v-model="type.value" filterable placeholder="请选择保养类型" style="width:202px">
+                    <el-option
+                    v-for="item in type"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                    ></el-option>
+                </el-select>
+                </el-form-item>
+                <!-- 保养类型为1时 选择易损件ID -->
+                <el-form-item v-if="type.value == 1" label="选择易损件" prop="vulnerable">
+                <el-select
+                    v-model="vulnerable.value"
+                    clearable
+                    filterable
+                    placeholder="请选择易损件"
+                    style="width:202px"
+                >
+                    <el-option
+                    v-for="item in vulnerable"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                    ></el-option>
+                </el-select>
+                </el-form-item>
+                <!-- 保养类型为0时 选择保养动作 -->
+                <el-form-item v-else label="选择动作" prop="action">
+                    <el-select v-model="action.value" filterable placeholder="请选择动作" style="width:202px">
+                        <el-option
+                        v-for="item in action"
+                        :key="item.value"
+                        :label="item.label"
+                        :value="item.value"
+                        ></el-option>
+                    </el-select>
+                </el-form-item>
+                <el-form-item label="选择照片">
+                <el-upload ref="upload" action="customize" :http-request="maintain" :limit="1" :auto-upload="false" :before-upload="beforeUpload">
+                    <el-button size="small" type="primary">上传</el-button>
+                </el-upload>
+                </el-form-item>
+            </el-form>
+            <div slot="footer" class="dialog-footer">
+                <el-button @click.native="maintenanceFormVisible = false">取消</el-button>
+                <el-button type="primary" @click.native="maintainConfirm" :loading="maintenanceLoading">立即处理</el-button>
+            </div>
+        </el-dialog>
 
-    <!--告警处理界面-->
-    <el-dialog
-      title="告警处理"
-      v-if="warningFormVisible"
-      :visible.sync="warningFormVisible"
-      :close-on-click-modal="false"
-      customClass="customWidth"
-    >
-      <el-form
-        :model="warningForm"
-        label-width="100px"
-        :rules="formRules"
-        ref="addForm"
-        :inline="true"
-        class="demo-form-inline"
-      >
-        <el-form-item label="报警类型">
-          <el-input placeholder="报警类型" v-model="warningInfo" :disabled="true"></el-input>
-        </el-form-item>
-        <el-form-item label="云模盒设置" prop="action">
-          <el-select
-            v-model="warningForm.equipmentId"
-            filterable
-            placeholder="请选择云模盒"
-            style="width:202px"
-          >
-            <el-option
-              v-for="item in equipments"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value"
-            ></el-option>
-          </el-select>
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button @click.native="warningArrangement = false">取消</el-button>
-        <el-button type="primary" @click.native="warningArrangement" :loading="warningLoading">立即处理</el-button>
-      </div>
-    </el-dialog>
-  </section>
+        <!--告警处理界面-->
+        <el-dialog
+        title="告警处理"
+        v-if="warningFormVisible"
+        :visible.sync="warningFormVisible"
+        :close-on-click-modal="false"
+        customClass="customWidth"
+        >
+        <el-form
+            :model="warningForm"
+            label-width="100px"
+            :rules="formRules"
+            ref="addForm"
+            :inline="true"
+            class="demo-form-inline"
+        >
+            <el-form-item label="报警类型">
+            <el-input placeholder="报警类型" v-model="warningInfo" :disabled="true"></el-input>
+            </el-form-item>
+            <el-form-item label="云模盒设置" prop="action">
+            <el-select
+                v-model="warningForm.equipmentId"
+                filterable
+                placeholder="请选择云模盒"
+                style="width:202px"
+            >
+                <el-option
+                v-for="item in equipments"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+                ></el-option>
+            </el-select>
+            </el-form-item>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+            <el-button @click.native="warningArrangement = false">取消</el-button>
+            <el-button type="primary" @click.native="warningArrangement" :loading="warningLoading">立即处理</el-button>
+        </div>
+        </el-dialog>
+    </section>
 </template>
 
 <script>
@@ -217,8 +186,8 @@ export default {
       //记录
       records: [],
       //警告信息
-      warningInfo: "低电量、过热",
-      stage: null,
+      warningInfo: "",
+      stage: 0,
       //告警时需要更换的设备的列表
       equipments: [
         { value: 1, label: "临时设备1" },

+ 2 - 1
ys_int/src/views/mold/moldDetail.vue

@@ -800,7 +800,8 @@
                             detail.diffTime = "";
                         } else {
                             detail.diffTime = util.formatDate.dateDiff(
-                                util.formatDate.format(new Date(detail.endTime), "yyyy-MM-dd"),
+                                // util.formatDate.format(new Date(detail.endTime), "yyyy-MM-dd"),
+                                detail.endTime,
                                 util.formatDate.format(new Date(new Date()), "yyyy-MM-dd")
                             );
                         }

+ 3 - 1
ys_int/src/views/mold/moldList.vue

@@ -197,6 +197,7 @@
                 },
                 listLoading: false,
                 total: 0,
+                size: 20,
                 tableHeight: 0,
 
                 boxes: [],
@@ -318,7 +319,8 @@
                                 list[i].diffTime = "";
                             } else {
                                 list[i].diffTime = util.formatDate.dateDiff(
-                                    util.formatDate.format(new Date(list[i].endTime), 'yyyy-MM-dd'), 
+                                    // util.formatDate.format(new Date(list[i].endTime), 'yyyy-MM-dd'), 
+                                    list[i].endTime,
                                     util.formatDate.format(new Date(new Date()), 'yyyy-MM-dd')
                                 );
                             }

+ 3 - 3
ys_int/src/views/project/projectDetail.vue

@@ -237,10 +237,10 @@
 		<el-dialog title="新增人员" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass='customWidth'>
 			<el-form :model="addForm" label-width="100px" :rules="formRules" ref="addForm" :inline="true" class="demo-form-inline">
 				<el-form-item label="姓名" prop="username">
-					<el-input v-model="addForm.username" autocomplete="off" placeholder="请输入姓名"></el-input>
+					<el-input v-model="addForm.username" autocomplete="off" placeholder="请输入姓名" style="width:202px"></el-input>
 				</el-form-item>
 				<el-form-item label="手机号" prop="account">
-					<el-input v-model="addForm.account" autocomplete="off" placeholder="请输入手机号(登录账号)"></el-input>
+					<el-input v-model="addForm.account" autocomplete="off" placeholder="请输入手机号(登录账号)" style="width:202px"></el-input>
 				</el-form-item>
                 <el-form-item label="公司" prop="companyId">
 					<el-select v-model="addForm.companyId" clearable filterable placeholder="请选择所属公司" style="width:202px">
@@ -249,7 +249,7 @@
                     </el-select>
 				</el-form-item>
                 <el-form-item label="备注">
-                    <el-input v-model="addForm.roleName" autocomplete="off" placeholder="请输入备注"></el-input>
+                    <el-input v-model="addForm.roleName" autocomplete="off" placeholder="请输入备注" style="width:202px"></el-input>
 				</el-form-item>
 			</el-form>
 			<div slot="footer" class="dialog-footer">

+ 2 - 1
ys_vue/src/common/js/util.js

@@ -54,7 +54,8 @@ export default {
             return null;
         },
         dateDiff: function(sDate1, sDate2) {
-            var aDate, oDate1, oDate2, iDays
+            var aDate, oDate1, oDate2, iDays;
+            sDate1 = sDate1.split(" ")[0];
             aDate = sDate1.split("-")
             oDate1 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0]);
             aDate = sDate2.split("-")

+ 2 - 1
ys_vue/src/views/base/allocation.vue

@@ -312,7 +312,8 @@
                                 list[i].diffTime = "";
                             } else {
                                 list[i].diffTime = util.formatDate.dateDiff(
-                                    util.formatDate.format(new Date(list[i].endTime), 'yyyy-MM-dd'), 
+                                    //util.formatDate.format(new Date(list[i].endTime), 'yyyy-MM-dd'), 
+                                    list[i].endTime,
                                     util.formatDate.format(new Date(new Date()), 'yyyy-MM-dd')
                                 );
                             }

+ 2 - 1
ys_vue/src/views/mold/moldDetail.vue

@@ -800,7 +800,8 @@
                             detail.diffTime = "";
                         } else {
                             detail.diffTime = util.formatDate.dateDiff(
-                                util.formatDate.format(new Date(detail.endTime), "yyyy-MM-dd"),
+                                // util.formatDate.format(new Date(detail.endTime), "yyyy-MM-dd"),
+                                detail.endTime,
                                 util.formatDate.format(new Date(new Date()), "yyyy-MM-dd")
                             );
                         }

+ 3 - 1
ys_vue/src/views/mold/moldList.vue

@@ -197,6 +197,7 @@
                 },
                 listLoading: false,
                 total: 0,
+                size: 20,
                 tableHeight: 0,
 
                 boxes: [],
@@ -318,7 +319,8 @@
                                 list[i].diffTime = "";
                             } else {
                                 list[i].diffTime = util.formatDate.dateDiff(
-                                    util.formatDate.format(new Date(list[i].endTime), 'yyyy-MM-dd'), 
+                                    // util.formatDate.format(new Date(list[i].endTime), 'yyyy-MM-dd'), 
+                                    list[i].endTime,
                                     util.formatDate.format(new Date(new Date()), 'yyyy-MM-dd')
                                 );
                             }