duanxiaoduan 2 tahun lalu
induk
melakukan
06b418ce5b

TEMPAT SAMPAH
dist.zip


+ 74 - 6
src/views/formulationPlan/dailyExecutionPlan/index.vue

@@ -30,7 +30,8 @@
         <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-button class="export" icon="el-icon-upload2" @click="handleExport">导出</el-button>
+        <el-button class="export" icon="el-icon-upload2" @click="handleExport">导出</el-button>
+        <el-button class="export" style="margin-left: -5px;" @click="handleDeleteRecord">删除记录</el-button>
       </div>
       <div class="operation" style="margin-bottom: 10px;">
         <el-button v-if="isRoleEdit" class="success" icon="el-icon-plus" @click="handleCreate">新生成</el-button>
@@ -705,7 +706,61 @@
       </div>
     </el-dialog>
     <!-- 修改计划 -->
-    <RevisePlan :show.sync="isShowDialog" :parent-active-name="activeName" :parent-date="parentDate" />
+    <RevisePlan :show.sync="isShowDialog" :parent-active-name="activeName" :parent-date="parentDate" />
+    <!-- 删除记录 -->
+    <el-dialog :title="textMap[deleteRecord.dialogStatus]" :destroy-on-close="true" :visible.sync="deleteRecord.dialogFormVisible" :close-on-click-modal="false" width="90%">
+      <div class="deleteRecord">
+        <div class="search">
+          <el-date-picker v-model="deleteRecord.mydate" type="date" placeholder="选择日期" style="width: 150px;" format="yyyy-MM-dd" value-format="yyyy-MM-dd" :clearable="false" @change="changeDate" />
+        </div>
+        <div class="table">
+          <el-table
+            :key="deleteRecord.tableKey"
+            v-loading="deleteRecord.listLoading"
+            element-loading-text="给我一点时间"
+            :data="deleteRecord.list"
+            border
+            fit
+            highlight-current-row
+            style="width: 98%;"
+            row-key="sort"
+            :row-style="rowStyle"
+            :cell-style="cellStyle"
+            class="elTable table-fixed"
+            :height="370"
+          >
+            <el-table-column label="序号" align="center" prop="sort" width="50px" />
+            <el-table-column label="计划名称" min-width="90px" align="center" prop="projname" />
+            <el-table-column label="计划类型" prop="weight" min-width="90px" align="center" :formatter="lpplantype" />
+            <el-table-column label="TMR编号" min-width="90px" align="center" prop="tmrtname" />
+            <el-table-column label="驾驶员" min-width="90px" align="center" prop="driver" />
+            <el-table-column label="已执行" min-width="70px" align="center">
+              <template slot-scope="scope">
+                <span v-if="scope.row.havebutton == 0">否</span>
+                <span v-else>是</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="班次" min-width="80px" align="center" prop="times" />
+            <el-table-column label="理论量" min-width="80px" align="center" prop="lweight" />
+            <el-table-column label="启用" min-width="70px" align="center">
+              <template slot-scope="scope">
+                <el-switch v-if="dataDisabled == false" v-model="scope.row.enable" :disabled="scope.row.havebutton == 1" active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleEnableChange(scope.row)" />
+                <el-switch v-else v-model="scope.row.enable" disabled active-color="#13ce66" inactive-color="#ff4949" :active-value="1" :inactive-value="0" @change="handleEnableChange(scope.row)" />
+              </template>
+            </el-table-column>
+            <el-table-column label="时间" min-width="80px" align="center" prop="plantime" />
+            <el-table-column label="配方名称" min-width="100px" align="center" prop="ftname" />
+            <el-table-column label="牛头数" min-width="80px" align="center" prop="cowcount" />
+            <el-table-column label="描述" min-width="80px" align="center" prop="display" />
+            <el-table-column label="发料位" min-width="80px" align="left" prop="barnames" />
+          </el-table>
+          <span v-if="deleteRecord.listLoading == false" style="margin-right: 30px;margin-top: 10px;font-size: 14px;">共{{ deleteRecord.total }}条</span>
+        </div>
+        <div slot="footer" class="dialog-footer" style="bottom:20px">
+          <el-button class="cancelClose1" @click="deleteRecord.dialogFormVisible = false;getList()">取消</el-button>
+        </div>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -897,7 +952,8 @@ export default {
         newGeneration: '新生成',
         historyRecord: '历史记录',
         revisePlan: '修改计划',
-        copy: '复制计划'
+        copy: '复制计划',
+        deleteRecord:'删除记录'
       },
       isokDisable: false,
       requestParam: {},
