陈婷婷
81 分钟以前 7b849f06f0b0986b3955c1d1d91a0b2a79fa7ea6
src/views/scMould/warehouse/Sc_MouldMoveStockRequestBillList.vue
@@ -1,5 +1,5 @@
<template>
  <div style="padding: 10px;">
  <div style="padding: 10px; position: relative;">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="78px" class="searchBox">
      <el-form-item label="开始日期" style="margin-left: 100px;">
        <el-date-picker v-model="sTime" type="date" placeholder="开始日期" style="width: 150px;">
@@ -40,18 +40,19 @@
            <el-form-item label="部门信息" prop="HDept">
              <el-input v-model="queryParams.HDept" placeholder="请输入部门信息" @keyup.enter.native="handleQuery" />
            </el-form-item>
            <el-form-item label="器具代码" prop="HModelNumber">
              <el-input v-model="queryParams.HModelNumber" placeholder="请输入器具代码" @keyup.enter.native="handleQuery" />
            <el-form-item label="容器代码" prop="HModelNumber">
              <el-input v-model="queryParams.HModelNumber" placeholder="请输入容器代码" @keyup.enter.native="handleQuery" />
            </el-form-item>
            <el-form-item label="往来单位" prop="HSupName">
              <el-input v-model="queryParams.HSupName" placeholder="请输入往来单位" @keyup.enter.native="handleQuery" />
            </el-form-item>
            <div slot="header" class="clearfix"><span>过滤</span></div>
            <div slot="header" class="clearfix"><span>其他条件</span></div>
            <div>
              <el-row>
                <el-form-item label-width="0">
                  <el-row>
                    <el-col :span="7">
                    <el-col :span="2"><span>过滤</span></el-col>
                    <el-col :span="6">
                      <el-select v-model="queryParams.ColName1" placeholder="请选择" @change="riqiChange">
                        <span v-for="(item, index) in btList" :key="index">
                          <el-option :label="item.field" :value="item.field" v-if="!item.hide"></el-option>
@@ -64,7 +65,7 @@
                          :value="item.value"></el-option>
                      </el-select>
                    </el-col>
                    <el-col :span="11">
                    <el-col :span="10">
                      <el-input v-model="queryParams.ColContent1" placeholder="请输入" clearable
                        @keyup.enter.native="handleQuery" />
                    </el-col>
@@ -74,7 +75,8 @@
              <el-row>
                <el-form-item label-width="0">
                  <el-row>
                    <el-col :span="7">
                    <el-col :span="2"><span>过滤</span></el-col>
                    <el-col :span="6">
                      <el-select v-model="queryParams.ColName2" placeholder="请选择" @change="riqiChange">
                        <span v-for="(item, index) in btList" :key="index">
                          <el-option :label="item.field" :value="item.field" v-if="!item.hide"></el-option>
@@ -87,7 +89,7 @@
                          :value="item.value"></el-option>
                      </el-select>
                    </el-col>
                    <el-col :span="11">
                    <el-col :span="10">
                      <el-input v-model="queryParams.ColContent2" placeholder="请输入" clearable
                        @keyup.enter.native="handleQuery" />
                    </el-col>
@@ -96,7 +98,8 @@
              </el-row>
              <el-form-item label-width="0">
                <el-row>
                  <el-col :span="7">
                  <el-col :span="2"><span>过滤</span></el-col>
                  <el-col :span="6">
                    <el-select v-model="queryParams.ColName" placeholder="请选择" @change="riqiChange">
                      <el-option v-for="(item, index) in btList" :key="index" :label="item.field"
                        :value="item.field"></el-option>
@@ -108,7 +111,7 @@
                        :value="item.value"></el-option>
                    </el-select>
                  </el-col>
                  <el-col :span="11">
                  <el-col :span="10">
                    <el-input v-model="queryParams.ColContent" placeholder="请输入" clearable
                      @keyup.enter.native="handleQuery" />
                  </el-col>
@@ -133,6 +136,10 @@
          @click="handleEdit(row = rowForm, OperationType = 1, copyType = 1)">复制</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="primary" icon="el-icon-tickets" size="mini"
          @click="handlePush(row = rowForm, OperationType = 4)">下推(容器直接调拨单)</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="primary" icon="el-icon-delete" size="mini" :disabled="single" @click="handleDelete">删除
        </el-button>
      </el-col>
