<template>
  <div class="content-main">
    <el-tabs v-model="activeName" @tab-click="handletabClick">
      <el-tab-pane label="倒仓" name="dc"></el-tab-pane>
      <el-tab-pane label="移库" name="yk"></el-tab-pane>
    </el-tabs>
    <el-row class="search-bm-boder">
      <el-form :inline="true" :model="formInline" class="demo-form-inline">
				<el-row>
					<el-form-item label="品种:">
						<el-cascader
							style="width: 180px"
							:options="pzOptions"
							:props="pzProps"
							clearable
							:show-all-levels="false"
							v-model="formInline.pz"
							placeholder="请选择品种"
						></el-cascader>
					</el-form-item>
					<el-form-item label="申请企业:">
						<el-input
							clearable
							v-model="formInline.ssqymc"
							placeholder="请输入"
						></el-input>
					</el-form-item>
					<el-form-item label="移入企业:" v-if="activeName == 'yk'">
						<el-input
							clearable
							v-model="formInline.yrkssqymc"
							placeholder="请输入"
						></el-input>
					</el-form-item>
					<el-form-item label="仓号:" v-if="activeName == 'dc'">
						<el-input
							clearable
							v-model="formInline.drc"
							placeholder="请输入"
						></el-input>
					</el-form-item>
					<el-form-item>
						<div class="search-button">
							<span class="search-line"></span>
							<div
								class="search-select"
								@click="
									searchShowMoreBool = !searchShowMoreBool
								"
							>
								更多条件
								<i
									class="el-icon-arrow-up"
									v-show="searchShowMoreBool"
								></i>
								<i
									class="el-icon-arrow-down"
									v-show="!searchShowMoreBool"
								></i>
							</div>
							<el-button
								type="primary"
								size="small"
								class="iconfont iconchaxun"
								@click="getList"
								>查询</el-button
							>
							<el-button
								type="primary"
								@click="
									formInline = {}
									doSearch()
								"
								size="small"
								class="iconfont iconzhongzhi"
								>重置</el-button
							>
						</div>
					</el-form-item>
				</el-row>
				<el-row v-show="searchShowMoreBool">
					<el-form-item label="移入仓号:" v-if="activeName == 'yk'">
						<el-input
							clearable
							v-model="formInline.yrksskdmc"
							placeholder="请输入"
						></el-input>
					</el-form-item>
					<el-form-item label="审批日期:">
						<el-date-picker
							@change="ChangereportDate"
							v-model="formInline.shrqList"
							type="daterange"
							range-separator="至"
							class="dateInputCompatible"
							start-placeholder="开始日期"
							end-placeholder="结束日期"
							format="yyyy-MM-dd"
							value-format="yyyy-MM-dd"
						>
						</el-date-picker>
					</el-form-item>
					<el-form-item label="状态:">
						<el-cascader
							style="width: 190px"
							:options="pzOptions2"
							:props="pzProps2"
							clearable
							:show-all-levels="false"
							v-model="formInline.shzt"
							placeholder="请选择状态"
						></el-cascader>
					</el-form-item>
				</el-row>
      </el-form>
    </el-row>
    <el-row v-if="activeName == 'dc'">
      <el-table
        :data="tableData"
        stripe
        v-loading="listLoading"
        border
        fit
        highlight-current-row
        style="width: 100%"
        :span-method="spanMethodOfParent"
      >
        <el-table-column align="center" label="序号" width="70">
          <template slot-scope="scope">
            <span>{{ scope.$index + 1 }}</span>
          </template>
        </el-table-column>
        <el-table-column
          align="center"
          prop="ssqymc"
          label="申请企业"
          show-overflow-tooltip
        >
        </el-table-column>
        <el-table-column
          label="倒入仓"
          class-name="table_cell"
        >
          <template slot-scope="scope">
            <el-table
              :data="scope.row.dcykbtmxDOList"
              :show-header="false"
              empty-text=" "
              :class="{
                in_table: true,
                inner_table: scope.row.dcykbtmxDOList.length == 1,
              }"
              v-if="scope.row.dcykbtmxDOList && scope.row.dcykbtmxDOList.length > 0"
            >
              <el-table-column
                align="center"
                prop="mdcfbhmc"
                label="倒入仓"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                align="center"
                prop="pzbmmc"
                label="品种"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                align="center"
                prop="cs"
                label="差数"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                align="center"
                prop="dnlhjsdj"
                label="当年轮换结算单价"
                 width="140px"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                align="center"
                prop="ysqbgbtje"
                label="预申请包干补贴金额"
                 width="144px"
                show-overflow-tooltip
              >
              </el-table-column>
            </el-table>
            <el-table
              :data="emptyData"
              style="width: 100%,height:100%"
              v-else
              :show-header="false"
              empty-text=" "
              class="empty_table"
            >
              <el-table-column></el-table-column>
              <el-table-column></el-table-column>
              <el-table-column></el-table-column>
              <el-table-column></el-table-column>
              <el-table-column></el-table-column>
            </el-table>
          </template>
        </el-table-column>
				<el-table-column
					align="center"
					label="品种"
				>
				</el-table-column>
				<el-table-column
					align="center"
					label="差数"
				>
				</el-table-column>
				<el-table-column
					align="center"
					label="当年轮换结算单价"
                 width="140px"
				>
				</el-table-column>
				<el-table-column
					align="center"
					label="预申请包干补贴金额"
                 width="145px"
				>
				</el-table-column>
        <el-table-column
          align="center"
          prop="shrq"
          label="审批日期"
          show-overflow-tooltip
        >
        </el-table-column>
        <el-table-column
          align="center"
          prop="shzt"
          label="状态"
          show-overflow-tooltip
        >
          <template slot-scope="scope">
            <span v-if="scope.row.shzt && scope.row.shzt==0">待提交</span>
            <span v-if="scope.row.shzt && scope.row.shzt==2">待盖章</span>
            <span v-if="scope.row.shzt && scope.row.shzt==4">待财务审核</span>
            <span v-if="scope.row.shzt && scope.row.shzt==5">审核人驳回</span>
            <span v-if="scope.row.shzt && scope.row.shzt==6">待财务复核</span>
            <span v-if="scope.row.shzt && scope.row.shzt==7">复核人驳回</span>
            <span v-if="scope.row.shzt && scope.row.shzt==8">待财务领导批示</span>
            <span v-if="scope.row.shzt && scope.row.shzt==9">财务领导驳回</span>
            <span v-if="scope.row.shzt && scope.row.shzt==10">待单位领导批示</span>
            <span v-if="scope.row.shzt && scope.row.shzt==11">单位领导驳回</span>
            <span v-if="scope.row.shzt && scope.row.shzt==12">审批通过</span>
            <span v-if="scope.row.shzt && scope.row.shzt==13">单位负责人撤销</span>
          </template>
        </el-table-column>
        <el-table-column align="center" label="操作" width="130px">
          <template slot-scope="scope">
            <el-tooltip
              class="item"
              effect="light"
              content="查看"
              placement="top"
            >
              <el-button
                @click="addSubmit(scope.row, 'detail')"
                style="float: left"
                type="primary"
                size="small"
                class="operate_show_btn iconfont iconchakan2"
              ></el-button>
            </el-tooltip>
            <el-tooltip
              class="item"
              effect="light"
              content="查看验收报告"
              placement="top"
            >
              <el-button
                @click="searchReport(scope.row)"
                style="float: left"
                type="primary"
                size="small"
                class="operate_show_btn iconfont iconpifu"
              ></el-button>
            </el-tooltip>
            <el-tooltip
              v-if="
                (scope.row.shzt == '4' || scope.row.shzt == '7')
                && buttonNameList.indexOf('财务审核') > -1
              "
              class="item"
              effect="light"
              content="财务审核"
              placement="top"
            >
              <el-button
                @click="addSubmit(scope.row, 'edit')"
                style="float: left"
                type="primary"
                size="small"
                class="operate_edit_btn iconfont iconshenhe"
              ></el-button>
            </el-tooltip>
            <el-tooltip
              v-if="
                (scope.row.shzt == '6' || scope.row.shzt == '9')
                && buttonNameList.indexOf('财务复核') > -1
              "
              class="item"
              effect="light"
              content="财务复核"
              placement="top"
            >
              <el-button
                @click="addSubmit(scope.row, 'edit')"
                style="float: left"
                type="primary"
                size="small"
                class="operate_edit_btn iconfont iconshenhe"
              ></el-button>
            </el-tooltip>
            <el-tooltip
              v-if="
                (scope.row.shzt == '8' || scope.row.shzt == '11' || scope.row.shzt == '13')
                && buttonNameList.indexOf('财务领导批示') > -1
              "
              class="item"
              effect="light"
              content="财务领导批示"
              placement="top"
            >
              <el-button
                @click="addSubmit(scope.row, 'edit')"
                style="float: left"
                type="primary"
                size="small"
                class="operate_edit_btn iconfont iconshenhe"
              ></el-button>
            </el-tooltip>
            <el-tooltip
              v-if="
                scope.row.shzt == '10'
                && buttonNameList.indexOf('单位领导批示') > -1
              "
              class="item"
              effect="light"
              content="单位领导批示"
              placement="top"
            >
              <el-button
                @click="addSubmit(scope.row, 'edit')"
                style="float: left"
                type="primary"
                size="small"
                class="operate_edit_btn iconfont iconshenhe"
              ></el-button>
            </el-tooltip>
            <el-tooltip
              v-if="
                scope.row.shzt == '12'
                && buttonNameList.indexOf('撤销') > -1
              "
              class="item"
              effect="light"
              content="撤销"
              placement="top"
            >
              <el-button
                @click="reject(scope.row)"
                style="float: left"
                type="primary"
                size="small"
                class="operate_edit_btn iconfont iconfanhui"
              ></el-button>
            </el-tooltip>
            <!-- <el-tooltip
              class="item"
              effect="light"
              content="导出"
              placement="top"
            >
              <el-button
                @click="addSubmit(scope.row, 'export')"
                style="float: left"
                type="primary"
                size="small"
                class="operate_edit_btn iconfont icondaochu11"
              ></el-button>
            </el-tooltip> -->
          </template>
        </el-table-column>
      </el-table>
    </el-row>
    <el-row v-if="activeName == 'yk'">
      <el-table
        :data="tableData"
        stripe
        v-loading="listLoading"
        border
        fit
        highlight-current-row
        style="width: 100%"
        :span-method="spanMethodOfParent2"
      >
        <el-table-column align="center" label="序号" width="70">
          <template slot-scope="scope">
            <span>{{ scope.$index + 1 }}</span>
          </template>
        </el-table-column>
        <el-table-column
          align="center"
          prop="ssqymc"
          label="申请企业"
          show-overflow-tooltip
        >
        </el-table-column>
        <el-table-column
          align="center"
          prop="yrkssqymc"
          label="移入企业"
          show-overflow-tooltip
        >
        </el-table-column>
        <el-table-column
          label="移入仓"
          class-name="table_cell"
        >
          <template slot-scope="scope">
            <el-table
              :data="scope.row.dcykbtmxDOList"
              :show-header="false"
              empty-text=" "
              :class="{
                in_table: true,
                inner_table: scope.row.dcykbtmxDOList.length == 1,
              }"
              v-if="scope.row.dcykbtmxDOList && scope.row.dcykbtmxDOList.length > 0"
            >
              <el-table-column
                align="center"
                prop="mdcfbhmc"
                label="移入仓"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                align="center"
                prop="pzbmmc"
                label="品种"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                align="center"
                prop="cs"
                label="差数"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                align="center"
                prop="dnlhjsdj"
                label="当年轮换结算单价"
                 width="140px"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                align="center"
                prop="ysqbgbtje"
                label="预申请包干补贴金额"
                 width="144px"
                show-overflow-tooltip
              >
              </el-table-column>
            </el-table>
            <el-table
              :data="emptyData"
              style="width: 100%,height:100%"
              v-else
              :show-header="false"
              empty-text=" "
              class="empty_table"
            >
              <el-table-column></el-table-column>
              <el-table-column></el-table-column>
              <el-table-column></el-table-column>
              <el-table-column></el-table-column>
              <el-table-column></el-table-column>
            </el-table>
          </template>
        </el-table-column>
				<el-table-column
					align="center"
					label="品种"
				>
				</el-table-column>
				<el-table-column
					align="center"
					label="差数"
				>
				</el-table-column>
				<el-table-column
					align="center"
					label="当年轮换结算单价"
           width="140px"
				>
				</el-table-column>
				<el-table-column
					align="center"
					label="预申请包干补贴金额"
          width="145px"
				>
				</el-table-column>
        <el-table-column
          align="center"
          prop="shrq"
          label="审批日期"
          show-overflow-tooltip
        >
        </el-table-column>
        <el-table-column
          align="center"
          prop="shzt"
          label="状态"
          show-overflow-tooltip
        >
          <template slot-scope="scope">
            <span v-if="scope.row.shzt && scope.row.shzt==0">待提交</span>
            <span v-if="scope.row.shzt && scope.row.shzt==2">待盖章</span>
            <span v-if="scope.row.shzt && scope.row.shzt==4">待财务审核</span>
            <span v-if="scope.row.shzt && scope.row.shzt==5">审核人驳回</span>
            <span v-if="scope.row.shzt && scope.row.shzt==6">待财务复核</span>
            <span v-if="scope.row.shzt && scope.row.shzt==7">复核人驳回</span>
            <span v-if="scope.row.shzt && scope.row.shzt==8">待财务领导批示</span>
            <span v-if="scope.row.shzt && scope.row.shzt==9">财务领导驳回</span>
            <span v-if="scope.row.shzt && scope.row.shzt==10">待单位领导批示</span>
            <span v-if="scope.row.shzt && scope.row.shzt==11">单位领导驳回</span>
            <span v-if="scope.row.shzt && scope.row.shzt==12">审批通过</span>
            <span v-if="scope.row.shzt && scope.row.shzt==13">单位负责人撤销</span>
          </template>
        </el-table-column>
        <el-table-column align="center" label="操作" width="130px">
          <template slot-scope="scope">
            <el-tooltip
              class="item"
              effect="light"
              content="查看"
              placement="top"
            >
              <el-button
                @click="addSubmit(scope.row, 'detail')"
                style="float: left"
                type="primary"
                size="small"
                class="operate_show_btn iconfont iconchakan2"
              ></el-button>
            </el-tooltip>
            <el-tooltip
              class="item"
              effect="light"
              content="查看验收报告"
              placement="top"
            >
              <el-button
                @click="searchReport(scope.row)"
                style="float: left"
                type="primary"
                size="small"
                class="operate_show_btn iconfont iconpifu"
              ></el-button>
            </el-tooltip>
            <el-tooltip
              v-if="
                (scope.row.shzt == '4' || scope.row.shzt == '7')
                && buttonNameList.indexOf('财务审核') > -1
              "
              class="item"
              effect="light"
              content="财务审核"
              placement="top"
            >
              <el-button
                @click="addSubmit(scope.row, 'edit')"
                style="float: left"
                type="primary"
                size="small"
                class="operate_edit_btn iconfont iconshenhe"
              ></el-button>
            </el-tooltip>
            <el-tooltip
              v-if="
                (scope.row.shzt == '6' || scope.row.shzt == '9')
                && buttonNameList.indexOf('财务复核') > -1
              "
              class="item"
              effect="light"
              content="财务复核"
              placement="top"
            >
              <el-button
                @click="addSubmit(scope.row, 'edit')"
                style="float: left"
                type="primary"
                size="small"
                class="operate_edit_btn iconfont iconshenhe"
              ></el-button>
            </el-tooltip>
            <el-tooltip
              v-if="
                (scope.row.shzt == '8' || scope.row.shzt == '11' || scope.row.shzt == '13')
                && buttonNameList.indexOf('财务领导批示') > -1
              "
              class="item"
              effect="light"
              content="财务领导批示"
              placement="top"
            >
              <el-button
                @click="addSubmit(scope.row, 'edit')"
                style="float: left"
                type="primary"
                size="small"
                class="operate_edit_btn iconfont iconshenhe"
              ></el-button>
            </el-tooltip>
            <el-tooltip
              v-if="
                scope.row.shzt == '10'
                && buttonNameList.indexOf('单位领导批示') > -1
              "
              class="item"
              effect="light"
              content="单位领导批示"
              placement="top"
            >
              <el-button
                @click="addSubmit(scope.row, 'edit')"
                style="float: left"
                type="primary"
                size="small"
                class="operate_edit_btn iconfont iconshenhe"
              ></el-button>
            </el-tooltip>
            <el-tooltip
              v-if="
                scope.row.shzt == '12'
                && buttonNameList.indexOf('撤销') > -1
              "
              class="item"
              effect="light"
              content="撤销"
              placement="top"
            >
              <el-button
                @click="reject(scope.row)"
                style="float: left"
                type="primary"
                size="small"
                class="operate_edit_btn iconfont iconfanhui"
              ></el-button>
            </el-tooltip>
            <!-- <el-tooltip
              class="item"
              effect="light"
              content="导出"
              placement="top"
            >
              <el-button
                @click="addSubmit(scope.row, 'export')"
                style="float: left"
                type="primary"
                size="small"
                class="operate_edit_btn iconfont icondaochu11"
              ></el-button>
            </el-tooltip> -->
          </template>
        </el-table-column>
      </el-table>
    </el-row>
    <el-row class="MarRow">
      <span>合计：</span>&emsp;<span>差数={{ tableData.length>0?tableData[0].csHj:"0" }}吨</span>&emsp;&emsp;<span>预申请包干补贴金额={{ tableData.length>0?tableData[0].btjeHj:"0" }}吨</span>
    </el-row>
    <el-row>
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page.sync="pageForm.pageNum"
        :page-sizes="[10, 20, 30, 40]"
        :page-size="pageForm.pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="pageForm.total"
      ></el-pagination>
    </el-row>
  </div>
