Przeglądaj źródła

1.日执行增加了编辑功能;2.修改了撒料计划名称全部显示;3。统计分析新增了配方统计页面

段小段 1 rok temu
rodzic
commit
78d79b9a86

+ 4 - 2
.env.development

@@ -6,7 +6,9 @@ ENV = 'development'
 # VUE_APP_BASE_API = 'http://210.16.189.72:8081/'
 
 
-VUE_APP_BASE_API = 'http://kpttest.kptyun.com/'
+# VUE_APP_BASE_API = 'http://kpttest.kptyun.com/'
+# VUE_APP_BASE_API = 'http://kpttestnt.kptyun.com/'
+
 
 # VUE_APP_BASE_API = 'http://tmrwatch.cn/'
 
@@ -20,7 +22,7 @@ VUE_APP_BASE_API = 'http://kpttest.kptyun.com/'
 
 
 # 白少杰
-# VUE_APP_BASE_API = 'http://192.168.1.77:8081/'
+VUE_APP_BASE_API = 'http://192.168.1.77:8081/'
 
 # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
 # to control whether the babel-plugin-dynamic-import-node plugin is enabled.

BIN
dist.zip


BIN
src/assets/cow.jpg


BIN
src/assets/images/index/row-bg1.png


BIN
src/assets/images/index/row-l1.png


BIN
src/assets/images/index/row-l2.png


BIN
src/assets/images/index/row-r1.png


BIN
src/assets/images/index/row-r10.png


BIN
src/assets/images/index/row-r7.png


BIN
src/assets/images/index/row-r8.png


BIN
src/assets/images/index/row-r9.png


BIN
src/assets/images/materiallssuancePlan/bg1.png


BIN
src/assets/images/nlogin-bg3.png


+ 1 - 1
src/store/getters.js

