Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-VUEUI
| | |
| | | |
| | | |
| | | <el-tab-pane label="其他信息" name="other"> |
| | | <el-form ref="formOther" :model="formData" label-width="100px"> |
| | | <el-form ref="formOther" :model="formData" :rules="rules" label-width="100px"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="联系人"> |
| | | <el-form-item label="联系人" prop="HLinkMan"> |
| | | <el-input v-model="formData.HLinkMan" placeholder="请输入联系人"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="联系电话"> |
| | | <el-form-item label="联系电话" prop="HLinkPhone"> |
| | | <el-input v-model="formData.HLinkPhone" placeholder="请输入联系电话"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="地址"> |
| | | <el-form-item label="地址" prop="HAddress"> |
| | | <el-input v-model="formData.HAddress" placeholder="请输入地址"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="地区"> |
| | | <el-form-item label="地区" prop="HAreaID"> |
| | | <el-input |
| | | v-model="formData.HAreaName" |
| | | placeholder="请选择地区" |
| | |
| | | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="客户状态"> |
| | | <el-form-item label="客户状态" prop="HCusStatus"> |
| | | <el-select v-model="formData.HCusStatus" placeholder="请选择客户状态" style="width: 100%"> |
| | | <el-option label="潜在" value="101"></el-option> |
| | | <el-option label="合格" value="102"></el-option> |
| | |
| | | this.initData() |
| | | this.loadOrganizations() |
| | | this.handleOperationType() |
| | | this.setConditionalRules() |
| | | }, |
| | | methods: { |
| | | initData() { |
| | |
| | | }, |
| | | |
| | | // 保存 |
| | | handleSave() { |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | if (!this.validateForm()) { |
| | | return |
| | | } |
| | | |
| | | const formData = { ...this.formData } |
| | | formData.HStopflag = formData.HStopflag ? 'true' : 'false' |
| | | |
| | | let url = `${this.baseURL}/Gy_Customer/AddBill` |
| | | let params = { oMain: JSON.stringify(formData) + ';' + this.user } |
| | | |
| | | if (this.operationType === 3) { |
| | | // 编辑保存 |
| | | url = `${this.baseURL}/Gy_Customer/AddBill1` |
| | | params = { |
| | | oMain: JSON.stringify(formData) + ';' + this.linterid + ';' + this.user + ';Gy_Customer_Edit' |
| | | } |
| | | } |
| | | |
| | | axios.post(url, params) |
| | | .then(response => { |
| | | if (response.data.count === 1) { |
| | | this.$modal.msgSuccess(response.data.Message) |
| | | this.saveDisabled = true |
| | | this.saveConfig() |
| | | this.openEdit = false |
| | | this.$emit('editClose', true) |
| | | } else { |
| | | this.$modal.msgError(response.data.Message) |
| | | } |
| | | }) |
| | | .catch(error => { |
| | | this.$modal.msgError('保存失败!') |
| | | }) |
| | | } |
| | | async handleSave() { |
| | | const validMain = await new Promise(resolve => { |
| | | this.$refs.form.validate(valid => resolve(valid)) |
| | | }) |
| | | |
| | | let validOther = true |
| | | if (this.$refs.formOther) { |
| | | validOther = await new Promise(resolve => { |
| | | this.$refs.formOther.validate(valid => resolve(valid)) |
| | | }) |
| | | } |
| | | |
| | | if (validMain && validOther) { |
| | | if (!this.validateForm()) { |
| | | return |
| | | } |
| | | |
| | | const formData = { ...this.formData } |
| | | formData.HStopflag = formData.HStopflag ? 'true' : 'false' |
| | | |
| | | let url = `${this.baseURL}/Gy_Customer/AddBill` |
| | | let params = { oMain: JSON.stringify(formData) + ';' + this.user } |
| | | |
| | | if (this.operationType === 3) { |
| | | // 编辑保存 |
| | | url = `${this.baseURL}/Gy_Customer/AddBill1` |
| | | params = { |
| | | oMain: JSON.stringify(formData) + ';' + this.linterid + ';' + this.user + ';Gy_Customer_Edit' |
| | | } |
| | | } |
| | | |
| | | axios.post(url, params) |
| | | .then(response => { |
| | | if (response.data.count === 1) { |
| | | this.$modal.msgSuccess(response.data.Message) |
| | | this.saveDisabled = true |
| | | this.saveConfig() |
| | | this.openEdit = false |
| | | this.$emit('editClose', true) |
| | | } else { |
| | | this.$modal.msgError(response.data.Message) |
| | | } |
| | | }) |
| | | .catch(error => { |
| | | this.$modal.msgError('保存失败!') |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | setConditionalRules() { |
| | | this.rules.HLinkMan = [ |
| | | { validator: this.validateRequiredIfAdd, trigger: 'blur', message: '请输入联系人' } |
| | | ] |
| | | |
| | | this.rules.HLinkPhone = [ |
| | | { validator: this.validateRequiredIfAdd, trigger: 'blur', message: '请输入联系电话' } |
| | | ] |
| | | |
| | | this.rules.HAddress = [ |
| | | { validator: this.validateRequiredIfAdd, trigger: 'blur', message: '请输入地址' } |
| | | ] |
| | | |
| | | this.rules.HAreaID = [ |
| | | { validator: this.validateRequiredIfAdd, trigger: 'change', message: '请选择地区' } |
| | | ] |
| | | |
| | | this.rules.HCusStatus = [ |
| | | { validator: this.validateRequiredIfAdd, trigger: 'change', message: '请选择客户状态' } |
| | | ] |
| | | }, |
| | | |
| | | validateRequiredIfAdd(rule, value, callback) { |
| | | if (this.operationType !== 1) { |
| | | return callback() |
| | | } |
| | | |
| | | if (value === null || value === undefined) { |
| | | return callback(new Error(rule.message || '该项为必填')) |
| | | } |
| | | |
| | | if (typeof value === 'string' && value.trim() === '') { |
| | | return callback(new Error(rule.message || '该项为必填')) |
| | | } |
| | | |
| | | if (value === '0') { |
| | | return callback(new Error(rule.message || '该项为必填')) |
| | | } |
| | | |
| | | return callback() |
| | | }, |
| | | |
| | | // 表单验证 |
| | |
| | | <el-row> |
| | | <el-col :span="7"> |
| | | <el-select v-model="queryParams.ColName" placeholder="请选择" style="width: 100%"> |
| | | <el-option value="0" label=""></el-option> |
| | | <!-- <el-option value="0" label=""></el-option> --> |
| | | <el-option v-for="(item, index) in visibleColumns" :key="index" :label="item.title" |
| | | :value="item.field"></el-option> |
| | | </el-select> |
| | | </el-col> |
| | | <el-col :span="6" style="padding: 0 10px"> |
| | | <el-select v-model="queryParams.Comparator" placeholder="请选择" style="width: 100%"> |
| | | <el-option value="0" label=""></el-option> |
| | | <!-- <el-option value="0" label=""></el-option> --> |
| | | <el-option v-for="(item, index) in comparatorList" :key="index" :label="item.label" |
| | | :value="item.value"></el-option> |
| | | </el-select> |
| | |
| | | <el-row> |
| | | <el-col :span="7"> |
| | | <el-select v-model="queryParams.ColName1" placeholder="请选择" style="width: 100%"> |
| | | <el-option value="0" label=""></el-option> |
| | | <!-- <el-option value="0" label=""></el-option> --> |
| | | <el-option v-for="(item, index) in visibleColumns" :key="index" :label="item.title" |
| | | :value="item.field"></el-option> |
| | | </el-select> |
| | | </el-col> |
| | | <el-col :span="6" style="padding: 0 10px"> |
| | | <el-select v-model="queryParams.Comparator1" placeholder="请选择" style="width: 100%"> |
| | | <el-option value="0" label=""></el-option> |
| | | <!-- <el-option value="0" label=""></el-option> --> |
| | | <el-option v-for="(item, index) in comparatorList" :key="index" :label="item.label" |
| | | :value="item.value"></el-option> |
| | | </el-select> |
| | |
| | | <el-row> |
| | | <el-col :span="7"> |
| | | <el-select v-model="queryParams.ColName2" placeholder="请选择" style="width: 100%"> |
| | | <el-option value="0" label=""></el-option> |
| | | <!-- <el-option value="0" label=""></el-option> --> |
| | | <el-option v-for="(item, index) in visibleColumns" :key="index" :label="item.title" |
| | | :value="item.field"></el-option> |
| | | </el-select> |
| | | </el-col> |
| | | <el-col :span="6" style="padding: 0 10px"> |
| | | <el-select v-model="queryParams.Comparator2" placeholder="请选择" style="width: 100%"> |
| | | <el-option value="0" label=""></el-option> |
| | | <!-- <el-option value="0" label=""></el-option> --> |
| | | <el-option v-for="(item, index) in comparatorList" :key="index" :label="item.label" |
| | | :value="item.value"></el-option> |
| | | </el-select> |
| | |
| | | HNumber: null, |
| | | HName: null, |
| | | HNumber2: null, |
| | | ColName: "0", |
| | | ColName1: "0", |
| | | ColName2: "0", |
| | | Comparator: "0", |
| | | Comparator1: "0", |
| | | Comparator2: "0", |
| | | ColName: "", |
| | | ColName1: "", |
| | | ColName2: "", |
| | | Comparator: "", |
| | | Comparator1: "", |
| | | Comparator2: "", |
| | | ColContent: "", |
| | | ColContent1: "", |
| | | ColContent2: "", |
| | |
| | | }, |
| | | |
| | | handleRefresh() { |
| | | if (this.$refs.tableData && this.$refs.tableData.clearSelection) { |
| | | this.$refs.tableData.clearSelection(); |
| | | } |
| | | this.selectedRow = null; |
| | | this.ids = []; |
| | | this.single = true; |
| | | this.multiple = true; |
| | | this.getList(); |
| | | }, |
| | | |
| | |
| | | |
| | | rowStyle({ row, rowIndex }) { |
| | | if (this.ids.includes(row.hmainid)) { |
| | | return { background: "#ecf5ff" }; |
| | | return { }; |
| | | } |
| | | }, |
| | | |
| | |
| | | <el-col :span="1.5"> |
| | | <el-button type="primary" icon="el-icon-printer" size="mini" :disabled="single" @click="get_BarCodeDetail">条码明细</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="primary" icon="el-icon-printer" size="mini" :disabled="single" @click="get_PackStockDetail">包装容器出入库明细</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <div class="tableBox" v-loading="loading"> |
| | | <el-table :data="tableData" ref="tableData" max-height="710" :summary-method="getSummaries" |
| | |
| | | </el-dialog> |
| | | <!-- 条码明细 --> |
| | | <BarCodeDetail :visible.sync="barCodeDetailShow" ref="barcodeDetail"/> |
| | | <!-- 包装容器出入库明细 --> |
| | | <PackStockDetail :visible.sync="packStockDetailShow" ref="packStockDetail"/> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | import RowSettings from '@/views/component/rowSettings' //列设置组件 |
| | | import PrintList from '@/views/component/printList' //打印组件 |
| | | import BarCodeDetail from '@/views/component/BarCodeDetail' //条码明细组件 |
| | | import PackStockDetail from '@/views/component/PackStockDetail' //条码明细组件 |
| | | import Edit from '@/views/KCGL/MoveStockBill/Kf_MoveStockBillEdit.vue' //编辑页面组件 |
| | | |
| | | export default { |
| | | name: 'Kf_MoveStockBillList', |
| | | components: { RowSettings, Edit, PrintList,BarCodeDetail }, |
| | | components: { RowSettings, Edit, PrintList,BarCodeDetail,PackStockDetail }, |
| | | data() { |
| | | return { |
| | | baseURL: process.env.VUE_APP_BASE_API, //后端接口前缀(后端服务器ip地址) |
| | |
| | | openRowHide: false, //列设置组件显示标记 |
| | | rowHideShow: false, //列设置组件容器显示标记 |
| | | barCodeDetailShow: false, //条码明细组件容器显示标记 |
| | | packStockDetailShow:false, //包装容器出入库明细容器显示标记 |
| | | |
| | | |
| | | |
| | |
| | | }, |
| | | //#endregion |
| | | |
| | | //#region 包装容器出入库明细 |
| | | get_PackStockDetail() { |
| | | // if (this.selectedRow.length !== 1) { |
| | | // this.$message.warning('请选择一行数据查看条码明细!') |
| | | // return |
| | | // } |
| | | this.packStockDetailShow = true |
| | | this.$nextTick(() => { |
| | | this.$refs.packStockDetail.open(this.rowForm) |
| | | }) |
| | | }, |
| | | //#endregion |
| | | |
| | | //#region 退出 |
| | | close() { |
| | | // this.reset() |
| New file |
| | |
| | | <template> |
| | | <div class="barcode-detail"> |
| | | <el-dialog |
| | | :visible.sync="dialogVisible" |
| | | title="包装容器出入库记录表" |
| | | width="90%" |
| | | top="5vh" |
| | | :close-on-click-modal="false" |
| | | @closed="handleClosed" |
| | | > |
| | | <el-card> |
| | | <div class="dialog-content"> |
| | | <el-form :model="formData" label-width="100px" class="form-container"> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="8"> |
| | | <el-form-item label="单据内码"> |
| | | <el-input v-model="formData.HInterID" disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="单据号"> |
| | | <el-input v-model="formData.HBillNo" disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="单据类型"> |
| | | <el-input v-model="formData.HBillType" disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | |
| | | <div class="table-toolbar"> |
| | | <el-button size="mini" @click="handleColumnSetting"> |
| | | <i class="el-icon-setting"></i> 列设置 |
| | | </el-button> |
| | | </div> |
| | | |
| | | <el-table |
| | | ref="mainTable" |
| | | :data="tableData" |
| | | border |
| | | stripe |
| | | style="width: 100%" |
| | | :loading="loading" |
| | | @selection-change="handleSelectionChange" |
| | | show-summary |
| | | :summary-method="getSummaries" |
| | | > |
| | | <el-table-column type="selection" width="55" fixed="left" /> |
| | | <el-table-column |
| | | v-for="column in tableColumns" |
| | | :key="column.field" |
| | | :prop="column.field" |
| | | :label="column.title" |
| | | :width="column.width" |
| | | :align="column.align" |
| | | :fixed="column.fixed" |
| | | :sortable="column.sortable" |
| | | :show-overflow-tooltip="true" |
| | | > |
| | | <template v-if="column.editable" #default="scope"> |
| | | <el-input |
| | | v-model="scope.row[column.field]" |
| | | size="mini" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </el-card> |
| | | </el-dialog> |
| | | |
| | | <el-dialog |
| | | :visible.sync="columnDialogVisible" |
| | | title="隐藏列设置" |
| | | width="50%" |
| | | > |
| | | <div class="column-setting"> |
| | | <el-checkbox-group v-model="selectedColumns"> |
| | | <el-checkbox |
| | | v-for="column in allColumns" |
| | | :key="column.field" |
| | | :label="column.field" |
| | | > |
| | | {{ column.title }} |
| | | </el-checkbox> |
| | | </el-checkbox-group> |
| | | </div> |
| | | <div slot="footer"> |
| | | <el-button @click="columnDialogVisible = false">取消</el-button> |
| | | <el-button type="primary" @click="applyColumnSettings">确定</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import axios from 'axios' |
| | | |
| | | export default { |
| | | name: 'BarCodeDetail', |
| | | data() { |
| | | return { |
| | | formData: { //用于查询的参数 |
| | | HInterID: '', |
| | | HBillNo: '', |
| | | HBillType: '' |
| | | }, |
| | | loading: false, //页面加载动画显示标记 |
| | | dialogVisible: false, //包装容器出入库明细数据显示标记 |
| | | columnDialogVisible: false, //列设置按钮显示标记 |
| | | |
| | | tableData: [], //表格数据 |
| | | tableColumns: [], //表格列数据 |
| | | allColumns: [], |
| | | selectedColumns: [], |
| | | selectedRows: [], |
| | | baseURL: process.env.VUE_APP_BASE_URL || "http://47.96.97.237/API/" |
| | | } |
| | | }, |
| | | methods: { |
| | | //#region 页面初始化 |
| | | open(record) { |
| | | if (!record) { |
| | | this.$message.warning('请选择要查看条码明细的单据') |
| | | return |
| | | } |
| | | |
| | | const hmainid = record.hmainid || record.HInterID |
| | | const billNo = record.单据号 || record.HBillNo |
| | | |
| | | |
| | | let billTypeDesc = '' |
| | | switch (record.单据类型 || '') { |
| | | case '1201': billTypeDesc = '外购入库单'; break |
| | | case '1202': billTypeDesc = '产品入库单'; break |
| | | case '1203': billTypeDesc = '其它入库单'; break |
| | | case '1204': billTypeDesc = '生产领料'; break |
| | | case '1205': billTypeDesc = '销售出库'; break |
| | | case '1206': billTypeDesc = '其它出库单'; break |
| | | case '1207': billTypeDesc = '直接调拨单'; break |
| | | case '1210': billTypeDesc = '委外加工入库单'; break |
| | | case '1211': billTypeDesc = '委外加工出库单'; break |
| | | default: billTypeDesc = record.单据类型 || '' |
| | | } |
| | | |
| | | this.formData = { |
| | | HInterID: hmainid, |
| | | HBillNo: billNo, |
| | | HBillType: billTypeDesc |
| | | } |
| | | |
| | | this.dialogVisible = true |
| | | this.$nextTick(() => { |
| | | this.loadData(hmainid, record.单据类型 || '', billNo) |
| | | }) |
| | | }, |
| | | //#endregion |
| | | |
| | | //#region 查询数据 |
| | | async loadData(HInterID, HBillType, HBillNo) { |
| | | this.loading = true |
| | | try { |
| | | const sWhere = " and hmainid = " + `${HInterID}` ; |
| | | |
| | | const url = `${this.baseURL}/Kf_ICStockInOutBill/Kf_PackStockDetailQuery` |
| | | const params = { sWhere } |
| | | |
| | | const response = await axios.get(url, { params }) |
| | | const data = response.data |
| | | |
| | | if (data && data.list) { |
| | | this.generateTableColumns(data.list) |
| | | this.tableData = data.data || [] |
| | | this.applyColumnSettingsFromStorage() |
| | | } else { |
| | | this.$message.error('获取包装容器出入库明细数据失败') |
| | | } |
| | | } catch (error) { |
| | | console.error('加载包装容器出入库明细失败:', error) |
| | | this.$message.error('加载包装容器出入库明细失败') |
| | | } finally { |
| | | this.loading = false |
| | | } |
| | | }, |
| | | //#endregion |
| | | |
| | | //#region 根据表格列数据进行进一步处理 |
| | | generateTableColumns(columnList) { |
| | | const columns = [] |
| | | const allColumns = [] |
| | | |
| | | |
| | | columns.push({ |
| | | type: 'selection', |
| | | width: 55, |
| | | fixed: 'left' |
| | | }) |
| | | |
| | | columnList.forEach((item, index) => { |
| | | const colName = item.ColmCols |
| | | let columnConfig = { |
| | | field: colName, |
| | | title: colName, |
| | | width: 200, |
| | | align: 'center', |
| | | sortable: true |
| | | } |
| | | |
| | | |
| | | switch (colName) { |
| | | case 'HItemID': |
| | | columnConfig.hide = true |
| | | break |
| | | case '数量': |
| | | columnConfig.total = true |
| | | break |
| | | } |
| | | |
| | | columns.push(columnConfig) |
| | | allColumns.push({ ...columnConfig }) |
| | | }) |
| | | |
| | | this.tableColumns = columns |
| | | this.allColumns = allColumns |
| | | this.selectedColumns = allColumns.map(col => col.field) |
| | | }, |
| | | //#endregion |
| | | |
| | | //#region 获取选中行数据 |
| | | handleSelectionChange(selection) { |
| | | this.selectedRows = selection |
| | | }, |
| | | //#endregion |
| | | |
| | | //#region 列设置 |
| | | handleColumnSetting() { |
| | | this.columnDialogVisible = true |
| | | }, |
| | | |
| | | applyColumnSettings() { |
| | | this.tableColumns = [ |
| | | this.tableColumns[0], |
| | | ...this.allColumns.filter(col => this.selectedColumns.includes(col.field)) |
| | | ] |
| | | this.columnDialogVisible = false |
| | | |
| | | |
| | | this.saveColumnSettings() |
| | | }, |
| | | |
| | | applyColumnSettingsFromStorage() { |
| | | |
| | | }, |
| | | |
| | | |
| | | saveColumnSettings() { |
| | | |
| | | }, |
| | | |
| | | //#endregion |
| | | |
| | | //#region 合计行计算 |
| | | getSummaries(param) { |
| | | const { columns, data } = param |
| | | const sums = [] |
| | | |
| | | columns.forEach((column, index) => { |
| | | if (index === 0) { |
| | | sums[index] = '合计' |
| | | return |
| | | } |
| | | |
| | | const values = data.map(item => Number(item[column.property])) |
| | | if (!values.every(value => isNaN(value))) { |
| | | sums[index] = values.reduce((prev, curr) => { |
| | | const value = Number(curr) |
| | | if (!isNaN(value)) { |
| | | return prev + curr |
| | | } else { |
| | | return prev |
| | | } |
| | | }, 0) |
| | | } else { |
| | | sums[index] = '' |
| | | } |
| | | }) |
| | | |
| | | return sums |
| | | }, |
| | | //#endregion |
| | | |
| | | //#region 页面关闭方法 |
| | | handleClosed() { |
| | | this.tableData = [] |
| | | this.tableColumns = [] |
| | | this.selectedRows = [] |
| | | } |
| | | //#endregion |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .barcode-detail { |
| | | font-family: "Microsoft YaHei", sans-serif; |
| | | } |
| | | |
| | | .form-container { |
| | | margin-bottom: 16px; |
| | | } |
| | | |
| | | .table-toolbar { |
| | | margin-bottom: 12px; |
| | | } |
| | | |
| | | .column-setting { |
| | | max-height: 400px; |
| | | overflow-y: auto; |
| | | } |
| | | |
| | | .column-setting .el-checkbox { |
| | | display: block; |
| | | margin-bottom: 8px; |
| | | } |
| | | |
| | | :deep(.el-dialog__body) { |
| | | padding: 10px 20px; |
| | | } |
| | | |
| | | :deep(.el-card__body) { |
| | | padding: 12px; |
| | | } |
| | | </style> |
| | |
| | | placeholder="请选择" |
| | | style="width: 100%" |
| | | > |
| | | <el-option value="0" label=""></el-option> |
| | | <!-- <el-option value="" label=""></el-option> --> |
| | | <el-option |
| | | v-for="(item, index) in visibleColumns" |
| | | :key="index" |
| | |
| | | placeholder="请选择" |
| | | style="width: 100%" |
| | | > |
| | | <el-option value="0" label=""></el-option> |
| | | <!-- <el-option value="0" label=""></el-option> --> |
| | | <el-option |
| | | v-for="(item, index) in comparatorList" |
| | | :key="index" |
| | |
| | | placeholder="请选择" |
| | | style="width: 100%" |
| | | > |
| | | <el-option value="0" label=""></el-option> |
| | | <!-- <el-option value="0" label=""></el-option> --> |
| | | <el-option |
| | | v-for="(item, index) in visibleColumns" |
| | | :key="index" |
| | |
| | | placeholder="请选择" |
| | | style="width: 100%" |
| | | > |
| | | <el-option value="0" label=""></el-option> |
| | | <!-- <el-option value="0" label=""></el-option> --> |
| | | <el-option |
| | | v-for="(item, index) in comparatorList" |
| | | :key="index" |
| | |
| | | placeholder="请选择" |
| | | style="width: 100%" |
| | | > |
| | | <el-option value="0" label=""></el-option> |
| | | <!-- <el-option value="0" label=""></el-option> --> |
| | | <el-option |
| | | v-for="(item, index) in visibleColumns" |
| | | :key="index" |
| | |
| | | placeholder="请选择" |
| | | style="width: 100%" |
| | | > |
| | | <el-option value="0" label=""></el-option> |
| | | <!-- <el-option value="0" label=""></el-option> --> |
| | | <el-option |
| | | v-for="(item, index) in comparatorList" |
| | | :key="index" |
| | |
| | | HModel: null, |
| | | HOrgID: null, |
| | | HProject: null, |
| | | ColName: "0", |
| | | ColName1: "0", |
| | | ColName2: "0", |
| | | Comparator: "0", |
| | | Comparator1: "0", |
| | | Comparator2: "0", |
| | | ColName: "", |
| | | ColName1: "", |
| | | ColName2: "", |
| | | Comparator: "", |
| | | Comparator1: "", |
| | | Comparator2: "", |
| | | ColContent: "", |
| | | ColContent1: "", |
| | | ColContent2: "", |
| | |
| | | .then((response) => { |
| | | let data = response.data.data[0]; |
| | | this.user = data.Czymc; |
| | | |
| | | this.getOrganizations(); |
| | | this.queryParams.HOrgID = data.HUSEORGID; |
| | | this.getTreeData(); |
| | | this.getProjectOptions(); |
| | | this.getList(); |
| | |
| | | .then((response) => { |
| | | if (response.data.count == 1) { |
| | | this.organizationOptions = response.data.data; |
| | | if (this.organizationOptions.length > 0) { |
| | | this.queryParams.HOrgID = this.organizationOptions[0].ID; |
| | | } |
| | | // if (this.organizationOptions.length > 0) { |
| | | // this.queryParams.HOrgID = this.organizationOptions[0].ID; |
| | | // } |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | |
| | | }, |
| | | |
| | | handleRefresh() { |
| | | // 刷新时清除表格选择并重置相关状态,保证复制/编辑/删除/审核等按钮被禁用 |
| | | if (this.$refs.tableData && this.$refs.tableData.clearSelection) { |
| | | this.$refs.tableData.clearSelection(); |
| | | } |
| | | this.selectedRow = null; |
| | | this.ids = []; |
| | | this.single = true; |
| | | this.multiple = true; |
| | | this.getList(); |
| | | }, |
| | | |
| | |
| | | // 行样式 |
| | | rowStyle({ row, rowIndex }) { |
| | | if (this.ids.includes(row.hmainid)) { |
| | | return { background: "#ecf5ff" }; |
| | | return { }; |
| | | // background: "#ecf5ff" |
| | | } |
| | | }, |
| | | |
| | |
| | | <!-- <el-button @click="cancel">取 消</el-button> --> |
| | | </div> |
| | | <div style="margin: 10px; font-size: 28px; font-weight: bold; text-align: center;">新增/编辑用户信息</div> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="128px"> |
| | | <el-form ref="form" :model="form" label-width="128px"> |
| | | <el-tabs v-model="activeName" type="card"> |
| | | <el-tab-pane label="基本信息" name="first"> |
| | | <el-row> |
| | |
| | | components: {}, |
| | | props: { |
| | | OperationType: { type: Number, }, |
| | | linterid: {}, |
| | | linterid: {type: Number}, |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | }; |
| | | }, |
| | | created() { |
| | | |
| | | this.getdata() |
| | | }, |
| | | methods: { |
| | | //#region 页面初始化 |
| | | getdata() { |
| | | this.formShow = false |
| | | this.formLoading = true |
| | | this.getUserGroup() |
| | | if ((this.OperationType == 1 && this.copyType != 1) || (!this.OperationType && !this.copyType)) { |
| | | this.handleAdd() |
| | | } else if (this.OperationType == 3 || this.copyType == 1) { |
| | | this.$nextTick(() => { |
| | | this.handleUpdate() |
| | | }) |
| | | try { |
| | | this.formShow = false |
| | | this.formLoading = true |
| | | this.getUserGroup() |
| | | if ((this.OperationType == 1 && this.copyType != 1) || (!this.OperationType && !this.copyType)) { |
| | | this.handleAdd() |
| | | } else if (this.OperationType == 3 || this.copyType == 1) { |
| | | this.$nextTick(() => { |
| | | this.handleUpdate() |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | console.error('Error ', err) |
| | | } |
| | | }, |
| | | |
| | |
| | | handleUpdate() { |
| | | this.reset() |
| | | let rowHmainid = this.linterid |
| | | console.log("编辑用户ID",rowHmainid) |
| | | axios.get(this.baseURL + "/Xt_User/EditUser", { |
| | | params: { 'HID': rowHmainid } |
| | | }).then(response => { |
| | |
| | | //#endregion |
| | | |
| | | //#region 获取子表数据 |
| | | getUserGroup() { |
| | | async getUserGroup() { |
| | | //角色列表 |
| | | axios.get(this.baseURL + '/Xt_UserGroup/list', { |
| | | axios.get(this.baseURL + '/Xt_User/list', { |
| | | params: { |
| | | sWhere: '', |
| | | user: sessionStorage["HUserName"], |
| | | }, |
| | | }).then(response => { |
| | | let data1 = response.data |
| | | if (data1.code == 1) { |
| | | console.log(data1) |
| | | this.editData = data1.data |
| | | console.log("zhiwei",this.editData) |
| | | //this.get_DisplayUserGroupInfoList() |
| | | } |
| | | }).catch(error => { |
| | | this.$modal.msgError("接口请求失败!"); |
| | |
| | | //#endregion |
| | | |
| | | |
| | | get_DisplayUserGroupInfoList() { |
| | | var sWhere = "and UserId='" + this.linterid + "'"; |
| | | async get_DisplayUserGroupInfoList() { |
| | | var sWhere = "and GroupId='" + this.linterid + "'"; |
| | | axios.get(this.baseURL + '/Xt_UserGroup/UserGroupInfoList', { |
| | | params: { |
| | | sWhere: sWhere, |
| | | }, |
| | | }).then(response => { |
| | | let data1 = response.data |
| | | console.log(data1) |
| | | if (data1.count == 1) { |
| | | if (data1.data.length > 0) |
| | | if (this.editData.length > 0) { |
| | |
| | | </el-dialog> |
| | | <!-- 编辑 --> |
| | | <el-dialog title="编辑" :visible.sync="openEdit" width="1480px" append-to-body class="xsckdBox" @close="close"> |
| | | <edit :OperationType=OperationType :linterid="this.rowForm.hmainid" @editClose="editClose" v-if="editShow" /> |
| | | <edit :OperationType="OperationType" :linterid="this.rowForm.HGroupID" @editClose="editClose" v-if="editShow" /> |
| | | </el-dialog> |
| | | <!-- 权限 --> |
| | | <el-dialog title="角色权限" :visible.sync="openQuery" width="1480px" append-to-body class="xsckdBox"> |
| | | <Query HSouceBillType="js" @editQueryClose="editQueryClose" :linterid=this.rowForm.HGroupID v-if="queryShow" /> |
| | | <Query HSouceBillType="js" @editQueryClose="editQueryClose" :linterid="this.rowForm.HGroupID" v-if="queryShow" /> |
| | | </el-dialog> |
| | | </div> |
| | | </div> |
| | |
| | | //#region 选中行高亮样式 |
| | | rowStyle({ row, rowIndex }) { |
| | | if (this.ids.includes(row.hmainid)) { |
| | | return { "background": "#ecf5ff" } |
| | | return { } |
| | | } |
| | | }, |
| | | //#endregion |
| | |
| | | //#region 双击行 |
| | | handleDblclick(row, column, cell, event) { |
| | | this.OperationType = 3 |
| | | this.handleEdit() |
| | | this.handleEdit(row) |
| | | }, |
| | | //#endregion |
| | | |
| | |
| | | |
| | | //#region 新增 |
| | | handleAddEdit() { |
| | | this.rowForm.hmainid = 0 |
| | | this.OperationType = 1 |
| | | this.rowForm.HGroupID = 0 |
| | | console.log(' OperationType=', this.OperationType, 'rowForm.HGroupID=', this.rowForm.HGroupID) |
| | | this.editShow = true |
| | | this.openEdit = true |
| | | }, |
| | |
| | | //#region 编辑 |
| | | handleEdit(row) { |
| | | this.rowForm = row |
| | | console.log('OperationType=', this.OperationType, 'rowForm=', this.rowForm) |
| | | this.editShow = true |
| | | this.openEdit = true |
| | | }, |