@@ -142,7 +149,7 @@
      </el-col>
      <el-col :span="1.5">
        <el-button type="primary" icon="el-icon-edit-outline" size="mini" :disabled="single"
          @click="set_CheckBill(2, form = rowForm)">返审核</el-button>
          @click="set_CheckBill(2, form = rowForm)">反审核</el-button>
      </el-col>
      <!-- <el-col :span="1.5">
        <el-button type="primary" icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
@@ -167,11 +174,9 @@
            <template slot-scope="{row,  column }">
              <el-checkbox v-model="checked" v-if="item.type == 'checkbox'"></el-checkbox>
              <div :style="item.style">
                <span v-if="column.property.includes('日期')">{{ parseTime(row[column.property], '{y}-{m}-{d}') }}</span>
                <span v-if="column.property.includes('日期')">{{ parseTime(row[column.property], '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
                <el-button type="text" @click="handleEdit(row, OperationType = 2)"
                  v-else-if="column.property == '单据号'">{{
                    row.单据号
                  }}</el-button>
                  v-else-if="column.property == '单据号'">{{row.单据号}}</el-button>
                <span v-else>{{ row[column.label] }}</span>
              </div>
            </template>
@@ -184,9 +189,14 @@
          v-if="rowHideShow" />
      </el-dialog>
      <!-- 编辑 -->
      <el-dialog title="编辑器具调拨申请单" :visible.sync="openEdit" width="1480px" append-to-body class="xsckdBox" @close="close">
      <el-dialog title="编辑容器调拨申请单" :visible.sync="openEdit" width="1480px" append-to-body class="xsckdBox" @close="close">
        <edit :OperationType=OperationType :linterid=this.rowForm.hmainid :HSouceBillType=this.rowForm.HSourceBillType
          :copyType="copyType" @editClose="editClose" v-if="editShow" />
      </el-dialog>
      <!-- 下推 -->
      <el-dialog title="下推容器直接调拨单" :visible.sync="openPush" width="1480px" append-to-body class="xsckdBox" @close="close">
        <push :OperationType='4' :propsData='pushData' :HSouceBillType=BillType
         @editClose="pushClose" v-if="pushShow" />
      </el-dialog>
      <el-dialog title="打印模板选择" :visible.sync="openPrintList" width="800px" append-to-body>
        <PrintList :linterid=this.rowForm.hmainid :MyMsg=this.rowForm.hmainid :Type='HModName'
@@ -201,18 +211,27 @@
import axios from 'axios'
import RowSettings from '@/views/component/rowSettings'
import Edit from '@/views/scMould/warehouse/Sc_MouldMoveStockRequestBillEdit'
import Push from '@/views/scMould/warehouse/Sc_MouldProdMoveBillEdit'
import PrintList from '@/views/component/printList'
import moment from 'moment';
export default {
  name: 'Sc_MouldMoveStockRequestBillList',
  components: { RowSettings, Edit, PrintList },
  components: { RowSettings, Edit, Push,PrintList },
  props: {
    openPage: { type: String, },
    HOrgID: { type: String, },
  },
  data() {
    return {
      HModName: "Sc_MouldMoveStockRequestBillList",
      rowList:[],
      activeSeach: '',
      editShow: false,
      openEdit: false,
      pushShow: false,
      openPush: false,
      pushData:'',
      totalNameList: [],
      tableShow: true,
      openPrintList: false,
@@ -301,10 +320,14 @@
      page: 1,
      pageSize: 0,
      total: 0,
      BillType:'3850',
    };
  },
  created() {
    // this.fetchData()
    if(this.openPage && this.HOrgID){
      this.queryParams.HStockOutOrgID = this.HOrgID
    }
    this.riqiChange()
    this.getList();
  },
@@ -379,13 +402,14 @@
      if (this.pageSize == 0) {
        this.pageSize = 50
      }
      // 销售出库单列表
      axios.get(this.baseURL + '/Sc_MouldMoveStockRequestBillController/page', {
      // 列表
      axios.get(this.$baseUrl + '/Sc_MouldMoveStockRequestBillController/page', {
        params: {
          "sWhere": this.sWhere,
          "user": sessionStorage["HUserName"],
          "page": this.page,
          "size": this.pageSize
          "size": this.pageSize,
          "Type": this.BillType,
        },
      }).then(response => {
        this.tyResList = response.data.data//总数据
@@ -423,6 +447,8 @@
          option.data = data1.data
          this.dataList = option
          this.DisPlay_HideColumn(this.HModName, sessionStorage["HUserName"], option, this.dataList);
        }else{
          this.$modal.msgError(response.data.Message);
        }
      }).catch(error => {
        this.$modal.msgError("接口请求失败!");
@@ -430,7 +456,7 @@
    },
    DisPlay_HideColumn(HModName, user, option, dataOption) {
      this.totalNameList = []
      axios.get(this.baseURL + '/Xt_grdAlignment_WMES/grdAlignmentWMESList', {
      axios.get(this.$baseUrl + '/Xt_grdAlignment_WMES/grdAlignmentWMESList', {
        params: {
          "HModName": HModName,
          "user": user,
@@ -571,22 +597,26 @@
      this.selectedRow = row; // 记录当前选中的行
      this.lastSelectedRowIndex = this.tableData.indexOf(row);
      this.$refs.tableData.toggleRowSelection(row);
      if (this.openPage) {
        this.$emit('deptEmit', this.rowList, this.BillType)
      }
    },
    //选中行高亮样式
    rowStyle({ row, rowIndex }) {
      if (this.ids.includes(row.hmainid)) {
      if (this.ids.includes(row.sorderid)) {
        return { "background": "#ecf5ff" }
      }
    },
    //双击行
    handleDblclick(row, column, cell, event) {
      this.OperationType = 2
      this.handleEdit()
      this.handleEdit(row);
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      // this.rowForm = {}
      this.ids = selection.map(item => item.hmainid)
      this.rowList=selection
      this.ids = selection.map(item => item.sorderid)
      this.single = selection.length != 1
      this.multiple = !selection.length
      if (!this.single) {
@@ -659,6 +689,22 @@
        }
        this.sWhere += " and " + this.queryParams.ColName2 + " " + com2;
      }
      if (this.queryParams.HStatus) {
          switch (this.queryParams.HStatus) {
              case '-1':   //全部
                  this.sWhere += "";
                  break;
              case '0':    //未审核
                  this.sWhere += " and 审核人=''";
                  break;
              case '1':    //已审核
                  this.sWhere += " and 审核人<>''";
                  break;
              case '2':    //已关闭
                  this.sWhere += " and 关闭人<>''";
              default:
          }
      }
      if (this.sTime) {
          this.sTime = moment(this.sTime).format('YYYY-MM-DD')
          this.sWhere += " and 日期 >= '" + this.sTime + "'";
@@ -674,11 +720,12 @@
          this.sWhere += " and 部门 like '%" + this.queryParams.HDept + "%'";
      }
      if (this.queryParams.HModelNumber) {
          this.sWhere += " and 模具代码 like '%" + this.queryParams.HModelNumber + "%'";
          this.sWhere += " and 器具代码 like '%" + this.queryParams.HModelNumber + "%'";
      }
      if (this.queryParams.HSupName) {
          this.sWhere += " and 往来单位 like '%" + this.queryParams.HSupName + "%'";
      }
      this.clearData()
      this.getList()
    },
    /** 重置按钮操作 */
@@ -702,6 +749,7 @@
        ColContent2: '',
        ColContent: '',
      }
      this.clearData()
      this.riqiChange()
      this.resetForm("queryForm")
      this.getList()
@@ -713,6 +761,9 @@
      this.tableShow = true
      this.openEdit = false
      this.editShow = false
      this.openPush = false
      this.pushShow = false
      this.clearData()
      this.getList()
    },
    //打开新增组件弹窗
@@ -727,24 +778,81 @@
      this.editShow = true
      this.openEdit = true
    },
    //打开下推组件弹窗
    handlePush() {
      if (this.rowList && this.rowList.length > 0) {
        var dataArray = [];
        var HSupTypeID_Temp = this.rowList[0].HSupTypeID
        var HStockInOrgID_Temp = this.rowList[0].HSTOCKORGINID
        for (var i = 0; i < this.rowList.length; i++) {
            if (this.rowList[i].单据状态 != "已审核") {
                this.$modal.msgError("下推失败!所选单据【" + this.rowList[i].单据号 + "】不为已审核状态,不允许下推!")
                return;
            }
            if (this.rowList[i].HQtyMust <= 0) {
                this.$modal.msgError("下推失败!所选单据【" + this.rowList[i].单据号 + "】对应可下推数量必须大于 0 !")
                return;
            }
            if (this.rowList[i].HSupTypeID != HSupTypeID_Temp) {
                this.$modal.msgError("下推失败!所选单据对应往来类型必须一致!")
                return;
            }
            if (this.rowList[i].HSTOCKORGINID != HStockInOrgID_Temp) {
                this.$modal.msgError("下推失败!所选单据对应调入组织必须一致!")
                return;
            }
            var temp = {
                "hmainid": this.rowList[i].hmainid
                , "hsubid": this.rowList[i].hsubid
                , "HBillType": this.rowList[i].HBillType
            }
            dataArray.push(temp);
        }
        var datajson = {
            "data": dataArray
        };
        this.pushData = JSON.stringify(datajson)
        this.pushShow = true
        this.openPush = true
      } else {
          this.$modal.msgError("请选择数据下推!")
      }
    },
    //关闭编辑页面
    editClose(val) {
      this.open = val
      this.editShow = false
      this.openEdit = val
      this.clearData()
      this.getList()
    },
    //关闭下推页面
    pushClose(val) {
      this.open = val
      this.pushShow = false
      this.openPush = val
      this.clearData()
      this.getList()
    },
    //清除选中数据的缓存
    clearData(){
      this.ids = []
      this.multiple = true
      this.single = true
      this.OperationType = 0
      this.copyType = 0
    },
    /** 删除按钮操作 */
    handleDelete() {
      this.$modal.confirm('确认要删除吗,删除后不能恢复').then(() => {
        axios.get(this.baseURL + "/Sc_MouldMoveStockRequestBillController/GetSc_MouldMoveStockRequestBill_Delete_Json", {
        axios.get(this.$baseUrl + "/Sc_MouldMoveStockRequestBillController/GetSc_MouldMoveStockRequestBill_Delete_Json", {
            params: { 'HInterID': this.rowForm.hmainid.toString(), 'HMaker': sessionStorage["HUserName"] }
          }).then(response => {
            if (response.data.count == 1) {
              this.getList()
              this.$modal.msgSuccess("删除成功")
            } else {
              this.$modal.msgError("错误:" + result.code + result.Message);
              this.$modal.msgError("错误:" + response.data.code + response.data.Message);
            }
          }).catch(error => {
            this.$modal.msgError("接口请求失败!");
@@ -755,12 +863,13 @@
    set_CheckBill(num, form) {
      var InterID = form.hmainid || form.HInterID
      //逻辑审核方法
      axios.get(this.baseURL + "/Sc_MouldMoveStockRequestBillController/GetSc_MouldMoveStockRequestBill_Check_Json", {
      axios.get(this.$baseUrl + "/Sc_MouldMoveStockRequestBillController/GetSc_MouldMoveStockRequestBill_Check_Json", {
        params: { "HInterID": InterID, "Type": num, "HMaker": sessionStorage["HUserName"] }
      }).then(response => {
        let result = response.data
        if (result.count == 1) {
          this.$modal.msgSuccess('操作成功');
          this.clearData()
          this.getList();
        }
        else {
@@ -784,7 +893,7 @@
      } else if (this.rowForm.状态 != "已审核" && !this.defaintOperationByCompanyName()) {
        this.$modal.msgError("打印失败!原因:单据状态不为'已审核'状态!!");
      } else {
        axios.get(this.baseURL + "/Kf_SellOutBill/CheckSellOutBill_IsExist", {
        axios.get(this.$baseUrl + "/Kf_SellOutBill/CheckSellOutBill_IsExist", {
          params: { "HInterID": this.rowForm.hmainid }
        }).then(response => {
          var result = response.data
@@ -802,22 +911,6 @@
      }
      //  var content= ['../../BaseSet/SRM_OpenTmpList.html?linterid=' + data[0].hmainid.toString() + '&MyMsg=' + data[0].hmainid.toString() + '&Type=Kf_SellOutBillList', 'yes']
    },
    //#region 获取公司名,根据公司进行定制化开发
    defaintOperationByCompanyName() {
      var result = false;
      axios.get(this.baseURL + '/Xt_getInfo/getCompanyName').then(response => {
        var data1 = response.data
        if (data1.count == 1) {
          if (data1.data == "水务") {
            result = true;
          }
        }
      }).catch(error => {
        this.$modal.msgError("接口请求失败!");
      });
      return result;
    },
  }
};