@@ -3,7 +3,7 @@ const getters = {
   device: state => state.app.device,
   token: state => state.user.token,
   avatar: state => state.user.avatar,
-  name: state => state.user.name,
+  username: state => state.user.username,
   roles: state => state.user.roles,
   buttons: state => state.user.buttons,
   pastureid: state => state.user.pastureid,

+ 2 - 2
src/views/console/menu/index.vue

@@ -254,7 +254,6 @@ export default {
       this.listLoading = true
       GetDataByName(this.getListParm).then(response => {
         if (response.data.list !== null) {
-          console.log(this.list, '-----------------')
           for (var i = 0; i < response.data.list.length; i++) {
             response.data.list[i].enable = parseInt(response.data.list[i].enable)
           }
@@ -270,7 +269,8 @@ export default {
     getDownList() {
       GetDataByName(this.getRecuListParm).then(response => {
         if (response.data.list !== null) {
-          this.parentmenu = transData(response.data.list, 'id', 'parentid', 'children')
+          this.parentmenu = transData(response.data.list, 'id', 'parentid', 'children')
+          console.log(this.parentmenu,'===')
         }
       })
     },

+ 378 - 77
src/views/formulationPlan/dailyExecutionPlan/index.vue

@@ -29,7 +29,8 @@
         </el-select>
         <el-select v-model="table.getdataListParm.parammaps.iscompleted" filterable placeholder="执行状态" class="filter-item" style="width: 120px;" :clearable="false">
           <el-option v-for="item in iscompletedList" :key="item.value" :label="item.lable" :value="item.value" />
-        </el-select>
+        </el-select>
+        <el-button class="successBorder" @click="form_search">查询</el-button>
         <el-button class="export" icon="el-icon-upload2" @click="handleExport">导出</el-button>
         <el-button class="export" icon="el-icon-upload2" @click="handlePrint">打印</el-button>
         <el-button class="export" style="margin-left: -5px;" @click="form_deleteRecord">删除记录</el-button>
@@ -45,12 +46,10 @@
         </div>
         <el-button v-if="isRoleEdit" class="success" icon="el-icon-open" @click="handleTakeEffect">生效</el-button>
         <el-button v-if="isRoleEdit" class="danger" icon="el-icon-turn-off" @click="handleDisable">禁用</el-button>
-
-
         <el-button v-if="dataSynchronization2.isDataSynchronization" class="success" icon="el-icon-plus" @click="form_updata">上传计划</el-button>
-
-
-        <el-button v-if="dataSynchronization.isDataSynchronization && isRoleEdit" class="success" @click="handleDataSynchronization">数据同步</el-button>
+        <el-button v-if="dataSynchronization.isDataSynchronization && isRoleEdit" class="success" @click="handleDataSynchronization">数据同步</el-button>
+        <el-button v-if="dataSynchronization3.isDataSynchronization&&isRoleEdit" class="success" @click="handleDataUpload">数据上传</el-button>
+        <el-button v-if="isRoleEdit" class="danger" icon="el-icon-delete" @click="handleDelete">删除</el-button>
       </div>
       <!-- 日执行计划 -->
       <div class="table">
@@ -87,9 +86,12 @@
               <span>{{ scope.row.tmrtname }}</span>
             </template>
           </el-table-column>
-          <el-table-column label="驾驶员" min-width="80px" align="center">
+          <el-table-column label="驾驶员" min-width="150px" align="center">
             <template slot-scope="scope">
-              <span>{{ scope.row.driver }}</span>
+              <!-- <span>{{ scope.row.driver }}</span> -->
+              <el-select v-model="scope.row.driverId" :disabled="scope.row.havebutton == 1" filterable placeholder="驾驶员" class="filter-item" style="width:95%;padding:10px 0;" :clearable="false"  @change="(value)=> {changeDriver(value, scope.row)}">
+                <el-option v-for="item in driverList" :key="item.id" :label="item.drivername" :value="item.id" />
+              </el-select>
             </template>
           </el-table-column>
           <el-table-column label="已执行" min-width="70px" align="center">
@@ -173,25 +175,35 @@
                 class="elTable table-fixed"
                 :span-method="objectSpanMethod"
               >
-                <el-table-column label="操作序号" min-width="130px" align="center">
+                <el-table-column label="操作序号" width="90px" align="center">
                   <template slot-scope="scope">
                     <span>{{ scope.row.sort }}</span>
                   </template>
                 </el-table-column>
-                <el-table-column label="饲料名称" prop="fname" min-width="130px" align="center">
+                <el-table-column label="饲料名称" prop="fname" min-width="90px" align="center">
                   <template slot-scope="scope">
                     <span>{{ scope.row.fname }}</span>
                   </template>
                 </el-table-column>
                 <el-table-column label="设计重量(KG)" prop="weight" min-width="130px" align="center">
-                  <template slot-scope="scope">
-                    <span>{{ scope.row.weight }}</span>
+                  <template slot-scope="scope">
+                    <span v-if="scope.row.NoEdit">{{ scope.row.weight }}</span>
+                    <el-input v-if="scope.row.Edit" v-model="scope.row.weight"  type="number" maxlength="32" style="width:95%;padding:10px 0;" />
                   </template>
                 </el-table-column>
-                <el-table-column label="小计" prop="description" min-width="130px" align="center">
+                <el-table-column label="小计" prop="description" min-width="90px" align="center">
                   <template slot-scope="scope">
                     <span>{{ scope.row.subtotal }}</span>
                   </template>
+                </el-table-column>
+                <el-table-column label="操作" align="left" min-width="200" class-name="small-padding">
+                  <template slot-scope="{row}">
+                    <el-button v-if="row.isUpdate && isRoleEdit" :disabled="table2.getdataListParm.parammaps.havebutton == 1" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate2(row)" />
+                    <span v-if="row.isUpdate && isRoleEdit" class="centerSpan">|</span>
+                    <el-button v-if="row.isUpdateSave" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="updateData2(row,'0')" />
+                    <span v-if="row.isUpdateSave" class="centerSpan">|</span>
+                    <el-button v-if="row.isUpdateSave" class="minCancel" icon="el-icon-close" @click="updateCancel2(row)" />
+                  </template>
                 </el-table-column>
               </el-table>
             </div>
@@ -224,25 +236,34 @@
                 class="elTable table-fixed"
                 :span-method="objectSpanMethod"
               >
-                <el-table-column label="操作序号" min-width="130px" align="center">
+                <el-table-column label="操作序号" min-width="90px" align="center">
                   <template slot-scope="scope">
                     <span>{{ scope.row.sort }}</span>
                   </template>
                 </el-table-column>
-                <el-table-column label="饲料名称" prop="fname" min-width="130px" align="center">
+                <el-table-column label="饲料名称" prop="fname" min-width="90px" align="center">
                   <template slot-scope="scope">
                     <span>{{ scope.row.fname }}</span>
                   </template>
                 </el-table-column>
                 <el-table-column label="设计重量(KG)" prop="weight" min-width="130px" align="center">
                   <template slot-scope="scope">
-                    <span>{{ scope.row.weight }}</span>
+                    <span v-if="scope.row.NoEdit">{{ scope.row.weight }}</span>
+                    <el-input v-if="scope.row.Edit" v-model="scope.row.weight"  type="number" maxlength="32" style="width:95%;padding:10px 0;" />
                   </template>
                 </el-table-column>
-                <el-table-column label="小计" prop="description" min-width="130px" align="center">
+                <el-table-column label="小计" prop="description" min-width="90px" align="center">
                   <template slot-scope="scope">
                     <span>{{ scope.row.subtotal }}</span>
                   </template>
+                </el-table-column>
+                <el-table-column label="操作" align="left" min-width="200" class-name="small-padding">
+                  <template slot-scope="{row}">
+                    <el-button v-if="row.isUpdate && isRoleEdit" :disabled="table2.getdataListParm.parammaps.havebutton == 1" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate2(row)" />
+                    <el-button v-if="row.isUpdateSave" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="updateData2(row,'0')" />
+                    <span v-if="row.isUpdateSave" class="centerSpan">|</span>
+                    <el-button v-if="row.isUpdateSave" class="minCancel" icon="el-icon-close" @click="updateCancel2(row)" />
+                  </template>
                 </el-table-column>
               </el-table>
             </div>
@@ -268,20 +289,29 @@
                 :cell-style="cellStyle"
                 class="elTable table-fixed"
               >
-                <el-table-column label=" 操作序号" min-width="130px" align="center">
+                <el-table-column label=" 操作序号" min-width="90px" align="center">
                   <template slot-scope="scope">
                     <span>{{ scope.row.sort }}</span>
                   </template>
                 </el-table-column>
-                <el-table-column label="栏舍" min-width="130px" align="center">
+                <el-table-column label="栏舍" min-width="90px" align="center">
                   <template slot-scope="scope">
                     <span>{{ scope.row.fname }}</span>
                   </template>
                 </el-table-column>
                 <el-table-column label="设计重量(KG)" prop="weight" min-width="130px" align="center">
                   <template slot-scope="scope">
-                    <span>{{ scope.row.weight }}</span>
+                    <span v-if="scope.row.NoEdit">{{ scope.row.weight }}</span>
+                    <el-input v-if="scope.row.Edit" v-model="scope.row.weight"  type="number" maxlength="32" style="width:95%;padding:10px 0;" />
                   </template>
+                </el-table-column>
+                <el-table-column label="操作" align="left" min-width="200" class-name="small-padding">
+                  <template slot-scope="{row}">
+                    <el-button v-if="row.isUpdate && isRoleEdit" :disabled="table3.getdataListParm.parammaps.havebutton == 1" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate3(row)" />
+                    <el-button v-if="row.isUpdateSave" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="updateData3(row,'1')" />
+                    <span v-if="row.isUpdateSave" class="centerSpan">|</span>
+                    <el-button v-if="row.isUpdateSave" class="minCancel" icon="el-icon-close" @click="updateCancel3(row)" />
+                  </template>
                 </el-table-column>
               </el-table>
             </div>
@@ -398,25 +428,34 @@
                 class="elTable table-fixed"
                 :span-method="objectSpanMethod"
               >
-                <el-table-column label="操作序号" min-width="130px" align="center">
+                <el-table-column label="操作序号" min-width="90px" align="center">
                   <template slot-scope="scope">
                     <span>{{ scope.row.sort }}</span>
                   </template>
                 </el-table-column>
-                <el-table-column label="饲料名称" prop="fname" min-width="130px" align="center">
+                <el-table-column label="饲料名称" prop="fname" min-width="90px" align="center">
                   <template slot-scope="scope">
                     <span>{{ scope.row.fname }}</span>
                   </template>
                 </el-table-column>
                 <el-table-column label="设计重量(KG)" prop="weight" min-width="130px" align="center">
                   <template slot-scope="scope">
-                    <span>{{ scope.row.weight }}</span>
+                    <span v-if="scope.row.NoEdit">{{ scope.row.weight }}</span>
+                    <el-input v-if="scope.row.Edit" v-model="scope.row.weight"  type="number" maxlength="32" style="width:95%;padding:10px 0;" />
                   </template>
                 </el-table-column>
-                <el-table-column label="小计" prop="description" min-width="130px" align="center">
+                <el-table-column label="小计" prop="description" min-width="90px" align="center">
                   <template slot-scope="scope">
                     <span>{{ scope.row.subtotal }}</span>
                   </template>
+                </el-table-column>
+               <el-table-column label="操作" align="left" min-width="200" class-name="small-padding">
+                  <template slot-scope="{row}">
+                    <el-button v-if="row.isUpdate && isRoleEdit" :disabled="table2.getdataListParm.parammaps.havebutton == 1" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate2(row)" />
+                    <el-button v-if="row.isUpdateSave" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="updateData2(row,'0')" />
+                    <span v-if="row.isUpdateSave" class="centerSpan">|</span>
+                    <el-button v-if="row.isUpdateSave" class="minCancel" icon="el-icon-close" @click="updateCancel2(row)" />
+                  </template>
                 </el-table-column>
               </el-table>
             </div>
@@ -442,20 +481,29 @@
                 :cell-style="cellStyle"
                 class="elTable table-fixed"
               >
-                <el-table-column label=" 操作序号" min-width="130px" align="center">
+                <el-table-column label=" 操作序号" min-width="90px" align="center">
                   <template slot-scope="scope">
                     <span>{{ scope.row.sort }}</span>
                   </template>
                 </el-table-column>
-                <el-table-column label="撒料车辆" min-width="130px" align="center">
+                <el-table-column label="撒料车辆" min-width="90px" align="center">
                   <template slot-scope="scope">
                     <span>{{ scope.row.fname }}</span>
                   </template>
                 </el-table-column>
                 <el-table-column label="设计重量(KG)" min-width="130px" align="center">
                   <template slot-scope="scope">
-                    <span>{{ scope.row.weight }}</span>
+                    <span v-if="scope.row.NoEdit">{{ scope.row.weight }}</span>
+                    <el-input v-if="scope.row.Edit" v-model="scope.row.weight"  type="number" maxlength="32" style="width:95%;padding:10px 0;" />
                   </template>
+                </el-table-column>
+                <el-table-column label="操作" align="left" min-width="200" class-name="small-padding">
+                  <template slot-scope="{row}">
+                    <el-button v-if="row.isUpdate && isRoleEdit" :disabled="table3.getdataListParm.parammaps.havebutton == 1" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate3(row)" />
+                    <el-button v-if="row.isUpdateSave" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="updateData3(row,'1')" />
+                    <span v-if="row.isUpdateSave" class="centerSpan">|</span>
+                    <el-button v-if="row.isUpdateSave" class="minCancel" icon="el-icon-close" @click="updateCancel3(row)" />
+                  </template>
                 </el-table-column>
               </el-table>
             </div>
@@ -487,25 +535,34 @@
                 :cell-style="cellStyle"
                 class="elTable table-fixed"
               >
-                <el-table-column label=" 操作序号" min-width="130px" align="center">
+                <el-table-column label="操作序号" min-width="90px" align="center">
                   <template slot-scope="scope">
                     <span>{{ scope.row.sort }}</span>
                   </template>
                 </el-table-column>
-                <el-table-column label="撒料车辆" min-width="130px" align="center">
+                <el-table-column label="撒料车辆" min-width="90px" align="center">
                   <template slot-scope="scope">
                     <span>{{ scope.row.fname }}</span>
                   </template>
                 </el-table-column>
                 <el-table-column label="设计重量(KG)" min-width="130px" align="center">
                   <template slot-scope="scope">
-                    <span>{{ scope.row.weight }}</span>
+                    <span v-if="scope.row.NoEdit">{{ scope.row.weight }}</span>
+                    <el-input v-if="scope.row.Edit" v-model="scope.row.weight"  type="number" maxlength="32" style="width:95%;padding:10px 0;" />
                   </template>
                 </el-table-column>
-                <el-table-column label="小计" prop="description" min-width="130px" align="center">
+                <el-table-column label="小计" prop="description" min-width="90px" align="center">
                   <template slot-scope="scope">
                     <span>{{ scope.row.subtotal }}</span>
                   </template>
+                </el-table-column>
+               <el-table-column label="操作" align="left" min-width="200" class-name="small-padding">
+                  <template slot-scope="{row}">
+                    <el-button v-if="row.isUpdate && isRoleEdit" :disabled="table3.getdataListParm.parammaps.havebutton == 1" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate3(row)" />
+                    <el-button v-if="row.isUpdateSave" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="updateData3(row,'0')" />
+                    <span v-if="row.isUpdateSave" class="centerSpan">|</span>
+                    <el-button v-if="row.isUpdateSave" class="minCancel" icon="el-icon-close" @click="updateCancel3(row)" />
+                  </template>
                 </el-table-column>
               </el-table>
             </div>
@@ -531,20 +588,29 @@
                 :cell-style="cellStyle"
                 class="elTable table-fixed"
               >
-                <el-table-column label="操作序号" min-width="130px" align="center">
+                <el-table-column label="操作序号" min-width="90px" align="center">
                   <template slot-scope="scope">
                     <span>{{ scope.row.sort }}</span>
                   </template>
                 </el-table-column>
-                <el-table-column label="栏舍名称" prop="fname" min-width="130px" align="center">
+                <el-table-column label="栏舍名称" prop="fname" min-width="90px" align="center">
                   <template slot-scope="scope">
                     <span>{{ scope.row.fname }}</span>
                   </template>
                 </el-table-column>
-                <el-table-column label="设计重量(KG)" prop="weight" min-width="130px" align="center">
+                <el-table-column label="设计重量(KG)" prop="weight" width="130px" align="center">
                   <template slot-scope="scope">
-                    <span>{{ scope.row.weight }}</span>
+                    <span v-if="scope.row.NoEdit">{{ scope.row.weight }}</span>
+                    <el-input v-if="scope.row.Edit" v-model="scope.row.weight"  type="number" maxlength="32" style="width:95%;padding:10px 0;" />
                   </template>
+                </el-table-column>
+               <el-table-column label="操作" align="left" min-width="200" class-name="small-padding">
+                  <template slot-scope="{row}">
+                    <el-button v-if="row.isUpdate && isRoleEdit" :disabled="table2.getdataListParm.parammaps.havebutton == 1" class="miniSuccess" icon="el-icon-edit-outline" @click="handleUpdate2(row)" />
+                    <el-button v-if="row.isUpdateSave" :disabled="isokDisable" icon="el-icon-folder-checked" class="miniSuccess" @click="updateData2(row,'1')" />
+                    <span v-if="row.isUpdateSave" class="centerSpan">|</span>
+                    <el-button v-if="row.isUpdateSave" class="minCancel" icon="el-icon-close" @click="updateCancel2(row)" />
+                  </template>
                 </el-table-column>
               </el-table>
             </div>
@@ -775,7 +841,7 @@
 </template>
 
 <script>
-import { GetDataByName, GetDataByNames, ExecDataByConfig, PostDataByName, getDorm, GetReportform, checkButtons,postJson,SyncSCJH } from '@/api/common'
+import { GetDataByName, GetDataByNames, ExecDataByConfig, PostDataByName, getDorm, GetReportform, checkButtons,postJson,postJson2,SyncSCJH } from '@/api/common'
 import RevisePlan from './revisePlan.vue'
 import printJS from 'print-js'
 import { parseTime, json2excel,handleTableSpan, handleObjectSpanMethod } from '@/utils/index.js'
@@ -974,6 +1040,22 @@ export default {
           }
         },
         isDataSynchronization: false
+      },
+      dataSynchronization3: {
+        dialogFormVisible: false,
+        dialogStatus: '',
+        getdataListParm: {
+          name: 'getSysoptEnable',
+          page: 1,
+          offset: 1,
+          pagecount: 1,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            inforname: 'wgSap'
+          }
+        },
+        isDataSynchronization: false
       },
       textMap: {
         newGeneration: '新生成',
@@ -1031,7 +1113,8 @@ export default {
         list:[],
         mydate: parseTime(new Date(), '{y}-{m}-{d}')
       },
-      selectList: [],
+      selectList: [],
+      driverList:[]
     }
   },
 
@@ -1040,30 +1123,42 @@ export default {
     console.log(this.parentDate, 'this.parentDate')
     this.getDataSynchronization()
     this.getDataSynchronization2()
+    this.getDataSynchronization3()
     this.getButtons()
     this.getList()
     this.getDownList()
     this.getIsDisplay()
-    this.getTMRList()
+    this.getTMRList()
+    this.getDriverList()
   },
   mounted() {
     this.getTmrListParam.parammaps.mydate = parseTime(new Date(), '{y}-{m}-{d}')
   },
-  methods: {
+  methods: {
+    getDriverList(){
+      const url = 'authdata/GetDataByName'
+      const data = {
+        "name":"getDriverList",
+        "page":1,"offset":1,"pagecount":50,
+        "returntype":"Map",
+        "parammaps":{"pastureid":Cookies.get('pastureid')}
+      }
+      postJson(url, data).then(response => {
+        if(response.data !== null){
+          this.driverList = response.data.list
+        }else{
+          this.driverList = []
+        }
+      })
+    },
     getTMRList(){
-  console.log('11111111')
       this.getTmrListParam.parammaps.mydate = this.table.getdataListParm.parammaps.mydate
-
         GetDataByName(this.getTmrListParam).then(response => {
         if (response.data.list !== null) {
-          console.log('11111111',response)
           this.tmrDownList = response.data.list
 
         }
       })
-
-
-
     },
     getButtons() {
       const Edit = 'DailyExecutionPlan'
@@ -1089,6 +1184,17 @@ export default {
           this.dataSynchronization2.isDataSynchronization = true
         }
       })
+    },
+
+    getDataSynchronization3() {
+      GetDataByName(this.dataSynchronization3.getdataListParm).then(response => {
+        // console.log(response.data.list[0])
+        if (response.data.list[0].inforvalue == 0) {
+          this.dataSynchronization3.isDataSynchronization = false
+        } else {
+          this.dataSynchronization3.isDataSynchronization = true
+        }
+      })
     },
 
 
@@ -1110,9 +1216,9 @@ export default {
               this.$notify({ title: '上传失败', message: response.data, type: 'warning', duration: 2000 })
             } else {
               this.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
-          
+
             }
-         
+
       })
     },
     getIsDisplay() {
@@ -1187,7 +1293,9 @@ export default {
           this.table.pageNum = response.data.pageNum
           this.table.pageSize = response.data.pageSize
           this.table.total = response.data.total
-          console.log('计划类型', response.data.list[0].lpplantype)
+          console.log('计划类型', response.data.list[0].lpplantype)
+          this.table2.getdataListParm.parammaps.havebutton = response.data.list[0].havebutton
+          this.table3.getdataListParm.parammaps.havebutton = response.data.list[0].havebutton
           if (response.data.list[0].lpplantype == 0) {
             // 撒料
             this.table2.getdataListParm.name = 'getDownloadplandtl1ListV2'
@@ -1276,6 +1384,11 @@ export default {
           this.table.listLoading = false
         }, 100)
       })