@@ -938,7 +994,16 @@ export default {
       myMaxTimes:'',
       tipsList:[],
       spanObj: {},
-      mergekeys: ['sort', 'description'],
+      mergekeys: ['sort', 'description'],
+      deleteRecord:{
+        dialogFormVisible: false,
+        dialogStatus: '',
+        total:0,
+        tableKey:0,
+        listLoading:false,
+        list:[],
+        mydate: parseTime(new Date(), '{y}-{m}-{d}')
+      }
     }
   },
 
@@ -2184,8 +2249,11 @@ export default {
           }
         }
       }
-    },
-
+    },
+    handleDeleteRecord(){
+      this.deleteRecord.dialogStatus = 'deleteRecord'
+      this.deleteRecord.dialogFormVisible = true
+    }
   }
 }
 </script>

+ 1 - 3
src/views/formulationPlan/materialIssuancePlan/index.vue

@@ -16,9 +16,7 @@
       <el-select v-model="table.getdataListParm.parammaps.times" filterable placeholder="班次" class="filter-item" style="width: 120px;float: left;margin-left: 10px;" @change="changeFrequency">
         <el-option v-for="item in frequencyList" :key="item.id" :label="item.name" :value="item.id" />
       </el-select>
-      <!-- 临时注释 -->
-      <!-- <el-button class="export" icon="el-icon-time" style="float:right;" @click="handleHistoryRecord">历史记录 </el-button> -->
-      <!-- 临时注释 -->
+      <el-button class="export" icon="el-icon-time" style="float:right;" @click="handleHistoryRecord">历史记录 </el-button>
     </div>
     <!-- <div class="search">
       <el-select v-model="table.getdataListParm.parammaps.times" filterable placeholder="班次" class="filter-item" style="width: 120px;" @change="changeFrequency">

+ 448 - 0
src/views/inventoryManagement/statistics/index改.vue

