陈婷婷
2025-11-19 00b790007f9505c2b11e429d13db94e8e431d142
src/views/system/user/xtUserListEdit.vue
@@ -35,7 +35,7 @@
            <el-col :span="6">
              <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)"></el-button>
                  <el-button slot="append" icon="el-icon-search" @click="openDataDialog(4, empType = '1')"></el-button>
                </el-input>
              </el-form-item>
            </el-col>
@@ -84,7 +84,7 @@
            <el-col :span="6">
              <el-form-item label="对应保管" prop="HKeeper">
                <el-input v-model="form.HKeeper" placeholder="请输入对应保管" disabled>
                  <el-button slot="append" icon="el-icon-search" @click="openDataDialog(4)"></el-button>
                  <el-button slot="append" icon="el-icon-search" @click="openDataDialog(4, empType = '2')"></el-button>
                </el-input>
              </el-form-item>
            </el-col>
@@ -93,28 +93,28 @@
            <el-col :span="6">
              <el-form-item label="对应验收" prop="HSecManager">
                <el-input v-model="form.HSecManager" placeholder="请输入对应验收" disabled>
                  <el-button slot="append" icon="el-icon-search" @click="openDataDialog(4)"></el-button>
                  <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="HSourceName">
                <el-input v-model="form.HSourceName" placeholder="请输入对应生产资源" disabled>
                  <el-button slot="append" icon="el-icon-search" @click="openDataDialog(4)"></el-button>
                  <el-button slot="append" icon="el-icon-search" @click="openDataDialog(5)"></el-button>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="对应业务员" prop="HSellMan">
                <el-input v-model="form.HSellMan" placeholder="请输入对应业务员" disabled>
                  <el-button slot="append" icon="el-icon-search" @click="openDataDialog(4)"></el-button>
                  <el-button slot="append" icon="el-icon-search" @click="openDataDialog(4, empType = '4')"></el-button>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="对应部门" prop="HDept">
                <el-input v-model="form.HDept" placeholder="请输入对应部门" disabled>
                  <el-button slot="append" icon="el-icon-search" @click="openDataDialog(4)"></el-button>
                  <el-button slot="append" icon="el-icon-search" @click="openDataDialog(1)"></el-button>
                </el-input>
              </el-form-item>
            </el-col>
@@ -123,21 +123,21 @@
            <el-col :span="6">
              <el-form-item label="检验员" prop="HCheckEmpName">
                <el-input v-model="form.HCheckEmpName" placeholder="请输入检验员" disabled>
                  <el-button slot="append" icon="el-icon-search" @click="openDataDialog(4)"></el-button>
                  <el-button slot="append" icon="el-icon-search" @click="openDataDialog(4, empType = '5')"></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(4)"></el-button>
                  <el-button slot="append" icon="el-icon-search" @click="openDataDialog(2, ckType = '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(4)"></el-button>
                  <el-button slot="append" icon="el-icon-search" @click="openDataDialog(2, ckType = '2')"></el-button>
                </el-input>
              </el-form-item>
            </el-col>
@@ -153,7 +153,7 @@
            <el-col :span="6">
              <el-form-item label="对应供应商" prop="HSupName">
                <el-input v-model="form.HSupName" placeholder="请输入对应供应商" disabled>
                  <el-button slot="append" icon="el-icon-search" @click="openDataDialog(4)"></el-button>
                  <el-button slot="append" icon="el-icon-search" @click="openDataDialog(6)"></el-button>
                </el-input>
              </el-form-item>
            </el-col>
@@ -167,7 +167,7 @@
            <el-col :span="6">
              <el-form-item label="客户" prop="HCusName">
                <el-input v-model="form.HCusName" placeholder="请输入客户" disabled>
                  <el-button slot="append" icon="el-icon-search" @click="openDataDialog(4)"></el-button>
                  <el-button slot="append" icon="el-icon-search" @click="openDataDialog(7)"></el-button>
                </el-input>
              </el-form-item>
            </el-col>
