| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643 | <template>  <div class="app-container home">    <ul class="block">      <li @click="jump('/business/inStock')">        <div>          <i class="el-icon-download" style="font-size: 50px;text-align: center"></i>          <p>入库</p>        </div>      </li>      <li @click="jump('/business/outStock')">        <div>          <i class="el-icon-upload2" style="font-size: 50px;text-align: center"></i>          <p>出库</p>        </div>      </li>      <li @click="jump('/basicdata/corps')">        <div>          <i class="el-icon-s-custom" style="font-size: 50px;text-align: center"></i>          <p>新增用户</p>        </div>      </li>      <li @click="jump('/basicdata/goods')">        <div>          <i class="el-icon-s-cooperation" style="font-size: 50px;text-align: center"></i>          <p>新增商品</p>        </div>      </li>      <li @click="jump('/business/transfer')">        <div>          <i class="el-icon-connection" style="font-size: 50px;text-align: center"></i>          <p>调拨</p>        </div>      </li>      <li @click="jump('/finance/charge')">        <div>          <i class="el-icon-wallet" style="font-size: 50px;text-align: center"></i>          <p>收款</p>        </div>      </li>      <li @click="jump('/finance/payment')">        <div>          <i class="el-icon-money" style="font-size: 50px;text-align: center"></i>          <p>付款</p>        </div>      </li>      <li @click="jump('/finance/contrast')">        <div>          <i class="el-icon-s-management" style="font-size: 50px;text-align: center"></i>          <p>对账</p>        </div>      </li>      <li @click="jump('/business/goodsTransfer')">        <div>          <i class="el-icon-takeaway-box" style="font-size: 50px;text-align: center"></i>          <p>货转</p>        </div>      </li>      <li @click="jump('/agreement/agreementStorage')">        <div>          <i class="el-icon-s-order" style="font-size: 50px;text-align: center"></i>          <p>协议</p>        </div>      </li>    </ul>    <div style="width: 30%;float: right">      <div style="display: flex;">        <div id="box" style="width:100%;height:350px;"></div>        <el-select v-model="select" slot="prepend" size="mini" :select="query()" placeholder="点击切换仓库"                   style="position:absolute; width: 8%;right: 1%;"        >          <div v-for="(item, index) in warehouse" :key="index">            <el-option :label="item.fName" :value="item.fWarehouseid"></el-option>          </div>        </el-select>      </div>    </div>    <div style="width: 100%;margin-bottom: 50px;">      <el-table :data="tableData" :header-cell-style="{borderBottom:'1px dashed #dfe6ec'}" :cell-style="cellStyle"                style="width: 67.5%;float: left;"      >        <el-table-column prop="refno1" :show-overflow-tooltip="true" label="委托方"></el-table-column>        <el-table-column prop="auditItem" :show-overflow-tooltip="true" label="日期">          <template slot-scope="scope">            <span>{{ scope.row.auditItem.slice(0,10) }}</span>          </template>        </el-table-column>        <el-table-column prop="refno3" :show-overflow-tooltip="true" label="提单号"></el-table-column>        <el-table-column prop="refno2" :show-overflow-tooltip="true" label="业务类型">          <template slot-scope="scope">            <span v-if="scope.row.refno2 === 'SJRK'">入库</span>            <span v-else-if="scope.row.refno2 === 'SJCK'">出库</span>            <span v-else-if="scope.row.refno2 === 'HQZY'">货转</span>            <span v-else-if="scope.row.refno2 === 'CKDB'">调拨</span>            <span v-else-if="scope.row.refno2 === 'CCF'">仓储费</span>            <span v-else-if="scope.row.refno2 === 'ZYF'">作业费</span>            <span v-else-if="scope.row.refno2 === 'SF'">收费</span>            <span v-else-if="scope.row.refno2 === 'DZ'">对账</span>            <span v-else-if="scope.row.refno2 === 'FF'">付费</span>          </template>        </el-table-column>        <el-table-column prop="address" label="操作" width="80">          <template slot-scope="scope">            <span style="cursor:pointer" @click="approval(scope.row)">查看详情</span>          </template>        </el-table-column>      </el-table>      <el-table :data="tableDataTwo" :header-cell-style="{borderBottom:'1px dashed #dfe6ec'}" :cell-style="cellStyle"                style="width: 30%;float: right;margin-left: 20px;"      >        <el-table-column prop="noticeTitle" :show-overflow-tooltip="true" label="消息中心"/>        <el-table-column prop="address" label="操作" width="80">          <template slot-scope="scope">            <span @click="querytoDo(scope.row.noticeContent)" style="cursor:pointer">查看详情</span>          </template>        </el-table-column>      </el-table>    </div>    <div style="width: 100%;float: left;margin-top:20px;">      <div style="display: flex;">        <div id="commoDity" style="width:68%;height:350px;margin-left: 40px"></div>        <div id="cargoOwner" style="width:30%;height:350px;"></div>      </div>    </div>    <el-dialog      title="消息提示"      :visible.sync="dialogVisible"      width="80%"      :before-close="handleClose"      :close-on-click-modal="false"    >      <span v-html="text" class="text" style="max-width: 100%;height: auto;"></span>      <span slot="footer" class="dialog-footer"><!--    <el-button @click="dialogVisible = false">取 消</el-button>-->    <el-button type="primary" @click="dialogVisible = false">关 闭</el-button>  </span>    </el-dialog>    <el-button type="primary" @click="addOrUpdateHandle">查看审批</el-button>    <el-button type="primary" @click="addOrUpdateHand">审批弹窗</el-button>    <!-- 弹窗, 新增 / 修改 -->    <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>    <approval-comments v-if="addOrUpdateVisib" ref="ApprovalComments" @refreshDataList="returnData"></approval-comments>  </div></template><script>import { listCorps, information, warehouse ,inquiry} from '../../src/api/index'import AddOrUpdate from '@/views/viewApproval'import ApprovalComments from '@/views/startApproval'export default {  name: 'index',  data() {    return {      editModel: {},      // 版本号      version: '3.2.1',      select: '',      text: '',      dialogVisible: false,      addOrUpdateVisible: false,      addOrUpdateVisib: false,      tableData: [],      chart: [],      warehouse: [],      master: [],      commodity: [],      commoditytwo: [],      name: [],      tableDataTwo: []    }  },  components: {    AddOrUpdate,    ApprovalComments  },  created() {    this.getList()    this.warehouses()    this.firstinventory()    this.inquiry()  },  methods: {    //跳转审批页面    approval(row){      switch (row.refno2){        case 'SJRK':{          this.$router.push({ path: '/finance/contrast',query:{data:row}})          break        }        case 'SJCK':{          break        }        case 'HQZY':{          break        }        case 'CKDB':{          break        }        case 'CCF':{          break        }        case 'ZYF':{          break        }        case 'SF':{          break        }        case 'DZ':{          break        }        case 'FF':{          break        }        default:{          return this.$message.error('未知错误,无状态')        }      }    },    inquiry(){      let data = {        actId: ''      }      inquiry(data).then( res =>{        console.log(res)        this.tableData = res.data      })    },    getDataList(){      this.addOrUpdateVisible = false    },    returnData(){      this.addOrUpdateVisib = false    },    addOrUpdateHandle(){      this.addOrUpdateVisible = true      let id = '448'      let actId = '110'      this.$nextTick(() => {        this.$refs.addOrUpdate.init(id,actId)      })    },    addOrUpdateHand(){      this.addOrUpdateVisib = true      let id = '448'      let actId = '110'      this.$nextTick(() => {        this.$refs.ApprovalComments.init(id,actId)      })    },    querytoDo(res) {      this.dialogVisible = true      this.text = res    },    handleClose(done) {      // console.log(done)      this.dialogVisible = false    },    firstinventory() {      information(0).then(response => {        this.chart = response.data        for (let index of this.chart.corpsListWhouse) {          this.master.push({            name: index.fName,            value: index.fGrossweightD          })          this.name.push(index.fName)        }        for (let index of this.chart.goodslistWhouse) {          this.commodity.push(index.fName)          this.commoditytwo.push(index.fGrossweightD)        }        this.drawLine()        this.drawLinetwo()        this.commoDity()      })    },    query() {      this.master = []      this.commodity = []      this.commoditytwo = []      this.name = []      if (this.select === '') {        return this.select      } else {        information(this.select).then(response => {          this.chart = response.data          for (let index of this.chart.corpsListWhouse) {            this.master.push({              name: index.fName,              value: index.fGrossweightD            })            this.name.push(index.fName)          }          for (let index of this.chart.goodslistWhouse) {            this.commodity.push(index.fName)            this.commoditytwo.push(index.fGrossweightD)          }          this.drawLine()          this.drawLinetwo()          this.commoDity()        })      }    },    jump(res) {      this.$router.push({ path: res })    },    //设置单元格边框    cellStyle({ row, column, rowIndex, columnIndex }) {      return 'border-bottom: 1px dashed rgb(223, 230, 236)'    },    //查询消息中心    getList() {      this.loading = true      listCorps(this.queryParams).then(response => {        this.tableDataTwo = response.rows      })    },    //查询仓库    warehouses() {      warehouse().then(response => {        this.warehouse = []        for (let index of response.rows) {          this.warehouse.push({            fName: index.fName,            fWarehouseid: index.fWarehouseid          })        }      })    },    goTarget(href) {      window.open(href, '_blank')    },    //仓库图表    drawLine() {      // 基于准备好的dom,初始化echarts实例,所以只能在mounted中调用      let myChart = this.$echarts.init(document.getElementById('box'))      // 绘制图表      myChart.setOption({        title: {          text: this.chart.whouseList[0].fName + '统计',          subtext: '实时数据',          left: 'center'        },        tooltip: {          trigger: 'item',          formatter: '{a} <br/>{b} : {c} ({d}%)'        },        legend: {          bottom: 10,          left: 'center',          data: ['空闲库容', '占用库容']        },        series: [          {            type: 'pie',            name: '实时数据',            radius: '65%',            center: ['50%', '50%'],            selectedMode: 'single',            data: [              {                label: {                  backgroundColor: '#eee',                  borderColor: '#777',                  borderWidth: 1,                  borderRadius: 4,                  rich: {                    title: {                      color: '#eee',                      align: 'center'                    },                    abg: {                      backgroundColor: '#333',                      width: '100%',                      align: 'right',                      height: 25,                      borderRadius: [4, 4, 0, 0]                    },                    Sunny: {                      height: 30,                      align: 'left'                    },                    Cloudy: {                      height: 30,                      align: 'left'                    },                    Showers: {                      height: 30,                      align: 'left'                    },                    weatherHead: {                      color: '#333',                      height: 24,                      align: 'left'                    },                    hr: {                      borderColor: '#777',                      width: '100%',                      borderWidth: 0.5,                      height: 0                    },                    value: {                      width: 20,                      padding: [0, 20, 0, 30],                      align: 'left'                    },                    valueHead: {                      color: '#333',                      width: 20,                      padding: [0, 20, 0, 30],                      align: 'center'                    },                    rate: {                      width: 40,                      align: 'right',                      padding: [0, 10, 0, 0]                    },                    rateHead: {                      color: '#333',                      width: 40,                      align: 'center',                      padding: [0, 10, 0, 0]                    }                  }                }              },              { value: this.chart.whouseList[0].fGrossweightD, name: '占用库容' },              { value: parseFloat(this.chart.whouseList[0].fTotalgross - this.chart.whouseList[0].fGrossweightD).toFixed(1), name: '空闲库容' }            ],            emphasis: {              itemStyle: {                shadowBlur: 10,                shadowOffsetX: 0,                shadowColor: 'rgba(0, 0, 0, 0.5)'              }            }          }        ]      })    },    drawLinetwo() {      // 基于准备好的dom,初始化echarts实例,所以只能在mounted中调用      let myChart = this.$echarts.init(document.getElementById('cargoOwner'))      // 绘制图表      myChart.setOption({        title: {          text: this.chart.whouseList[0].fName + '货权方统计',          subtext: '实时数据',          left: 'center'        },        tooltip: {          trigger: 'item',          formatter: '{a} <br/>{b}: {c} ({d}%)'        },        legend: {          bottom: 10,          left: 'center',          data: this.name        },        series: [          {            name: '访问来源',            type: 'pie',            radius: ['40%', '60%'],            avoidLabelOverlap: false,            label: {              show: false,              position: 'center'            },            emphasis: {              label: {                // show: true,                fontSize: '30',                fontWeight: 'bold'              }            },            labelLine: {              show: false            },            data:            this.master          }        ]      })    },    commoDity() {      // 基于准备好的dom,初始化echarts实例,所以只能在mounted中调用      let myChart = this.$echarts.init(document.getElementById('commoDity'))      // 绘制图表      myChart.setOption({        title: {          text:this.chart.whouseList[0].fName + '商品统计',          subtext: '实时数据',          left: 'center'        },        color: ['#3398DB'],        tooltip: {          trigger: 'axis',          axisPointer: {            // 坐标轴指示器,坐标轴触发有效            type: 'shadow'        // 默认为直线,可选为:'line' | 'shadow'          }        },        grid: {          left: '3%',          right: '4%',          bottom: '3%',          containLabel: true        },        xAxis: [          {            type: 'category',            data: this.commodity,            axisTick: {              alignWithLabel: true            }          }        ],        yAxis: [          {            type: 'value'          }        ],        series: [          {            name: '实时状态',            type: 'bar',            barWidth: '60%',            data: this.commoditytwo          }        ]      })    }  }}</script><style scoped lang="scss">.block {  width: 68%;  float: left;  display: flex;  flex-wrap: wrap;  justify-content: space-around;  height: 350px;  li:hover{    background-color: #025184;  }  li:nth-child(6),li:nth-child(7),li:nth-child(8),li:nth-child(9),li:nth-child(10){    background-color: #2f4554;  }  li:nth-child(6):hover,li:nth-child(7):hover,li:nth-child(8):hover,li:nth-child(9):hover,li:nth-child(10):hover{    background-color: #2f4454d1;  }  li {    width: 18%;    height: 150px;    background-color: #1c84c6;    margin-left: 10px;    text-align: center;    color: #FFFFFF;    border-radius: 10px;    cursor:pointer;    div {      margin-top: 40px;      p {        font-size: 20px;      }    }  }}.home {  blockquote {    padding: 10px 20px;    margin: 0 0 20px;    font-size: 17.5px;    border-left: 5px solid #eee;  }  hr {    margin-top: 20px;    margin-bottom: 20px;    border: 0;    border-top: 1px solid #eee;  }  .col-item {    margin-bottom: 20px;  }  ul {    padding: 0;    margin: 0;  }  font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;  font-size: 13px;  color: #676a6c;  overflow-x: hidden;  ul {    list-style-type: none;  }  h4 {    margin-top: 0px;  }  h2 {    margin-top: 10px;    font-size: 26px;    font-weight: 100;  }  p {    margin-top: 10px;    b {      font-weight: 700;    }  }  .update-log {    ol {      display: block;      list-style-type: decimal;      margin-block-start: 1em;      margin-block-end: 1em;      margin-inline-start: 0;      margin-inline-end: 0;      padding-inline-start: 40px;    }  }}</style><style>.text img {  max-width: 100%;  height: auto;}</style>
 |