@@ -0,0 +1,448 @@
+<template>
+  <div class="app-container">
+    <div class="search">
+      <el-select v-model="table.getdataListParm.parammaps.feedid" filterable placeholder="饲料名称" class="filter-item" style="width: 150px;" clearable>
+        <el-option v-for="item in feedNameList" :key="item.id" :label="item.fname" :value="item.id" />
+      </el-select>
+      <el-button class="successBorder" @click="handleSearch">查询</el-button>
+      <el-button class="successBorder" @click="handleRefresh">重置</el-button>
+      <el-button class="export" icon="el-icon-upload2" style="float: right;margin-right: 10px;" @click="handleExport">导出</el-button>
+    </div>
+
+    <div class="table">
+      <el-table
+        :key="table.tableKey"
+        v-loading="table.listLoading"
+        element-loading-text="给我一点时间"
+        :data="table.list"
+        border
+        fit
+        highlight-current-row
+        style="width: 100%;"
+        :row-style="rowStyle"
+        :cell-style="cellStyle"
+        class="elTable table-fixed"
+        :max-height="myHeight"
+      >
+        <el-table-column label="序号" align="center" type="index" width="50px">
+          <template slot-scope="scope">
+            <span>{{ scope.$index + (table.pageNum-1) * table.pageSize + 1 }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="饲料名称" min-width="130px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.feedname }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="当前库存重量(kg)" min-width="110px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.stockweight }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="金额(元)" min-width="110px" align="center">
+          <template slot-scope="scope">
+            <span>{{ scope.row.sumprice }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="平均单价(元/kg)" min-width="130px" align="center">
+          <template slot-scope="scope">
+            <span>后台待返回</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" align="center" width="50" class-name="small-padding fixed-width" fixed="right">
+          <template slot-scope="{row}">
+            <el-button class="miniSuccess" icon="el-icon-search" :disabled="isokDisable" @click="handleSee(row)" />
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination v-show="table.total>=0" :total="table.total" :page.sync="table.getdataListParm.offset" :limit.sync="table.getdataListParm.pagecount" @pagination="getList" />
+    </div>
+
+    <el-dialog :fullscreen="dialogFull" :visible.sync="see.dialogFormVisible" :close-on-click-modal="false" width="90%">
+      <template slot="title">
+        <div class="avue-crud__dialog__header">
+          <span class="el-dialog__title">
+            <span style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px" />
+            {{ textMap[see.dialogStatus] }}
+          </span>
+          <div class="avue-crud__dialog__menu" @click="dialogFull? dialogFull=false: dialogFull=true">
+            <svg-icon v-if="dialogFull" icon-class="exit-fullscreen" />
+            <svg-icon v-else icon-class="fullscreen" />
+          </div>
+        </div>
+      </template>
+      <div class="app-see">
+        <el-tabs v-model="see.activeName" @tab-click="handleTabClick">
+          <el-tab-pane label="入库记录" name="first">
+            <div class="search">
+              <el-date-picker v-model="see.getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" />
+              <el-button class="successBorder" @click="handleSearch1">查询</el-button>
+            </div>
+            <div class="table">
+              <el-table
+                :key="see.tableKey"
+                v-loading="see.listLoading"
+                element-loading-text="给我一点时间"
+                :data="see.list"
+                border
+                fit
+                highlight-current-row
+                style="width: 100%;"
+                :row-style="rowStyle"
+                :cell-style="cellStyle"
+                class="elTable table-fixed"
+              >
+                <el-table-column label="序号" align="center" type="index" width="50px">
+                  <template slot-scope="scope">
+                    <span>{{ scope.$index + (see.pageNum-1) * see.pageSize + 1 }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="入库日期" min-width="130px" align="center">
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.laiddate }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="操作重量(kg)" min-width="130px" align="center">
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.operateweight }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="金额(元)" min-width="110px" align="center">
+                  <template slot-scope="scope">
+                    <span> {{ scope.row.sumprice }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="备注" min-width="110px" align="center">
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.remark }}</span>
+                  </template>
+                </el-table-column>
+              </el-table>
+            </div>
+            <pagination v-show="see.total>=0" style="margin-bottom: 50px;" :total="see.total" :page.sync="see.getdataListParm.offset" :limit.sync="see.getdataListParm.pagecount" @pagination="getSeeList" />
+          </el-tab-pane>
+          <el-tab-pane label="出库记录" name="second">
+            <div class="search">
+              <el-select v-model="see.getdataListParm2.parammaps.usetype" placeholder="出库类型" class="filter-item" style="width: 150px;" clearable>
+                <el-option v-for="item in deliveryTypeList" :key="item.id" :label="item.label" :value="item.value" />
+              </el-select>
+              <el-date-picker v-model="see.getdataListParm2.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" />
+              <el-button class="successBorder" @click="handleSearch2">查询</el-button>
+            </div>
+            <div class="table">
+              <el-table
+                :key="see.tableKey2"
+                v-loading="see.listLoading2"
+                element-loading-text="给我一点时间"
+                :data="see.list2"
+                border
+                fit
+                highlight-current-row
+                style="width: 100%;"
+                :row-style="rowStyle"
+                :cell-style="cellStyle"
+                class="elTable table-fixed"
+              >
+                <el-table-column label="序号" align="center" type="index" width="50px">
+                  <template slot-scope="scope">
+                    <span>{{ scope.$index + (see.pageNum2-1) * see.pageSize2 + 1 }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="出库日期" min-width="130px" align="center">
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.usedate }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="出库类型" min-width="130px" align="center">
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.usetype }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="牲畜类别" min-width="110px" align="center">
+                  <template slot-scope="scope">
+                    <span> {{ scope.row.cowclass }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="操作重量(kg)" min-width="110px" align="center">
+                  <template slot-scope="scope">
+                    <span> {{ scope.row.operateweight }}</span>
+                  </template>
+                </el-table-column>
+                <el-table-column label="备注" min-width="110px" align="center">
+                  <template slot-scope="scope">
+                    <span>{{ scope.row.remark }}</span>
+                  </template>
+                </el-table-column>
+              </el-table>
+            </div>
+            <pagination v-show="see.total2>=0" style="margin-bottom: 50px;" :total="see.total2" :page.sync="see.getdataListParm2.offset" :limit.sync="see.getdataListParm2.pagecount" @pagination="getSeeList2" />
+          </el-tab-pane>
+        </el-tabs>
+        <div slot="footer" class="dialog-footer">
+          <el-button class="cancelClose cancelClose1" @click="see.dialogFormVisible = false; ">关闭</el-button>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
+
+</template>
+
+<script>
+import { GetDataByName, GetDataByNames, checkButtons } from '@/api/common'
+import Pagination from '@/components/Pagination'
+import Cookies from 'js-cookie'
+import { parseTime, json2excel } from '@/utils/index.js'
+export default {
+  name: 'Statistics',
+  components: { Pagination },
+  data() {
+    return {
+      dialogFull: false,
+      isRoleEdit: [],
+      requestParams: [
+        { name: 'getFeedListEnable', offset: 0, pagecount: 0, parammaps: { pastureid: Cookies.get('pastureid') }},
+        { name: 'getDictByNameUse', offset: 0, pagecount: 0, params: ['人工用量操作类型'] }
+      ],
+      feedNameList: [], // 饲料名称
+      deliveryTypeList: [], // 出库类型
+      table: {
+        getdataListParm: {
+          name: 'getFeedstorageList',
+          page: 1,
+          offset: 1,
+          pagecount: parseInt(Cookies.get('pageCount')),
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            feedid: ''
+          }
+        },
+        tableKey: 0,
+        list: [],
+        total: 0,
+        listLoading: true
+      },
+      textMap: {
+        see: '库存'
+      },
+      see: {
+        dialogFormVisible: false,
+        dialogStatus: '',
+        temp: {},
+        rules: {},
+        getdataListParm: {
+          name: 'getFsLaidList',
+          page: 1,
+          offset: 1,
+          pagecount: 10,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: '',
+            feedid: '',
+            inputDatetime: '',
+            startTime: '',
+            stopTime: ''
+          }
+        },
+        tableKey: 0,
+        list: [],
+        total: 0,
+        listLoading: true,
+        activeName: 'first',
+        getdataListParm2: {
+          name: 'getFsUseList',
+          page: 1,
+          offset: 1,
+          pagecount: 10,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: '',
+            feedid: '',
+            inputDatetime: '',
+            startTime: '',
+            stopTime: '',
+            usetype: ''
+          }
+        },
+        tableKey2: 0,
+        list2: [],
+        total2: 0,
+        listLoading2: true
+      },
+      requestParam: {},
+      download: {
+        getdataListParm: {
+          name: 'getFeedstorageList',
+          page: 1,
+          offset: 1,
+          pagecount: 0,
+          returntype: 'Map',
+          parammaps: {
+            pastureid: Cookies.get('pastureid'),
+            feedid: ''
+          }
+        },
+        list: []
+      },
+      isokDisable: false,
+      rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
+      cellStyle: { padding: 0 + 'px' },
+      myHeight:document.documentElement.clientHeight - 85- 150 -10
+    }
+  },
+
+  created() {
+    this.getButtons()
+    this.getDownList()
+    this.getList()
+  },
+
+  methods: {
+    getButtons() {
+      const Edit = 'Statistics'
+      const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
+      this.isRoleEdit = isRoleEdit
+    },
+    getDownList() {
+      GetDataByNames(this.requestParams).then(response => {
+        this.feedNameList = response.data.getFeedListEnable.list
+        this.deliveryTypeList = response.data.getDictByNameUse.list
+      })
+    },
+    getList() {
+      this.table.listLoading = true
+      GetDataByName(this.table.getdataListParm).then(response => {
+        console.log('table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.table.list = response.data.list
+          this.table.pageNum = response.data.pageNum
+          this.table.pageSize = response.data.pageSize
+        } else {
+          this.table.list = []
+        }
+        this.table.total = response.data.total
+        setTimeout(() => {
+          this.table.listLoading = false
+        }, 100)
+      })
+    },
+
+    handleSearch() {
+      console.log('点击了查询')
+      this.table.getdataListParm.offset = 1
+      this.getList()
+    },
+    handleRefresh() {
+      console.log('点击了重置')
+      this.table.getdataListParm.offset = 1
+      this.table.getdataListParm.parammaps.feedid = ''
+      this.getList()
+    },
+    handleSee(row) {
+      this.see.dialogStatus = 'see'
+      this.dialogFull = false
+      this.see.dialogFormVisible = true
+      this.see.list = []
+      this.see.getdataListParm.offset = 1
+      this.see.getdataListParm2.offset = 1
+      this.see.getdataListParm.parammaps.pastureid = row.pastureid
+      this.see.getdataListParm.parammaps.feedid = row.feedid
+      this.see.getdataListParm2.parammaps.pastureid = row.pastureid
+      this.see.getdataListParm2.parammaps.feedid = row.feedid
+      this.see.activeName = 'first'
+      this.getSeeList()
+      this.getSeeList2()
+    },
+    getSeeList() {
+      this.see.listLoading = true
+      GetDataByName(this.see.getdataListParm).then(response => {
+        console.log('table数据', response.data.list)
+        if (response.data.list !== null) {
+          this.see.list = response.data.list
+          this.see.pageNum = response.data.pageNum
+          this.see.pageSize = response.data.pageSize
+          this.see.total = response.data.total
+        } else {
+          this.see.list = []
+        }
+        setTimeout(() => {
+          this.see.listLoading = false
+        }, 100)
+      })
+    },
+    getSeeList2() {
+      this.see.listLoading2 = true
+      GetDataByName(this.see.getdataListParm2).then(response => {
+        console.log('table数据2', response.data.list)
+        if (response.data.list !== null) {
+          this.see.list2 = response.data.list
+          this.see.pageNum2 = response.data.pageNum
+          this.see.pageSize2 = response.data.pageSize
+          this.see.total2 = response.data.total
+        } else {
+          this.see.list2 = []
+        }
+        setTimeout(() => {
+          this.see.listLoading2 = false
+        }, 100)
+      })
+    },
+    handleTabClick(val) {
+      if (val.name === 'first') {
+        this.getSeeList()
+      } else if (val.name === 'second') {
+        this.getSeeList2()
+      }
+    },
+    handleSearch1() {
+      console.log('点击了库存入库记录查询')
+      if (this.see.getdataListParm.parammaps.inputDatetime !== '' && this.see.getdataListParm.parammaps.inputDatetime !== null) {
+        this.see.getdataListParm.parammaps.startTime = parseTime(this.see.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+        this.see.getdataListParm.parammaps.stopTime = parseTime(this.see.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      } else {
+        this.see.getdataListParm.parammaps.inputDatetime = ''
+        this.see.getdataListParm.parammaps.startTime = ''
+        this.see.getdataListParm.parammaps.stopTime = ''
+      }
+      this.getSeeList()
+    },
+    handleSearch2() {
+      console.log('点击了库存出库记录查询')
+      if (this.see.getdataListParm2.parammaps.inputDatetime !== '' && this.see.getdataListParm2.parammaps.inputDatetime !== null) {
+        this.see.getdataListParm2.parammaps.startTime = parseTime(this.see.getdataListParm2.parammaps.inputDatetime[0], '{y}-{m}-{d}')
+        this.see.getdataListParm2.parammaps.stopTime = parseTime(this.see.getdataListParm2.parammaps.inputDatetime[1], '{y}-{m}-{d}')
+      } else {
+        this.see.getdataListParm2.parammaps.inputDatetime = ''
+        this.see.getdataListParm2.parammaps.startTime = ''
+        this.see.getdataListParm2.parammaps.stopTime = ''
+      }
+      this.getSeeList2()
+    },
+    handleExport() {
+      console.log('点击了导出')
+      this.download.getdataListParm.parammaps = this.table.getdataListParm.parammaps
+      GetDataByName(this.download.getdataListParm).then(response => {
+        if (response.data.list !== null) {
+          this.download.list = response.data.list
+        } else {
+          this.download.list = []
+        }
+        var excelDatas = [
+          {
+            tHeader: ['饲料名称', '批号', '当前库存重量(kg)', '金额(元)'],
+            filterVal: ['feedname', 'pcpde', 'stockweight', 'sumprice'],
+            tableDatas: this.download.list,
+            sheetName: 'Sheet1'
+          }
+        ]
+        json2excel(excelDatas, '库存统计', true, 'xlsx')
+      })
+    }
+
+  }
+}
+</script>
+<style lang="scss" scoped>
+  .search{margin-top:10px;}
+
+</style>