@@ -198,10 +198,13 @@
    </el-form>
    <!-- 部门弹窗 -->
    <el-dialog :title="dialogTitle" :visible.sync="openData" width="1280px" append-to-body>
      <Dept @deptEmitDb="dbEmitData" @deptEmit="emitData" v-if="deptShow" />
      <Warehouse @deptEmitDb="dbEmitData" @deptEmit="emitData" v-if="warehouseShow" />
      <Material @deptEmitDb="dbEmitData" @deptEmit="emitData" v-if="materialShow" />
      <Dept @deptEmitDb="dbEmitData" @deptEmit="emitData" :openPage="HModName" v-if="deptShow" />
      <Warehouse @deptEmitDb="dbEmitData" @deptEmit="emitData" :openPage="HModName" v-if="warehouseShow" />
      <Material @deptEmitDb="dbEmitData" @deptEmit="emitData" :openPage="HModName" v-if="materialShow" />
      <GyEmployee @deptEmitDb="dbEmitData" @deptEmit="emitData" :openPage="HModName" v-if="gyEmployeeShow" />
      <GySource @deptEmitDb="dbEmitData" @deptEmit="emitData" :openPage="HModName" v-if="gySourceShow" />
      <GySupplier @deptEmitDb="dbEmitData" @deptEmit="emitData" :openPage="HModName" v-if="gySupplierShow" />
      <GyCustomer @deptEmitDb="dbEmitData" @deptEmit="emitData" :openPage="HModName" v-if="gyCustomerShow" />
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="deptClickSub">确 定</el-button>
        <el-button @click="deptClose">取 消</el-button>
@@ -215,15 +218,18 @@
<script>
import axios from 'axios'
import Dept from '@/views/component/dept'
import Warehouse from '@/views/component/warehouse'
import Dept from '@/views/basic/gy/gyDepartment.vue'
import Warehouse from '@/views/basic/gyWarehouse/gyWarehouse.vue'
import Material from '@/views/component/material'
import RowSettings from '@/views/component/rowSettings'
import GyEmployee from '@/views/basic/gyEmployee/gyEmployee.vue'
import GySource from '@/views/basic/production/gySource.vue'
import GySupplier from '@/views/basic/gy/gySupplier.vue'
import GyCustomer from '@/views/GyCustomer'
export default {
  name: 'XtUserListEdit',
  components: { Dept, Warehouse, Material, RowSettings, GyEmployee },
  components: { Dept, Warehouse, Material, RowSettings, GyEmployee, GySource, GySupplier, GyCustomer },
  props: {
    OperationType: { type: Number, },
    linterid: {},
@@ -240,7 +246,7 @@
      }
    }
    const equalToHWHName = (rule, value, callback) => {
      if (this.form.HWHName&&this.form.HSCWHName&&(this.form.HWHName == this.form.HSCWHName)) {
      if (this.form.HWHName && this.form.HSCWHName && (this.form.HWHName == this.form.HSCWHName)) {
        callback(new Error("对应仓库和调入仓库不能相同!"))
      } else {
        callback()
@@ -248,6 +254,8 @@
    }
    return {
      HModName: "Xt_UserListEdit",
      empType: '',
      ckType: '',
      formShow: false,
      temp: undefined,
      formLoading: true,
@@ -261,7 +269,10 @@
      deptShow: false,//部门数据组件
      warehouseShow: false,//仓库数据组件
      materialShow: false,//物料数据组件
      gyEmployeeShow: false,//销售员数据组件
      gyEmployeeShow: false,//职员数据组件
      gySourceShow: false,
      gySupplierShow: false,
      gyCustomerShow: false,
      deptform: {},//弹窗选中数据
      openData: false,//数据弹窗
      dialogTitle: '',
@@ -374,7 +385,6 @@
          sWhere: sWhere,
        },
      }).then(response => {
        console.log(response)
        let data1 = response.data
        if (data1.count == 1) {
          if (data1.data.length > 0)
@@ -387,7 +397,6 @@
            }
        }
      }).catch(error => {
        console.log(error)
        this.$modal.msgError("接口请求失败!");
      });
    },