</template>

<script>
import { selectList, getPzOptions, update } from "@/api/reverseSubsidy/index";
import { authorityControl } from '@/api/login/login'
export default {
  data() {
    return {
      activeName: "dc",
      formInline: {},
      searchShowMoreBool:false,
      listLoading: false,
      tableData: [],
      pageForm: {
        pageNum: 1,
        pageSize: 10,
        total: 0,
      },
      emptyData:[{}],
      pzProps: {
        label: "dictName",
        value: "dictName",
        key: "dictCode",
        children: "subDataDictionarys",
        // checkStrictly: true,

        emitPath: false,
      },
      pzOptions: [],
      pzProps2: {
        label: "dictName",
        value: "dictCode",
        key: "dictCode",
        // checkStrictly: true,

        emitPath: false,
      },
      pzOptions2: [
        {
          dictCode: "0",
          dictName: "待提交",
        },
        {
          dictCode: "2",
          dictName: "待盖章",
        },
        {
          dictCode: "4",
          dictName: "待财务审核",
        },
        {
          dictCode: "5",
          dictName: "审核人驳回",
        },
        {
          dictCode: "6",
          dictName: "待财务复核",
        },
        {
          dictCode: "7",
          dictName: "复核人驳回",
        },
        {
          dictCode: "8",
          dictName: "待财务领导批示",
        },
        {
          dictCode: "9",
          dictName: "财务领导驳回",
        },
        {
          dictCode: "10",
          dictName: "待单位领导批示",
        },
        {
          dictCode: "11",
          dictName: "单位领导驳回",
        },
        {
          dictCode: "12",
          dictName: "审批通过",
        },
      ],
      buttonNameList:[],
      /**
       *审核状态：
       0，待提交；
       2，待盖章；
       3，已驳回；
       4，待制表人审批；
       5，制表人驳回；
       6，待复核人审批；
       7，复核人驳回；
       8，待财务领导批示；
       9，财务领导驳回；
       10，待单位负责人批示；
       11，单位负责人驳回；
       12，审批通过；
       13，单位负责人撤销；",
       */
    };
  },
  created() {
    if (this.$route.query.active == "yk") {
      this.activeName = "yk";
    } else {
      this.activeName = "dc";
    }
    this.getresourceCode();
  },
  methods: {
    getresourceCode() {
      let codeData = {
        resourceCode: sessionStorage.getItem("resourceCode"),
        userId: sessionStorage.getItem("userCode"),
      };
      authorityControl(codeData).then((res) => {
        this.buttonNameList = [];
        res.data.forEach((item) => {
          this.buttonNameList.push(item.resourceName);
        });
        this.getList("start");
      });
    },
    handletabClick(tab, event) {
      this.formInline = {};
      this.pageForm = {
        pageNum: 1,
        pageSize: 10,
        total: 0,
      };
      this.activeName = tab.name;
      this.searchShowMoreBool = false
      this.getList();
    },
    ChangereportDate(val) {
      this.formInline.shrqks = val[0];
      this.formInline.shrqjs = val[1];
    },
    doSearch() {
      this.pageForm.pageNum = 1;
      this.getList();
    },
    //获取列表
    getList(type) {
      this.listLoading = true;
      if (type != "start") {
        //非初始化调用：查询、分页
        sessionStorage.setItem("searchData", JSON.stringify(this.formInline));
        sessionStorage.setItem("pageData", JSON.stringify(this.pageForm));
      } else {
        //初始化分两种情况，详情页等返回后的初始化，以及第一次进入此菜单的初始化
        if (JSON.parse(sessionStorage.getItem("searchData"))) {
          //详情页返回后，将对应查询条件和分页的字段赋值，页面回显参数
          this.formInline = JSON.parse(sessionStorage.getItem("searchData"));
          this.pageForm = JSON.parse(sessionStorage.getItem("pageData"));
        } else {
          //第一次进去此菜单时，保存上方默认的data
          sessionStorage.setItem("searchData", JSON.stringify(this.formInline));
          sessionStorage.setItem("pageData", JSON.stringify(this.pageForm));
        }
      }
      let data = {
        ...this.pageForm,
         ...this.formInline,
        // ssqymc: sessionStorage.getItem('orgName')
      };
      if (this.activeName == "dc") {
        data.lx = "0";
      } else {
        data.lx = "1";
      }
      selectList(data).then((res) => {
        if (res.infoCode == 200) {
          this.tableData = res.data.items;
          this.pageForm.total = res.data.total;
        }
        this.listLoading = false;
      });
    },
    //操作
    addSubmit(row, type) {
      if (this.activeName == "dc") {
        this.$router.push({
          name: "reverseSubsidyDetail",
          query: {
            dcyksqbm: row ? row.dcyksqbm : undefined,
            state: type ? type : undefined,
            shzt: row ? row.shzt : undefined,
            detail: type=='detail' ? 0 : 1,
          },
        });
      } else {
        this.$router.push({
          name: "reverseSubsidyYketail",
          query: {
            dcyksqbm: row ? row.dcyksqbm : undefined,
            state: type ? type : undefined,
            shzt: row ? row.shzt : undefined,
            detail: type=='detail' ? 0 : 1,
            ssqymc: row.ssqymc,
            yrkssqymc: row.yrkssqymc,
          },
        });
      }
    },
    //撤销
    reject(row) {
      this.$confirm("是否确认撤销？", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.doRejectTodo(row);
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消撤销",
          });
        });
    },
    //查看验收报告
    searchReport(row) {
      if (this.activeName == "dc") {
        let url = "/grainReserves/warehouseAcceptance/detail"
				// this.$router.push({
				// 	path: '/grainReserves/warehouseAcceptance/detail',
				// 	query: {
				// 		id: row.dcyksqbm,
				// 		state: 'show',
				// 		detail: 0,
				// 		shzt: '90401000',
				// 		isLocal: true,
				// 		active: this.activeName,
				// 	},
				// })
        
        window.location.href =
          location.host == "localhost:9000"
            ? "/#" + url + `?id=${row.dcyksqbm}&state=show&detail=0&shzt=90401000&isLocal=true&active=dc`
            : "/web/portal/#" + url + `?id=${row.dcyksqbm}&state=show&detail=0&shzt=90401000&isLocal=true&active=dc`;
      } else {
        let path = "/grainReserves/transferNotice/detail"
        window.location.href =
          location.host == "localhost:9000"
            ? "/#" + path + `?id=${row.dcyksqbm}&state=show&shzt=90401000&active=yk`
            : "/web/portal/#" + path + `?id=${row.dcyksqbm}&state=show&shzt=90401000&active=yk`;
      }
      getLeftMenuList("储备粮管理");
    },
    doRejectTodo(row) {
      let data = {
        ...row,
        shzt: "13",
      };
      update(data)
        .then((res) => {
          if (res.infoCode == "200") {
            this.$message({
              message: "撤销成功",
              type: "success",
            });
            this.getList();
          } else {
            this.$message({
              message: "撤销失败",
              type: "error",
            });
          }
        })
        .catch((res) => {
          this.$message({
            message: res.msg,
            type: "error",
          });
        });
    },
    handleSizeChange(val) {
      this.pageForm.pageSize = val;
      this.getList();
    },
    handleCurrentChange(val) {
      this.pageForm.pageNum = val;
      this.getList();
    },
    spanMethodOfParent({row, column, rowIndex, columnIndex}) {
        // 从父Table的第2列开始，合并之后的5列（包含第2列），将2列合同成一个单元格，容纳子Table
          if(columnIndex === 2) {
              return [1, 5]
          }
          // 隐藏父Table中的第3列
          if(columnIndex == 3||columnIndex == 4||columnIndex == 5||columnIndex == 6) {
              return [0, 0]
          }
    },
    spanMethodOfParent2({row, column, rowIndex, columnIndex}) {
          if(columnIndex === 3) {
              return [1, 5]
          }
          // 隐藏父Table中的第3列
          if(columnIndex == 4||columnIndex == 5||columnIndex == 6||columnIndex == 7) {
              return [0, 0]
          }
    },
  },
  beforeCreate() {
    getPzOptions(11).then((res) => {
      this.pzOptions = res.data;
    });
  },
};
</script>
<style scoped lang="scss">
.MarRow {
  margin-top: 20px;
}
.h3 {
  text-align: center;
  font-size: 1em;
  line-height: 2.5;
  color: #fff;
  background-color: #49a2fa;
  margin-bottom: 20px;
}
/deep/ .table_cell{
  // .el-table .el-table__cell{
    // }
    padding: 0 !important;
  .cell{
    padding: 0 !important;
    .el-table td{
      border-bottom: 0;
    }
    text-align: center;
    // .in_table{
    //   min-width: 242px;
    // }
    // .inner_table{
    //   .el-table__row td {
    //    border-bottom: 0 !important;
    //   }
    // }
    .el-table::after {
     display: none;
    }
    .el-table::before {
     display: none;
    }
  }
}
// /deep/ .empty_table{
//   min-width: 242px;
//   .el-table__row td {
//    border-bottom: 0 !important;
//   }
//   .el-table__row td ::last-child{
//    border-right: 0 !important;
//   }
//   .el-table__body-wrapper::-webkit-scrollbar{
//    width: 0;
//   }
// }
</style>