+    },
+    form_search() {
+      this.getTMRList()
+      this.table.getdataListParm.offset = 1
+      this.getList()
     },
     handleEnableChange(row) {
       this.requestParam.name = 'updatedownloadenable'
@@ -1379,7 +1492,9 @@ export default {
     // 日执行计划行点击
     tableRowClick(row, column, event) {
       console.log(row, column, event)
-      console.log('点击计划类型', row.lpplantype)
+      console.log('点击计划类型', row.lpplantype)
+      this.table2.getdataListParm.parammaps.havebutton = row.havebutton
+      this.table3.getdataListParm.parammaps.havebutton = row.havebutton
       // 撒料计划0/撒料计划-混料1/撒料计划-撒料2/剩料计划3/预混计划4/预称重计划5
       if (row.lpplantype == 0) {
         // 撒料
@@ -1467,7 +1582,14 @@ export default {
 
       GetDataByName(this.table2.getdataListParm).then(response => {
         console.log('table数据', response.data.list)
-        if (response.data.list !== null) {
+        if (response.data.list !== null) {
+          for (let i = 0; i < response.data.list.length; i++) {
+            this.$set(response.data.list[i], 'Edit', false) // 编辑
+            this.$set(response.data.list[i], 'NoEdit', true) // 不可编辑/输入
+            this.$set(response.data.list[i], 'isCreate', false) // 新增操作
+            this.$set(response.data.list[i], 'isUpdate', true) // 编辑操作
+            this.$set(response.data.list[i], 'isUpdateSave', false) // 编辑保存
+          }
           this.table2.list = response.data.list
           // 撒料计划0/撒料计划-混料1/撒料计划-撒料2/剩料计划3/预混计划4
           if (this.table3.getdataListParm.parammaps.lpplantype == 0 || this.table3.getdataListParm.parammaps.lpplantype == 1 || this.table3.getdataListParm.parammaps.lpplantype == 4) {
@@ -1530,7 +1652,14 @@ export default {
 
       GetDataByName(this.table3.getdataListParm).then(response => {
         console.log('table数据', response.data.list)
-        if (response.data.list !== null) {
+        if (response.data.list !== null) {
+          for (let i = 0; i < response.data.list.length; i++) {
+            this.$set(response.data.list[i], 'Edit', false) // 编辑
+            this.$set(response.data.list[i], 'NoEdit', true) // 不可编辑/输入
+            this.$set(response.data.list[i], 'isCreate', false) // 新增操作
+            this.$set(response.data.list[i], 'isUpdate', true) // 编辑操作
+            this.$set(response.data.list[i], 'isUpdateSave', false) // 编辑保存
+          }
           this.table3.list = response.data.list
           if (this.table3.getdataListParm.parammaps.lpplantype == 0) {
             const arr = []
@@ -1804,31 +1933,31 @@ export default {
             return false
           }
           // 相同班次之间可以拖动
-          if (targetRow2 !== undefined && targetRow3 !== undefined) {
-            if (targetRow.times !== targetRow2.times && targetRow.times !== targetRow3.times) {
-              that.$nextTick(() => {
-                that.$set(that.table, 'list', tableList)
-              })
-              that.$message({ type: 'error', message: '因班次不同不可调整顺序', duration: 2000 })
-              return false
-            }
-          } else if (targetRow2 !== undefined && targetRow3 == undefined) {
-            if (targetRow.times !== targetRow2.times) {
-              that.$nextTick(() => {
-                that.$set(that.table, 'list', tableList)
-              })
-              that.$message({ type: 'error', message: '因班次不同不可调整顺序', duration: 2000 })
-              return false
-            }
-          } else if (targetRow2 == undefined && targetRow3 !== undefined) {
-            if (targetRow.times !== targetRow3.times) {
-              that.$nextTick(() => {
-                that.$set(that.table, 'list', tableList)
-              })
-              that.$message({ type: 'error', message: '因班次不同不可调整顺序', duration: 2000 })
-              return false
-            }
-          }
+          // if (targetRow2 !== undefined && targetRow3 !== undefined) {
+          //   if (targetRow.times !== targetRow2.times && targetRow.times !== targetRow3.times) {
+          //     that.$nextTick(() => {
+          //       that.$set(that.table, 'list', tableList)
+          //     })
+          //     that.$message({ type: 'error', message: '因班次不同不可调整顺序', duration: 2000 })
+          //     return false
+          //   }
+          // } else if (targetRow2 !== undefined && targetRow3 == undefined) {
+          //   if (targetRow.times !== targetRow2.times) {
+          //     that.$nextTick(() => {
+          //       that.$set(that.table, 'list', tableList)
+          //     })
+          //     that.$message({ type: 'error', message: '因班次不同不可调整顺序', duration: 2000 })
+          //     return false
+          //   }
+          // } else if (targetRow2 == undefined && targetRow3 !== undefined) {
+          //   if (targetRow.times !== targetRow3.times) {
+          //     that.$nextTick(() => {
+          //       that.$set(that.table, 'list', tableList)
+          //     })
+          //     that.$message({ type: 'error', message: '因班次不同不可调整顺序', duration: 2000 })
+          //     return false
+          //   }
+          // }
           // 撒料计划0,
           // 撒料计划-混料1
           // 撒料计划-撒料2
@@ -2533,7 +2662,179 @@ export default {
           gridHeaderStyle:'border:1px solid #ccc;text-align:center'
         })
       })
-    },
+    },
+    handleDelete(){
+      if (this.selectList.length == 0) {
+        this.$message({ type: 'error', message: '请选择计划', duration: 2000 })
+      } else {
+        MessageBox.confirm('当前选中' + this.selectList.length + '条信息,是否删除?', {
+          confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
+        }).then(() => {
+          console.log(this.selectList)
+          this.requestParam.common = { 'returnmap': '0' }
+          this.requestParam.data = []
+          this.requestParam.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.selectList }}
+          this.requestParam.data[0].children = []
+          this.requestParam.data[0].children[0] = { 'name': 'delDownloadedplan', 'type': 'e', 'parammaps': {
+            id: '@insertSpotList.id',
+            pastureid: '@insertSpotList.pastureid'
+          }}
+          ExecDataByConfig(this.requestParam).then(response => {
+            console.log('删除保存发送参数', this.requestParam)
+            if (response.msg === 'fail') {
+              this.$notify({ title: '删除失败', message: response.data, type: 'warning', duration: 2000 })
+            } else {
+              this.$notify({ title: '', message: '删除成功', type: 'success', duration: 2000 })
+              this.getList()
+            }
+          })
+        })
+      }
+    },
+    handleDataUpload(){
+      let a = process.env.VUE_APP_BASE_API
+      let b = a.search(8081)
+      let c = a.substring(0,a.search(8081)) + '8082'
+      let d = a.substring(0,a.lastIndexOf('/'))
+      console.log(d)
+      let url = ''
+      if(b == -1){
+        url = d + ':8082'
+      }else{
+        url = c
+      }
+      let _url = url + '/authdata/feeding/push'
+      let data = {
+        date:parseTime(new Date(), '{y}-{m}-{d}'),
+        pastureId:Cookies.get('pastureid')
+      }
+      console.log(_url,'_url')
+      postJson2(_url, data).then(response => {
+        if(response.msg == 'ok'){
+          this.$notify({ title: '', message: response.data, type: 'success', duration: 2000 })
+        }else{
+          this.$notify({ title: '上传失败', message: response.data, type: 'warning', duration: 2000 })
+        }
+      })
+    },
+    handleUpdate2(row){
+      for (let i = 0; i < this.table2.list.length; i++) {
+        if (this.table2.list[i].Edit == true) {
+          this.$message({ type: 'error', message: '当前内容未保存,请点击取消或保存继续进行操作', duration: 2000 })
+          return false
+        }
+      }
+      // 编辑true,不可编辑false
+      row.Edit = true
+      row.NoEdit = false
+      // 新增false,编辑false,编辑保存true
+      row.isUpdate = false
+      row.isUpdateSave = true
+    },
+    updateData2(row,type){
+      const url = 'authdata/dailydata/edit'
+      const data = {}
+      data.pid = row.pid
+      data.weight = row.weight
+      data.sort = row.sort
+      // 饲料
+      if(type == '0'){
+        data.location = 0
+        data.fid = row.fid
+      }else{
+        // 车辆||栏舍
+        data.location = 1
+        data.fbarid = row.fbarid
+      }
+      data.date = this.table.getdataListParm.parammaps.mydate
+      data.sort = row.sort
+      postJson(url, data).then(response => {
+        if(response.msg == 'ok'){
+          this.$notify({ title: '', message: '修改成功', type: 'success', duration: 2000 })
+          this.getList2()
+          this.getList3()
+        }else{
+          this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
+        }
+      })
+    },
+    updateCancel2(row){
+      row.Edit = false
+      row.NoEdit = true
+      // 新增false,编辑true,编辑保存false
+      row.isCreate = false
+      row.isUpdate = true
+      row.isUpdateSave = false
+      this.getList2()
+    },
+    handleUpdate3(row){
+      for (let i = 0; i < this.table3.list.length; i++) {
+        if (this.table3.list[i].Edit == true) {
+          this.$message({ type: 'error', message: '当前内容未保存,请点击取消或保存继续进行操作', duration: 2000 })
+          return false
+        }
+      }
+      // 编辑true,不可编辑false
+      row.Edit = true
+      row.NoEdit = false
+      // 新增false,编辑false,编辑保存true
+      row.isUpdate = false
+      row.isUpdateSave = true
+    },
+    updateData3(row,type){
+      const url = 'authdata/dailydata/edit'
+      const data = {}
+      data.pid = row.pid
+      data.weight = row.weight
+      data.sort = row.sort
+      // 饲料
+      if(type == '0'){
+        data.location = 0
+        data.fid = row.fid
+      }else{
+        // 车辆||栏舍
+        data.location = 1
+        data.fbarid = row.fbarid
+      }
+      data.date = this.table.getdataListParm.parammaps.mydate
+      data.sort = row.sort
+      postJson(url, data).then(response => {
+        if(response.msg == 'ok'){
+          this.$notify({ title: '', message: '修改成功', type: 'success', duration: 2000 })
+          this.getList2()
+          this.getList3()
+        }else{
+          this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
+        }
+      })
+    },
+    updateCancel3(row){
+      row.Edit = false
+      row.NoEdit = true
+      // 新增false,编辑true,编辑保存false
+      row.isCreate = false
+      row.isUpdate = true
+      row.isUpdateSave = false
+      this.getList3()
+    },
+    changeDriver(value,row){
+      const url = 'authdata/PostDataByName'
+      const data = {
+        name:'updateDownloadedplanDriver',
+        parammaps:{
+          driverId:value,
+          id:row.id
+        }
+      }
+      postJson(url, data).then(response => {
+        if(response.msg == 'ok'){
+          this.$notify({ title: '', message: '修改成功', type: 'success', duration: 2000 })
+          this.getList()
+        }else{
+          this.$notify({ title: '失败', message: response.data, type: 'warning', duration: 2000 })
+        }
+      })
+    }
   }
 }
 </script>

+ 34 - 7
src/views/formulationPlan/materialIssuancePlan/index.vue

@@ -328,7 +328,7 @@
                         <input
                           ref="weight"
                           v-model="element.weight"
-                          
+
                           type="number"
                           placeholder="重量"
                           step="0.01"
@@ -581,6 +581,32 @@ export default {
       postJson(url, data1).then(response => {
         if (response.data !== null) {
           this.TMRNumberList = response.data.list
+          if(this.create.dialogStatus == 'create'){
+            let isId = false
+            for(let i=0;i<this.TMRNumberList.length;i++){
+              if(this.TMRNumberList[i].id == '1000'){
+                isId = true
+              }
+            }
+            if(isId = true){
+              if (this.create.list2.length > 0) {
+                this.tmrNumber.dialogFormVisible = true
+                this.tmrNumber.dialogStatus = 'tmrNumber'
+                this.tmrNumber.radio = '0'
+              } else {
+                this.create.temp.tmrid2 = '1000'
+                this.create.temp.tmrid = this.create.temp.tmrid2
+                this.create.temp.tmrname = this.TMRNumberList.find(obj => obj.id === '1000').eqcode
+                this.create.temp.maxweight = this.TMRNumberList.find(obj => obj.id === '1000').maxstirfeed
+                this.create.temp.tclassname = this.TMRNumberList.find(obj => obj.id === '1000').tclassname
+                this.create.temp.mytmrid = this.create.temp.tmrid
+                this.create.temp.mytmrname = this.create.temp.tmrname
+                if (this.isDispaly || this.create.dialogStatus == 'update') {
+                  this.getClearList()
+                }
+              }
+            }
+          }
         } else {
           this.TMRNumberList = []
         }
@@ -884,7 +910,7 @@ export default {
       console.log("item.weight", item)
       console.log("监听Blur======================")
       this.isDropState = false
-    
+
       if (parseFloat(item.weight) <= 0) {
         this.$message({ type: 'error', message: '重量不可输入小于0的数据', duration: 2000 })
         return false
@@ -937,7 +963,7 @@ export default {
         }
         this.getCreateList1()
 
-        
+
       })
     },
     handleFLDelete(ele) {
@@ -965,8 +991,9 @@ export default {
       })
     },
     handleCreate() {
-      console.log('新增车次')
       this.create.temp = { sel: 1, tmrid: '', tmrid2: '', maxweight: '', issplit: 1, begintime: '', sumweight: 0, display: '', times: 1, ftid: '', ftname: '', tmrname: '', maxweight: '' }
+      // console.log('新增车次',create.temp.tmrid2)
+
       this.create.temp.times = this.table.getdataListParm.parammaps.times
       this.getDownList()
       this.isDispaly = false
@@ -1226,7 +1253,7 @@ export default {
             this.create.dialogFormVisible = false
             this.getList()
             //window.location.reload()
-    
+
           }
         })
       } else {
@@ -1248,7 +1275,7 @@ export default {
             this.create.dialogFormVisible = false
             this.getList()
             // window.location.reload()
-       
+
           } else {
             this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
           }
@@ -1689,7 +1716,7 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-  .list{width: 60px;display: inline-block;margin: 5px 5px;text-align: center;
+  .list{min-width: 60px;display: inline-block;margin: 5px 5px;text-align: center;
     .tmrname{
       width:100%;padding: 5px 5px;overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
     }

+ 2 - 3
src/views/formulationPlan/surplusMaterialPlan/index.vue

@@ -316,9 +316,9 @@
     PostDataByName,
     failproccess,
     ExecDataByConfig,
-    checkButtons
+    checkButtons,postJson2
   } from '@/api/common'
-
+  import { parseTime } from '@/utils/index.js'
   import Pagination from '@/components/Pagination'
   import Sortable from 'sortablejs'
   import draggable from 'vuedraggable'
@@ -2255,7 +2255,6 @@
           })
         }
       }
-
     }
   }
 </script>

+ 446 - 0
src/views/login/index - 副本.vue

@@ -0,0 +1,446 @@
+<template>
+  <div class="login-container">
+    <div class="new-login">
+      <div class="new-login-l">
+        <img src="@/assets/images/logo.png" alt="">
+      </div>
+      <div class="new-login-r">
+        <div class="title">用户登录</div>
+        <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" auto-complete="on" label-position="left">
+          <el-form-item prop="username">
+            <span class="svg-container">
+              <svg-icon icon-class="user" />
+            </span>
+            <el-input ref="username" v-model="loginForm.username" placeholder="用户名" name="username" type="text" tabindex="1" auto-complete="on" />
+          </el-form-item>
+
+          <el-form-item prop="password" class="password">
+            <span class="svg-container">
+              <svg-icon icon-class="password" />
+            </span>
+            <el-input :key="passwordType" ref="password" v-model="loginForm.password" :type="passwordType" placeholder="密码" name="password" tabindex="2" auto-complete="on" @keyup.enter.native="handleLogin" />
+            <span class="show-pwd" @click="showPwd">
+              <svg-icon :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'" />
+            </span>
+          </el-form-item>
+          <el-form-item prop="password" class="rememberPassword">
+            <input id="remember-password-checkbox" v-model="rememberPassword" type="checkbox" value="remember-me" @click="doRememberPassword($event)">
+            <span for="remember-password-checkbox">
+              记住密码
+            </span>
+            </input>
+          </el-form-item>
+        </el-form>
+        <el-button type="text" :loading="loading" class="btn" @click.native.prevent="handleLogin">登录</el-button>
+      </div>
+    </div>
+    <div style="position: absolute;bottom: 0;left: 0;right:0;color: #000;background: #fee; opacity: .7; font-size: 14px;">
+      <p style="text-align:center;line-height:16px;">
+        版权所有
+        <a href="http://www.dairyinfo.com.cn" target="_blank">上海科湃腾信息科技有限公司</a>
+        <a style="margin-left: 20px;" href="https://beian.miit.gov.cn/" target="_blank">沪ICP备11008303号-3 </a>
+      </p>
+
+    </div>
+  </div>
+</template>
+
+<script>
+import { validUsername } from '@/utils/validate'
+import Cookies from 'js-cookie'
+import { getToken } from '@/utils/auth'
+export default {
+  name: 'Login',
+  data() {
+    const validateUsername = (rule, value, callback) => {
+      if (!validUsername(value)) {
+        callback(new Error('请输入正确的用户名'))
+      } else {
+        callback()
+      }
+    }
+    const validatePassword = (rule, value, callback) => {
+      if (value.length < 6) {
+        callback(new Error('密码不能少于6个字符'))
+      } else {
+        callback()
+      }
+    }
+    return {
+      loginForm: {
+        username: '',
+        password: ''
+      },
+      loginRules: {
+        username: [
+          { required: true, trigger: 'blur', validator: validateUsername }
+        ],
+        password: [
+          { required: true, trigger: 'blur', validator: validatePassword }
+        ]
+      },
+      loading: false,
+      passwordType: 'password',
+      redirect: undefined,
+      rememberPassword: ''
+    }
+  },
+  watch: {
+    $route: {
+      handler: function(route) {
+        this.redirect = route.query && route.query.redirect
+      },
+      immediate: true
+    }
+  },
+  created() {
+    var that = this
+    document.onkeydown = function(e) {
+      e = window.event || e
+      // eslint-disable-next-line eqeqeq
+      if (that.$route.path == '/login' && (e.code == 'Enter' || e.code == 'Num Enter')) { // 验证在登录界面和按得键是回车键enter
+        that.handleLogin('ruleForm2') // 登录函数 (handleSubmit2('ruleForm2')-登录按钮的点击事件)
+      }
+    }
+  },
+  mounted: function() {
+    // 读取cookie中的账号信息,如果有accountInfo的话,则说明该用户之前勾选了记住密码的功能,则需要自动填上账号密码
+    this.loadAccountInfo()
+  },
+  methods: {
+    showPwd() {
+      if (this.passwordType === 'password') {
+        this.passwordType = ''
+      } else {
+        this.passwordType = 'password'
+      }
+      this.$nextTick(() => {
+        this.$refs.password.focus()
+      })
+    },
+    handleLogin() {
+      var rememberStatus = this.rememberPassword
+      var accountInfo = this.loginForm.username + '&' + this.loginForm.password
+      this.$refs.loginForm.validate(valid => {
+        if (valid) {
+          this.loading = true
+          this.$store
+            .dispatch('user/login', this.loginForm).then(() => {
+              if (rememberStatus) {
+                console.log('勾选了记住密码,现在开始写入cookie')
+                Cookies.set('accountInfo', accountInfo, 1440 * 3)
+              } else {
+                console.log('没有勾选记住密码,现在开始删除账号cookie')
+                Cookies.remove('accountInfo')
+              }
+
+              // 若为本地环境 则手写cookie
+              if (window.location.href.indexOf('localhost') != -1) {
+                Cookies.set('token', getToken(), 1440)
+              }
+              this.$router.push({ path: this.redirect || '/' })
+              this.loading = false
+            })
+            .catch(() => {
+              this.loading = false
+            })
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    doRememberPassword() {
+      const rememberStatus = this.rememberPassword
+      this.rememberPassword = !rememberStatus
+    },
+    loadAccountInfo: function() {
+      const _this = this
+      // zhaopeng&A15hOsu8YeGnCsjb
+      const accountInfo = Cookies.get('accountInfo')
+      // 如果cookie里没有账号信息
+      if (Boolean(accountInfo) == false) {
+        console.log('cookie中没有检测到账号信息!')
+        return false
+      } else {
+        // 如果cookie里有账号信息
+        console.log('cookie中检测到账号信息!现在开始预填写!')
+        let userName = ''
+        let passWord = ''
+        const index = accountInfo.indexOf('&')
+
+        userName = accountInfo.substring(0, index)
+        passWord = accountInfo.substring(index + 1)
+        // this.loginForm.username + '&' + this.loginForm.password
+        _this.loginForm.username = userName
+        _this.loginForm.password = passWord
+        _this.rememberPassword = true
+      }
+    }
+  }
+}
+</script>
+
+<style lang="scss">
+/* 修复input 背景不协调 和光标变色 */
+/* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */
+
+// $bg: #283443;
+// $light_gray: #fff;
+// $cursor: #fff;
+// 更改
+// $bg: #ccc;
+// $light_gray: #ccc;
+// $cursor: #000;
+// @supports (-webkit-mask: none) and (not (cater-color: $cursor)) {
+//   .login-container .el-input input {
+//     color: $cursor;
+//   }
+// }
+// .login-container {
+//   min-height: 232px;
+//   .el-input {
+//     display: inline-block;
+//     height: 38px;
+//     width: 80%;
+
+//     input {
+//       background: #fff;
+//       border: 0px;
+//       -webkit-appearance: none;
+//       border-radius: 0px;
+//       padding: 5px 5px 5px 15px;
+//       color: #000;
+//       height: 16.7%;
+//       caret-color: $cursor;
+
+//       &:-webkit-autofill {
+//         box-shadow: 0 0 0px 1000px $bg inset !important;
+//         -webkit-text-fill-color: $cursor !important;
+//       }
+//     }
+//   }
+//   .el-form-item {
+//       border: 1px solid rgba(255, 255, 255, 0.1);
+//       background: #fff;
+//       border-radius: 5px;
+//       color: #999;
+//       width: 73%;
+//       margin: 10px auto;
+//       .el-form-item__content {
+//         line-height: 16%;
+//         border-bottom: 1px solid #e7e7e7;
+//       }
+
+//     }
+//     .rememberPassword{
+//       .el-form-item__content {
+//         line-height:16%;
+//         border: none;
+//         span{padding-left: 5px;}
+//       }
+
+//     }
+//     .password{
+//       margin-top: 20px;margin-bottom: 15px;
+//     }
+//     .btn{
+//       position: relative;
+//       width: 520px;
+//       max-width: 100%;
+//       overflow: hidden;
+//     }
+//     .btn  span{width:72%;background:#01996a;border: #01996a;border-radius: 5px;line-height: 40px; text-align: center;color:#fff; margin: 0 auto;display: block;}
+
+//   }
+
+</style>
+
+/* <style>
+
+.login-container .el-input input:-webkit-autofill, textarea:-webkit-autofill, select:-webkit-autofill {
+    -webkit-box-shadow: 0 0 0px 1000px #fff inset !important;
+    box-shadow: 0 0 0px 1000px #fff inset !important;
+    -webkit-text-fill-color: #000 !important;
+}
+
+</style> */
+// <style lang="scss" scoped>
+// $bg: #2d3a4b;
+// $dark_gray: #999;
+// $light_gray: #000;
+
+// .login-container {
+//   min-height: 100%;
+//   width: 100%;
+//   height: 100%;
+//   position: relative;
+//   background: url("../../assets/images/nlogin-bg.png") no-repeat;
+//   background-size:100%;
+//   overflow: hidden;
+//   .login {
+//     border-radius: 5%;
+//     padding: 30px;
+//     background: rgba(0,0,0,0.4);
+//     width: 380px;
+//     height: 340px;
+//     position: relative;
+//     top: 50%;
+//     left: 50%;
+//     margin-left: -190px;
+//     margin-top: -270px;
+//     box-shadow:0px 0px 10px #fff;
+//     .login-form {
+//       margin-top: 60px;
+//       position: relative;
+//       width: 520px;
+//       max-width: 100%;
+//       overflow: hidden;
+//     }
+
+//     .tips {
+//       font-size: 14px;
+//       color: #fff;
+//       margin-bottom: 10px;
+
+//       span {
+//         &:first-of-type {
+//           margin-right: 16px;
+//         }
+//       }
+//     }
+
+//     .svg-container {
+//       padding: 6px 5px 6px 15px;
+//       color: $dark_gray;
+//       vertical-align: middle;
+//       width: 30px;
+//       display: inline-block;
+//     }
+
+//       .title {
+//         font-size: 26px;
+//         color: $light_gray;
+//         margin: 0px auto 0 auto;
+//         text-align: center;
+//         font-weight: bold;
+//       }
+//       b {
+//         text-align: center;
+//         font: 14px/2 "";
+//       }
+
+//     .show-pwd {
+//       position: absolute;
+//       right: 10px;
+//       top: 7px;
+//       font-size: 16px;
+//       color: $dark_gray;
+//       cursor: pointer;
+//       user-select: none;
+//     }
+
+//     .kpt{text-align: center;color: #fff;display: inline-block;width: 100%;font:12px/18px '';}
+//   }
+// }
+// </style>
+// <style lang="scss" scoped>
+//   .login-container {
+//     width: 100vw;
+//     height: 100vh;
+//     display: flex;
+//     justify-content: center;
+//     align-items: center;
+//     .new-login{
+//       width: 57%;
+//       height: 43%;
+//       display: flex;
+//       .new-login-l{
+//         flex: 1 1;
+//         width: 50%;
+//         background:  url("../../assets/images/nlogin-bg2.png") no-repeat;
+//         position: relative;
+//         .new-login-l-t{
+//           width: 34%;
+//           height: 13%;
+//           position: absolute;
+//           top: 36%;
+//           left: 32%;
+//           right: 0;
+//           bottom: 0;
+//         }
+//         .new-login-l-b{
+//           position: absolute;
+//           // 138,263
+//           width: 40%;
+//           // height: 5%;
+//           top: 56%;
+//           left: 30%;
+//           // right: 0;
+//           // bottom: 0;
+//         }
+//       }
+//       .new-login-r{
+//         flex: 1 1;
+//         width: 50%;
+//         background:  url("../../assets/images/nlogin-bg3.png") no-repeat;
+//         position: relative;
+//         .title{
+//           text-align: center;
+//           font-size: 26px;
+//           font-weight: 700;
+//           color: #01996a;
+//           padding-top: 10%;
+//           padding-bottom: 3%;
+//         }
+//         .btn {position: absolute;bottom: 10%;}
+//       }
+//     }
+//   }
+// </style>
+<style lang="scss" scoped>
+$bg: #2d3a4b;
+$dark_gray: #999;
+$light_gray: #000;
+$bg: #ccc;
+$light_gray: #ccc;
+$cursor: #000;
+.login-container{
+  position: relative;height: 100%;width: 100%;background:  url("../../assets/images/nlogin-bg1.jpg") no-repeat;
+    .new-login{
+      width: 50%;height: 42%;position: absolute;left: 0;right: 0;bottom: 0;top: 0;margin: auto;
+      .new-login-l{
+        background: red;float:left;height:100%;width:50%;background:  url("../../assets/images/nlogin-bg2.png") no-repeat;position: relative;
+        img{position: absolute;left: 0;right: 0;bottom: 0;top: 0;margin: auto;width: 50%;height:23%;}
+      }
+      .new-login-r{
+        background: #fff;float:left;height:100%;width:50%;position: relative;
+        .title{margin-top: 10%;font-size: 20px;font-weight: 600;color: #019969;text-align: center;}
+        .login-form{
+          position: relative;width: 520px;max-width: 100%;overflow: hidden;height: 48%;
+          .svg-container{padding: 6px 5px 6px 15px; color: $dark_gray; vertical-align: middle; width: 30px; display: inline-block;}
+          .el-input {
+            display: inline-block; width: 80%;
+          }
+        }
+        .el-form-item {
+          border: none; background: #fff; border-radius: 5px; color: #999;width: 73%; margin: 10px auto;height: 30%;
+          /deep/.el-form-item__content {
+            line-height: 16%; border-bottom: 1px solid #e7e7e7;
+          }
+          .el-form-item__content .el-input{
+            /deep/.el-input__inner{border: none !important;}
+          }
+        }
+        .rememberPassword{
+          /deep/.el-form-item__content { line-height:16%; border: none;padding-bottom: 10px; span{padding-left: 5px;} }
+        }
+        .password{margin-top: 10px;margin-bottom: 20px;}
+        .btn{
+          position: absolute; overflow: hidden; width: 75%;left: 0;right: 0;bottom: 10%;margin: 0 auto;
+          /deep/span{background:#01996a;border: #01996a;border-radius: 5px;line-height: 40px; text-align: center;color:#fff; display: block;}
+        }
+      }
+    }
+}
+</style>

+ 61 - 6
src/views/shedProduction/materialRemainingRecord/index.vue

@@ -15,11 +15,12 @@
       </el-select>
       <el-button class="successBorder" @click="form_search">查询</el-button>
       <el-button class="successBorder" @click="handleRefresh">重置</el-button>
-    </div>
+    </div>
     <div class="operation" v-if="record== '0'">
       <el-button v-if="isRoleEdit" icon="el-icon-plus" class="success"  @click="handleCreate">新增</el-button>
       <el-button v-if="isRoleEdit" icon="el-icon-delete" class="danger"  @click="form_delete">删除</el-button>
       <el-button v-if="isRoleEdit" icon="el-icon-copy-document" class="copy"  @click="handleCopy">复制</el-button>
+      <el-button v-if="dataSynchronization.isDataSynchronization && isRoleEdit" class="success" @click="handleDataUpload">数据上传</el-button>
       <el-upload v-if="isRoleEdit" style="float: right;" :headers="headers" :data="uploadData" :action="uploadExcelUrl" :show-file-list="false" :before-upload="beforeImport" :on-success="handleImportSuccess">
         <el-button class="import" icon="el-icon-download" style="float: right;">导入</el-button>
       </el-upload>
@@ -31,7 +32,8 @@
         </el-dropdown-menu>
       </el-dropdown>
     </div>
-    <div class="operation" v-else>
+    <div class="operation" v-else>
+      <el-button v-if="dataSynchronization.isDataSynchronization && isRoleEdit" class="success" @click="handleDataUpload">数据上传</el-button>
         <el-button style="float: right;margin-right: 10px;" class="export" icon="el-icon-upload2" @click="handleExport(3)">导出</el-button>
     </div>
     <!-- 手动记录 -->
@@ -178,7 +180,7 @@
 </template>
 
 <script>
-import { GetDataByName, PostDataByName, failproccess, ExecDataByConfig, GetDataByNames, checkButtons } from '@/api/common'
+import { GetDataByName, PostDataByName, failproccess, ExecDataByConfig, GetDataByNames, checkButtons,postJson2  } from '@/api/common'
 import Cookies from 'js-cookie'
 import { parseTime, json2excel } from '@/utils/index.js'
 import Pagination from '@/components/Pagination'
@@ -271,6 +273,22 @@ export default {
           }
         },
         list: []
+      },
+      dataSynchronization: {
+        dialogFormVisible: false,
+        dialogStatus: '',
+        getdataListParm: {
+          name: 'getSysoptEnable',
+          page: 1,
+          offset: 1,
+          pagecount: 1,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            inforname: 'wgSap'
+          }
+        },
+        isDataSynchronization: false
       },
       isokDisable: false,
       selectList: [],
@@ -306,13 +324,24 @@ export default {
       return process.env.VUE_APP_BASE_API + 'authdata/ImportExcel'
     }
   },
-  created() {
+  created() {
+    this.getDataSynchronization()
     this.getList()
     this.getDownList()
     this.getButtons()
   },
 
-  methods: {
+  methods: {
+    getDataSynchronization() {
+      GetDataByName(this.dataSynchronization.getdataListParm).then(response => {
+        // console.log(response.data.list[0])
+        if (response.data.list[0].inforvalue == 0) {
+          this.dataSynchronization.isDataSynchronization = false
+        } else {
+          this.dataSynchronization.isDataSynchronization = true
+        }
+      })
+    },
     getButtons() {
       const Edit = 'MaterialRemainingRecord'
       const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
@@ -770,8 +799,34 @@ export default {
           }
         })
       )
+    },
+    handleDataUpload(){
+      let a = process.env.VUE_APP_BASE_API
+      let b = a.search(8081)
+      let c = a.substring(0,a.search(8081)) + '8082'
+      let d = a.substring(0,a.lastIndexOf('/'))
+      console.log(d)
+      let url = ''
+      if(b == -1){
+        url = d + ':8082'
+      }else{
+        url = c
+      }
+      console.log(url,'url')
+      let _url = url + '/authdata/surplus/push'
+      let data = {
+        date:parseTime(new Date(), '{y}-{m}-{d}'),
+        pastureId:Cookies.get('pastureid')
+      }
+      console.log(_url,'_url')
+      postJson2(_url, data).then(response => {
+        if(response.msg == 'ok'){
+          this.$notify({ title: '', message: response.data, type: 'success', duration: 2000 })
+        }else{
+          this.$notify({ title: '上传失败', message: response.data, type: 'warning', duration: 2000 })
+        }
+      })
     }
-
   }
 }
 </script>

+ 289 - 0
src/views/statisticalAnalysis/formulaStatistics/index.vue

@@ -0,0 +1,289 @@
+<template>
+  <div class="app-container" ref="searchBar">
+    <el-date-picker v-model="inputDatetime" :clearable="false" class="inputDatetime filter-item" type="daterange"
+      range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;margin-right: 10px;"
+      :picker-options="pickerOptions" />
+    <el-button class="el-icon-arrow-left elIconArrowLeft" :disabled="Beforedisabled" @click="handleBefore" />
+    <el-button class="el-icon-arrow-right elIconArrowRight" :disabled="Nextdisabled" @click="handleNext" />
+    <el-button class="successBorder" @click="form_search">查询</el-button>
+    <h3 style="text-align: center;">每日拌料车次</h3>
+    <div id="chartLine1" :style="{height:height,width:width}" />
+  </div>
+
+</template>
+
+<script>
+  import echarts from 'echarts'
+
+  require('echarts/theme/macarons')
+  import Cookies from 'js-cookie'
+  import {
+    parseTime
+  } from '@/utils/index.js'
+  import {
+    GetDataByName,
+    postJson,
+    GetReportform,
+    whichWeek
+  } from '@/api/common'
+  export default {
+    name: 'FormulaStatistics',
+    data() {
+      return {
+        width: '100%',
+        height: document.documentElement.clientHeight - 85 - 150 + 'px',
+        startTime: parseTime(new Date(), '{y}-{m}-{d}'),
+        endTime: parseTime(new Date(), '{y}-{m}-{d}'),
+        inputDatetime: [new Date(), new Date()],
+        Beforedisabled: false,
+        Nextdisabled: false,
+        pickerOptions: {
+          onPick: ({
+            maxDate,
+            minDate
+          }) => {
+            this.pickerMinDate = minDate.getTime()
+            if (maxDate) {
+              this.pickerMinDate = ''
+            }
+          },
+          // 限制不能选择明天之后的日期
+          disabledDate: (time) => {
+            if (this.pickerMinDate !== '') {
+              const one = 31 * 24 * 3600 * 1000
+              const minTime = this.pickerMinDate - one
+              let maxTime = this.pickerMinDate + one
+
+              // console.log(minTime, 'minTime')
+              // console.log(maxTime, 'maxTime')
+              // console.log(new Date(), 'new Date()')
+              // console.log(Date.now(), 'Date.now()')
+              // console.log(time.getTime(), 'time.getTime()')
+              if (maxTime > new Date()) {
+                maxTime = Date.now() + 8.64e7
+              }
+
+              return time.getTime() < minTime || time.getTime() > maxTime
+            }
+            return time.getTime() > Date.now() + 8.64e7
+          }
+        },
+        chart1: {
+          chartLine: null,
+          chartLine_data: {},
+
+          tableKey: 1,
+          list: [],
+          total: 0,
+          listLoading: true,
+          statisticsList: [],
+          chart1Data1: [],
+          isChart: true,
+          isTable: false,
+          table: {
+            tableKey: 1,
+            list: [],
+            total: 0,
+            listLoading: false
+          }
+        }
+      }
+    },
+
+    created() {
+      // this.getChart1()
+      this.getChart1()
+    },
+
+    methods: {
+      handleBefore() {
+        if (this.inputDatetime !== '' && this.inputDatetime !== null) {
+          var start = new Date(this.inputDatetime[0].setDate(this.inputDatetime[0].getDate() - 1))
+          var stop = new Date(this.inputDatetime[1].setDate(this.inputDatetime[1].getDate() - 1))
+          if (stop > Date.now()) {
+            this.Nextdisabled = true
+            this.Beforedisabled = false
+          } else {
+            this.Nextdisabled = false
+            this.Beforedisabled = false
+          }
+          this.inputDatetime.length = 0
+          this.inputDatetime.push(start, stop)
+          this.$forceUpdate()
+        }
+        this.startTime = parseTime(this.inputDatetime[0], '{y}-{m}-{d}')
+        this.endTime = parseTime(this.inputDatetime[1], '{y}-{m}-{d}')
+        this.getList()
+      },
+      handleNext() {
+        if (this.inputDatetime !== '' && this.inputDatetime !== null) {
+          var start2 = new Date(this.inputDatetime[0].setDate(this.inputDatetime[0].getDate() + 1))
+          var stop2 = new Date(this.inputDatetime[1].setDate(this.inputDatetime[1].getDate() + 1))
+          if (stop2 > Date.now()) {
+            this.Nextdisabled = true
+            this.Beforedisabled = false
+          } else {
+            this.Nextdisabled = false
+            this.Beforedisabled = false
+          }
+          this.inputDatetime.length = 0
+          this.inputDatetime.push(start2, stop2)
+          this.$forceUpdate()
+        }
+        this.startTime = parseTime(this.inputDatetime[0], '{y}-{m}-{d}')
+        this.endTime = parseTime(this.inputDatetime[1], '{y}-{m}-{d}')
+        this.getChart1()
+      },
+      form_search() {
+        this.getChart1()
+      },
+      getChart1() {
+        this.chart1.listLoading = true
+        const url = 'authdata/formulastatistics'
+        const data = {}
+        // data.parammaps = {}
+        data.pastureId = Cookies.get('pastureid')
+        data.startTime = parseTime(this.inputDatetime[0], '{y}-{m}-{d}')
+        data.endTime = parseTime(this.inputDatetime[1], '{y}-{m}-{d}')
+        postJson(url, data).then(response => {
+          if (response.data !== null) {
+            this.chart1.chartLine_data = {}
+            this.chart1.chartLine_data = response.data
+            // this.chart1.chartLine_data.xdata = ['业务系统1', '业务系统2', '业务系统3', '业务系统4', '业务系统5', '业务系统6', '业务系统7']
+            // // this.chart1.chartLine_data.data1 = ['高危', '中低', '低危','']
+            // this.chart1.chartLine_data.data1 = ['高危', '中低', '低危']
+            // this.chart1.chartLine_data.data2 = [
+            //   [50, 60, 59, 50, 50, 50, 50],
+            //   [70, 70, 70, 70, 70, 70, 0],
+            //   [70, 70, 70, 70, 70, 70, 70]
+            // ]
+          } else {
+            this.chart1.chartLine_data = []
+          }
+          this.roadChartLine1(this.chart1.chartLine_data)
+          setTimeout(() => {
+            this.chart1.listLoading = false
+          }, 100)
+        })
+      },
+      roadChartLine1(chartLine_data) {
+        if (this.chart1.chartLine != null) {
+          this.chart1.chartLine.dispose()
+        }
+        this.chart1.chartLine = echarts.init(document.getElementById('chartLine1'))
+        var option = {
+          tooltip:{
+            // trigger: 'axis'
+            formatter: (param, ticket, callback) => {
+              var str = ''
+              str +=  param.name + '<br>' + param.marker + ' ' + param.seriesName +':' +param.value
+              console.log(ticket,'ticket')
+              return str
+            }
+          },
+          grid: {
+            top: '30%',
+            left: '3%',
+            right: '10%',
+            // bottom: '3%',
+            containLabel: true
+          },
+          legend: {
+            data:chartLine_data.data1
+          },
+          xAxis: {
+            data: chartLine_data.xdata,
+            type: 'category',
+            axisLabel: {
+              showMaxLabel: true
+            }
+          },
+          yAxis: {
+            type: 'value',
+            max: function(value) {
+              return (value.max+1)
+            }
+          },
+          series: (function() {
+            var serie = []
+            if (chartLine_data.data2 !== null) {
+              for (var i = 0; i < chartLine_data.data2.length; i++) {
+                var item = {
+                  name: chartLine_data.data1[i],
+                  type: 'bar',
+                  stack: '总量',
+                  label: {
+                    show: true,
+                    formatter: function(params) {
+                      const a = params.value
+                      if (a > 0) {
+                        return a
+                      } else {
+                        return ''
+                      }
+                    },
+                    color: 'black'
+                  },
+                  emphasis: {
+                    focus: 'series'
+                  },
+                  data: chartLine_data.data2[i]
+                }
+                serie.push(item)
+              }
+              var item2 = {
+                name: '',
+                type: 'bar',
+                stack: '总量',
+                label: {
+                  show: true,
+                  position: 'top',
+                  formatter: function(params) {
+                    const a = params.value
+                    if (a > 0) {
+                      return a
+                    } else {
+                      return ''
+                    }
+                  }
+                },
+                emphasis: {
+                  focus: 'series'
+                },
+                data: chartLine_data.data2[chartLine_data.data2.length -1]
+              }
+              serie.push(item2)
+            }
+            return serie
+          }())
+        };
+        var series = option.series
+
+        function getSum(params) {
+          var datavalue = 0
+          for (var i = 0; i < series.length; i++) {
+            datavalue += series[i].data[params.dataIndex]
+          }
+          return datavalue
+        }
+        series[series.length - 1].label.formatter = getSum
+        this.chart1.chartLine.setOption(option, true);
+
+        this.chart1.chartLine.on('legendselectchanged', (obj) => {
+               function getSum (params) {
+                 var datavalue = 0
+                 for (var i = 0; i < series.length; i++) {
+                   if (obj.selected[series[i].name]) {
+                     datavalue += series[i].data[params.dataIndex]
+                   }
+                 }
+                 return datavalue
+               }
+               series[series.length - 1].label.formatter = getSum
+               this.chart1.chartLine.setOption(option)
+             })
+        // this.chart1.chartLine.setOption(option, true);
+      },
+    }
+  }
+</script>