@@ -435,14 +444,18 @@
      // num=1部门 num=2出库仓库
      if (deptRow.HItemID) {
        if (num == 1) {
          this.form.HDeptName = deptRow.部门名称
          this.form.HDept = deptRow.部门名称
          this.form.HDeptID = deptRow.HItemID
          this.form.HManagerName = deptRow.负责人
          this.deptShow = false
          this.openData = false
        } else if (num == 2) {
          this.editData[this.zbIndex].HWHID = deptRow.HItemID;
          this.editData[this.zbIndex].发货仓库 = deptRow.仓库名称;
          if (this.ckType == '1') {
            this.form.HWHName = deptRow.仓库名称;
            this.form.HWhID = deptRow.HItemID;
          } else if (this.ckType == '2') {
            this.form.HSCWHName = deptRow.仓库名称;
            this.form.HSCWHID = deptRow.HItemID;
          }
          this.warehouseShow = false
          this.openData = false
        } else if (num == 3) {
@@ -457,9 +470,39 @@
          this.materialShow = false
          this.openData = false
        } else if (num == 4) {
          this.form.HEmpName = deptRow.职员名称
          this.form.HEmpID = deptRow.HItemID
          if (this.empType == '1') {
            this.form.HEmpName = deptRow.职员名称
            this.form.HEmpID = deptRow.HItemID
          } else if (this.empType == '2') {
            this.form.HKeeper = deptRow.职员名称
            this.form.HKeeperID = deptRow.HItemID
          } else if (this.empType == '3') {
            this.form.HSecManager = deptRow.职员名称
            this.form.HSecManagerID = deptRow.HItemID
          } else if (this.empType == '4') {
            this.form.HSellMan = deptRow.职员名称
            this.form.HSellManID = deptRow.HItemID
          } else if (this.empType == '5') {
            this.form.HCheckEmpName = deptRow.职员名称
            this.form.HCheckEmpID = deptRow.HItemID
          }
          this.gyEmployeeShow = false
          this.openData = false
        } else if (num == 5) {
          this.form.HSourceName = deptRow.生产资源名称
          this.form.HSourceID = deptRow.HItemID
          this.gySourceShow = 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) {
          console.log(deptRow)
          this.form.HCusName = deptRow.客户名称
          this.form.HCusID = deptRow.HItemID
          this.gyCustomerShow = false
          this.openData = false
        }
      } else {
@@ -479,7 +522,6 @@
      this.deptform = {}
      this.openData = false
    },
    //销售出库单新增编辑表单初始化
    reset() {
      this.form = {
@@ -534,13 +576,8 @@
    //退出
    close() {
      this.reset()
      if (!this.OperationType && !this.copyType) {
        const obj = { path: "/system/user/xtUserListEdit", name: "xtUserListEdit" };
        this.$tab.closePage(obj);
      } else {
        this.formShow = false
        this.$emit('editClose', false)
      }
      this.formShow = false
      this.$emit('editClose', false)
    },
    /** 新增按钮操作 */
    handleAdd() {
@@ -610,7 +647,6 @@
    /** 编辑页子表复选框选中数据 */
    handleTableZbEdit(selection) {
      console.log(selection)
      this.checkedSysZb = selection
      // this.editData.forEach(row => {
      //   row.AuthorityHID = this.checkedSysZb.some(selectedRow => selectedRow.GroupId === row.HGroupID) ? 1 : 0;
@@ -619,9 +655,7 @@
    // 编辑提交保存
    submitForm() {
      this.$refs["form"].validate(valid => {
          console.log(this.form)
        if (valid) {
          var num = [];
          var Sav = ''
          if (this.OperationType == 1) {
@@ -629,13 +663,11 @@
          } else if (this.OperationType == 3) {
            Sav = "Update"
          }
          for (var i = 0; i < this.checkedSysZb.length; i++) {
            num.push(this.checkedSysZb[i].HGroupID)
          }
           console.log(num,Sav)
          var sSubStr = num.toString() == "" ? "-1" : num.toString();
          var sMainStr = JSON.stringify(this.form) + ';' + Sav + ';' + sSubStr;
          var sMainStr = JSON.stringify(this.form) + ';' + Sav + ';' + sSubStr;
          axios({
            method: 'post',
            url: this.baseURL + "/Xt_User/SaveUser",
@@ -659,10 +691,12 @@
      this.warehouseShow = false
      this.materialShow = false
      this.gyEmployeeShow = false
      this.gySourceShow = false
      this.gySupplierShow = false
      this.gyCustomerShow = false
    },
    //  打开数据列表弹窗
    openDataDialog(num, row) {
      //num1部门,2出库仓库,3物料,4销售员
      if (row) {
        this.zbIndex = row.index - 1
      }
@@ -680,9 +714,21 @@
        this.materialShow = true
        this.openData = true
      } else if (num == 4) {
        this.dialogTitle = '销售员列表'
        this.dialogTitle = '职员列表'
        this.gyEmployeeShow = true
        this.openData = true
      } else if (num == 5) {
        this.dialogTitle = '生产资源列表'
        this.gySourceShow = true
        this.openData = true
      } else if (num == 6) {
        this.dialogTitle = '供应商列表'
        this.gySupplierShow = true
        this.openData = true
      } else if (num == 7) {
        this.dialogTitle = '客户列表'
        this.gyCustomerShow = true
        this.openData = true
      }
    },
  }