chenhaozhe
2025-12-05 bb40eba5dd2ec75a6fa2cd2c8eb41d769c092fca
Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-VUEUI
2个文件已添加
14个文件已修改
3885 ■■■■ 已修改文件
src/router/index.js 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/modules/permission.js 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/GyCustomer/index.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/ICMO/ScICMOBillList.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/component/material/index.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/scMould/warehouse/Sc_MouldInRequestBillList.vue 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/scMould/warehouse/Sc_MouldMoveStockRequestBillEdit.vue 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/scMould/warehouse/Sc_MouldMoveStockRequestBillList.vue 157 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/scMould/warehouse/Sc_MouldOutRequestBillEdit.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/scMould/warehouse/Sc_MouldOutRequestBillList.vue 53 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/scMould/warehouse/Sc_MouldProdBackBillList.vue 111 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/scMould/warehouse/Sc_MouldProdMoveBillEdit.vue 766 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/scMould/warehouse/Sc_MouldProdMoveBillList.vue 143 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/scMould/warehouse/Sc_MouldProdOutBillList.vue 115 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/user/GyDriver.vue 1676 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/system/user/GyDriverEdit.vue 734 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js
@@ -210,6 +210,25 @@
      },
    ],
  },
  //用户列表
  {
    path: "/system/user/GyDriver",
    component: Layout,
    hidden: true,
    redirect: "noredirect",
    meta: {
      breadcrumb: false, // 如果设置为false,则不会在breadcrumb面包屑中显示
      activeMenu: "/system/user", // 当路由设置了该属性,则会高亮相对应的侧边栏。
    },
    children: [
      {
        path: "/system/user/GyDriver",
        component: () => import("@/views/system/user/GyDriver.vue"),
        name: "gyDriver",
        meta: { title: "驾驶员列表", activeMenu: "system/user" },
      },
    ],
  },
  //采购入库单
  {
    path: "/purchase/POStockInBill/POStockInBillList",
src/store/modules/permission.js
@@ -1311,6 +1311,18 @@
                      icon: "build",
                      link: null,
                      noCache: false,
                      title: "驾驶员列表",
                    },
                    component: () =>import("@/views/system/user/GyDriver.vue"),
                    hidden: false,
                    name: "gyDriver",
                    path: "GyDriver",
                  },
                  {
                    meta: {
                      icon: "build",
                      link: null,
                      noCache: false,
                      title: "权限查询",
                    },
                    component: () =>
src/views/GyCustomer/index.vue
@@ -351,7 +351,7 @@
        title: "导入",
        isUploading: false,
        updateSupport: 0,
        url: "http://47.96.97.237/API/Gy_Customer/Gy_Customer_Excel",
        url: "",
      },
      uploadData: [],
      uploadTableLoading: false,
@@ -366,14 +366,19 @@
    }
  },
  created() {
    this.upload.url = this.baseURL + "Gy_Customer/Gy_Customer_Excel";
    this.fetchData();
  },
  methods: {
    fetchData() {
      axios
        .get(
          "http://47.96.97.237/API/Web/GetUser?UserName=001&PassWord=123456&HOrgName=100038"
        )
        .get(this.baseURL + "Web/GetUser", {
          params: {
            UserName: sessionStorage.getItem("UserName") || "admin",
            PassWord: "123456",
            HOrgName: sessionStorage.getItem("OrganizationID") || "100038"
          }
        })
        .then((response) => {
          let data = response.data.data[0];
          this.user = data.Czymc;
src/views/ICMO/ScICMOBillList.vue
@@ -883,8 +883,7 @@
        updateSupport: 0,
        // 设置上传的请求头部
        // headers: { Authorization: "Bearer " + getToken() },
        // 上传的地址
        url: "http://47.96.97.237/API/Gy_Source/Gy_Source_Excel",
        url: "",
      },
      uploadData: [],
      alluploadList: [],
@@ -901,6 +900,8 @@
    };
  },
  created() {
    // set upload URL from configured baseURL
    this.upload.url = this.baseURL + "Gy_Source/Gy_Source_Excel";
    this.riqiChange();
    this.get_HProjectList();
    this.get_HDeptNameList();
src/views/component/material/index.vue
@@ -26,7 +26,8 @@
      subDisabled: false,//编辑页面保存按钮是否禁用(true禁用,false可用)
      OperationType: null,//保存类型(新增1修改3)
      HInterID: null,
      baseURL: 'http://47.96.97.237/API',
      //baseURL: 'http://47.96.97.237/API',
        baseURL: process.env.VUE_APP_BASE_API,
      user: 'admin',
      currentRow: [],
      lastSelectedRowIndex: null, // 用于记录上次点击的行索引
src/views/scMould/warehouse/Sc_MouldInRequestBillList.vue
@@ -46,12 +46,13 @@
            <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>
@@ -393,7 +396,8 @@
          "sWhere": this.sWhere,
          "user": sessionStorage["HUserName"],
          "page": this.page,
          "size": this.pageSize
          "size": this.pageSize,
          "Type": '3851'
        },
      }).then(response => {
        this.tyResList = response.data.data//总数据
@@ -589,7 +593,7 @@
    //双击行
    handleDblclick(row, column, cell, event) {
      this.OperationType = 2
      this.handleEdit()
      this.handleEdit(row)
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
@@ -667,6 +671,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 + "'";
@@ -687,6 +707,7 @@
      if (this.queryParams.HSupName) {
          this.sWhere += " and 往来单位 like '%" + this.queryParams.HSupName + "%'";
      }
      this.clearData()
      this.getList()
    },
    /** 重置按钮操作 */
@@ -712,6 +733,7 @@
      }
      this.riqiChange()
      this.resetForm("queryForm")
      this.clearData()
      this.getList()
    },
@@ -721,6 +743,7 @@
      this.tableShow = true
      this.openEdit = false
      this.editShow = false
      this.clearData()
      this.getList()
    },
    //打开新增组件弹窗
@@ -740,7 +763,16 @@
      this.open = val
      this.editShow = false
      this.openEdit = val
      this.clearData()
      this.getList()
    },
    //清除选中数据的缓存
    clearData(){
      this.ids = []
      this.multiple = true
      this.single = true
      this.OperationType = 0
      this.copyType = 0
    },
    /** 删除按钮操作 */
    handleDelete() {
@@ -769,6 +801,7 @@
        let result = response.data
        if (result.count == 1) {
          this.$modal.msgSuccess('操作成功');
          this.clearData()
          this.getList();
        }
        else {
src/views/scMould/warehouse/Sc_MouldMoveStockRequestBillEdit.vue
@@ -3,7 +3,7 @@
    <div style=" margin-bottom: 10px; border-bottom: 1px solid #f6f6f6;">
      <!-- <el-button type="primary" @click="handleAdd(OperationType = 1)" v-if="addBtnShow">新增</el-button> -->
      <el-button type="primary" @click="submitForm" :disabled="subDisabled">保 存</el-button>
      <!-- <el-button type="primary" @click="set_CheckBill(1, form)">审 核</el-button> -->
      <el-button type="primary" @click="set_CheckBill(1, form)">审 核</el-button>
      <el-button type="primary" @click="close">退 出</el-button>
      <!-- <el-button @click="cancel">取 消</el-button> -->
    </div>
@@ -334,7 +334,7 @@
  name: 'Sc_MouldMoveStockRequestBillEdit',
  components: { Dept, Warehouse, RowSettings, GyEmployee,GySupplier,GyCustomer,GyMould,GyStockPlace },
  props: {
    OperationType: { type: Number, },
    OperationType: { type: Number, },//操作类型(1新增、2编辑、3复制、4下推)
    linterid: { type: Number, },
    HSouceBillType: { type: String, },
    propsData: { type: String, },
@@ -862,6 +862,12 @@
          , "HSCSPID": "0"
          , "HSCSPNumber": ""
          , "HSCSPName": ""
          , "HSourceInterID": "0"
          , "HSourceEntryID": "0"
          , "HSourceBillType": ""
          , "HSourceBillNo": ""
          , "HRelationQty": "0"
          , "HRelationMoney": "0"
          , "HRemark": ""
          , "HPropertyID": "0"
          , "HSecUnitID": "0"
@@ -882,11 +888,11 @@
          , "HICMOInterID": "0"
          , "HICMOEntryID": "0"
          , "HICMOBillNo": ""
          , "HSTOCKORGID": "0"
          , "HOWNERID": "0"
          , "HSTOCKORGID": this.form.HStockOutOrgID
          , "HOWNERID": this.form.HStockOutOrgID
          , "HOWNERTYPEID": ""
          , "HSTOCKORGINID": "0"
          , "HOWNERINID": "0"
          , "HSTOCKORGINID": this.form.HStockInOrgID
          , "HOWNERINID": this.form.HStockInOrgID
          , "HOWNERTYPEINID": ""
          , "HBASEUNITID": "0"
          , "HEXTAUXUNITID": "0"
@@ -1021,12 +1027,13 @@
    set_CheckBill(num, form) {
      var InterID = form.hmainid || form.HInterID
      //逻辑审核方法
      axios.get(this.baseURL + "/Sc_MouldProdMoveBill/AuditMouldProdMoveBill", {
        params: { "HInterID": InterID, "flag": num, "user": sessionStorage["HUserName"] }
      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.code == 1) {
          this.$modal.msgSuccess('操作成功');
          this.close()
        }
        else {
          this.$modal.msgError("错误:" + result.code + result.Message,);
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;">
@@ -46,12 +46,13 @@
            <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>
@@ -131,6 +134,10 @@
      <el-col :span="1.5">
        <el-button type="primary" icon="el-icon-document-copy" size="mini" :disabled="single"
          @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" :disabled="single"
          @click="handleMove(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">删除
@@ -169,9 +176,7 @@
              <div :style="item.style">
                <span v-if="column.property.includes('日期')">{{ parseTime(row[column.property], '{y}-{m}-{d}') }}</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>
@@ -188,6 +193,11 @@
        <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="openMove" width="1480px" append-to-body class="xsckdBox" @close="close">
        <move :OperationType='4' :propsData='moveData' :HSouceBillType=BillType
         @editClose="moveClose" v-if="moveShow" />
      </el-dialog>
      <el-dialog title="打印模板选择" :visible.sync="openPrintList" width="800px" append-to-body>
        <PrintList :linterid=this.rowForm.hmainid :MyMsg=this.rowForm.hmainid :Type='HModName'
          :HModName='HModName' @rowEditClose="rowSetClose" v-if="printListShow" />
@@ -201,18 +211,27 @@
import axios from 'axios'
import RowSettings from '@/views/component/rowSettings'
import Edit from '@/views/scMould/warehouse/Sc_MouldMoveStockRequestBillEdit'
import Move 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, Move,PrintList },
  props: {
    openPage: { type: String, },
    HOrgID: { type: String, },
  },
  data() {
    return {
      HModName: "Sc_MouldMoveStockRequestBillList",
      rowList:[],
      activeSeach: '',
      editShow: false,
      openEdit: false,
      moveShow: false,
      openMove: false,
      moveData:'',
      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', {
        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//总数据
@@ -571,22 +595,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 +687,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 +718,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 +747,7 @@
        ColContent2: '',
        ColContent: '',
      }
      this.clearData()
      this.riqiChange()
      this.resetForm("queryForm")
      this.getList()
@@ -713,6 +759,7 @@
      this.tableShow = true
      this.openEdit = false
      this.editShow = false
      this.clearData()
      this.getList()
    },
    //打开新增组件弹窗
@@ -727,12 +774,69 @@
      this.editShow = true
      this.openEdit = true
    },
    //打开下推组件弹窗
    handleMove() {
      if (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.msgSuccess("下推失败!所选单据【" + this.rowList[i].单据号 + "】不为已审核状态,不允许下推!")
                return;
            }
            if (this.rowList[i].HQtyMust <= 0) {
                this.$modal.msgSuccess("下推失败!所选单据【" + this.rowList[i].单据号 + "】对应可下推数量必须大于 0 !")
                return;
            }
            if (this.rowList[i].HSupTypeID != HSupTypeID_Temp) {
                this.$modal.msgSuccess("下推失败!所选单据对应往来类型必须一致!")
                return;
            }
            if (this.rowList[i].HSTOCKORGINID != HStockInOrgID_Temp) {
                this.$modal.msgSuccess("下推失败!所选单据对应调入组织必须一致!")
                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.moveData = JSON.stringify(datajson)
        this.moveShow = true
        this.openMove = true
      } else {
          layer.msg('请选择数据下推!');
      }
    },
    //关闭编辑页面
    editClose(val) {
      this.open = val
      this.editShow = false
      this.openEdit = val
      this.clearData()
      this.getList()
    },
    //关闭下推页面
    moveClose(val) {
      this.open = val
      this.editShow = false
      this.openEdit = val
      this.clearData()
      this.getList()
    },
    //清除选中数据的缓存
    clearData(){
      this.ids = []
      this.multiple = true
      this.single = true
      this.OperationType = 0
      this.copyType = 0
    },
    /** 删除按钮操作 */
    handleDelete() {
@@ -761,6 +865,7 @@
        let result = response.data
        if (result.count == 1) {
          this.$modal.msgSuccess('操作成功');
          this.clearData()
          this.getList();
        }
        else {
@@ -802,22 +907,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;
    },
  }
};
src/views/scMould/warehouse/Sc_MouldOutRequestBillEdit.vue
@@ -96,14 +96,14 @@
          <el-row>
            <el-col :span="6">
              <el-form-item label="源单类型" prop="HSourceBillType">
                <el-select v-model="form.HSourceBillType" placeholder="请选择往来类型">
                <el-select v-model="form.HSourceBillType" placeholder="请选择">
                  <el-option v-for="(item, index) in HSourceBillTypes" :key="index" :label="item.HSourceBillTypeName" :value="item.HSourceBillType">
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="源单单号" prop="HRemark">
              <el-form-item label="源单单号" prop="HSourceBillNo">
                <el-input placeholder="请选择源单单号" disabled>
                  <el-button slot="append" icon="el-icon-search" @click="get_checkMainSource()"></el-button>
                </el-input>
src/views/scMould/warehouse/Sc_MouldOutRequestBillList.vue
@@ -46,12 +46,13 @@
            <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>
@@ -393,7 +396,8 @@
          "sWhere": this.sWhere,
          "user": sessionStorage["HUserName"],
          "page": this.page,
          "size": this.pageSize
          "size": this.pageSize,
          "Type":"3849",
        },
      }).then(response => {
        this.tyResList = response.data.data//总数据
@@ -589,7 +593,7 @@
    //双击行
    handleDblclick(row, column, cell, event) {
      this.OperationType = 2
      this.handleEdit()
      this.handleEdit(row)
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
@@ -667,6 +671,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 + "'";
@@ -682,11 +702,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()
    },
    /** 重置按钮操作 */
@@ -712,6 +733,7 @@
      }
      this.riqiChange()
      this.resetForm("queryForm")
      this.clearData()
      this.getList()
    },
@@ -721,6 +743,7 @@
      this.tableShow = true
      this.openEdit = false
      this.editShow = false
      this.clearData()
      this.getList()
    },
    //打开新增组件弹窗
@@ -740,7 +763,16 @@
      this.open = val
      this.editShow = false
      this.openEdit = val
      this.clearData()
      this.getList()
    },
    //清除选中数据的缓存
    clearData(){
      this.ids = []
      this.multiple = true
      this.single = true
      this.OperationType = 0
      this.copyType = 0
    },
    /** 删除按钮操作 */
    handleDelete() {
@@ -769,6 +801,7 @@
        let result = response.data
        if (result.count == 1) {
          this.$modal.msgSuccess('操作成功');
          this.clearData()
          this.getList();
        }
        else {
src/views/scMould/warehouse/Sc_MouldProdBackBillList.vue
@@ -25,36 +25,34 @@
      <el-collapse v-model="activeSeach">
        <el-collapse-item title="更多" name="1">
          <el-card class="box-card">
            <el-form-item label="组织名称" prop="HStockOrgName">
              <el-input v-model="queryParams.HStockOrgName" placeholder="请输入组织名称" @keyup.enter.native="handleQuery" />
            <el-form-item label="状态" prop="HStatus">
              <el-select v-model="queryParams.HStatus" placeholder="请选择状态">
                <el-option v-for="(item, index) in HStatusList" :key="index" :label="item.name" :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
            <!-- <el-form-item label="组织">
              <el-select v-model="queryParams.HOrgID" placeholder="请选择">
            <el-form-item label="组织">
              <el-select v-model="queryParams.HStockOrgID" placeholder="请选择">
                <el-option v-for="(item, index) in organizationList" :key="index" :label="item.Name" :value="item.ID">
                </el-option>
              </el-select>
            </el-form-item> -->
            </el-form-item>
            <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="HMaterNumber">
              <el-input v-model="queryParams.HMaterNumber" 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>
            <el-form-item label="仓库" prop="HWhName">
              <el-input v-model="queryParams.HWhName" 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>
@@ -67,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>
@@ -77,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>
@@ -90,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>
@@ -99,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>
@@ -111,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>
@@ -253,7 +253,7 @@
        { label: '近一年', value: 365 },
      ],
      organizationList: JSON.parse(sessionStorage.getItem('organizationList')),//组织列表
      hPriceTypeList: ['成本价', '结算价'],
      HStatusList: [{name:'全部',value:'-1'},{name:'未审核',value:'0'},{name:'已审核',value:'1'},{name:'已关闭',value:'2'}],
      addBtnShow: false,
      dialogTitle: '',
      OperationType: null,//保存类型(新增1修改3)
@@ -271,11 +271,10 @@
      queryParams: {
        HBillNo: '',
        HInitTimeCycle: 29,
        HStockOrgName: '',
        HStockOrgID: sessionStorage["OrganizationID"] - 0,
        HStatus:'-1',
        HDept:'',
        HMaterNumber: '',
        HModelNumber:'',
        HWhName:'',
        HSupName:'',
        ColName1: '',
        ColName2: '',
@@ -374,20 +373,24 @@
      this.tableShow = false
      this.loading = true
      if (this.sTime && !this.sWhere) {
        this.sWhere += " and CONVERT(varchar(100),日期, 23) >= '" + this.sTime + "'"
        this.sWhere += " and CONVERT(varchar(100),日期, 23) <= '" + this.eTime + "'"
        this.sTime = moment(this.sTime).format('YYYY-MM-DD')
        this.eTime = moment(this.eTime).format('YYYY-MM-DD')
        this.sWhere += " and 日期 >= '" + this.sTime + "'";
        this.sWhere += " and 日期 <= '" + this.eTime + "'";
      }
      this.sWhere += " and HSTOCKORGID=" + this.queryParams.HStockOrgID
      if (this.pageSize == 0) {
        this.pageSize = 50
      }
      // 销售出库单列表
      axios.get(this.baseURL + '/Sc_MouldProdBackBill/list_byPage', {
      axios.get(this.baseURL + '/Sc_MouldProdBackBillController/page', {
        params: {
          "sWhere": this.sWhere,
          "user": sessionStorage["HUserName"],
          "Organization": sessionStorage["Organization"],
          "page": this.page,
          "size": this.pageSize
          "size": this.pageSize,
          "Type": '3803'
        },
      }).then(response => {
        this.tyResList = response.data.data//总数据
@@ -583,7 +586,7 @@
    //双击行
    handleDblclick(row, column, cell, event) {
      this.OperationType = 3
      this.handleEdit()
      this.handleEdit(row)
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
@@ -661,34 +664,43 @@
        }
        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.eTime = moment(this.eTime).format('YYYY-MM-DD')
        console.log(this.sTime, this.eTime)
        this.sWhere += " and CONVERT(varchar(100),日期, 23) >= '" + this.sTime + "'" + " and CONVERT(varchar(100),日期, 23) <= '" + this.eTime + "'";
        this.sWhere += " and 日期 >= '" + this.sTime + "'";
      }
      if (this.eTime) {
        this.eTime = moment(this.eTime).format('YYYY-MM-DD')
        this.sWhere += " and 日期 <= '" + this.eTime + "'";
      }
      if (this.queryParams.HBillNo) {
        this.sWhere += " and 单据号 like '%" + this.queryParams.HBillNo + "%'";
      }
      if (this.queryParams.HStockOrgName) {
        this.sWhere += " and 组织名称 like '%" + this.queryParams.HStockOrgName + "%'";
      }
      if (this.queryParams.HDept) {
          this.sWhere += " and 部门 like '%" + this.queryParams.HDept + "%'";
      }
      if (this.queryParams.HMaterNumber) {
          this.sWhere += " and 物料代码 like '%" + this.queryParams.HMaterNumber + "%'";
      }
      if (this.queryParams.HModelNumber) {
          this.sWhere += " and 模具代码 like '%" + this.queryParams.HModelNumber + "%'";
      }
      if (this.queryParams.HWhName) {
          this.sWhere += " and 仓库 like '%" + this.queryParams.HWhName + "%'";
          this.sWhere += " and 器具代码 like '%" + this.queryParams.HModelNumber + "%'";
      }
      if (this.queryParams.HSupName) {
          this.sWhere += " and 往来单位 like '%" + this.queryParams.HSupName + "%'";
      }
      this.clearData()
      this.getList()
    },
    /** 重置按钮操作 */
@@ -697,11 +709,10 @@
      this.queryParams = {
        HBillNo: '',
        HInitTimeCycle: 29,
        HStockOrgName: '',
        HStockOrgID: sessionStorage["OrganizationID"] - 0,
        HStatus:'-1',
        HDept:'',
        HMaterNumber: '',
        HModelNumber:'',
        HWhName:'',
        HSupName:'',
        ColName1: '',
        ColName2: '',
@@ -715,6 +726,7 @@
      }
      this.riqiChange()
      this.resetForm("queryForm")
      this.clearData()
      this.getList()
    },
@@ -724,6 +736,7 @@
      this.tableShow = true
      this.openEdit = false
      this.editShow = false
      this.clearData()
      this.getList()
    },
    //打开新增组件弹窗
@@ -743,7 +756,16 @@
      this.open = val
      this.editShow = false
      this.openEdit = val
      this.clearData()
      this.getList()
    },
    //清除选中数据的缓存
    clearData(){
      this.ids = []
      this.multiple = true
      this.single = true
      this.OperationType = 0
      this.copyType = 0
    },
    /** 删除按钮操作 */
    handleDelete() {
@@ -772,6 +794,7 @@
        let result = response.data
        if (result.count == 1) {
          this.$modal.msgSuccess('操作成功');
          this.clearData()
          this.getList();
        }
        else {
src/views/scMould/warehouse/Sc_MouldProdMoveBillEdit.vue
@@ -23,59 +23,112 @@
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="调入组织" prop="HStockInOrgID">
                <el-select v-model="form.HStockInOrgID" placeholder="请选择组织" :disabled="ifOrganizationEdit">
                  <el-option v-for="(item, index) in organizationList" :key="index" :label="item.Name" :value="item.ID">
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="6">
              <el-form-item label="内部单据号" prop="HInnerBillNo">
                <el-input v-model="form.HInnerBillNo" placeholder="请输入内部单据号" />
              <el-form-item label="往来类型" prop="HSupTypeID">
                <el-select v-model="form.HSupTypeID" placeholder="请选择往来类型">
                  <el-option v-for="(item, index) in hSupTypeList" :key="index" :label="item.name" :value="item.id">
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="器具仓库" prop="HWHName">
                <el-input v-model="form.HWHName" placeholder="请选择器具仓库" disabled>
              <el-form-item label="往来单位" prop="HSupName">
                <el-input v-model="form.HSupName" placeholder="请选择往来单位" disabled>
                  <el-button slot="append" icon="el-icon-search" @click="openDataDialogChoose()"></el-button>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="调出组织" prop="HStockOutOrgID">
                <el-select v-model="form.HStockOutOrgID" placeholder="请选择组织" :disabled="ifOrganizationEdit">
                  <el-option v-for="(item, index) in organizationList" :key="index" :label="item.Name" :value="item.ID">
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="6">
              <el-form-item label="部门" prop="HDeptName">
                <el-input v-model="form.HDeptName" placeholder="请选择部门" disabled>
                  <el-button slot="append" icon="el-icon-search" @click="openDataDialog(1,deptType=1)"></el-button>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="调入仓库" prop="HWHName">
                <el-input v-model="form.HWHName" placeholder="请选择调入仓库" disabled>
                  <el-button slot="append" icon="el-icon-search" @click="openDataDialog(2,eHWHType=1)"></el-button>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="调出仓库" prop="HSCWHName">
                <el-input v-model="form.HSCWHName" placeholder="请选择调出仓库" disabled>
                  <el-button slot="append" icon="el-icon-search" @click="openDataDialog(2,eHWHType=2)"></el-button>
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="6">
              <el-form-item label="领料人" prop="HSecManagerName">
                <el-input v-model="form.HSecManagerName" placeholder="请选择领料人" disabled>
              <el-form-item label="业务员" prop="HEmpName">
                <el-input v-model="form.HEmpName" placeholder="请选择" disabled>
                  <el-button slot="append" icon="el-icon-search" @click="openDataDialog(4,empType=1)"></el-button>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="发料人" prop="HKeeperName">
                <el-input v-model="form.HKeeperName" placeholder="请选择发料人" disabled>
              <el-form-item label="负责人" prop="HMangerName">
                <el-input v-model="form.HMangerName" placeholder="请选择" disabled>
                  <el-button slot="append" icon="el-icon-search" @click="openDataDialog(4,empType=2)"></el-button>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="部门" prop="HDeptName">
                <el-input v-model="form.HDeptName" placeholder="请选择部门" disabled>
                  <el-button slot="append" icon="el-icon-search" @click="openDataDialog(1)"></el-button>
              <el-form-item label="验收员" prop="HSecManagerName">
                <el-input v-model="form.HSecManagerName" placeholder="请选择" disabled>
                  <el-button slot="append" icon="el-icon-search" @click="openDataDialog(4,empType=3)"></el-button>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="保管员" prop="HKeeperName">
                <el-input v-model="form.HKeeperName" placeholder="请选择" disabled>
                  <el-button slot="append" icon="el-icon-search" @click="openDataDialog(4,empType=4)"></el-button>
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="6">
              <el-form-item label="调拨类型" prop="HStockStyle">
                <el-select v-model="form.HStockStyle" placeholder="请选择">
                  <el-option label="同组织调拨" value="同组织调拨" />
                  <el-option label="跨组织调拨" value="跨组织调拨" />
              <el-form-item label="源单类型" prop="HSourceBillType">
                <el-select v-model="form.HSourceBillType" placeholder="请选择">
                  <el-option v-for="(item, index) in HSourceBillTypes" :key="index" :label="item.HSourceBillTypeName" :value="item.HSourceBillType">
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="6">
              <el-form-item label="组织" prop="HOrgID">
                <el-select v-model="form.HOrgID" placeholder="请选择组织" :disabled="zzSelDis">
                  <el-option v-for="(item, index) in organizationList" :key="index" :label="item.Name" :value="item.ID">
                  </el-option>
                </el-select>
              <el-form-item label="源单单号" prop="HSourceBillNo">
                <el-input placeholder="请选择源单单号" disabled>
                  <el-button slot="append" icon="el-icon-search" @click="get_checkMainSource()"></el-button>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="内部单据号" prop="HInnerBillNo">
                <el-input v-model="form.HInnerBillNo" placeholder="请输入" />
              </el-form-item>
            </el-col>
          </el-row>
@@ -177,7 +230,7 @@
            <el-table-column align="center" label="序号" type="index" width="80" />
            <el-table-column align="center" label="器具代码" width="120">
              <template slot-scope="scope">
                <el-input v-model="scope.row.HMaterCode" placeholder="请输入" @keyup.native.f7="openDataDialog(8, scope.row)"
                <el-input v-model="scope.row.HMaterNumber" placeholder="请输入" @keyup.native.f7="openDataDialog(8, scope.row)"
                  @dblclick.native="openDataDialog(8, scope.row)" />
              </template>
            </el-table-column>
@@ -188,37 +241,17 @@
            </el-table-column>
            <el-table-column align="center" label="规格型号" width="120">
              <template slot-scope="scope">
                <span>{{ scope.row.HMaterSpec }}</span>
              </template>
            </el-table-column>
            <el-table-column align="center" label="批次" width="120">
              <template slot-scope="scope">
                <el-input v-model="scope.row.HBatchNo" placeholder="请输入" />
                <span>{{ scope.row.HMaterModel }}</span>
              </template>
            </el-table-column>
            <el-table-column align="center" label="计量单位代码" width="120">
              <template slot-scope="scope">
                <span>{{ scope.row.HUnitCode }}</span>
                <span>{{ scope.row.HUnitNumber }}</span>
              </template>
            </el-table-column>
            <el-table-column align="center" label="计量单位" width="120">
              <template slot-scope="scope">
                <span>{{ scope.row.HUnitName }}</span>
              </template>
            </el-table-column>
            <el-table-column align="center" label="设计寿命" width="120">
              <template slot-scope="scope">
                <el-input v-model="scope.row.HDesignLife" placeholder="请输入" />
              </template>
            </el-table-column>
            <el-table-column align="center" label="剩余寿命" width="120">
              <template slot-scope="scope">
                <el-input v-model="scope.row.HLeaveLife" placeholder="请输入" />
              </template>
            </el-table-column>
            <el-table-column align="center" label="累计使用寿命" width="120">
              <template slot-scope="scope">
                <el-input v-model="scope.row.HUseLife" placeholder="请输入" />
              </template>
            </el-table-column>
            <el-table-column align="center" label="应发数量" width="120">
@@ -232,34 +265,10 @@
                  controls-position="right"></el-input-number>
              </template>
            </el-table-column>
            <el-table-column align="center" label="单价" width="120">
              <template slot-scope="scope">
                <el-input v-model="scope.row.HPrice" placeholder="请输入" />
              </template>
            </el-table-column>
            <el-table-column align="center" label="金额" width="120">
              <template slot-scope="scope">
                <el-input v-model="scope.row.HMoney" placeholder="请输入" />
              </template>
            </el-table-column>
            <el-table-column align="center" label="调入组织代码" width="120">
              <template slot-scope="scope">
                <!-- <el-select v-model="scope.row.HStockOrgCode" placeholder="请选择组织" @change="HStockOrgChange(zbIndex = scope.row.index - 1)">
                  <el-option v-for="(item, index) in organizationList" :key="index" :label="item.Name" :value="item.ID"></el-option>>
                  </el-option>
                </el-select> -->
                <span>{{ scope.row.HStockOrgCode }}</span>
              </template>
            </el-table-column>
            <el-table-column align="center" label="调入组织" width="120">
              <template slot-scope="scope">
                <span>{{ scope.row.HStockOrgName }}</span>
              </template>
            </el-table-column>
            <el-table-column align="center" label="调入仓库代码" width="120">
              <template slot-scope="scope">
                <el-input v-model="scope.row.HWHCode" placeholder="请输入" @keyup.native.f7="openDataDialog(2, scope.row ,eHWHType=2)"
                  @dblclick.native="openDataDialog(2, scope.row ,eHWHType=2)" />
                <el-input v-model="scope.row.HWHNumber" placeholder="请输入" @keyup.native.f7="openDataDialog(2, scope.row ,eHWHType=3)"
                  @dblclick.native="openDataDialog(2, scope.row ,eHWHType=3)" />
              </template>
            </el-table-column>
            <el-table-column align="center" label="调入仓库" width="120">
@@ -269,7 +278,7 @@
            </el-table-column>
            <el-table-column align="center" label="调入仓位代码" width="120">
              <template slot-scope="scope">
                <el-input v-model="scope.row.HSPCode" placeholder="请输入" @keyup.native.f7="openDataDialog(9, scope.row,HSPType=1)"
                <el-input v-model="scope.row.HSPNumber" placeholder="请输入" @keyup.native.f7="openDataDialog(9, scope.row,HSPType=1)"
                  @dblclick.native="openDataDialog(9, scope.row,HSPType=1)" />
              </template>
            </el-table-column>
@@ -280,8 +289,8 @@
            </el-table-column>
            <el-table-column align="center" label="调出仓库代码" width="120">
              <template slot-scope="scope">
                <el-input v-model="scope.row.HSCWHCode" placeholder="请输入" @keyup.native.f7="openDataDialog(2, scope.row ,eHWHType=3)"
                  @dblclick.native="openDataDialog(2, scope.row ,eHWHType=3)" />
                <el-input v-model="scope.row.HSCWHNumber" placeholder="请输入" @keyup.native.f7="openDataDialog(2, scope.row ,eHWHType=4)"
                  @dblclick.native="openDataDialog(2, scope.row ,eHWHType=4)" />
              </template>
            </el-table-column>
            <el-table-column align="center" label="调出仓库" width="120">
@@ -291,7 +300,7 @@
            </el-table-column>
            <el-table-column align="center" label="调出仓位代码" width="120">
              <template slot-scope="scope">
                <el-input v-model="scope.row.HSCSPCode" placeholder="请输入" @keyup.native.f7="openDataDialog(9, scope.row,HSPType=2)"
                <el-input v-model="scope.row.HSCSPNumber" placeholder="请输入" @keyup.native.f7="openDataDialog(9, scope.row,HSPType=2)"
                  @dblclick.native="openDataDialog(9, scope.row,HSPType=2)" />
              </template>
            </el-table-column>
@@ -377,6 +386,7 @@
      <GyCustomer @deptEmitDb="dbEmitData" @deptEmit="emitData" :openPage="HModName" v-if="gyCustomerShow" />
      <GyMould @deptEmitDb="dbEmitData" @deptEmit="emitData" :openPage="HModName" v-if="gyMouldShow" />
      <GyStockPlace @deptEmitDb="dbEmitData" @deptEmit="emitData" :openPage="HModName" v-if="gyStockPlaceShow" />
      <ScMouldMove @deptEmitDb="dbEmitData" @deptEmit="emitData" :openPage="HModName" :HOrgID="form.HStockOutOrgID" v-if="scMouldMoveShow" />
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="deptClickSub">确 定</el-button>
        <el-button @click="deptClose">取 消</el-button>
@@ -398,13 +408,14 @@
import GyCustomer from '@/views/GyCustomer'
import GyMould from '@/views/scMould/basicModeling/Gy_MouldFileList.vue'
import GyStockPlace from '@/views/basic/gyStockPlace/gyStockPlace.vue'
import ScMouldMove from '@/views/scMould/warehouse/Sc_MouldMoveStockRequestBillList.vue'
import moment from 'moment';
export default {
  name: 'Sc_MouldProdMoveBillEdit',
  components: { Dept, Warehouse, RowSettings, GyEmployee,GySupplier,GyCustomer,GyMould,GyStockPlace },
  components: { Dept, Warehouse, RowSettings, GyEmployee,GySupplier,GyCustomer,GyMould,GyStockPlace,ScMouldMove },
  props: {
    OperationType: { type: Number, },
    OperationType: { type: Number, },//(1新增、2编辑、3复制、4下推)
    linterid: { type: Number, },
    HSouceBillType: { type: String, },
    propsData: { type: String, },
@@ -419,6 +430,8 @@
      zzSelDis: false,
      rowHideShow: false,
      openRowHide: false,
      hSupTypeList: [{name:'供应商',id:1,},{name:'客户',id:2},{name:'车间部门',id:3}],
      HSourceBillTypes:[],
      addBtnShow: false,
      zbIndex: null,
      zbSelForm: {},//子表选中数据
@@ -430,15 +443,18 @@
      gyCustomerShow: false,//客户数据组件
      gyMouldShow: false,//器具数据组件
      gyStockPlaceShow: false,//仓位数据组件
      scMouldMoveShow:false,//源单组件
      eHWHType:1,//仓库弹窗区分标志
      empType:1,//职员弹窗区分标志
      HSPType:1,//仓位弹窗区分标志
      deptType:1,//部门弹窗区分标志
      deptform: {},//弹窗选中数据
      openData: false,//数据弹窗
      dialogTitle: '',
      organizationList: [],//组织列表
      ifOrganizationEdit: false,
      subDisabled: false,//编辑页面保存按钮是否禁用(true禁用,false可用)
      // OperationType: this.$route.query.OperationType,//保存类型(新增1修改3)
      // OperationType: this.$route.query.OperationType,//保存类型(1新增、2编辑、3复制、4下推)
      HInterID: 0,
      baseURL: process.env.VUE_APP_BASE_API,
      checkedSysZb: [],
@@ -486,26 +502,30 @@
      form: {},
      // 表单校验
      rules: {
        HBillNo: [
          { required: true, message: "单据号不能为空", trigger: "blur" }
        ],
        HDate: [
          { required: true, message: "日期不能为空", trigger: "blur" }
        ],
        HWHName: [
          { required: true, message: "器具仓库不能为空", trigger: "blur" }
        HStockInOrgID: [
          { required: true, message: "调入组织不能为空", trigger: "blur" }
        ],
        HStockOutOrgID: [
          { required: true, message: "调出组织不能为空", trigger: "blur" }
        ],
        HSecManagerName: [
          { required: true, message: "领料人不能为空", trigger: "blur" }
          { required: true, message: "验收员不能为空", trigger: "blur" }
        ],
        HKeeperName: [
          { required: true, message: "发料人不能为空", trigger: "blur" }
        ],
        HDeptName: [
          { required: true, message: "部门不能为空", trigger: "blur" }
          { required: true, message: "保管员不能为空", trigger: "blur" }
        ]
      }
    };
  },
  created() {
    this.fetchData()
    this.SourceBillType()
    this.getdata()
  },
  methods: {
@@ -519,14 +539,29 @@
        this.$modal.msgError("接口请求失败!");
      });
    },
    SourceBillType(){
      axios.get(this.baseURL + "/Web/GetHSourceBillType", {
        params: { "HName": '器具调拨单', "Num": 2 }//0蓝单 1红单 2不分红蓝单
      }).then(response => {
        if (response.data.count == 1) {
          this.HSourceBillTypes = response.data.data
          this.form.HSourceBillType = this.HSourceBillTypes[0].HSourceBillType
          this.form.HSourceBillTypeName = this.HSourceBillTypes[0].HSourceBillTypeName
        }
      }).catch(error => {
        this.$modal.msgError("接口请求失败!");
      });
    },
    getdata() {
      console.log(this.copyType, this.OperationType)
      this.formShow = false
      this.formLoading = true
      if ((this.OperationType == 1 && this.copyType != 1) || (!this.OperationType && !this.copyType)) {
        this.handleAdd()
      } else if (this.OperationType == 3 || this.copyType == 1) {
      } else if (this.OperationType == 2 || this.copyType == 1) {
        this.handleUpdate()
      } else if (this.OperationType == 4) {
        this.handleMove()
      }
    },
    // 获取参数_传递的JSON格式参数
@@ -553,70 +588,235 @@
      // let options=undefined
      //  this.form=this.organizationList.find(option => option.ID === val)?.Name || '';
    },
    //获取源单数据
    GetSourceBillList(HSourceInterID, HSourceEntryID, HSourceBillType) {
        var res = "none"
        axios.get(this.baseURL + "/Sc_MouldProdMoveBillController/GetSourceBill_MouldProdMove_Json", {
          params: { "HInterID": HSourceInterID, "HEntryID": HSourceEntryID, "HBillType": HSourceBillType }
        }).then(response => {
          if (response.data.count == 1) {
            res = response.data.data[0]
          }else {
            res = "none";
          }
        }).catch(error => {
          this.$modal.msgError("接口请求失败!");
        });
        return res;
    },
    //写入源单数据
    setInitBySourceBill(dataArray){
      var data = dataArray[0]
      this.form.HSupTypeID = data.HSupTypeID
      this.form.HSupID = data.HSupID
      this.form.HSupName = data.HSupName
      this.form.HDeptID = data.HDeptID
      this.form.HDeptName = data.HDeptName
      this.form.HStockInOrgID = data.HStockInOrgID
      this.form.HStockOutOrgID = data.HStockOutOrgID
      this.form.HStockOrgID = data.HStockOutOrgID
      this.form.HStockInOrgID = data.HStockInOrgID == null ? 0 : data.HStockInOrgID
      this.form.HStockOutOrgID = data.HStockOutOrgID == null ? 0 : data.HStockOutOrgID
      this.ifOrganizationEdit = true
      //子表  赋值
      var rowdata = [];
      for (let i = 0; i < dataArray.length; i++) {
          rowdata.push(
              {
                  "HMaterID": dataArray[i].HMaterID == null ? 0 : dataArray[i].HMaterID
                  , "HMaterNumber": dataArray[i].HMaterNumber == null ? "" : dataArray[i].HMaterNumber
                  , "HMaterName": dataArray[i].HMaterName == null ? "" : dataArray[i].HMaterName
                  , "HMaterModel": dataArray[i].HMaterModel == null ? "" : dataArray[i].HMaterModel
                  , "HUnitID": dataArray[i].HUnitID == null ? 0 : dataArray[i].HUnitID
                  , "HUnitNumber": dataArray[i].HUnitNumber == null ? "" : dataArray[i].HUnitNumber
                  , "HUnitName": dataArray[i].HUnitName == null ? "" : dataArray[i].HUnitName
                  , "HBatchNo": ""
                  , "HQty": dataArray[i].HQty == null ? 0 : dataArray[i].HQty
                  , "HWHID": dataArray[i].HWHID == null ? 0 : dataArray[i].HWHID
                  , "HWHNumber": dataArray[i].HWHNumber == null ? "" : dataArray[i].HWHNumber
                  , "HWHName": dataArray[i].HWHName == null ? "" : dataArray[i].HWHName
                  , "HSPID": "0"
                  , "HSPNumber": ""
                  , "HSPName": ""
                  , "HSCWHID": dataArray[i].HSCWHID == null ? 0 : dataArray[i].HSCWHID
                  , "HSCWHNumber": dataArray[i].HSCWHNumber == null ? "" : dataArray[i].HSCWHNumber
                  , "HSCWHName": dataArray[i].HSCWHName == null ? "" : dataArray[i].HSCWHName
                  , "HSCSPID": "0"
                  , "HSCSPNumber": ""
                  , "HSCSPName": ""
                  , "HSourceInterID": dataArray[i].HInterID == null ? 0 : dataArray[i].HInterID
                  , "HSourceEntryID": dataArray[i].HEntryID == null ? 0 : dataArray[i].HEntryID
                  , "HSourceBillType": dataArray[i].HBillType == null ? "" : dataArray[i].HBillType
                  , "HSourceBillNo": dataArray[i].HBillNo == null ? "" : dataArray[i].HBillNo
                  , "HRelationQty": "0"
                  , "HRelationMoney": "0"
                  , "HRemark": ""
                  , "HPropertyID": "0"
                  , "HSecUnitID": "0"
                  , "HSecUnitRate": "0"
                  , "HQtyMust": dataArray[i].HQty == null ? 0 : dataArray[i].HQty
                  , "HPrice": "0"
                  , "HMoney": "0"
                  , "HDesignLife": "0"
                  , "HLeaveLife": "0"
                  , "HPOOrderInterID": "0"
                  , "HPOOrderEntryID": "0"
                  , "HPOOrderBillNo": ""
                  , "HSeOrderInterID": "0"
                  , "HSeOrderEntryID": "0"
                  , "HSeOrderBillNo": ""
                  , "HSTOCKORGID": dataArray[i].HStockOutOrgID == null ? 0 : dataArray[i].HStockOutOrgID
                  , "HOtherOrgID": dataArray[i].HStockInOrgID == null ? 0 : dataArray[i].HStockInOrgID
                  , "HOWNERID": dataArray[i].HStockOutOrgID == null ? 0 : dataArray[i].HStockOutOrgID
                  , "HOWNERTYPEID": ""
                  , "HUseLife": "0"
                  , "HUseLifeQty": "0"
                  , "HNewLifeQty": "0"
                  , "HQtyRel": "0"
                  , "HSPGroupID": "0"
                  , "HNewModel": ""
                  , "HWallThickness": ""
                  , "HHardness": ""
                  , "HLastProdModel": ""
                  , "HDiameter": ""
                  , "HBackFlag": ""
                  , "HBarCode": ""
                  , "HMouldType": "0"
                  , "HInitModel": ""
                  , "HInitDesignLife": "0"
                  , "HLifeUnitID": "0"
                  , "HNowModel": ""
                  , "HNowLife": "0"
                  , "HCorrespondentTypeID": "0"
                  , "HCorrespondentID": "0"
              }
          )
      }
      this.editData = rowdata
    },
    //弹窗赋值
    dbEmitData(deptRow, num) {
      // num=1部门 num=2仓库
      console.log(deptRow)
      if (deptRow.HItemID || deptRow.hmainid) {
        if (num == 1) {
          this.form.HDeptName = deptRow.部门名称
          this.form.HDeptID = deptRow.HItemID
          this.deptShow = false
          this.openData = false
        } else if (num == 2) {
          if(this.eHWHType == 1){
            this.form.HWHName = deptRow.仓库名称
            this.form.HWHID = deptRow.HItemID
            this.form.HWHNumber = deptRow.仓库代码
          }else if(this.eHWHType == 2){
            this.editData[this.zbIndex].HWHID = deptRow.HItemID
            this.editData[this.zbIndex].HWHCode = deptRow.仓库代码
            this.editData[this.zbIndex].HWHName = deptRow.仓库名称
          }else if(this.eHWHType == 3){
            this.editData[this.zbIndex].HSCWHID = deptRow.HItemID
            this.editData[this.zbIndex].HSCWHCode = deptRow.仓库代码
            this.editData[this.zbIndex].HSCWHName = deptRow.仓库名称
      console.log(33,deptRow)
      if(num == 3850){
        if (deptRow.length > 0) {
          var HSupTypeID_Temp = deptRow[0].HSupTypeID
          var HStockInOrgID_Temp = deptRow[0].HStockInOrgID
          for (var i = 0; i < deptRow.length; i++) {
            if (deptRow[i].HSupTypeID != HSupTypeID_Temp) {
              this.$modal.msgError("所选单据对应往来类型必须一致!");
            }
            if (deptRow[i].HStockInOrgID != HStockInOrgID_Temp) {
              this.$modal.msgError("所选单据对应调入组织必须一致!");
            }
          }
          this.warehouseShow = false
          this.openData = false
        } else if (num == 4) {
          if(this.empType == 1){
            this.form.HSecManagerName = deptRow.职员名称
            this.form.HSecManagerID = deptRow.HItemID
          }else{
            this.form.HKeeperName = deptRow.职员名称
            this.form.HKeeperID = deptRow.HItemID
          }
          this.gyEmployeeShow = false
          this.openData = false
        } else if (num == 8){
          this.editData[this.zbIndex].HMaterID = deptRow.hmainid
          this.editData[this.zbIndex].HMaterCode = deptRow.模具编号
          this.editData[this.zbIndex].HMaterName = deptRow.模具名称
          this.editData[this.zbIndex].HMaterSpec = deptRow.模具型号
          this.editData[this.zbIndex].HUnitID = deptRow.HUnitID
          this.editData[this.zbIndex].HUnitCode = deptRow.计量单位代码
          this.editData[this.zbIndex].HUnitName = deptRow.计量单位
          this.editData[this.zbIndex].HQty = 1
          this.gyMouldShow = false
          this.openData = false
        } else if (num == 9){
          if(this.HSPType == 1){
            this.editData[this.zbIndex].HSPID = deptRow.HMainID
            this.editData[this.zbIndex].HSPCode = deptRow.仓位代码
            this.editData[this.zbIndex].HSPName = deptRow.仓位名称
          }else{
            this.editData[this.zbIndex].HSCSPID = deptRow.HMainID
            this.editData[this.zbIndex].HSCSPCode = deptRow.仓位代码
            this.editData[this.zbIndex].HSCSPName = deptRow.仓位名称
          }
          this.gyStockPlaceShow = false
          this.openData = false
        }
      } else {
        this.$modal.msgError("请选择单条数据!");
      }
          var dataArray = [];
          for (var i = 0; i < deptRow.length; i++) {
              var temp = this.GetSourceBillList(deptRow[i].hmainid, deptRow[i].hsubid, deptRow[i].HBillType)
              console.log(718,temp)
              if (temp != "none") {
                  dataArray.push(temp);
              } else {
                this.$modal.msgError("未查询到源单信息,请刷新源单列表后重新选择对应源单!");
              }
          }
          this.setInitBySourceBill(dataArray)
          this.scMouldMoveShow = false
          this.openData = false
        } else {
          this.$modal.msgError("请选择数据!");
        }
      }else{
        if (deptRow.HItemID || deptRow.hmainid) {
          if (num == 1) {
            if(this.deptType == 1){
              this.form.HDeptName = deptRow.部门名称
              this.form.HDeptID = deptRow.HItemID
            }else{
              this.form.HSupName = deptRow.部门名称
              this.form.HSupID = deptRow.HItemID
            }
            this.deptShow = false
            this.openData = false
          } else if (num == 2) {
            if(this.eHWHType == 1){
              this.form.HWHName = deptRow.仓库名称
              this.form.HWHID = deptRow.HItemID
              this.form.HWHNumber = deptRow.仓库代码
            }else if(this.eHWHType == 2){
              this.form.HSCWHName = deptRow.仓库名称
              this.form.HSCWHID = deptRow.HItemID
              this.form.HSCWHNumber = deptRow.仓库代码
            }else if(this.eHWHType == 3){
              this.editData[this.zbIndex].HWHID = deptRow.HItemID
              this.editData[this.zbIndex].HWHNumber = deptRow.仓库代码
              this.editData[this.zbIndex].HWHName = deptRow.仓库名称
            }else if(this.eHWHType == 4){
              this.editData[this.zbIndex].HSCWHID = deptRow.HItemID
              this.editData[this.zbIndex].HSCWHNumber = deptRow.仓库代码
              this.editData[this.zbIndex].HSCWHName = deptRow.仓库名称
            }
            this.warehouseShow = false
            this.openData = false
          } else if (num == 4) {
            if(this.empType == 1){
              this.form.HEmpName = deptRow.职员名称
              this.form.HEmpID = deptRow.HItemID
            }else if(this.empType == 2){
              this.form.HMangerName = deptRow.职员名称
              this.form.HMangerID = deptRow.HItemID
            }else if(this.empType == 3){
              this.form.HSecManagerName = deptRow.职员名称
              this.form.HSecManagerID = deptRow.HItemID
            }else if(this.empType == 4){
              this.form.HKeeperName = deptRow.职员名称
              this.form.HKeeperID = deptRow.HItemID
            }else
            this.gyEmployeeShow = false
            this.openData = false
          } else if (num == 6) {
            this.form.HSupName = deptRow.供应商名称
            this.form.HSupID = deptRow.HItemID
            this.gySupplierShow = false
            this.openData = false
          } else if (num == 7) {
            this.form.HSupName = deptRow.客户名称
            this.form.HSupID = deptRow.HItemID
            this.gyCustomerShow = false
            this.openData = false
          } else if (num == 8){
            this.editData[this.zbIndex].HMaterID = deptRow.hmainid
            this.editData[this.zbIndex].HMaterNumber = deptRow.模具编号
            this.editData[this.zbIndex].HMaterName = deptRow.模具名称
            this.editData[this.zbIndex].HMaterModel = deptRow.模具型号
            this.editData[this.zbIndex].HUnitID = deptRow.HUnitID
            this.editData[this.zbIndex].HUnitNumber = deptRow.计量单位代码
            this.editData[this.zbIndex].HUnitName = deptRow.计量单位
            this.editData[this.zbIndex].HQty = 1
            this.editData[this.zbIndex].HDesignLife = 0
            this.editData[this.zbIndex].HLeaveLife = 0
            this.editData[this.zbIndex].HMoney = 0
            this.gyMouldShow = false
            this.openData = false
          } else if (num == 9){
            if(this.HSPType == 1){
              this.editData[this.zbIndex].HSPID = deptRow.HMainID
              this.editData[this.zbIndex].HSPCode = deptRow.仓位代码
              this.editData[this.zbIndex].HSPName = deptRow.仓位名称
            }else{
              this.editData[this.zbIndex].HSCSPID = deptRow.HMainID
              this.editData[this.zbIndex].HSCSPCode = deptRow.仓位代码
              this.editData[this.zbIndex].HSCSPName = deptRow.仓位名称
            }
            this.gyStockPlaceShow = false
            this.openData = false
          }
        } else {
          this.$modal.msgError("请选择单条数据!");
        }
      }
    },
    emitData(deptRow, num) {
      this.dialogTypeNum = num
@@ -744,69 +944,98 @@
        this.$modal.msgError("接口请求失败!");
      });
    },
    /** 下推打开 */
    handleMove() {
      this.reset()
      //新增获取单据号
      this.getHBillNo()
      let date = new Date()
      this.form.HDate = moment(date).format('YYYY-MM-DDTHH:mm:ss')
      //设置源单类型
      this.form.HSourceBillType = this.HSouceBillType
      //获取源单数据
      var data = this.getUrlVars_JSON().data;
      var dataArray = [];
      for (var i = 0; i < data.length; i++) {
          var temp = this.GetSourceBillList(data[i].hmainid, data[i].hsubid, data[i].HBillType)
          console.log(temp)
          if (temp != "none") {
              dataArray.push(temp);
          } else {
              this.$modal.msgError("未查询到单据可下推数据,请刷新单据列表后重新选择单据下推!");
              return;
          }
      }
      this.$nextTick(() => {
        this.setInitBySourceBill(dataArray);
        this.OperationType = 1;
        this.formShow = true
        this.formLoading = false
      })
    },
    /** 修改按钮操作 */
    handleUpdate() {
      this.reset()
      let rowHmainid = this.linterid
      console.log(this.linterid)
      //主表
      axios.get(this.baseURL + "/Sc_MouldProdMoveBill/Sc_MouldProdMoveBillListCheckDetai", {
        params: { 'HID': rowHmainid }
      axios.get(this.baseURL + "/Sc_MouldStockBillController/GetSc_MouldStockBill_Json", {
        params: { 'HInterID': rowHmainid,"HMaker": sessionStorage["HUserName"] }
      }).then(response => {
        if (response.data.code == 1) {
          var data = response.data.data.h_v_Sc_MouldProdMoveBill_Edit[0]
          console.log(data)
        if (response.data.count == 1) {
          var data = response.data.data[0]
          // console.log(response.data)
          if (this.copyType == 1) {
            this.getHBillNo()
            let date = new Date()
            this.form.HDate = moment(date).format('YYYY-MM-DDTHH:mm:ss')
          } else {
            this.form = {
                  "HBillNo": data.单据号
                , "HDate": data.日期
                , "HInnerBillNo": data.内部单据号
                , "HWHID": data.HWHID1                    //仓库ID
                , "HWHName": data.器具仓库                   //仓库名称
                , "HSecManagerID": data.hsecmanagerid    //验收员ID
                , "HSecManagerName": data.领料人         //验收员名称
                , "HKeeperID": data.hkeeperid            //保管员ID
                , "HKeeperName": data.发料人            //保管员名称
                , "HDeptID": data.HDeptID                 //部门ID
                , "HDeptName": data.部门                //部门名称
                , "HSourceBillType": ""                   //源单类型
                , "XDH": ""                               //选单号
                , "HExplanation": data.摘要              //摘要
                , "HRemark": data.表头备注                    //备注
                , "HStockStyle": data.调拨类型
                , "HMaker": data.制单人
                , "HMakeDate": data.制单日期 == null ? "" : data.制单日期
                , "HChecker": data.审核人
                , "HCheckDate": data.审核日期 == null ? "" : data.审核日期
                , "HUpDater": data.修改人
                , "HUpDateDate": data.修改日期 == null ? "" : data.修改日期
                , "HCloseMan": data.关闭人
                , "HCloseDate": data.关闭日期 == null ? "" : data.关闭日期
                , "HDeleteMan": data.作废人
                , "HDeleteDate": data.作废日期 == null ? "" : data.作废日期
            if (data[0].HSourceInterID != "0") {
              this.ifOrganizationEdit = true
            }
            this.form = {
                "HBillNo": data[0].单据号
                , "HDate": data[0].日期
                , "HSupTypeID": data[0].HSupTypeID
                , "HSupID": data[0].HSupID
                , "HSupName": data[0].往来单位
                , "HDeptID": data[0].HDeptID
                , "HDeptName": data[0].部门
                , "HWHID": data[0].HMainWHID
                , "HWHName": data[0].调入仓库
                , "HSCWHID": data[0].HMainSCWHID
                , "HSCWHName": data[0].调出仓库
                , "HEmpID": data[0].HEmpID
                , "HEmpName": data[0].业务员
                , "HManagerID": data[0].HManagerID
                , "HManagerName": data[0].负责人
                , "HSecManagerID": data[0].HSecManagerID
                , "HSecManagerName": data[0].验收员
                , "HKeeperID": data[0].HKeeperID
                , "HKeeperName": data[0].保管员
                , "HExplanation": data[0].摘要
                , "HRemark": data[0].表头备注
                , "HInnerBillNo": data[0].内部单据号
                , "HStockInOrgID": data[0].HStockInOrgID
                , "HStockOutOrgID": data[0].HStockOutOrgID
                , "HMaker": data[0].制单人
                , "HChecker": data[0].审核人
                , "HCloseMan": data[0].关闭人
                , "HUpDater": data[0].修改人
                , "HDeleteMan": data[0].作废人
                , "HMakeDate": data[0].制单日期 == null ? "" : data[0].制单日期
                , "HCheckDate": data[0].审核日期 == null ? "" : data[0].审核日期
                , "HCloseDate": data[0].关闭日期 == null ? "" : data[0].关闭日期
                , "HUpDateDate": data[0].修改日期 == null ? "" : data[0].修改日期
                , "HDeleteDate": data[0].作废日期 == null ? "" : data[0].作废日期
            }
            this.form.HStockInOrgID = data[0].HStockInOrgID == null ? 0 : data[0].HStockInOrgID;
            this.form.HStockOutOrgID = data[0].HStockOutOrgID == null ? 0 : data[0].HStockOutOrgID;
            //子表  赋值
            this.editData = response.data.data[0];
            this.editData1 = response.data.data[1];
          }
          this.formShow = true
          this.formLoading = false
        }
      }).catch(error => {
        console.log(error)
        this.$modal.msgError("接口请求失败!");
      });
      //子表
      axios.get(this.baseURL + "/Sc_MouldProdMoveBill/Sc_MouldProdMoveBillListProjectDetai", {
        params: { 'sqlWhere': "and hmainid=" + rowHmainid }
      }).then(response => {
        if (response.data.count == 1) {
          var data = response.data
          console.log(data)
          this.editData = data.list[0]
          this.editData1 = data.list[1]
          this.formShow = true
          this.formLoading = false
        }
@@ -825,38 +1054,72 @@
        this.$modal.msgError("请选择一行数据编辑!");
      } else {
        let obj = {
          HBatchNo: "",
          HDesignLife: 0,
          HLeaveLife: 0,
          HMaterCode:"",
          HMaterID:0,
          HMaterName:"",
          HMaterSpec:"",
          HMoney:0,
          HPrice:0,
          HQty:0,
          HQtyMust:0,
          HSPCode:"",
          HSPID:0,
          HSPName:"",
          HOtherOrgID:sessionStorage["OrganizationID"] - 0,//组织id
          HStockOrgID:0,
          HStockOrgCode:"",
          HStockOrgName:"",
          HUnitCode:"",
          HUnitID:0,
          HUnitName:"",
          HUseLife:0,
          HWHCode:"",
          HWHID:0,
          HWHName:"",
          HSCWHID:0,
          HSCWHCode:"",
          HSCWHName:"",
          HSCSPID:0,
          HSCSPCode:"",
          HSCSPName:"",
          HRemark:"",
            "HMaterID": "0"
            , "HMaterNumber": ""
            , "HMaterName": ""
            , "HMaterModel": ""
            , "HUnitID": "0"
            , "HUnitNumber": ""
            , "HUnitName": ""
            , "HBatchNo": ""
            , "HQty": "0"
            , "HWHID": "0"
            , "HWHNumber": ""
            , "HWHName": ""
            , "HSPID": "0"
            , "HSPNumber": ""
            , "HSPName": ""
            , "HSCWHID": "0"
            , "HSCWHNumber": ""
            , "HSCWHName": ""
            , "HSCSPID": "0"
            , "HSCSPNumber": ""
            , "HSCSPName": ""
            , "HSourceInterID": "0"
            , "HSourceEntryID": "0"
            , "HSourceBillType": ""
            , "HSourceBillNo": ""
            , "HRelationQty": "0"
            , "HRelationMoney": "0"
            , "HRemark": ""
            , "HPropertyID": "0"
            , "HSecUnitID": "0"
            , "HSecUnitRate": "0"
            , "HQtyMust": "0"
            , "HPrice": "0"
            , "HMoney": "0"
            , "HDesignLife": "0"
            , "HLeaveLife": "0"
            , "HPOOrderInterID": "0"
            , "HPOOrderEntryID": "0"
            , "HPOOrderBillNo": ""
            , "HSeOrderInterID": "0"
            , "HSeOrderEntryID": "0"
            , "HSeOrderBillNo": ""
            , "HSTOCKORGID": sessionStorage["OrganizationID"] - 0
            , "HOtherOrgID": sessionStorage["OrganizationID"] - 0
            , "HOWNERID": sessionStorage["OrganizationID"] - 0
            , "HOWNERTYPEID": ""
            , "HUseLife": "0"
            , "HUseLifeQty": "0"
            , "HNewLifeQty": "0"
            , "HQtyRel": "0"
            , "HSPGroupID": "0"
            , "HNewModel": ""
            , "HWallThickness": ""
            , "HHardness": ""
            , "HLastProdModel": ""
            , "HDiameter": ""
            , "HBackFlag": ""
            , "HBarCode": ""
            , "HMouldType": "0"
            , "HInitModel": ""
            , "HInitDesignLife": "0"
            , "HLifeUnitID": "0"
            , "HNowModel": ""
            , "HNowLife": "0"
            , "HCorrespondentTypeID": "0"
            , "HCorrespondentID": "0"
        }
        if (index) {
          this.editData.splice(index, 0, obj);
@@ -931,7 +1194,7 @@
          let fhck = false
          if(this.editData.length == 0){
              fhck = true
              this.$modal.msgError("没有物料明细记录!");
              this.$modal.msgError("没有明细记录!");
          }
          this.editData.map((item, index) => {
            if (!item.HMaterID) {
@@ -943,19 +1206,31 @@
            }else if(!item.HSCWHID){
              fhck = true
              this.$modal.msgError("第" + (index + 1) + "行:调出仓库未选择!");
            }else if(!item.HUnitID){
              fhck = true
              this.$modal.msgError("第" + (index + 1) + "行:计量单位为空!");
            }else if(item.HQty == 0){
              fhck = true
              this.$modal.msgError("第" + (index + 1) + "行:数量不能为0!");
            }
          })
          this.$nextTick(() => {
            if (!fhck) {
              if(this.OperationType == 3){
                this.form.HInterID = this.linterid
              var Operation = null
              if(!this.OperationType){
                Operation = 1
              }else{
                Operation = this.OperationType
                if(Operation == 2){
                  this.form.HInterID = this.linterid
                }
              }
              var sMainStr = JSON.stringify(this.form);
              var sSubStr = JSON.stringify(this.editData);
              var sMainSub = sMainStr + ';' + sSubStr + ';' + sessionStorage["HUserName"];
              var sMainSub = sMainStr + ';' + sSubStr + ';' + Operation + ";" + sessionStorage["HUserName"];
              axios({
                method: 'post',
                url: this.baseURL + "/Sc_MouldProdMoveBill/SaveGetMouldProdMoveBillList",
                url: this.baseURL + "/Sc_MouldProdMoveBillController/GetSc_MouldProdMoveBill_Save_Json",
                data: {
                  'msg': sMainSub
                },
@@ -984,12 +1259,13 @@
    set_CheckBill(num, form) {
      var InterID = form.hmainid || form.HInterID
      //逻辑审核方法
      axios.get(this.baseURL + "/Sc_MouldProdMoveBill/AuditMouldProdMoveBill", {
        params: { "HInterID": InterID, "flag": num, "user": sessionStorage["HUserName"] }
      axios.get(this.baseURL + "/Sc_MouldProdMoveBillController/GetSc_MouldProdMoveBill_Check_Json", {
        params: { "HInterID": InterID, "Type": num, "HMaker": sessionStorage["HUserName"] }
      }).then(response => {
        let result = response.data
        if (result.code == 1) {
          this.$modal.msgSuccess('操作成功');
          this.close()
        }
        else {
          this.$modal.msgError("错误:" + result.code + result.Message,);
@@ -1006,6 +1282,7 @@
      this.gyCustomerShow = false
      this.gyMouldShow = false
      this.gyStockPlaceShow = false
      this.scMouldMoveShow = false
    },
    //  打开数据列表弹窗
    openDataDialog(num, row) {
@@ -1046,8 +1323,31 @@
        this.dialogTitle = '仓位列表'
        this.gyStockPlaceShow = true
        this.openData = true
      } else if (num == 3850) {
        this.dialogTitle = '器具调拨申请单列表'
        this.scMouldMoveShow = true
        this.openData = true
      } 
    },
    //根据往来类型判断往来单位
    openDataDialogChoose(){
      if(this.form.HSupTypeID == 1){
        this.openDataDialog(6)
      }else if(this.form.HSupTypeID == 2){
        this.openDataDialog(7)
      }else if(this.form.HSupTypeID == 3){
        this.deptType = 2
        this.openDataDialog(1)
      }
    },
    //选择源单
    get_checkMainSource(){
      if(this.form.HSourceBillType == "3850"){
        this.openDataDialog(3850)
      }else{
        this.$modal.msgError("未查询到所选源单类型相关单据信息!");
      }
    },
  }
};
</script>
src/views/scMould/warehouse/Sc_MouldProdMoveBillList.vue
@@ -25,36 +25,34 @@
      <el-collapse v-model="activeSeach">
        <el-collapse-item title="更多" name="1">
          <el-card class="box-card">
            <el-form-item label="组织名称" prop="HStockOrgName">
              <el-input v-model="queryParams.HStockOrgName" placeholder="请输入组织名称" @keyup.enter.native="handleQuery" />
            </el-form-item>
            <!-- <el-form-item label="组织">
              <el-select v-model="queryParams.HOrgID" placeholder="请选择">
                <el-option v-for="(item, index) in organizationList" :key="index" :label="item.Name" :value="item.ID">
                </el-option>
              </el-select>
            </el-form-item> -->
            <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="HMaterNumber">
              <el-input v-model="queryParams.HMaterNumber" 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>
            <el-form-item label="仓库" prop="HWhName">
              <el-input v-model="queryParams.HWhName" 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>
              <el-form-item label="状态" prop="HStatus">
                <el-select v-model="queryParams.HStatus" placeholder="请选择状态">
                  <el-option v-for="(item, index) in HStatusList" :key="index" :label="item.name" :value="item.value">
                  </el-option>
                </el-select>
              </el-form-item>
              <el-form-item label="调出组织">
                <el-select v-model="queryParams.HStockOutOrgID" placeholder="请选择">
                  <el-option v-for="(item, index) in organizationList" :key="index" :label="item.Name" :value="item.ID">
                  </el-option>
                </el-select>
              </el-form-item>
              <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>
              <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>
              <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>
@@ -67,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>
@@ -77,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>
@@ -90,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>
@@ -99,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>
@@ -111,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>
@@ -253,7 +253,7 @@
        { label: '近一年', value: 365 },
      ],
      organizationList: JSON.parse(sessionStorage.getItem('organizationList')),//组织列表
      hPriceTypeList: ['成本价', '结算价'],
      HStatusList: [{name:'全部',value:'-1'},{name:'未审核',value:'0'},{name:'已审核',value:'1'},{name:'已关闭',value:'2'}],
      addBtnShow: false,
      dialogTitle: '',
      OperationType: null,//保存类型(新增1修改3)
@@ -271,11 +271,10 @@
      queryParams: {
        HBillNo: '',
        HInitTimeCycle: 29,
        HStockOrgName: '',
        HStockOutOrgID: sessionStorage["OrganizationID"] - 0,
        HStatus:'-1',
        HDept:'',
        HMaterNumber: '',
        HModelNumber:'',
        HWhName:'',
        HSupName:'',
        ColName1: '',
        ColName2: '',
@@ -374,20 +373,23 @@
      this.tableShow = false
      this.loading = true
      if (this.sTime && !this.sWhere) {
        this.sWhere += " and CONVERT(varchar(100),日期, 23) >= '" + this.sTime + "'"
        this.sWhere += " and CONVERT(varchar(100),日期, 23) <= '" + this.eTime + "'"
        this.sTime = moment(this.sTime).format('YYYY-MM-DD')
        this.eTime = moment(this.eTime).format('YYYY-MM-DD')
        this.sWhere += " and 日期 >= '" + this.sTime + "'";
        this.sWhere += " and 日期 <= '" + this.eTime + "'";
      }
      this.sWhere += " and HSTOCKORGID=" + this.queryParams.HStockOutOrgID;
      if (this.pageSize == 0) {
        this.pageSize = 50
      }
      // 销售出库单列表
      axios.get(this.baseURL + '/Sc_MouldProdMoveBill/page', {
      axios.get(this.baseURL + '/Sc_MouldProdMoveBillController/page', {
        params: {
          "sWhere": this.sWhere,
          "user": sessionStorage["HUserName"],
          "Organization": sessionStorage["Organization"],
          "page": this.page,
          "size": this.pageSize
          "size": this.pageSize,
          "Type": '3814',
        },
      }).then(response => {
        this.tyResList = response.data.data//总数据
@@ -583,7 +585,7 @@
    //双击行
    handleDblclick(row, column, cell, event) {
      this.OperationType = 3
      this.handleEdit()
      this.handleEdit(row)
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
@@ -661,34 +663,44 @@
        }
        this.sWhere += " and " + this.queryParams.ColName2 + " " + com2;
      }
      if (this.sTime) {
        this.sTime = moment(this.sTime).format('YYYY-MM-DD')
        this.eTime = moment(this.eTime).format('YYYY-MM-DD')
        console.log(this.sTime, this.eTime)
        this.sWhere += " and CONVERT(varchar(100),日期, 23) >= '" + this.sTime + "'" + " and CONVERT(varchar(100),日期, 23) <= '" + this.eTime + "'";
      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 + "'";
      }
      if (this.eTime) {
          this.eTime = moment(this.eTime).format('YYYY-MM-DD')
          this.sWhere += " and 日期 <= '" + this.eTime + "'";
      }
      if (this.queryParams.HBillNo) {
        this.sWhere += " and 单据号 like '%" + this.queryParams.HBillNo + "%'";
      }
      if (this.queryParams.HStockOrgName) {
        this.sWhere += " and 组织名称 like '%" + this.queryParams.HStockOrgName + "%'";
      }
      if (this.queryParams.HDept) {
          this.sWhere += " and 部门 like '%" + this.queryParams.HDept + "%'";
      }
      if (this.queryParams.HMaterNumber) {
          this.sWhere += " and 物料代码 like '%" + this.queryParams.HMaterNumber + "%'";
      }
      if (this.queryParams.HModelNumber) {
          this.sWhere += " and 模具代码 like '%" + this.queryParams.HModelNumber + "%'";
      }
      if (this.queryParams.HWhName) {
          this.sWhere += " and 仓库 like '%" + this.queryParams.HWhName + "%'";
          this.sWhere += " and 器具代码 like '%" + this.queryParams.HModelNumber + "%'";
      }
      if (this.queryParams.HSupName) {
          this.sWhere += " and 往来单位 like '%" + this.queryParams.HSupName + "%'";
      }
      this.clearData()
      this.getList()
    },
    /** 重置按钮操作 */
@@ -697,11 +709,10 @@
      this.queryParams = {
        HBillNo: '',
        HInitTimeCycle: 29,
        HStockOrgName: '',
        HStockOutOrgID: sessionStorage["OrganizationID"] - 0,
        HStatus:'-1',
        HDept:'',
        HMaterNumber: '',
        HModelNumber:'',
        HWhName:'',
        HSupName:'',
        ColName1: '',
        ColName2: '',
@@ -715,6 +726,7 @@
      }
      this.riqiChange()
      this.resetForm("queryForm")
      this.clearData()
      this.getList()
    },
@@ -724,6 +736,7 @@
      this.tableShow = true
      this.openEdit = false
      this.editShow = false
      this.clearData()
      this.getList()
    },
    //打开新增组件弹窗
@@ -743,7 +756,16 @@
      this.open = val
      this.editShow = false
      this.openEdit = val
      this.clearData()
      this.getList()
    },
    //清除选中数据的缓存
    clearData(){
      this.ids = []
      this.multiple = true
      this.single = true
      this.OperationType = 0
      this.copyType = 0
    },
    /** 删除按钮操作 */
    handleDelete() {
@@ -772,6 +794,7 @@
        let result = response.data
        if (result.count == 1) {
          this.$modal.msgSuccess('操作成功');
          this.clearData()
          this.getList();
        }
        else {
src/views/scMould/warehouse/Sc_MouldProdOutBillList.vue
@@ -25,30 +25,34 @@
      <el-collapse v-model="activeSeach">
        <el-collapse-item title="更多" name="1">
          <el-card class="box-card">
            <el-form-item label="组织名称" prop="HStockOrgName">
              <el-input v-model="queryParams.HStockOrgName" placeholder="请输入组织名称" @keyup.enter.native="handleQuery" />
            <el-form-item label="状态" prop="HStatus">
              <el-select v-model="queryParams.HStatus" placeholder="请选择状态">
                <el-option v-for="(item, index) in HStatusList" :key="index" :label="item.name" :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="组织">
              <el-select v-model="queryParams.HStockOrgID" placeholder="请选择">
                <el-option v-for="(item, index) in organizationList" :key="index" :label="item.Name" :value="item.ID">
                </el-option>
              </el-select>
            </el-form-item>
            <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="HMaterNumber">
              <el-input v-model="queryParams.HMaterNumber" 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>
            <el-form-item label="仓库" prop="HWhName">
              <el-input v-model="queryParams.HWhName" 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>
@@ -61,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>
@@ -71,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>
@@ -84,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>
@@ -93,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>
@@ -105,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>
@@ -246,7 +252,8 @@
        { label: '近半年', value: 180 },
        { label: '近一年', value: 365 },
      ],
      hPriceTypeList: ['成本价', '结算价'],
      organizationList: JSON.parse(sessionStorage.getItem('organizationList')),//组织列表
      HStatusList: [{name:'全部',value:'-1'},{name:'未审核',value:'0'},{name:'已审核',value:'1'},{name:'已关闭',value:'2'}],
      addBtnShow: false,
      dialogTitle: '',
      OperationType: null,//保存类型(新增1修改3)
@@ -264,11 +271,10 @@
      queryParams: {
        HBillNo: '',
        HInitTimeCycle: 29,
        HStockOrgName: '',
        HStockOrgID: sessionStorage["OrganizationID"] - 0,
        HStatus:'-1',
        HDept:'',
        HMaterNumber: '',
        HModelNumber:'',
        HWhName:'',
        HSupName:'',
        ColName1: '',
        ColName2: '',
@@ -367,20 +373,23 @@
      this.tableShow = false
      this.loading = true
      if (this.sTime && !this.sWhere) {
        this.sWhere += " and CONVERT(varchar(100),日期, 23) >= '" + this.sTime + "'"
        this.sWhere += " and CONVERT(varchar(100),日期, 23) <= '" + this.eTime + "'"
        this.sTime = moment(this.sTime).format('YYYY-MM-DD')
        this.eTime = moment(this.eTime).format('YYYY-MM-DD')
        this.sWhere += " and 日期 >= '" + this.sTime + "'";
        this.sWhere += " and 日期 <= '" + this.eTime + "'";
      }
      this.sWhere += " and HSTOCKORGID=" + this.queryParams.HStockOrgID
      if (this.pageSize == 0) {
        this.pageSize = 50
      }
      // 销售出库单列表
      axios.get(this.baseURL + '/Sc_MouldProdOutBill/list_byPage', {
      // 分页查询
      axios.get(this.baseURL + '/Sc_MouldProdOutBillController/page', {
        params: {
          "sWhere": this.sWhere,
          "user": sessionStorage["HUserName"],
          "Organization": sessionStorage["Organization"],
          "page": this.page,
          "size": this.pageSize
          "size": this.pageSize,
          "Type":'3802',
        },
      }).then(response => {
        this.tyResList = response.data.data//总数据
@@ -577,7 +586,7 @@
    //双击行
    handleDblclick(row, column, cell, event) {
      this.OperationType = 3
      this.handleEdit()
      this.handleEdit(row)
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
@@ -655,34 +664,43 @@
        }
        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.eTime = moment(this.eTime).format('YYYY-MM-DD')
        console.log(this.sTime, this.eTime)
        this.sWhere += " and CONVERT(varchar(100),日期, 23) >= '" + this.sTime + "'" + " and CONVERT(varchar(100),日期, 23) <= '" + this.eTime + "'";
        this.sWhere += " and 日期 >= '" + this.sTime + "'";
      }
      if (this.eTime) {
        this.eTime = moment(this.eTime).format('YYYY-MM-DD')
        this.sWhere += " and 日期 <= '" + this.eTime + "'";
      }
      if (this.queryParams.HBillNo) {
        this.sWhere += " and 单据号 like '%" + this.queryParams.HBillNo + "%'";
      }
      if (this.queryParams.HStockOrgName) {
        this.sWhere += " and 组织名称 like '%" + this.queryParams.HStockOrgName + "%'";
      }
      if (this.queryParams.HDept) {
          this.sWhere += " and 部门 like '%" + this.queryParams.HDept + "%'";
      }
      if (this.queryParams.HMaterNumber) {
          this.sWhere += " and 物料代码 like '%" + this.queryParams.HMaterNumber + "%'";
      }
      if (this.queryParams.HModelNumber) {
          this.sWhere += " and 模具代码 like '%" + this.queryParams.HModelNumber + "%'";
      }
      if (this.queryParams.HWhName) {
          this.sWhere += " and 仓库 like '%" + this.queryParams.HWhName + "%'";
          this.sWhere += " and 器具代码 like '%" + this.queryParams.HModelNumber + "%'";
      }
      if (this.queryParams.HSupName) {
          this.sWhere += " and 往来单位 like '%" + this.queryParams.HSupName + "%'";
      }
      this.clearData()
      this.getList()
    },
    /** 重置按钮操作 */
@@ -691,11 +709,10 @@
      this.queryParams = {
        HBillNo: '',
        HInitTimeCycle: 29,
        HStockOrgName: '',
        HStockOrgID: sessionStorage["OrganizationID"] - 0,
        HStatus:'-1',
        HDept:'',
        HMaterNumber: '',
        HModelNumber:'',
        HWhName:'',
        HSupName:'',
        ColName1: '',
        ColName2: '',
@@ -709,6 +726,7 @@
      }
      this.riqiChange()
      this.resetForm("queryForm")
      this.clearData()
      this.getList()
    },
@@ -718,6 +736,7 @@
      this.tableShow = true
      this.openEdit = false
      this.editShow = false
      this.clearData()
      this.getList()
    },
    //打开新增组件弹窗
@@ -737,7 +756,16 @@
      this.open = val
      this.editShow = false
      this.openEdit = val
      this.clearData()
      this.getList()
    },
    //清除选中数据的缓存
    clearData(){
      this.ids = []
      this.multiple = true
      this.single = true
      this.OperationType = 0
      this.copyType = 0
    },
    /** 删除按钮操作 */
    handleDelete() {
@@ -766,6 +794,7 @@
        let result = response.data
        if (result.count == 1) {
          this.$modal.msgSuccess('操作成功');
          this.clearData()
          this.getList();
        }
        else {
src/views/system/user/GyDriver.vue
New file
@@ -0,0 +1,1676 @@
<template>
  <div style="padding: 10px">
    <el-card class="search-card" style="margin-bottom: 15px">
            <el-button
              type="text"
              @click="toggleAdvancedSearch"
              style="font-size: 12px; color: #409eff"
            >
              {{ showAdvancedSearch ? "收起" : "更多" }}
              <i
                :class="
                  showAdvancedSearch
                    ? 'el-icon-arrow-up'
                    : 'el-icon-arrow-down'
                "
              ></i>
            </el-button>
      <div style="margin-top: 15px">
        <el-row :gutter="15">
          <el-col :span="6">
            <div style="display: flex; align-items: center">
              <span style="width: 200px; text-align: right; margin-right: 10px"
                >驾驶员代码:</span
              >
              <el-input
                v-model="queryParams.HNumber"
                placeholder="请输入驾驶员代码"
                size="small"
                @keyup.enter.native="handleQuery"
                clearable
              />
            </div>
          </el-col>
          <el-col :span="6">
            <div style="display: flex; align-items: center">
              <span style="width: 200px; text-align: right; margin-right: 10px"
                >驾驶员名称:</span
              >
              <el-input
                v-model="queryParams.HName"
                placeholder="请输入驾驶员名称"
                size="small"
                @keyup.enter.native="handleQuery"
                clearable
              />
            </div>
          </el-col>
          <el-col :span="6">
            <div style="display: flex; align-items: center">
              <span style="width: 100px; text-align: right; margin-right: 10px"
                >组织:</span
              >
              <el-select
                v-model="queryParams.HUSEORGID"
                placeholder="请选择组织"
                size="small"
                style="width: 100%"
              >
                <el-option
                  v-for="(item, index) in organizationList"
                  :key="index"
                  :label="item.Name"
                  :value="item.ID"
                >
                </el-option>
              </el-select>
            </div>
          </el-col>
          <el-col :span="6">
            <div style="display: flex; align-items: center">
              <span style="width: 80px; text-align: right; margin-right: 10px"
                >重新同步:</span
              >
              <el-input
                v-model="queryParams.HSyncNumber"
                placeholder="请输入驾驶员代码"
                size="small"
                @keyup.enter.native="handleSync"
                clearable
                style="flex: 1"
              />
              <el-button
                @click="handleSync"
                size="small"
                style="margin-left: 5px"
                >同步</el-button
              >
            </div>
          </el-col>
        </el-row>
      <div class="search-header">
        <div style="display: flex; justify-content: space-between; align-items: center">
          <div>
            <el-button
              type="primary"
              icon="el-icon-search"
              size="mini"
              @click="handleQuery"
              style="margin-right: 10px"
              >搜索</el-button
            >
            <el-button
              icon="el-icon-refresh"
              size="mini"
              @click="resetQuery"
              style="margin-right: 10px"
              >重置</el-button
            >
            <el-button
              icon="el-icon-refresh"
              size="mini"
              @click="getList"
              style="margin-right: 10px"
              >刷新</el-button
            >
          </div>
        </div>
      </div>
        <el-collapse-transition>
          <div v-show="showAdvancedSearch">
            <div style="margin-top: 15px">
              <el-row :gutter="15">
                <div style="margin-bottom: 50px">
                <!-- 第一组过滤条件 -->
                <el-col :span="24">
                  <div style="display: flex; align-items: center">
                    <el-select
                      v-model="queryParams.ColName"
                      placeholder="请选择"
                      size="small"
                      style="flex: 1"
                    >
                      <el-option label="" value="0"></el-option>
                      <el-option
                        v-for="(item, index) in filterColumnList"
                        :key="index"
                        :label="item.field"
                        :value="item.field"
                        v-if="!item.hide"
                      ></el-option>
                    </el-select>
                    <el-select
                      v-model="queryParams.Comparator"
                      placeholder="请选择"
                      size="small"
                      style="width: 100px; margin: 0 10px"
                    >
                      <el-option label="" value="0"></el-option>
                      <el-option
                        v-for="(item, index) in comparatorList"
                        :key="index"
                        :label="item.label"
                        :value="item.value"
                      ></el-option>
                    </el-select>
                    <el-input
                      v-model="queryParams.ColContent"
                      placeholder="请输入"
                      size="small"
                      @keyup.enter.native="handleQuery"
                      clearable
                      style="flex: 1"
                    />
                  </div>
                </el-col>
                </div>
                <div style="margin-bottom: 100px">
                <!-- 第二组过滤条件 -->
                <el-col :span="24">
                  <div style="display: flex; align-items: center">
                    <el-select
                      v-model="queryParams.ColName1"
                      placeholder="请选择"
                      size="small"
                      style="flex: 1"
                    >
                      <!-- <el-option label="" value="0"></el-option> -->
                      <el-option
                        v-for="(item, index) in filterColumnList"
                        :key="index"
                        :label="item.field"
                        :value="item.field"
                        v-if="!item.hide"
                      ></el-option>
                    </el-select>
                    <el-select
                      v-model="queryParams.Comparator1"
                      placeholder="请选择"
                      size="small"
                      style="width: 100px; margin: 0 10px"
                    >
                      <!-- <el-option label="" value="0"></el-option> -->
                      <el-option
                        v-for="(item, index) in comparatorList"
                        :key="index"
                        :label="item.label"
                        :value="item.value"
                      ></el-option>
                    </el-select>
                    <el-input
                      v-model="queryParams.ColContent1"
                      placeholder="请输入"
                      size="small"
                      @keyup.enter.native="handleQuery"
                      clearable
                      style="flex: 1"
                    />
                  </div>
                </el-col>
                </div>
                <div style="margin-bottom: 50px">
                <!-- 第三组过滤条件 -->
                <el-col :span="24">
                  <div style="display: flex; align-items: center">
                    <el-select
                      v-model="queryParams.ColName2"
                      placeholder="请选择"
                      size="small"
                      style="flex: 1"
                    >
                      <!-- <el-option label="" value="0"></el-option> -->
                      <el-option
                        v-for="(item, index) in filterColumnList"
                        :key="index"
                        :label="item.field"
                        :value="item.field"
                        v-if="!item.hide"
                      ></el-option>
                    </el-select>
                    <el-select
                      v-model="queryParams.Comparator2"
                      placeholder="请选择"
                      size="big"
                      style="width: 100px; margin: 0 10px"
                    >
                      <el-option label="" value="0"></el-option>
                      <el-option
                        v-for="(item, index) in comparatorList"
                        :key="index"
                        :label="item.label"
                        :value="item.value"
                      ></el-option>
                    </el-select>
                    <el-input
                      v-model="queryParams.ColContent2"
                      placeholder="请输入"
                      size="big"
                      @keyup.enter.native="handleQuery"
                      clearable
                      style="flex: 1"
                    />
                  </div>
                </el-col>
                </div>
              </el-row>
            </div>
            <div
              v-if="currentFilterScheme"
              style="
                margin-top: 15px;
                padding: 10px;
                background-color: #f0f9ff;
                border-radius: 4px;
                border-left: 4px solid #409eff;
              "
            >
              <span style="font-size: 14px; font-weight: bold; color: #fc9393">
                当前过滤方案:{{ currentFilterScheme }}
              </span>
              <span
                v-if="currentFilterRemark"
                style="font-size: 13px; color: #7b90fb; margin-left: 10px"
              >
                ({{ currentFilterRemark }})
              </span>
              <el-button
                type="text"
                @click="handleSaveScheme"
                size="mini"
                style="margin-left: 20px"
                >保存方案</el-button
              >
              <el-button
                type="text"
                @click="handleReadScheme"
                size="mini"
                >读取方案</el-button
              >
              <el-button
                type="text"
                @click="clearFilterScheme"
                size="mini"
                style="color: #f56c6c"
                >清除方案</el-button
              >
            </div>
          </div>
        </el-collapse-transition>
      </div>
    </el-card>
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-upload2"
          size="mini"
          @click="handleImport"
          id="set_SouceExcel"
          >导入</el-button
        >
      </el-col>
      <!-- <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          id="get_export"
          >导出</el-button
        >
      </el-col> -->
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAddEdit((OperationType = 1))"
          id="set_add"
          >新增</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-document-copy"
          size="mini"
          :disabled="single"
          @click="handleCopy"
          id="set_Copy"
          >复制</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleEdit((row = rowForm), (OperationType = 3))"
          id="set_show"
          >编辑</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="single"
          @click="handleDelete"
          id="set_delete"
          >删除</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-check"
          size="mini"
          :disabled="single"
          @click="handleAudit(0)"
          id="btn_audit"
          >审核</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-close"
          size="mini"
          :disabled="single"
          @click="handleAudit(1)"
          id="btn_deaudit"
          >反审核</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-turn-off"
          size="mini"
          :disabled="single"
          @click="handleStop(0)"
          id="btn_stop"
          >禁用</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-open"
          size="mini"
          :disabled="single"
          @click="handleStop(1)"
          id="btn_destop"
          >反禁用</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-setting"
          size="mini"
          @click="handleRowHide"
          id="set_hidecolumn"
          >列设置</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-s-operation"
          size="mini"
          @click="handleBtnHide"
          id="HideButton"
          >按钮设置</el-button
        >
      </el-col>
    </el-row>
    <div class="tableBox" v-loading="loading">
      <el-table
        :data="tableData"
        ref="tableData"
        max-height="650"
        @selection-change="handleSelectionChange"
        border
        @row-click="handleRowClick"
        :row-style="rowStyle"
        @cell-dblclick="handleDblclick"
        v-if="tableShow"
        stripe
      >
        <el-table-column
          type="selection"
          width="55"
          align="center"
          fixed="left"
        />
        <template v-for="(item, index) in btList">
          <el-table-column
            :align="item.align"
            :prop="item.field"
            :label="item.title"
            :width="item.width"
            :key="item.field"
            v-if="!item.hide && item.field !== 'checkbox'"
            :sortable="item.sort"
            show-overflow-tooltip
            :fixed="item.fixed"
          >
            <template slot-scope="{ row, column }">
              <div :style="item.style">
                <!-- 日期格式化 -->
                <span
                  v-if="
                    column.property.includes('日期') ||
                    column.property.includes('Date')
                  "
                >
                  {{ parseTime(row[column.property], "{y}-{m}-{d}") }}
                </span>
                <el-button
                  type="text"
                  @click="handleDriverCodeClick(row)"
                  v-else-if="column.property === '驾驶员代码'"
                  style="color: #409eff"
                  >{{ row[column.property] }}</el-button
                >
                <span
                  v-else-if="column.property === '禁用标记'"
                  :style="{
                    color: row[column.property] === 'Y' ? '#f56c6c' : '#67c23a',
                    fontWeight:
                      row[column.property] === 'Y' ? 'bold' : 'normal',
                  }"
                >
                  {{ row[column.property] === "Y" ? "已禁用" : "正常" }}
                </span>
                <!-- 审核状态特殊样式 -->
                <span
                  v-else-if="column.property === '审核人'"
                  :style="{
                    color: row[column.property] ? '#67c23a' : '#909399',
                  }"
                >
                  {{ row[column.property] || "未审核" }}
                </span>
                <span v-else>{{ row[column.property] }}</span>
              </div>
            </template>
          </el-table-column>
        </template>
      </el-table>
      <pagination
        v-show="total > 0"
        :total="total"
        :page.sync="page"
        :limit.sync="pageSize"
        :pageSizes="pageSizes"
        @pagination="getList"
      />
      <!-- 隐藏列设置弹窗 -->
      <el-dialog
        title="隐藏列设置"
        :visible.sync="openRowHide"
        width="816px"
        append-to-body
      >
        <RowSettings
          :colName="btResList"
          :HModName="HModName"
          @rowEditClose="rowSetClose"
          v-if="rowHideShow"
        />
      </el-dialog>
      <!-- 编辑弹窗 -->
      <el-dialog
        :title="editDialogTitle"
        :visible.sync="openEdit"
        width="1480px"
        append-to-body
        class="driver-edit-dialog"
        :before-close="closeEditDialog"
        :close-on-click-modal="false"
      >
        <GyDriverEdit
          :OperationType="OperationType"
          :linterid="rowForm.HItemID"
          :HSouceBillType="''"
          @editCloseGy="editGyClose"
          v-if="editShow"
          ref="editComponent"
        />
        <span slot="footer" class="dialog-footer" v-if="OperationType !== 4">
          <!-- <el-button @click="closeEditDialog">取 消</el-button>
          <el-button type="primary" @click="saveDriverData">保 存</el-button> -->
        </span>
      </el-dialog>
      <!-- 导入弹窗 -->
      <el-dialog
        :title="upload.title"
        :visible.sync="upload.open"
        width="1500px"
        append-to-body
      >
        <div style="margin-top: -20px">
          <el-button type="primary" @click="set_AddNew">导入数据</el-button>
          <el-button type="primary" @click="upload.open = false">退 出</el-button>
          <el-upload
            ref="upload"
            :limit="1"
            accept=".xlsx, .xls"
            style="display: inline-block; margin-left: 10px"
            :action="upload.url + '?updateSupport=' + upload.updateSupport"
            :disabled="upload.isUploading"
            :on-progress="handleFileUploadProgress"
            :on-success="handleFileSuccess"
          >
            <el-button type="primary">文件上传</el-button>
          </el-upload>
        </div>
        <el-table
          :data="uploadData"
          v-loading="uploadTableLoading"
          :row-class-name="uploadDataIndex"
          border
          height="550"
        >
          <el-table-column
            type="index"
            label="序号"
            width="55"
            align="center"
          />
          <el-table-column
            label="驾驶员代码"
            prop="驾驶员代码"
            align="center"
            width="120"
          />
          <el-table-column
            label="驾驶员名称"
            prop="驾驶员名称"
            align="center"
            width="120"
          />
          <el-table-column
            label="联系电话"
            prop="联系电话"
            align="center"
            width="120"
          />
          <el-table-column
            label="驾驶证号"
            prop="驾驶证号"
            align="center"
            width="120"
          />
          <el-table-column label="操作" align="center">
            <template slot-scope="scope">
              <el-button
                size="mini"
                type="text"
                icon="el-icon-delete"
                @click="uploadDataDelete(scope.row)"
                >删除</el-button
              >
            </template>
          </el-table-column>
        </el-table>
        <pagination
          v-show="uploadTotal > 0"
          :total="uploadTotal"
          :page.sync="uploadPage"
          :limit.sync="uploadPageSize"
          :pageSizes="uploadPageSizes"
          @pagination="currentPage"
        />
      </el-dialog>
      <!-- 过滤方案弹窗 -->
      <el-dialog
        title="过滤方案列表"
        :visible.sync="openFilterScheme"
        width="80%"
        append-to-body
      >
        <div style="height: 500px; overflow: auto">
          <el-table
            :data="filterSchemeList"
            border
            style="width: 100%"
            @row-click="selectFilterScheme"
          >
            <el-table-column
              prop="方案名称"
              label="方案名称"
              width="200"
            ></el-table-column>
            <el-table-column
              prop="备注"
              label="备注"
              width="300"
            ></el-table-column>
            <el-table-column prop="创建人" label="创建人" width="120"></el-table-column>
            <el-table-column
              prop="创建日期"
              label="创建日期"
              width="150"
            ></el-table-column>
            <el-table-column label="操作" width="150" align="center">
              <template slot-scope="scope">
                <el-button
                  type="text"
                  size="mini"
                  @click="applyFilterScheme(scope.row)"
                  >应用</el-button
                >
                <el-button
                  type="text"
                  size="mini"
                  @click="deleteFilterScheme(scope.row)"
                  style="color: #f56c6c"
                  >删除</el-button
                >
              </template>
            </el-table-column>
          </el-table>
        </div>
        <span slot="footer" class="dialog-footer">
          <el-button type="primary" @click="confirmFilterScheme">确 定</el-button>
          <el-button @click="openFilterScheme = false">取 消</el-button>
        </span>
      </el-dialog>
    </div>
  </div>
</template>
<script>
import axios from "axios";
import RowSettings from "@/views/component/rowSettings";
import GyDriverEdit from "@/views/system/user/GyDriverEdit.vue";
export default {
  name: "GyDriverListNew",
  components: { RowSettings, GyDriverEdit },
  props: {
    openPage: { type: String },
  },
  data() {
    return {
      HModName: "gy_driver",
      HModuleName: "驾驶员设置",
      showAdvancedSearch: false,
      currentFilterScheme: "",
      currentFilterRemark: "",
      filterSchemeList: [],
      openFilterScheme: false,
      comparatorList: [
        { label: "=", value: "=" },
        { label: ">=", value: ">=" },
        { label: ">", value: ">" },
        { label: "<=", value: "<=" },
        { label: "<", value: "<" },
        { label: "<>", value: "<>" },
        { label: "包含", value: "7" },
        { label: "左包含", value: "8" },
        { label: "右包含", value: "9" },
        { label: "不包含", value: "10" },
      ],
      sWhere: "",
      organizationList: [],
      filterColumnList: [],
      user: "admin",
      Organization: "",
      currentRow: [],
      rowForm: {},
      editShow: false,
      openEdit: false,
      editDialogTitle: "驾驶员编辑",
      tableShow: true,
      openBtnHide: false,
      btnHideShow: false,
      rowHideShow: false,
      openRowHide: false,
      queryParams: {
        HUSEORGID: null,
        HName: null,
        HNumber: null,
        HSyncNumber: null,
        Comparator: "",
        Comparator1: "",
        Comparator2: "",
        ColContent: "",
        ColContent1: "",
        ColContent2: "",
        ColName: "",
        ColName1: "",
        ColName2: "",
      },
      showSearch: true,
      ids: [],
      single: true,
      multiple: true,
      loading: true,
      tyResList: [],
      btList: [],
      btResList: [],
      tableData: [],
      dataList: [],
      titleData: ["HItemID", "HUSEORGID", "HEmpID", "负责人"],
      pageSizes: [50, 100, 500, 5000, 50000],
      page: 1,
      pageSize: 50,
      total: 0,
      upload: {
        open: false,
        title: "导入驾驶员",
        isUploading: false,
        updateSupport: 0,
        url: process.env.VUE_APP_BASE_API + "/Gy_Driver/Gy_Driver_Excel",
      },
      uploadData: [],
      alluploadList: [],
      uploadTableLoading: false,
      uploadPageSizes: [50, 100, 500, 5000, 50000],
      uploadPage: 1,
      uploadPageSize: 50,
      uploadTotal: 0,
      OperationType: null,
      copyType: 0,
      baseURL: process.env.VUE_APP_BASE_API,
    };
  },
  created() {
    this.initData();
  },
  methods: {
    async initData() {
      try {
        const userRes = await axios.get(
          `${this.baseURL}/Web/GetUser?UserName=${
            sessionStorage.getItem("UserName") || "001"
          }&PassWord=123456&HOrgName=100038`
        );
        if (userRes.data.data && userRes.data.data[0]) {
          const userData = userRes.data.data[0];
          this.user = userData.Czymc || "admin";
          this.Organization = userData.HUSEORGID;
          this.queryParams.HUSEORGID = userData.HUSEORGID;
        }
        const orgRes = await axios.get(`${this.baseURL}/Web/GetOrganizations`);
        if (orgRes.data.count == 1) {
          this.organizationList = orgRes.data.data;
        }
        await this.getList();
      } catch (error) {
        this.$modal.msgError("初始化数据失败!");
      }
    },
    toggleAdvancedSearch() {
      this.showAdvancedSearch = !this.showAdvancedSearch;
    },
    async getList() {
      this.tableShow = false;
      this.loading = true;
      console.log("获取列表数据...",this.sWhere );
      try {
        const params = {
          sWhere: this.sWhere || "",
          user: this.user,
          Organization: this.Organization,
          page: this.page,
          size: this.pageSize,
        };
        const res = await axios.get(`${this.baseURL}/Gy_DriverController/list`, {
          params,
        });
        if (res.data.count == 1) {
          this.tyResList = res.data.data;
          this.btResList = res.data.list;
          this.total = res.data.count;
          this.processTableHeader(res.data.list, res.data.data);
        } else {
          this.$modal.msgError(res.data.Message || "获取数据失败");
        }
      } catch (error) {
        this.$modal.msgError("接口请求失败!");
      } finally {
        this.loading = false;
      }
    },
    processTableHeader(headerList, data) {
      const col = [];
      col.push({ type: "checkbox", fixed: "left", field: "checkbox" });
      headerList.forEach((item) => {
        if (this.titleData.includes(item.ColmCols)) {
          col.push({
            field: item.ColmCols,
            title: item.ColmCols,
            align: "center",
            hide: true,
          });
        } else {
          const column = {
            field: item.ColmCols,
            title: item.ColmCols,
            align: "center",
            sort: true,
            width: 200,
          };
          if (item.ColmType === "DateTime") {
            column.templet = true; // 标记为日期类型
          }
          col.push(column);
        }
      });
      this.btList = col;
      this.tableData = data;
      this.tableShow = true;
      this.updateFilterColumns();
      this.DisPlay_HideColumn();
    },
    updateFilterColumns() {
      this.filterColumnList = this.btList.filter(
        (item) => !item.hide && item.field !== "checkbox"
      );
    },
    async DisPlay_HideColumn() {
      try {
        const res = await axios.get(
          `${this.baseURL}/Xt_grdAlignment_WMES/grdAlignmentWMESList`,
          {
            params: {
              HModName: this.HModName,
              user: this.user,
            },
          }
        );
        if (res.data.data.length > 0) {
          const config = res.data.data[0];
          const dataCol = config.HGridString.split(",");
          dataCol.forEach((colStr, index) => {
            if (this.btList[index + 1]) {
              const colParts = colStr.split("|");
              // 隐藏列
              if (colParts[1] == "1") {
                this.btList[index + 1].hide = true;
              }
              // 列宽
              if (colParts[3] > 0) {
                this.btList[index + 1].width = colParts[3];
              }
              // 字体大小
              if (config.HFontSize != 0) {
                this.btList[index + 1].style = `font-size:${config.HFontSize}px;`;
              }
              // 显示列
              if (
                colParts[1] == "0" &&
                !this.titleData.includes(this.btList[index + 1].title)
              ) {
                this.btList[index + 1].hide = false;
              }
              // 对齐方式
              switch (colParts[2]) {
                case "L":
                  this.btList[index + 1].align = "left";
                  break;
                case "M":
                  this.btList[index + 1].align = "center";
                  break;
                case "R":
                  this.btList[index + 1].align = "right";
                  break;
              }
              // 列别名
              if (colParts[4]) {
                this.btList[index + 1].title = colParts[4];
              }
            }
          });
          // 冻结列
          if (config.HFixCols > 0) {
            for (
              let i = 1;
              i <= config.HFixCols && i < this.btList.length;
              i++
            ) {
              this.btList[i].fixed = "left";
            }
          }
          this.tableShow = false;
          this.$nextTick(() => {
            this.tableShow = true;
          });
        }
      } catch (error) {
        console.error("加载列配置失败:", error);
      }
    },
    handleQuery() {
      this.sWhere = "";
      const conditions = [];
      if (this.queryParams.HNumber) {
        conditions.push(`驾驶员代码 like '%${this.queryParams.HNumber}%'`);
      }
      if (this.queryParams.HName) {
        conditions.push(`驾驶员名称 like '%${this.queryParams.HName}%'`);
      }
      // if (this.queryParams.HUSEORGID) {
      //   conditions.push(`HUSEORGID = '${this.queryParams.HUSEORGID}'`);
      // }
      if (this.queryParams.ColName !== "0" && this.queryParams.Comparator !== "0") {
        const condition = this.buildCondition(
          this.queryParams.ColName,
          this.queryParams.Comparator,
          this.queryParams.ColContent
        );
        if (condition) conditions.push(condition);
      }
      if (
        this.queryParams.ColName1 !== "0" &&
        this.queryParams.Comparator1 !== "0"
      ) {
        const condition = this.buildCondition(
          this.queryParams.ColName1,
          this.queryParams.Comparator1,
          this.queryParams.ColContent1
        );
        if (condition) conditions.push(condition);
      }
      if (
        this.queryParams.ColName2 !== "0" &&
        this.queryParams.Comparator2 !== "0"
      ) {
        const condition = this.buildCondition(
          this.queryParams.ColName2,
          this.queryParams.Comparator2,
          this.queryParams.ColContent2
        );
        if (condition) conditions.push(condition);
      }
      if (conditions.length > 0) {
        this.sWhere ="and "+conditions;
      }
      console.log("查询条件:", this.sWhere);
      //this.sWhere += this.addSWhereByOpenType();
      this.page = 1;
      this.getList();
    },
    buildCondition(colName, comparator, content) {
      if (!content) return null;
      switch (comparator) {
        case "7":
          return `${colName} like '%${content}%'`;
        case "8":
          return `${colName} like '%${content}'`;
        case "9":
          return `${colName} like '${content}%'`;
        case "10":
          return `${colName} not like '%${content}%'`;
        default:
          return `${colName} ${comparator} '${content}'`;
      }
    },
    //
    addSWhereByOpenType() {
      // if (this.openPage) {
      //   return " and 禁用标记 = '' and ISNULL(审核人,'') <> ''";
      // }
      // // 直接打开的情况
      // return " and 禁用标记 = ' '";
    },
    resetQuery() {
      this.queryParams = {
        HUSEORGID: this.Organization,
        HName: "",
        HNumber: "",
        HSyncNumber: "",
        Comparator: "0",
        Comparator1: "0",
        Comparator2: "0",
        ColContent: "",
        ColContent1: "",
        ColContent2: "",
        ColName: "0",
        ColName1: "0",
        ColName2: "0",
      };
      this.sWhere = "";
      this.page = 1;
      this.getList();
    },
    async handleSync() {
      if (!this.queryParams.HSyncNumber) {
        this.$modal.msgWarning("请输入要同步的驾驶员代码");
        return;
      }
      try {
        const res = await axios.get(`${this.baseURL}/Gy_Driver/Gy_DriverViewApi`, {
          params: {
            Number: this.queryParams.HSyncNumber,
            Type: "JSY", // 驾驶员类型
            HUseOrgID: this.queryParams.HUSEORGID,
          },
        });
        if (res.data.count == 1) {
          this.$modal.msgSuccess("同步成功");
          this.getList();
        } else {
          this.$modal.msgError(res.data.Message || "同步失败");
        }
      } catch (error) {
        this.$modal.msgError("同步失败");
      }
    },
    // 点击行
    handleRowClick(row) {
      this.$refs.tableData.toggleRowSelection(row);
    },
    // 行样式
    rowStyle({ row }) {
      if (this.ids.includes(row.HItemID)) {
        return { background: "#ecf5ff" };
      }
      return {};
    },
    // 双击行
    handleDblclick(row) {
      this.rowForm = row;
      this.OperationType = 3;
      this.editDialogTitle = "编辑驾驶员";
      this.openEdit = true;
      this.editShow = true;
    },
    handleDriverCodeClick(row) {
      this.rowForm = row;
      this.OperationType = 3;
      this.editDialogTitle = "编辑驾驶员";
      this.openEdit = true;
      this.editShow = true;
    },
    handleSelectionChange(selection) {
      this.ids = selection.map((item) => item.HItemID);
      this.single = selection.length !== 1;
      this.multiple = !selection.length;
      if (!this.single) {
        this.rowForm = selection[0];
      }
    },
    // 新增
    handleAddEdit() {
      this.rowForm = { HItemID: 0 };
      this.OperationType = 1;
      this.editDialogTitle = "新增驾驶员";
      this.openEdit = true;
      this.editShow = true;
    },
    // 复制
    handleCopy() {
      if (this.single) {
        this.$modal.msgWarning("请选择一条数据进行复制");
        return;
      }
      this.OperationType = 2;
      this.editDialogTitle = "复制驾驶员";
      this.openEdit = true;
      this.editShow = true;
    },
    // 编辑
    handleEdit() {
      if (this.single) {
        this.$modal.msgWarning("请选择一条数据进行编辑");
        return;
      }
      this.OperationType = 3;
      this.editDialogTitle = "编辑驾驶员";
      this.openEdit = true;
      this.editShow = true;
    },
    // 关闭编辑弹窗
    closeEditDialog() {
      this.openEdit = false;
      this.editShow = false;
      setTimeout(() => {
        this.getList();
      }, 100);
    },
    // 保存
    async saveDriverData() {
      if (this.$refs.editComponent) {
        await this.$refs.editComponent.handleSave();
        this.closeEditDialog();
      }
    },
    // 关闭编辑页面
    editGyClose(val) {
      this.editShow = false;
      this.openEdit = false;
      this.getList();
    },
    // 删除
    async handleDelete() {
      if (this.single) {
        this.$modal.msgWarning("请选择一条数据进行删除");
        return;
      }
      if (this.rowForm.审核人) {
        this.$modal.msgError("已审核的数据不能删除");
        return;
      }
      try {
        await this.$modal.confirm("确认要删除吗,删除后不能恢复");
        const res = await axios.get(`${this.baseURL}/DeltetGy_Driver`, {
          params: {
            HItemID: this.rowForm.HItemID.toString(),
            user: this.user,
          },
        });
        if (res.data.count == 1) {
          this.$modal.msgSuccess("删除成功");
          this.getList();
        } else {
          this.$modal.msgError(res.data.Message || "删除失败");
        }
      } catch (error) {
        if (error !== "cancel") {
          this.$modal.msgError("删除失败");
        }
      }
    },
    // 审核/反审核
    async handleAudit(isAudit) {
      if (this.single) {
        this.$modal.msgWarning("请选择一条数据");
        return;
      }
      try {
        const action = isAudit ? "反审核" : "审核";
        await this.$modal.confirm(`确认要${action}吗?`);
        const res = await axios.get(`${this.baseURL}/Gy_Driver/AuditGy_Driver`, {
          params: {
            HInterID: this.rowForm.HItemID.toString(),
            IsAudit: isAudit,
            CurUserName: this.user,
          },
        });
        if (res.data.count == 1) {
          this.$modal.msgSuccess(`${action}成功`);
          this.getList();
        } else {
          this.$modal.msgError(res.data.Message || `${action}失败`);
        }
      } catch (error) {
        if (error !== "cancel") {
          this.$modal.msgError("操作失败");
        }
      }
    },
    // 禁用/反禁用
    async handleStop(isStop) {
      if (this.single) {
        this.$modal.msgWarning("请选择一条数据");
        return;
      }
      try {
        const action = isStop ? "反禁用" : "禁用";
        await this.$modal.confirm(`确认要${action}吗?`);
        const res = await axios.get(`${this.baseURL}/Gy_Driver/StopGy_Driver`, {
          params: {
            HInterID: this.rowForm.HItemID.toString(),
            IsStop: isStop,
            CurUserName: this.user,
          },
        });
        if (res.data.count == 1) {
          this.$modal.msgSuccess(`${action}成功`);
          this.getList();
        } else {
          this.$modal.msgError(res.data.Message || `${action}失败`);
        }
      } catch (error) {
        if (error !== "cancel") {
          this.$modal.msgError("操作失败");
        }
      }
    },
    // // 导出
    // handleExport() {
    //   import("@/vendor/Export2Excel").then((excel) => {
    //     const tHeader = this.btList
    //       .filter((item) => !item.hide && item.field !== "checkbox")
    //       .map((item) => item.title);
    //     const filterVal = this.btList
    //       .filter((item) => !item.hide && item.field !== "checkbox")
    //       .map((item) => item.field);
    //     const data = this.formatJson(filterVal, this.tyResList);
    //     excel.export_json_to_excel({
    //       header: tHeader,
    //       data,
    //       filename: `驾驶员设置_${new Date().getTime()}`,
    //       autoWidth: true,
    //       bookType: "xlsx",
    //     });
    //   });
    // },
    formatJson(filterVal, jsonData) {
      return jsonData.map((v) =>
        filterVal.map((j) => {
          if (j.includes("日期") || j.includes("Date")) {
            return this.parseTime(v[j], "{y}-{m}-{d}");
          }
          return v[j];
        })
      );
    },
    parseTime(time, cFormat) {
      if (arguments.length === 0) {
        return null;
      }
      const format = cFormat || "{y}-{m}-{d} {h}:{i}:{s}";
      let date;
      if (typeof time === "object") {
        date = time;
      } else {
        if (typeof time === "string" && /^[0-9]+$/.test(time)) {
          time = parseInt(time);
        }
        if (typeof time === "number" && time.toString().length === 10) {
          time = time * 1000;
        }
        date = new Date(time);
      }
      const formatObj = {
        y: date.getFullYear(),
        m: date.getMonth() + 1,
        d: date.getDate(),
        h: date.getHours(),
        i: date.getMinutes(),
        s: date.getSeconds(),
        a: date.getDay(),
      };
      const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => {
        const value = formatObj[key];
        if (key === "a") {
          return ["日", "一", "二", "三", "四", "五", "六"][value];
        }
        return value.toString().padStart(2, "0");
      });
      return time_str;
    },
    // 导入
    handleImport() {
      this.uploadData = [];
      this.upload.title = "导入驾驶员";
      this.upload.open = true;
    },
    // 文件上传中
    handleFileUploadProgress(event, file, fileList) {
      this.upload.isUploading = true;
      this.uploadTableLoading = true;
    },
    // 文件上传成功
    handleFileSuccess(response, file, fileList) {
      this.upload.isUploading = false;
      this.$refs.upload.clearFiles();
      if (response.code == 1) {
        this.alluploadList = response.data;
        this.uploadData = this.getPage(this.uploadPage, this.alluploadList);
        this.uploadTotal = this.alluploadList.length;
        this.uploadTableLoading = false;
      } else {
        this.$alert(
          `<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>${response.Message}</div>`,
          "导入结果",
          { dangerouslyUseHTMLString: true }
        );
      }
    },
    // 执行导入
    async set_AddNew() {
      const validData = this.uploadData.filter((item) => item);
      if (validData.length === 0) {
        this.$modal.msgWarning("没有可导入的数据");
        return;
      }
      try {
        const sSubStr = JSON.stringify(validData);
        const sMainSub = sSubStr + "&和" + this.user;
        const res = await axios.post(`${this.baseURL}/Gy_Driver/Gy_Process_Excel`, {
          sMainSub: sMainSub,
        });
        this.$alert(
          `<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>${res.data.Message}</div>`,
          "导入结果",
          { dangerouslyUseHTMLString: true }
        );
        this.upload.open = false;
        this.getList();
      } catch (error) {
        this.$modal.msgError("导入失败");
      }
    },
    // 获取分页数据
    getPage(page, list) {
      const sindex = (page - 1) * this.uploadPageSize;
      const eindex = page * this.uploadPageSize;
      return list.slice(sindex, eindex);
    },
    // 导入分页
    currentPage(val) {
      this.uploadPage = val.page;
      this.uploadData = this.getPage(this.uploadPage, this.alluploadList);
    },
    // 导入数据序号
    uploadDataIndex({ row, rowIndex }) {
      row.index = rowIndex + 1 + (this.uploadPage - 1) * this.uploadPageSize;
    },
    // 删除导入数据
    uploadDataDelete(row) {
      this.$modal.confirm("确认要删除吗").then(() => {
        const deleteIndex = row.index - 1 - (this.uploadPage - 1) * this.uploadPageSize;
        this.uploadData.splice(deleteIndex, 1);
        this.alluploadList.splice(row.index - 1, 1);
        this.uploadTotal = this.alluploadList.length;
        // 重新计算当前页数据
        this.uploadData = this.getPage(this.uploadPage, this.alluploadList);
      });
    },
    // 隐藏列设置
    handleRowHide() {
      this.rowHideShow = true;
      this.openRowHide = true;
    },
    // 关闭列设置
    rowSetClose(val) {
      this.rowHideShow = false;
      this.openRowHide = val;
      this.getList();
    },
    // 按钮设置
    handleBtnHide() {
      this.$modal.msgInfo("按钮设置功能待开发");
    },
    // 保存方案
    handleSaveScheme() {
      this.$modal.msgInfo("保存方案功能待开发");
    },
    // 读取方案
    handleReadScheme() {
      this.loadFilterSchemes();
      this.openFilterScheme = true;
    },
    // 加载过滤方案
    async loadFilterSchemes() {
      try {
        const res = await axios.get(`${this.baseURL}/Xt_FastICScheme/list`, {
          params: {
            HModuleName: this.HModuleName,
            user: this.user,
          },
        });
        if (res.data.count == 1) {
          this.filterSchemeList = res.data.data;
        }
      } catch (error) {
        console.error("加载过滤方案失败:", error);
      }
    },
    // 选择过滤方案
    selectFilterScheme(row) {
      this.selectedFilterScheme = row;
    },
    // 应用过滤方案
    applyFilterScheme(row) {
      this.currentFilterScheme = row.方案名称;
      this.currentFilterRemark = row.备注;
      // 这里应该根据方案内容设置查询条件
      // 由于方案数据结构复杂,这里只做简单演示
      this.$modal.msgSuccess(`已应用方案:${row.方案名称}`);
      this.openFilterScheme = false;
    },
    // 删除过滤方案
    async deleteFilterScheme(row) {
      try {
        await this.$modal.confirm(`确认要删除方案"${row.方案名称}"吗?`);
        const res = await axios.post(`${this.baseURL}/Xt_FastICScheme/delete`, {
          HInterID: row.hmainid,
        });
        if (res.data.count == 1) {
          this.$modal.msgSuccess("删除成功");
          this.loadFilterSchemes();
        } else {
          this.$modal.msgError("删除失败");
        }
      } catch (error) {
        if (error !== "cancel") {
          this.$modal.msgError("删除失败");
        }
      }
    },
    // 确认过滤方案
    confirmFilterScheme() {
      if (this.selectedFilterScheme) {
        this.applyFilterScheme(this.selectedFilterScheme);
      } else {
        this.$modal.msgWarning("请选择一个过滤方案");
      }
    },
    // 清除过滤方案
    clearFilterScheme() {
      this.currentFilterScheme = "";
      this.currentFilterRemark = "";
      this.resetQuery();
      this.$modal.msgSuccess("已清除过滤方案");
    },
  },
};
</script>
<style scoped>
.search-card {
  border-radius: 4px;
  border: 1px solid #ebeef5;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}
.search-header {
  border-bottom: 1px solid #ebeef5;
  padding-bottom: 8px;
  margin-bottom: 8px;
}
.mb8 {
  margin-bottom: 15px;
}
.tableBox {
  margin-top: 10px;
  border: 1px solid #ebeef5;
  border-radius: 4px;
  padding: 15px;
  background-color: #fff;
}
.driver-edit-dialog ::v-deep .el-dialog__body {
  padding: 20px;
}
/* 响应式调整 */
@media (max-width: 1200px) {
  .el-col {
    margin-bottom: 10px;
  }
}
/* 表格行样式优化 */
::v-deep .el-table--striped .el-table__body tr.el-table__row--striped td {
  background-color: #fafafa;
}
::v-deep .el-table th {
  background-color: #f5f7fa;
  color: #909399;
  font-weight: bold;
}
/* 按钮组样式 */
::v-deep .el-button-group .el-button {
  margin-right: 0;
}
/* 折叠过渡效果 */
.el-collapse-transition-enter-active,
.el-collapse-transition-leave-active {
  transition: all 0.3s ease;
}
.el-collapse-transition-enter,
.el-collapse-transition-leave-to {
  opacity: 0;
  transform: translateY(-10px);
}
</style>
src/views/system/user/GyDriverEdit.vue
New file
@@ -0,0 +1,734 @@
<template>
  <div class="gy-driver-edit">
    <div class="operation-buttons">
      <el-button
        type="primary"
        icon="el-icon-check"
        @click="handleSave"
        :disabled="saveDisabled"
        id="set_SaveBill"
        >保存</el-button
      >
      <el-button
        type="primary"
        icon="el-icon-check"
        @click="handleAudit"
        :disabled="!canAudit"
        id="set_CheckBill"
        >审核</el-button
      >
      <el-button
        type="primary"
        icon="el-icon-close"
        @click="handleCancel"
        id="Cancel"
        >退出</el-button
      >
    </div>
    <el-form
      ref="formRef"
      :model="formData"
      :rules="formRules"
      label-width="120px"
      class="edit-form"
    >
      <el-tabs v-model="activeTab" type="card">
        <el-tab-pane label="基本信息" name="basic">
          <div class="form-row">
            <el-form-item label="驾驶员代码" prop="HNumber">
              <el-input
                v-model="formData.HNumber"
                placeholder="请输入驾驶员代码"
                clearable
                :disabled="isViewMode"
              />
              <el-input
                type="hidden"
                v-model="formData.HCREATEORGID"
                style="display: none"
              />
            </el-form-item>
            <el-form-item label="驾驶员名称" prop="HName">
              <el-input
                v-model="formData.HName"
                placeholder="请输入驾驶员名称"
                clearable
                :disabled="isViewMode"
              />
            </el-form-item>
            <el-form-item label="助记码">
              <el-input
                v-model="formData.HHelpCode"
                placeholder="请输入助记码"
                clearable
                :disabled="isViewMode"
              />
            </el-form-item>
            <el-form-item label="所属公司" prop="HDeptID">
              <div class="dept-select">
                <el-input
                  v-model="formData.HDeptName"
                  placeholder="请选择所属公司"
                  readonly
                  clearable
                  :disabled="isViewMode"
                />
                <el-input
                  type="hidden"
                  v-model="formData.HDeptID"
                  style="display: none"
                />
                <el-button
                  type="primary"
                  icon="el-icon-search"
                  @click="openDeptDialog"
                  :disabled="isViewMode"
                  style="margin-left: 10px"
                >
                </el-button>
              </div>
            </el-form-item>
          </div>
          <div class="form-row">
            <el-form-item label="禁用标记">
              <el-checkbox
                v-model="formData.checkboxHStopflag"
                :true-label="1"
                :false-label="0"
                :disabled="!canEditStopFlag"
                @change="handleStopFlagChange"
              >
                是否禁用
              </el-checkbox>
              <el-input
                type="hidden"
                v-model="formData.HStopflag"
                style="display: none"
              />
            </el-form-item>
          </div>
          <div class="form-row">
            <el-form-item label="备注">
              <el-input
                v-model="formData.HRemark"
                placeholder="请输入备注"
                type="textarea"
                :rows="3"
                style="width: 75%"
                :disabled="isViewMode"
              />
            </el-form-item>
          </div>
          <div class="form-row">
            <el-form-item label="组织" prop="Organization">
              <el-select
                v-model="formData.Organization"
                placeholder="请选择组织"
                style="width: 717px"
                :disabled="isViewMode || orgDisabled"
              >
                <el-option
                  v-for="org in organizationList"
                  :key="org.ID"
                  :label="org.Name"
                  :value="org.ID"
                  style="color: blue"
                />
              </el-select>
            </el-form-item>
          </div>
        </el-tab-pane>
        <el-tab-pane label="其他信息" name="other">
          <div class="form-row">
            <el-form-item label="身份证号码">
              <el-input
                v-model="formData.identityID"
                placeholder="请输入身份证号码"
                clearable
                :disabled="isViewMode"
                style="width: 150px; background-color: #f5f7fa"
              />
            </el-form-item>
            <el-form-item label="手机号码">
              <el-input
                v-model="formData.Telephone"
                placeholder="请输入手机号码"
                clearable
                :disabled="isViewMode"
              />
            </el-form-item>
            <el-form-item label="驾照类型">
              <el-select
                v-model="formData.LicenseType"
                placeholder="请选择驾照类型"
                :disabled="isViewMode"
              >
                <el-option label="A1" value="A1" />
                <el-option label="A2" value="A2" />
                <el-option label="A3" value="A3" />
                <el-option label="B1" value="B1" />
                <el-option label="B2" value="B2" />
              </el-select>
            </el-form-item>
            <el-form-item label="司机类型">
              <el-select
                v-model="formData.DriverType"
                placeholder="请选择司机类型"
                :disabled="isViewMode"
              >
                <el-option label="固定" value="固定" />
                <el-option label="临时" value="临时" />
              </el-select>
            </el-form-item>
          </div>
        </el-tab-pane>
        <el-tab-pane label="制单信息" name="record">
          <div class="form-row">
            <el-form-item label="制单人">
              <el-input
                v-model="formData.HMakeEmp"
                readonly
                style="width: 200px; background-color: #f5f7fa"
              />
            </el-form-item>
            <el-form-item label="审核人">
              <el-input
                v-model="formData.HCheckEmp"
                readonly
                style="width: 200px; background-color: #f5f7fa"
              />
            </el-form-item>
            <el-form-item label="禁用人">
              <el-input
                v-model="formData.HStopEmp"
                readonly
                style="width: 200px; background-color: #f5f7fa"
              />
            </el-form-item>
          </div>
          <div class="form-row">
            <el-form-item label="制单日期">
              <el-input
                v-model="formData.HMakeDate"
                readonly
                style="width: 200px; background-color: #f5f7fa"
              />
            </el-form-item>
            <el-form-item label="审核日期">
              <el-input
                v-model="formData.HCheckDate"
                readonly
                style="width: 200px; background-color: #f5f7fa"
              />
            </el-form-item>
            <el-form-item label="禁用日期">
              <el-input
                v-model="formData.HStopDate"
                readonly
                style="width: 200px; background-color: #f5f7fa"
              />
            </el-form-item>
          </div>
        </el-tab-pane>
      </el-tabs>
      <el-input type="hidden" v-model="formData.HItemID" />
    </el-form>
    <!-- 部门选择弹窗 -->
    <el-dialog
      title="dialogTitle"
      :visible.sync="openData"
      width="90%"
      top="5vh"
      append-to-body
    >
    <Dept @deptEmitDb="dbEmitData" @deptEmit="emitData" v-if="deptShow" />
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="deptClickSub">确 定</el-button>
        <el-button @click="closeDeptDialog">取 消</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import axios from "axios";
import Dept from "@/views/component/dept";
export default {
  name: "GyDriverEdit",
  components: { Dept},
  props: {
    OperationType: {
      type: Number,
      default: 1, // 1:新增, 2:复制, 3:编辑, 4:浏览
    },
    linterid: {
      type: String,
      type: Number,
      default: "0",
    },
    HSouceBillType: {
      type: String,
      default: "",
    },
  },
  data() {
    return {
      baseURL: process.env.VUE_APP_BASE_API,
      activeTab: "basic",
      // 部门选择弹窗
      deptDialogVisible: false,
      deptDialogUrl: "",
      dialogTitle: "",
      deptShow: false,
      openData: false,
      deptform: {}, //弹窗选中数据
      // 组织列表
      organizationList: [],
      // 表单数据
      formData: {
        HItemID: "0",
        HNumber: "",
        HName: "",
        HHelpCode: "",
        HDeptName: "",
        HDeptID: "0",
        HDepNumber: "",
        identityID: "",
        Telephone: "",
        LicenseType: "A1",
        DriverType: "固定",
        HStopflag: "0",
        checkboxHStopflag: 0,
        HRemark: "",
        HUSEORGID: "",
        HCREATEORGID: "0",
        HMakeEmp: "",
        HMakeDate: "",
        HCheckEmp: "",
        HCheckDate: "",
        HStopEmp: "",
        HStopDate: "",
        Organization: "",
      },
      // 表单验证规则
      formRules: {
        HNumber: [
          { required: true, message: "请输入驾驶员代码", trigger: "blur" },
        ],
        HName: [
          { required: true, message: "请输入驾驶员名称", trigger: "blur" },
        ],
        HUSEORGID: [
          { required: true, message: "请选择组织", trigger: "change" },
        ],
        HDeptID: [
          { required: true, message: "请选择所属公司", trigger: "change" },
        ],
      },
      saveDisabled: false,
      orgDisabled: false,
      isViewMode: false,
      canEditStopFlag: true,
    };
  },
  computed: {
    canAudit() {
      return (
        this.OperationType === 3 &&
        this.formData.HItemID !== "0" &&
        !this.formData.HCheckEmp
      );
    },
    // 格式化当前日期
    currentDate() {
      const now = new Date();
      const year = now.getFullYear();
      const month = String(now.getMonth() + 1).padStart(2, "0");
      const day = String(now.getDate()).padStart(2, "0");
      return `${year}-${month}-${day}`;
    },
  },
  created() {
    this.initData();
  },
  methods: {
    async initData() {
      try {
        await this.getOrganizationList();
        await this.initByOperationType();
      } catch (error) {
        this.$modal.msgError("初始化失败");
        console.error("初始化错误:", error);
      }
    },
    emitData(row) {
        this.deptform = row; // 存储选中的部门数据
    },
    dbEmitData(deptRow){
        this.formData.HDeptName = deptRow.部门名称;
        this.formData.HDeptID = deptRow.HItemID;
        this.openData = false;
    },
    deptClickSub() {
      if (this.deptform && this.deptform.HItemID) {
      this.formData.HDeptName = this.deptform.部门名称;
      this.formData.HDeptID = this.deptform.HItemID;
      this.openData = false;
      this.deptShow = false;
    } else {
      this.$modal.msgWarning("请先选择一个部门");
    }
    },
    deptDialogVisible() {
      this.deptform = {};
      this.openData = false;
    },
    // 获取组织列表
    async getOrganizationList() {
      try {
        const res = await axios.get(`${this.baseURL}/Web/GetOrganizations`);
        if (res.data.count === 1) {
          this.organizationList = res.data.data;
          const orgId = sessionStorage.getItem("Organization");
          this.formData.HUSEORGID = sessionStorage.getItem("OrganizationID") || "";
          this.formData.Organization = orgId;
          this.formData.HCREATEORGID = sessionStorage.getItem("OrganizationID")|| "0";
        }
      } catch (error) {
        console.error("获取组织列表失败:", error);
      }
    },
    async initByOperationType() {
      const { OperationType, linterid } = this;
      this.formData.HMakeEmp = sessionStorage.getItem("HUserName") || "";
      this.formData.HMakeDate = this.currentDate;
      switch (OperationType) {
        case 1: // 新增
          this.orgDisabled = true;
          this.formData.HItemID = "0";
          break;
        case 2: // 复制
          await this.loadDriverData(linterid);
          this.formData.HItemID = "0";
          this.formData.HNumber = "";
          this.formData.HName = "";
          this.formData.HMakeEmp = sessionStorage.getItem("HUserName") || "";
          this.formData.HMakeDate = this.currentDate;
          this.formData.HCheckEmp = "";
          this.formData.HCheckDate = "";
          this.formData.HStopEmp = "";
          this.formData.HStopDate = "";
          break;
        case 3: // 编辑
          this.orgDisabled = true;
          this.formData.HItemID = linterid;
          await this.loadDriverData(linterid);
          break;
        case 4: // 浏览
          this.isViewMode = true;
          this.saveDisabled = true;
          this.canEditStopFlag = false;
          this.formData.HItemID = linterid;
          await this.loadDriverData(linterid);
          break;
        default:
          this.$modal.msgError("未知操作类型");
          break;
      }
    },
    async loadDriverData(linterid) {
      try {
        const res = await axios.get(`${this.baseURL}/Gy_Driver/cx`, {
          params: { HInterID: linterid },
        });
        console.log("驾驶员数据加载响应:", linterid,this.baseURL);
        console.log("加载驾驶员数据:", res.data.data);
        if (res.data.data[0]) {
          const data = res.data.data[0];
          console.log("加载驾驶员数据:", data);
          this.mapDataToForm(data);
        } else {
          this.$modal.msgError(res.data.msg || "加载数据失败");
        }
      } catch (error) {
        console.error("加载驾驶员数据失败:", error);
        this.$modal.msgError("加载数据失败");
      }
    },
    mapDataToForm(data) {
      const mapping = {
        HNumber: "驾驶员代码",
        HName: "驾驶员名称",
        HHelpCode: "短代码",
        HDeptName: "所属公司名称",
        HDepNumber: "所属公司代码",
        HDeptID: "所属公司ID",
        identityID: "身份证号码",
        Telephone: "手机号码",
        HStopflag: "禁用标记",
        HRemark: "备注",
        HUSEORGID: "HUSEORGID",
        LicenseType: "驾照类型",
        DriverType: "司机类型",
        HMakeEmp: "创建人",
        HMakeDate: "创建日期",
        HCheckEmp: "审核人",
        HCheckDate: "审核日期",
        HStopEmp: "禁用人",
        HStopDate: "禁用日期",
      };
      Object.entries(mapping).forEach(([formKey, dataKey]) => {
        if (data[dataKey] !== undefined) {
          if (dataKey.includes("日期")) {
            this.formData[formKey] = this.formatDate(data[dataKey]);
          } else {
            this.formData[formKey] = data[dataKey];
          }
        }
      });
      if (data.禁用标记) {
        this.formData.checkboxHStopflag = 1;
        this.formData.HStopflag = "1";
      } else {
        this.formData.checkboxHStopflag = 0;
        this.formData.HStopflag = "0";
      }
    },
    formatDate(dateStr) {
      if (!dateStr) return "";
      try {
        const date = new Date(dateStr);
        const year = date.getFullYear();
        const month = String(date.getMonth() + 1).padStart(2, "0");
        const day = String(date.getDate()).padStart(2, "0");
        return `${year}-${month}-${day}`;
      } catch (error) {
        return dateStr;
      }
    },
    async handleSave() {
      try {
        await this.$refs.formRef.validate();
        if (!this.formData.HNumber) {
          this.$modal.msgWarning("请输入驾驶员代码!");
          return;
        }
        if (!this.formData.HName) {
          this.$modal.msgWarning("请输入驾驶员名称!");
          return;
        }
        const saveData = {
          ...this.formData,
          HItemID: this.formData.HItemID,
          HStopflag: this.formData.HStopflag,
        };
        console.log("保存数据:", saveData);
        const sMainStr = JSON.stringify(saveData);
        const res = await axios.post(`${this.baseURL}/Gy_Driver/AddBill1`, {
          oMain: `${sMainStr};${sessionStorage.getItem("HUserName")};${
            sessionStorage.getItem("OrganizationID") || 100038
          }`,
        });
        if (res.data.count === 1) {
          this.$modal.msgSuccess("保存成功");
          this.saveDisabled = true;
          if (this.OperationType === 1 || this.OperationType === 2) {
            this.isViewMode = true;
          }
        } else {
          this.$modal.msgError(res.data.Message || "保存失败");
        }
      } catch (error) {
        if (error.name !== "Error") {
          this.$modal.msgError("保存失败");
          console.error("保存错误:", error);
        }
      }
    },
    async handleAudit() {
      try {
        await this.$modal.confirm("确认要审核吗?");
        const res = await axios.get(`${this.baseURL}/Gy_Driver/AuditGy_Driver`, {
          params: {
            HInterID: this.formData.HItemID,
            IsAudit: 0,
            CurUserName: sessionStorage.getItem("HUserName") || "",
          },
        });
        if (res.data.count === 1) {
          this.$modal.msgSuccess("审核成功");
          if (this.formData.HItemID !== "0") {
            await this.loadDriverData(this.formData.HItemID);
          }
        } else {
          this.$modal.msgError(res.data.Message || "审核失败");
        }
      } catch (error) {
        if (error !== "cancel") {
          this.$modal.msgError("审核失败");
        }
      }
    },
    handleCancel() {
      this.$emit("editCloseGy", false);
    },
    handleStopFlagChange(value) {
      this.formData.HStopflag = value ? "1" : "0";
    },
    openDeptDialog() {
        this.deptShow = false;
       this.dialogTitle = "部门列表";
        this.deptShow = true;
        this.openData = true;
    },
    clearDept() {
      this.formData.HDeptName = "";
      this.formData.HDeptID = "0";
      this.formData.HDepNumber = "";
    },
    handleMessage(event) {
      if (event.data && event.data.type === "deptSelected") {
        const dept = event.data.data;
        if (dept) {
          this.formData.HDeptName = dept.部门名称;
          this.formData.HDeptID = dept.HItemID;
          this.formData.HDepNumber = dept.部门代码;
          this.deptDialogVisible = false;
        }
      }
    },
  },
};
</script>
<style scoped>
.gy-driver-edit {
  padding: 15px;
  height: 100%;
  box-sizing: border-box;
}
.operation-buttons {
  margin-bottom: 20px;
}
.operation-buttons .el-button {
  margin-right: 10px;
}
.edit-form {
  height: calc(100% - 60px);
  overflow-y: auto;
}
.form-row {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 15px;
}
.form-row .el-form-item {
  flex: 1 1 300px;
  margin-right: 20px;
  margin-bottom: 0;
  min-width: 300px;
}
.form-row .el-form-item:last-child {
  margin-right: 0;
}
.dept-select {
  display: flex;
  align-items: center;
}
.dept-select .el-input {
  flex: 1;
}
/* 调整标签页样式 */
::v-deep .el-tabs__header {
  margin-bottom: 20px;
}
::v-deep .el-tabs__content {
  padding: 0 20px;
}
/* 响应式调整 */
@media (max-width: 1200px) {
  .form-row .el-form-item {
    flex: 1 1 100%;
    margin-right: 0;
  }
}
/* 隐藏字段样式 */
input[type="hidden"] {
  display: none;
}
</style>