| | |
| | | method: 'delete' |
| | | }) |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | // æ¥è¯¢å·¥åä»åºå表 |
| | | export function listWaresList() { |
| | | return request({ |
| | | url: 'system/warehouse/listWerks', |
| | | method: 'get', |
| | | }) |
| | | } |
| | | |
| | | |
| | | |
| | | // æ¥è¯¢å·¥åå表 |
| | | export function listwerkshouse(query) { |
| | | return request({ |
| | | url: '/system/werks/list', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="dialog-search"> |
| | | <el-form |
| | | :inline="true" |
| | | ref="ruleForm" |
| | | :model="formInline" |
| | | class="demo-form-inline" |
| | | v-show="showSearch" |
| | | > |
| | | <el-form-item |
| | | v-for="(item, index) in formItemListData" |
| | | :key="index" |
| | | :label="item.label" |
| | | > |
| | | <!-- ä¸æéæ©æ¡ --> |
| | | <template v-if="item.component == 'Select'"> |
| | | <template v-if="item.slot"> |
| | | <slot :name="item.slot" :form="formInline" :field="item.field"> |
| | | </slot> |
| | | </template> |
| | | <template v-else> |
| | | <el-select |
| | | v-model="formInline[item.field]" |
| | | :multiple="item.multiple" |
| | | :placeholder="item.componentProps.placeholder" |
| | | size="mini" |
| | | clearable |
| | | > |
| | | <el-option |
| | | v-for="(item2, index2) in item.selectOptions" |
| | | size="mini" |
| | | :key="index2" |
| | | :label="item2.label" |
| | | :value="item2.value" |
| | | ></el-option> |
| | | </el-select> |
| | | </template> |
| | | </template> |
| | | |
| | | <!-- ä¸æéæ©æ¡end --> |
| | | <!-- è¾å
¥æ¡ --> |
| | | <el-input |
| | | v-if="item.component == 'Input' && item.show !== false" |
| | | v-model.trim="formInline[item.field]" |
| | | :placeholder="item.componentProps.placeholder" |
| | | clearable |
| | | size="mini" |
| | | ></el-input> |
| | | <!-- è¾å
¥æ¡ --> |
| | | <!-- æ¥æèå´éæ©æ¡ --> |
| | | <el-date-picker |
| | | v-if=" |
| | | item.component == 'daterange' || |
| | | item.component == 'datetimerange' || |
| | | item.component == 'date' || |
| | | item.component == 'datetime' |
| | | " |
| | | size="mini" |
| | | v-model="formInline[item.field]" |
| | | :value-format="item.valueFormat || 'yyyy/MM/dd'" |
| | | :format="item.format || 'yyyy/MM/dd'" |
| | | clearable |
| | | :type="item.component || ''" |
| | | :range-separator="item.rangeSeparator || 'è³'" |
| | | :start-placeholder="item.componentProps.startPlaceholder" |
| | | :end-placeholder="item.componentProps.endPlaceholder" |
| | | :placeholder="item.componentProps.placeholder" |
| | | > |
| | | </el-date-picker> |
| | | <!-- æ¥æèå´éæ©æ¡end --> |
| | | <!-- 级èéæ©å¨ --> |
| | | <el-cascader |
| | | v-if="item.component == 'cascader'" |
| | | v-model="formInline[item.field]" |
| | | :options="item.options" |
| | | :props="item.props" |
| | | size="mini" |
| | | clearable |
| | | ></el-cascader> |
| | | <!-- 级èéæ©å¨end --> |
| | | </el-form-item> |
| | | |
| | | <slot name="formItem"></slot> |
| | | <el-form-item style="width: 10rem"> |
| | | <el-button type="primary" size="mini" @click="onSubmit">æ¥è¯¢</el-button> |
| | | <el-button type="" size="mini" @click="resetForm('ruleForm')" |
| | | >éç½®</el-button |
| | | > |
| | | </el-form-item> |
| | | <!-- å¯ç¨äºæ¾ç¤ºå
¶ä»æé® --> |
| | | <slot name="formButton"></slot> |
| | | </el-form> |
| | | <el-row :gutter="10" class="mb8"> |
| | | <div class="bottonBox"> |
| | | <slot name="actionButton"></slot> |
| | | <right-toolbar |
| | | :showSearch.sync="showSearch" |
| | | @queryTable="getList" |
| | | class="rightbotton" |
| | | ></right-toolbar> |
| | | </div> |
| | | </el-row> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import request from "@/utils/request"; |
| | | import { time } from "echarts"; |
| | | |
| | | export default { |
| | | name: "BaseSearch", |
| | | props: { |
| | | emitSearch: { |
| | | // æ¯å¦ç«å³æ§è¡æç´¢ |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | formItemList: { |
| | | type: Array, |
| | | default() { |
| | | return []; |
| | | }, |
| | | }, |
| | | }, |
| | | data() { |
| | | let formInline = {}; |
| | | for (const obj of this.formItemList) { |
| | | formInline[obj.field] = obj.defaultValue || ""; |
| | | } |
| | | return { |
| | | formInline, |
| | | showSearch: true, |
| | | // formItemListData: [], |
| | | }; |
| | | }, |
| | | computed: { |
| | | formItemListData() { |
| | | return JSON.parse(JSON.stringify(this.formItemList)).map((item) => { |
| | | if (item.component == "Select" && !item.slot) { |
| | | if (item.componentProps.options) { |
| | | item.selectOptions = item.componentProps.options; |
| | | } |
| | | } |
| | | |
| | | return item; |
| | | }); |
| | | }, |
| | | }, |
| | | mounted() {}, |
| | | watch: { |
| | | emitSearch(newVal, oldVal) { |
| | | // æ¯å¦ç«å³è§¦åæç´¢ ç¨å¨å¼¹çªä¸å¼æ¥è¯·æ±ä¸ææ¡å æè
ç»ä¸ææ¡èµå¼é»è®¤å¼å éè¦ç¨å°è¿ä¸ªæ¹æ³ |
| | | if (newVal) { |
| | | console.log("æ¤æ¶è§¦å--ç«å³æ§è¡æç´¢"); |
| | | this.$emit("search", this.formInline); |
| | | } |
| | | }, |
| | | formItemList: { |
| | | handler(newVal, oldVal) { |
| | | for (const obj of this.formItemList) { |
| | | console.log(obj); |
| | | if (obj.defaultValue) { |
| | | formInline[obj.field] = obj.defaultValue; |
| | | } |
| | | } |
| | | }, |
| | | deep: true, |
| | | }, |
| | | showSearch() { |
| | | this.$emit("showSearchChange"); |
| | | }, |
| | | }, |
| | | methods: { |
| | | onSubmit() { |
| | | this.$emit("search", this.formInline); |
| | | }, |
| | | resetForm(formName) { |
| | | this.$refs[formName].resetFields(); |
| | | let formInline = {}; |
| | | for (const obj of this.formItemList) { |
| | | formInline[obj.field] = ""; // ææçéæ¡ä»¶æ¸
空 |
| | | } |
| | | this.formInline = formInline; |
| | | |
| | | this.$emit("search", this.formInline); |
| | | }, |
| | | getList() { |
| | | this.$emit("getList"); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .dialog-search { |
| | | // margin: 0 1rem; |
| | | margin-bottom: 20px; |
| | | text-align: left; |
| | | ::v-deep .el-form-item__content { |
| | | // width: 16rem; |
| | | .el-input { |
| | | width: 16rem; |
| | | } |
| | | .el-select { |
| | | .el-input__inner { |
| | | // height: 3.2rem; |
| | | width: 16rem; |
| | | } |
| | | } |
| | | } |
| | | ::v-deep .el-form-item { |
| | | margin-bottom: 5px; |
| | | } |
| | | } |
| | | .bottonclas { |
| | | display: flex; |
| | | justify-content: flex-start; |
| | | } |
| | | .bottonBox { |
| | | display: flex; |
| | | justify-content: flex-start; |
| | | } |
| | | .rightbotton { |
| | | margin-left: 20px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-table |
| | | ref="multipleTable" |
| | | v-loading="tableLoading" |
| | | :data="tableData" |
| | | element-loading-text="æ¼å½å è½½ä¸" |
| | | :height="elementHeight" |
| | | :key='elementHeight' |
| | | element-loading-spinner="el-icon-loading" |
| | | element-loading-background="rgba(255, 255, 255, 0.2)" |
| | | tooltip-effect="dark" |
| | | style="width: 100%" |
| | | border |
| | | :row-class-name="rowClassName" |
| | | :header-cell-style="headerCellStyle" |
| | | stripe |
| | | cell-class-name="cellClassName" |
| | | :row-key="isTree ? rowKey : ''" |
| | | @expand-change="expandChange" |
| | | @select="selectchange" |
| | | @select-all="selectAll" |
| | | > |
| | | <template v-if="isSelection"> |
| | | <el-table-column type="selection" width="55" /> |
| | | </template> |
| | | |
| | | <template v-for="(item, index) in column"> |
| | | <el-table-column |
| | | :key="index" |
| | | :label="item.label" |
| | | :prop="item.prop" |
| | | :type="item.type" |
| | | :width="item.width" |
| | | :fixed="item.fixed" |
| | | :sortable="item.sortable ? true : false" |
| | | :filters="item.filters" |
| | | :column-key="item.columnKey" |
| | | :filtered-value="item.filteredValue" |
| | | :filter-multiple="item.filterMultiple" |
| | | :min-width="item.minWidth" |
| | | :align="item.align" |
| | | :show-overflow-tooltip="true" |
| | | > |
| | | <!-- <div class="123" v-if="item.type == ''"> --> |
| | | <template |
| | | v-if="item.hasOwnProperty('colunmTemplate')" |
| | | :slot="item.colunmTemplate" |
| | | slot-scope="scope" |
| | | > |
| | | <slot |
| | | v-if="item.theadSlot" |
| | | :name="item.theadSlot" |
| | | :row="scope.row" |
| | | :index="index" |
| | | /> |
| | | </template> |
| | | |
| | | <template slot-scope="scope"> |
| | | <!-- æ槽 --> |
| | | <div v-if="item.dataType == 'slot'"> |
| | | <slot |
| | | v-if="item.slot" |
| | | :name="item.slot" |
| | | :row="scope.row" |
| | | :index="scope.$index" |
| | | /> |
| | | </div> |
| | | |
| | | <!-- è¿åº¦æ¡ --> |
| | | <div v-else-if="item.dataType == 'progress'"> |
| | | <el-progress :percentage="Number(scope.row[item.prop])" /> |
| | | </div> |
| | | |
| | | <!-- tag --> |
| | | <div v-else-if="item.dataType == 'tag'"> |
| | | <el-tag |
| | | v-if=" |
| | | typeof dataTypeFn(scope.row[item.prop], item.formatData) == |
| | | 'string' |
| | | " |
| | | :title="scope.row[item.prop] | formatters(item.formatData)" |
| | | :type="formatType(scope.row[item.prop], item.formatType)" |
| | | > |
| | | {{ scope.row[item.prop] | formatters(item.formatData) }} |
| | | </el-tag> |
| | | |
| | | <el-tag |
| | | v-for="(tag, index) in dataTypeFn( |
| | | scope.row[item.prop], |
| | | item.formatData |
| | | )" |
| | | v-else-if=" |
| | | typeof dataTypeFn(scope.row[item.prop], item.formatData) == |
| | | 'object' |
| | | " |
| | | :key="index" |
| | | :title="scope.row[item.prop] | formatters(item.formatData)" |
| | | :type="formatType(tag, item.formatType)" |
| | | > |
| | | {{ |
| | | item.tagGroup |
| | | ? tag[item.tagGroup.label] |
| | | ? tag[item.tagGroup.label] |
| | | : tag |
| | | : tag |
| | | }} |
| | | </el-tag> |
| | | |
| | | <el-tag |
| | | v-else |
| | | :title="scope.row[item.prop] | formatters(item.formatData)" |
| | | :type="formatType(scope.row[item.prop], item.formatType)" |
| | | > |
| | | {{ scope.row[item.prop] | formatters(item.formatData) }} |
| | | </el-tag> |
| | | </div> |
| | | |
| | | <!-- æé® --> |
| | | <div v-else-if="item.dataType == 'option'"> |
| | | <template > |
| | | <el-button |
| | | v-for="(o, key) in item.operation" |
| | | v-show="o.showHide ? o.showHide(scope.row) : true" |
| | | :key="key" |
| | | :icon="o.icon | iconFn(scope.row)" |
| | | :disabled="o.disabled ? o.disabled(scope.row) : false" |
| | | :plain="o.plain" |
| | | :type="o.type | typeFn(scope.row)" |
| | | :size="o.size" |
| | | @click="clickFun(scope.row, o.typeText)" |
| | | v-hasPermi="[o.hasPermi]" |
| | | > |
| | | {{ o.name }} |
| | | ããããã |
| | | </el-button> |
| | | </template> |
| | | </div> |
| | | |
| | | <!-- --> |
| | | |
| | | <!-- é»è®¤çº¯å±ç¤ºæ°æ® --> |
| | | <span v-else> |
| | | <span class="overClass" v-if="!item.formatData"> |
| | | {{ scope.row[item.prop] }} |
| | | </span> |
| | | <span class="overClass" v-else> |
| | | {{ scope.row[item.prop] | formatters(item.formatData) }} |
| | | </span> |
| | | </span> |
| | | </template> |
| | | |
| | | <!-- </div> --> |
| | | </el-table-column> |
| | | </template> |
| | | </el-table> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | filters: { |
| | | iconFn(val, row) { |
| | | if (typeof val === "function") { |
| | | return val(row); |
| | | } else return val; |
| | | }, |
| | | typeFn(val, row) { |
| | | if (typeof val === "function") { |
| | | return val(row); |
| | | } else return val; |
| | | }, |
| | | describeConts(val, describeCont) { |
| | | if (typeof describeCont === "function") { |
| | | return describeCont(val); |
| | | } else return val; |
| | | }, |
| | | formatters(val, format) { |
| | | if (typeof format === "function") { |
| | | return format(val); |
| | | } else return val; |
| | | }, |
| | | }, |
| | | props: { |
| | | // æ¯å¦å¼å¯å¤é |
| | | isSelection: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | // è®¾ç½®è¡¨æ ¼é«åº¦ |
| | | height: { |
| | | type: Number|String, |
| | | default: null, |
| | | }, |
| | | // è¡¨æ ¼æ°æ®è¯·æ±loading |
| | | tableLoading: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | // è¡¨æ ¼å¤´é¨æ ·å¼ |
| | | headerCellStyle: { |
| | | type: Object, |
| | | default: () => { |
| | | return {}; |
| | | }, |
| | | }, |
| | | // åæ°æ®è¡¨å¤´ |
| | | column: { |
| | | type: Array, |
| | | default() { |
| | | return []; |
| | | }, |
| | | }, |
| | | // è¡æ°æ®ç±»å |
| | | rowClassName: { |
| | | type: Function, |
| | | default: () => {}, |
| | | }, |
| | | // è¡¨æ ¼æ°æ® |
| | | tableData: { |
| | | type: Array, |
| | | default() { |
| | | return []; |
| | | }, |
| | | }, |
| | | // å¨æ¯æ ç¶è¡¨æ ¼æ¶éè¦ä½¿ç¨rowKeyé»è®¤ä¸ä½¿ç¨ |
| | | isTree: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | // è¡¨æ ¼è¡ç»å®çidæ°æ® |
| | | rowKey: { |
| | | type: String, |
| | | default: "", |
| | | }, |
| | | // chectypeé项类 |
| | | checktype: { |
| | | type: String, |
| | | default: "check", |
| | | }, |
| | | }, |
| | | computed: { |
| | | elementHeight() { |
| | | return this.height; |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | expandedData: [], |
| | | multipleSelection: [], |
| | | isCheckedAll: false, |
| | | }; |
| | | }, |
| | | watch: { |
| | | multipleSelection(val, oldval) { |
| | | |
| | | this.setIsCheckedAll(val); |
| | | this.$emit("checkData", val); |
| | | }, |
| | | |
| | | tableLoading() { |
| | | this.multipleSelection = []; |
| | | }, |
| | | |
| | | elementHeight(){ |
| | | |
| | | this.multipleSelection = []; |
| | | } |
| | | }, |
| | | mounted() {}, |
| | | methods: { |
| | | formatType(val, format) { |
| | | if (typeof format === "function") { |
| | | return format(val); |
| | | } else return ""; |
| | | }, |
| | | dataTypeFn(val, format) { |
| | | if (typeof format === "function") { |
| | | return format(val); |
| | | } else return val; |
| | | }, |
| | | toggleSelection(row, type) { |
| | | this.$refs.multipleTable.toggleRowSelection(row, type); |
| | | }, |
| | | clearSection(row) { |
| | | this.$refs.multipleTable.clearSelection(); |
| | | }, |
| | | // éæ©çæ¹æ³ |
| | | // selectchange(selection, row) { |
| | | |
| | | |
| | | // if (this.checktype == "radio") { |
| | | // row.isChecked = true; |
| | | // if (this.multipleSelection.length < 0) { |
| | | // this.multipleSelection.push(row); |
| | | // } else { |
| | | // this.toggleSelection(this.multipleSelection[0],false) |
| | | |
| | | // this.multipleSelection.splice(0, 1, row); |
| | | // } |
| | | // } else { |
| | | |
| | | // if (!row.isChecked) { |
| | | // this.multipleSelection.push(row); |
| | | // row.isChecked = true; |
| | | // if ( |
| | | // row.children && |
| | | // this.expandedData.indexOf(row[this.rowKey]) > -1 |
| | | // ) { |
| | | // row.children.map((item) => { |
| | | // this.toggleSelection(item, true); |
| | | // item.isChecked = true; |
| | | // this.multipleSelection.push(item); |
| | | // }); |
| | | // } |
| | | // } else { |
| | | |
| | | // row.isChecked = false; |
| | | // this.multipleSelection.splice(this.multipleSelection.indexOf(row), 1); |
| | | // if (row.children) { |
| | | // row.children.map((item) => { |
| | | |
| | | // this.toggleSelection(item, false); |
| | | // item.isChecked = false; |
| | | // this.multipleSelection.splice( |
| | | // this.multipleSelection.indexOf(item), |
| | | // 1 |
| | | // ); |
| | | // }); |
| | | // } |
| | | // } |
| | | // } |
| | | // }, |
| | | selectchange(selection, row) { |
| | | |
| | | if (this.checktype === "radio") { |
| | | row.isChecked = true; |
| | | if (this.multipleSelection.length < 0) { |
| | | this.multipleSelection.push(row); |
| | | } else { |
| | | this.toggleSelection(this.multipleSelection[0], false); |
| | | this.multipleSelection.splice(0, 1, row); |
| | | } |
| | | } else { |
| | | if (!row.isChecked) { |
| | | console.log('éæ©æä½'); |
| | | this.multipleSelection.push(row); |
| | | row.isChecked = true; |
| | | if (row.children && this.expandedData.includes(row[this.rowKey])) { |
| | | row.children.forEach((item) => { |
| | | this.toggleSelection(item, true); |
| | | item.isChecked = true; |
| | | this.multipleSelection.push(item); |
| | | }); |
| | | } |
| | | } else { |
| | | console.log('åæ¶éæ©æä½'); |
| | | row.isChecked = false; |
| | | this.removeSelectionAndChildren(row); |
| | | } |
| | | } |
| | | }, |
| | | |
| | | removeSelectionAndChildren(row) { |
| | | this.toggleSelection(row, false); |
| | | this.multipleSelection = this.multipleSelection.filter(item => item !== row); |
| | | if (row.children) { |
| | | row.children.forEach((child) => { |
| | | this.toggleSelection(child, false); |
| | | child.isChecked = false; |
| | | this.removeSelectionAndChildren(child); // éå½ç§»é¤ |
| | | }); |
| | | } |
| | | }, |
| | | // æ°æ®è¡ç¹å»å±å¼çæ¹æ³ |
| | | expandChange(record, expanded) { |
| | | if (expanded) { |
| | | this.expandedData.push(record[this.rowKey]); |
| | | } else { |
| | | this.expandedData = this.expandedData.filter( |
| | | (key) => key !== record[this.rowKey] |
| | | ); |
| | | } |
| | | }, |
| | | //æ ç¶è¡¨æ ¼å
¨é |
| | | selectAll(selection) { |
| | | |
| | | if (this.checktype == "check") { |
| | | this.isCheckedAll = !this.isCheckedAll; |
| | | if (this.isCheckedAll) { |
| | | this.$refs.multipleTable.data.map((items) => { |
| | | if (!items.isChecked) { |
| | | items.isChecked = true; |
| | | this.toggleSelection(items, true); |
| | | this.multipleSelection.push(items); |
| | | |
| | | if ( |
| | | this.expandedData.indexOf(items[this.rowKey]) > -1 && |
| | | items.children |
| | | ) { |
| | | items.children.map((item) => { |
| | | this.toggleSelection(item, true); |
| | | item.isChecked = true; |
| | | this.multipleSelection.push(item); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | } else { |
| | | this.$refs.multipleTable.data.map((items) => { |
| | | this.toggleSelection(items, false); |
| | | items.isChecked = false; |
| | | if (items.children) { |
| | | items.children.map((item) => { |
| | | this.toggleSelection(item, false); |
| | | item.isChecked = false; |
| | | }); |
| | | } |
| | | }); |
| | | this.multipleSelection = []; |
| | | } |
| | | }else{ |
| | | this.clearSection() |
| | | } |
| | | }, |
| | | setIsCheckedAll(data) { |
| | | let num = 0; |
| | | |
| | | let arrlist = this.$refs.multipleTable.data.map((item) => { |
| | | return item[this.rowKey]; |
| | | }); |
| | | if (data.length) { |
| | | data.forEach((item) => { |
| | | if (item.isChecked && arrlist.indexOf(item[this.rowKey]) > -1) { |
| | | num += 1; |
| | | } |
| | | }); |
| | | if (num == this.$refs.multipleTable.data.length) { |
| | | this.isCheckedAll = true; |
| | | } else { |
| | | this.isCheckedAll = false; |
| | | } |
| | | } else { |
| | | this.isCheckedAll = false; |
| | | } |
| | | }, |
| | | clickFun(info, type) { |
| | | switch (type) { |
| | | case 4: |
| | | this.$emit("checkLook", info); |
| | | break; |
| | | } |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .overClass { |
| | | /* white-space: pre-wrap; */ |
| | | width: 100% !important; |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | } |
| | | /* .el-table .warning-row { |
| | | background: oldlace; |
| | | } |
| | | .el-table .success-row { |
| | | background: #f0f9eb; |
| | | } */ |
| | | |
| | | /* .app-container /deep/ .el-table, .el-table__expanded-cell { |
| | | background-color: transparent; |
| | | } |
| | | .app-container /deep/ .el-table tr { |
| | | background-color: transparent!important; |
| | | } |
| | | .app-container /deep/ .el-table--enable-row-transition .el-table__body td, .el-table .cell{ |
| | | background-color: transparent; |
| | | } */ |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | elementHeight: null, |
| | | contHeight: null |
| | | } |
| | | }, |
| | | created() { |
| | | this.getElHeight(0); |
| | | }, |
| | | mounted() { |
| | | window.addEventListener('resize', this.getElHeight) |
| | | }, |
| | | beforeDestroy() { |
| | | window.removeEventListener('resize', this.getElHeight); // 移é¤çªå£å¤§å°ååçå¬å¨ |
| | | }, |
| | | methods: { |
| | | // è®¾ç½®è¡¨æ ¼é«åº¦ |
| | | getElHeight(num) { |
| | | this.$nextTick(() => { |
| | | this.elementHeight = |
| | | this.$refs.contBox.$el.clientHeight - |
| | | this.$refs.headBox.offsetHeight - |
| | | 124 - |
| | | this.$refs.pagination.offsetHeight + num; |
| | | }); |
| | | }, |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | // ç»æå¼ |
| | | export const testVal = '100' |
| | | // æ°æ®JSON |
| | | export const testValJson = '150' |
| | | // è¿ç¨ç»æ1 |
| | | export const testVal1 = '110' |
| | | // ææ¯è¦æ± |
| | | // export const testVal2 = '180' |
| | | // è¿ç¨ç»æ2 |
| | | export const testVal2 = '110' |
| | | // è¿ç¨ç»æ3 |
| | | export const testVal3 = '110' |
| | | // è¿ç¨ç»æ4 |
| | | export const testVal4 = '110' |
| | | // è¿ç¨ç»æ5 |
| | | export const testVal5 = '110' |
| | | // æè¿° |
| | | export const description = '160' |
| | | // æåæ´æ°äººå§å |
| | | export const lastUpdatedUserName = '120' |
| | | // æåæ´æ°æ¥ææ¶é´ |
| | | export const lastUpdatedDateTime = '160' |
¶Ô±ÈÐÂÎļþ |
| | |
| | | // æ£éªé¡¹ç®ç¼å· |
| | | export const checkItemNo = '150' |
| | | // æ£éªé¡¹ç®å称 |
| | | export const checkItemName = '150' |
| | | // ç»è®¡ç±»å |
| | | export const checkType = '80' |
| | | // ææ¯è¦æ± |
| | | export const checkStandard = '180' |
| | | // åèæ åå¼ |
| | | export const standardVal = '150' |
| | | // åèä¸éå¼ |
| | | export const standardHigh = '100' |
| | | // åèä¸éå¼ |
| | | export const standardLow = '100' |
| | | // æ£éªå·¥å
· |
| | | export const checkTool = '180' |
| | | // æ¯å¦èªå¨å¤æ |
| | | export const isAutoCheck = '120' |
| | | // æ¯å¦å¿
å¡« |
| | | export const isToSpc = '80' |
| | | // åä½ |
| | | export const unit = '100' |
| | | // æ¯å¦å¯ç¨ |
| | | export const status = '80' |
| | | // å¤æ³¨ |
| | | export const description = '160' |
| | | // æåæ´æ°äººå§å |
| | | export const lastUpdatedUserName = '120' |
| | | // æåæ´æ°æ¥ææ¶é´ |
| | | export const lastUpdatedDateTime = '160' |
| | | |
| | | // ç¼å· |
| | | export const noWidth = '150' |
| | | // å称 |
| | | export const nameWidth = '150' |
| | | // ç±»å |
| | | export const classWidth = '80' |
| | | // è¦æ± |
| | | export const requireWidth = '180' |
| | | // å¤æ³¨ |
| | | export const descrWidth = '160' |
| | | // å·¥å
· |
| | | export const toolWidth = '180' |
| | | // æ¯å¦ |
| | | export const whetherWidth = '80' |
| | | // ç¶æ |
| | | export const statusWidth = '80' |
| | | // ä¸å¡ |
| | | export const businessWidth = '120' |
| | | // å®¡æ ¸äººåå§å |
| | | export const auditNameWidth = '100' |
| | | // æ¶é´ |
| | | export const timeWidth = '160' |
| | | // å·¥å |
| | | export const workWidth = '200' |
| | | // ä¾åºå |
| | | export const supplierWidth="180" |
| | | // istreeno |
| | | export const istreeno="200" |
| | | |
| | | |
| | | // æ£æµä»»å¡æ£æµé¡¹ |
| | | export const testItem="150" |
| | | |
| | | export const testWidth="500" |
| | | export const top="130" |
| | | export const checkResult="300" |
| | | export const action="100" |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <!-- æ·»å æä¿®æ¹IQCæ£éªé¡¹ç®å¯¹è¯æ¡ --> |
| | | <el-dialog |
| | | :title="title" |
| | | :visible.sync="open" |
| | | width="750px" |
| | | custom-class="madelClass" |
| | | :destroyOnClose="true" |
| | | > |
| | | <div class="contbox"> |
| | | <el-form |
| | | ref="form" |
| | | v-if="open" |
| | | :model="form" |
| | | :rules="rules" |
| | | :disabled="isCheck" |
| | | > |
| | | <el-form-item |
| | | v-for="(item, index) in formItem" |
| | | :key="index" |
| | | :label="item.label" |
| | | :prop="item.prop" |
| | | label-width="120px" |
| | | :class="item.component == 'inputNumber' ? 'itemFixed' : ''" |
| | | > |
| | | <template v-if="item.component == 'input'"> |
| | | <el-input |
| | | v-model="form[item.prop]" |
| | | :readonly="item.readonly" |
| | | :placeholder=" |
| | | item.prop == 'checkItemNo' ? 'èªå¨çæ' : '请è¾å
¥' + item.label |
| | | " |
| | | /> |
| | | </template> |
| | | <template v-if="item.component == 'inputNumber'"> |
| | | <el-input-number |
| | | v-model="form[item.prop]" |
| | | :label="'请è¾å
¥' + item.label" |
| | | ></el-input-number> |
| | | </template> |
| | | <template v-if="item.component == 'textarea'"> |
| | | <el-input |
| | | type="textarea" |
| | | :rows="2" |
| | | :placeholder="'请è¾å
¥' + item.label" |
| | | v-model="form[item.prop]" |
| | | > |
| | | </el-input> |
| | | </template> |
| | | <template v-if="item.component == 'select'"> |
| | | <template v-if="item.prop == 'checkType'"> |
| | | <el-select |
| | | v-model="form[item.prop]" |
| | | :placeholder="'请éæ©' + item.label" |
| | | v-if="item.prop == 'checkType'" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="dict in dict.type.check_type" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </template> |
| | | |
| | | <template v-if="item.prop == 'locationGroupNo'"> |
| | | <el-select |
| | | v-model="form[item.prop]" |
| | | :placeholder="'请éæ©' + item.label" |
| | | v-if="item.prop == 'locationGroupNo'" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="dict in dict.type.check_type" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </template> |
| | | |
| | | <template v-if="item.prop == 'isAutoCheck'"> |
| | | <el-select |
| | | v-model="form[item.prop]" |
| | | :placeholder="'请éæ©' + item.label" |
| | | |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="dict in dict.type.is_auto_check" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </template> |
| | | <template v-if="item.prop == 'isRequired'"> |
| | | <el-select |
| | | v-model="form[item.prop]" |
| | | :placeholder="'请éæ©' + item.label" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="dict in dict.type.is_required" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </template> |
| | | <template v-if="item.prop == 'isToSpc'"> |
| | | <el-select |
| | | v-model="form[item.prop]" |
| | | :placeholder="'请éæ©' + item.label" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="dict in dict.type.is_to_spc" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </template> |
| | | <template v-if="item.prop == 'status'"> |
| | | <el-select |
| | | v-model="form[item.prop]" |
| | | :placeholder="'请éæ©' + item.label" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="dict in dict.type.status" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </template> |
| | | </template> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button |
| | | v-if="!isCheck" |
| | | :loading="buttonLoading" |
| | | type="primary" |
| | | @click="submitForm" |
| | | >ç¡® å®</el-button |
| | | > |
| | | <el-button @click="cancel">å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import { formatData, formrRquired, formatDataItem } from "./info.data"; |
| | | import { getLocation, addLocation, updateLocation } from "@/api/basicData/location"; |
| | | |
| | | export default { |
| | | name: "checkItemAdd", |
| | | components: {}, |
| | | dicts: ["check_type", "is_auto_check", "is_required", "is_to_spc", "status"], |
| | | data() { |
| | | return { |
| | | form: JSON.parse(JSON.stringify(formatData)), |
| | | rules: formrRquired, |
| | | open: false, |
| | | title: "", |
| | | buttonLoading: false, |
| | | isCheck: false, |
| | | }; |
| | | }, |
| | | |
| | | computed: { |
| | | formItem() { |
| | | return formatDataItem; |
| | | }, |
| | | }, |
| | | watch:{ |
| | | open(val){ |
| | | if(!val){ |
| | | this.$refs["form"].resetFields(); |
| | | |
| | | } |
| | | |
| | | } |
| | | }, |
| | | mounted() {}, |
| | | methods: { |
| | | /** æ交æé® */ |
| | | submitForm() { |
| | | this.$refs["form"].validate((valid) => { |
| | | if (valid) { |
| | | this.buttonLoading = true; |
| | | if (this.form.checkItemId != null) { |
| | | updateLocation(this.form) |
| | | .then((response) => { |
| | | this.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | this.open = false; |
| | | this.$emit("getList"); |
| | | }) |
| | | .finally(() => { |
| | | this.buttonLoading = false; |
| | | }); |
| | | } else { |
| | | addLocation(this.form) |
| | | .then((response) => { |
| | | this.$modal.msgSuccess("æ°å¢æå"); |
| | | this.open = false; |
| | | this.$emit("getList"); |
| | | }) |
| | | .finally(() => { |
| | | this.buttonLoading = false; |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | // åæ¶æé® |
| | | cancel() { |
| | | this.reset(); |
| | | }, |
| | | reset() { |
| | | this.$refs["form"].resetFields(); |
| | | this.open = false; |
| | | this.isCheck = false; |
| | | }, |
| | | elDialogShow(type, info = "") { |
| | | this.open = true; |
| | | if (type == 1) { |
| | | this.title = "æ£æµé¡¹ç®æ·»å "; |
| | | this.isCheck = false; |
| | | } else if (type == 2) { |
| | | this.isCheck = false; |
| | | this.getDetailse(info); |
| | | this.title = "æ£æµé¡¹ç®ç¼è¾"; |
| | | } else { |
| | | this.title = "æ£æµé¡¹ç®æ¥ç"; |
| | | this.isCheck = true; |
| | | this.getDetailse(info); |
| | | } |
| | | this.$nextTick(()=>{ |
| | | |
| | | }) |
| | | }, |
| | | getDetailse(id) { |
| | | getLocation(id).then((res) => { |
| | | if (res.code === 200) { |
| | | this.form = res.data; |
| | | } |
| | | }); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | .contbox { |
| | | max-height: 60vh !important; |
| | | overflow: auto; |
| | | box-sizing: border-box; |
| | | padding: 0 20px; |
| | | } |
| | | .itemFixed { |
| | | display: inline-block !important; |
| | | } |
| | | .itemFixed:first-child { |
| | | display: block !important; |
| | | } |
| | | ::v-deep .is-disabled .el-input__inner { |
| | | color: #606266 !important; |
| | | } |
| | | // ::v-deep .el-input.is-disabled .el-input__inner |
| | | </style> |
| | |
| | | <template> |
| | | <div class="box"> |
| | | <el-card class="box-card1"> |
| | | <div v-for="o in 4" :key="o" class="text item"> |
| | | {{'å表å
容 ' + o }} |
| | | </div> |
| | | </el-card> |
| | | <el-card class="box-card2"> |
| | | <div v-for="o in 4" :key="o" class="text item"> |
| | | {{'å表å
容 ' + o }} |
| | | </div> |
| | | </el-card> |
| | | <div> |
| | | <el-menu |
| | | class="sidebar-el-menu" |
| | | background-color="white" |
| | | text-color="#7a8297" |
| | | active-text-color="#2d8cf0" |
| | | > |
| | | <div v-for="(item, index) in leftListdata" :key="item.werksId"> |
| | | <!-- ä¸çº§èå --> |
| | | <el-menu-item |
| | | :index="index.toString()" |
| | | :class="{ 'is-active': currentIndex === index.toString() }" |
| | | v-if="item.detailList == null" |
| | | @click="handleClick(item, index.toString())" |
| | | > |
| | | <span slot="title">{{ item.werksName }}</span> |
| | | </el-menu-item> |
| | | <!-- äºçº§èå --> |
| | | <el-submenu |
| | | :index="index.toString()" |
| | | v-else |
| | | > |
| | | <template #title> |
| | | <span>{{ item.werksName }}</span> |
| | | </template> |
| | | <el-menu-item-group :class="{ 'is-active': currentIndex === index.toString() }"> |
| | | <el-menu-item |
| | | v-for="(it, subIndex) in item.detailList" |
| | | :key="it.warehouseId" |
| | | :index="`${index}-${subIndex}`" |
| | | :class="{ 'is-active': currentIndex === `${index}-${subIndex}` }" |
| | | @click="handleClick(it, `${index}-${subIndex}`)" |
| | | > |
| | | {{ it.warehouseName }} |
| | | </el-menu-item> |
| | | </el-menu-item-group> |
| | | </el-submenu> |
| | | </div> |
| | | </el-menu> |
| | | </div> |
| | | </el-card> |
| | | <!-- å³ä¾§ --> |
| | | <el-card class="box-card2"> |
| | | <div class="box1"> |
| | | <el-form |
| | | :model="queryParams" |
| | | ref="queryForm" |
| | | size="small" |
| | | :inline="true" |
| | | v-show="showSearch" |
| | | label-width="68px" |
| | | > |
| | | <el-form-item label="ä»åº" prop="lgort"> |
| | | <el-input |
| | | v-model="queryParams.lgort" |
| | | placeholder="请è¾å
¥ä»åº" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="å称" prop="locationName"> |
| | | <el-input |
| | | v-model="queryParams.locationName" |
| | | placeholder="请è¾å
¥å称" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="ç¶æ" prop="state"> |
| | | <el-input |
| | | v-model="queryParams.state" |
| | | placeholder="请è¾å
¥ç¶æ" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button |
| | | type="primary" |
| | | icon="el-icon-search" |
| | | size="mini" |
| | | @click="handleQuery" |
| | | >æç´¢</el-button |
| | | > |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery" |
| | | >éç½®</el-button |
| | | > |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="el-icon-plus" |
| | | size="mini" |
| | | @click="handleAdd" |
| | | v-hasPermi="['system:location:add']" |
| | | >æ°å¢</el-button |
| | | > |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="success" |
| | | plain |
| | | icon="el-icon-edit" |
| | | size="mini" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['system:location:edit']" |
| | | >ä¿®æ¹</el-button |
| | | > |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="el-icon-delete" |
| | | size="mini" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['system:location:remove']" |
| | | >å é¤</el-button |
| | | > |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="el-icon-download" |
| | | size="mini" |
| | | @click="handleExport" |
| | | v-hasPermi="['system:location:export']" |
| | | >导åº</el-button |
| | | > |
| | | </el-col> |
| | | <right-toolbar |
| | | :showSearch.sync="showSearch" |
| | | @queryTable="getList" |
| | | ></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table |
| | | v-loading="loading" |
| | | border |
| | | :data="locationList" |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="åºå·" type="index" fixed width="50" /> |
| | | <!-- <el-table-column label="åºä½ID" align="center" prop="locationId" v-if="true"/> --> |
| | | <el-table-column |
| | | label="é¶å±åºä½ID" |
| | | align="center" |
| | | prop="parentLocationId" |
| | | /> |
| | | <el-table-column label="ä»åº" align="center" prop="lgort" /> |
| | | <el-table-column label="åºä½åºå·" align="center" prop="locationNo" /> |
| | | <el-table-column label="å称" align="center" prop="locationName" /> |
| | | <el-table-column label="å·¥å" align="center" prop="werks" /> |
| | | <el-table-column label="ç±»å" align="center" prop="type" /> |
| | | <el-table-column |
| | | label="ä½ç§¯éå¶" |
| | | align="center" |
| | | prop="volumeRestriction" |
| | | /> |
| | | <el-table-column label="éééå¶" align="center" prop="weightLimit" /> |
| | | <el-table-column |
| | | label="ç®±æ°éå¶" |
| | | align="center" |
| | | prop="containerNumberLimit" |
| | | /> |
| | | <el-table-column |
| | | label="æ°ééå¶" |
| | | align="center" |
| | | prop="quantitativeRestrictions" |
| | | /> |
| | | <el-table-column label="æçéå¶" align="center" prop="trayLimit" /> |
| | | <el-table-column label="é¿åº¦" align="center" prop="length" /> |
| | | <el-table-column label="宽" align="center" prop="width" /> |
| | | <el-table-column label="é«" align="center" prop="height" /> |
| | | <el-table-column label="åæ X" align="center" prop="coordinateX" /> |
| | | <el-table-column label="åæ Y" align="center" prop="coordinateY" /> |
| | | <el-table-column label="åæ Z" align="center" prop="coordinateZ" /> |
| | | <el-table-column label="åç´ X" align="center" prop="pixelX" /> |
| | | <el-table-column label="åç´ Y" align="center" prop="pixelY" /> |
| | | <el-table-column label="空é´å±æ°" align="center" prop="paceLayer" /> |
| | | <el-table-column |
| | | label="1-å
许" |
| | | align="center" |
| | | prop="allowMixedProduct" |
| | | /> |
| | | <el-table-column |
| | | label="1-å
许" |
| | | align="center" |
| | | prop="allowMixedProductLot" |
| | | /> |
| | | <el-table-column label="å±çº§" align="center" prop="layer" /> |
| | | <el-table-column label="1-åå¨" align="center" prop="hasChild" /> |
| | | <el-table-column label="è·¯å¾" align="center" prop="path" /> |
| | | <el-table-column label="æè¿°" align="center" prop="description" /> |
| | | <!-- <el-table-column label="ç¶æ" align="center" prop="state" /> --> |
| | | <el-table-column |
| | | label="æåæ´æ°äººid" |
| | | align="center" |
| | | prop="lastUpdatedUserId" |
| | | /> |
| | | <el-table-column |
| | | label="æåæ´æ°äººå§å" |
| | | align="center" |
| | | prop="lastUpdatedUserName" |
| | | /> |
| | | <el-table-column |
| | | label="æåæ´æ°æ¶é´" |
| | | align="center" |
| | | prop="lastUpdatedDateTime" |
| | | width="180" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <span>{{ |
| | | parseTime(scope.row.lastUpdatedDateTime, "{y}-{m}-{d}") |
| | | }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="æä½" |
| | | align="center" |
| | | class-name="small-padding fixed-width" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['system:location:edit']" |
| | | >ä¿®æ¹</el-button |
| | | > |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['system:location:remove']" |
| | | >å é¤</el-button |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="total > 0" |
| | | :total="total" |
| | | :page.sync="queryParams.pageNum" |
| | | :limit.sync="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | </div> |
| | | </el-card> |
| | | |
| | | <!-- æ·»å æä¿®æ¹åºä½å¯¹è¯æ¡ --> |
| | | <el-dialog |
| | | :title="title" |
| | | v-if="open" |
| | | :visible.sync="open" |
| | | width="500px" |
| | | append-to-body |
| | | > |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
| | | <!-- <el-form-item label="é¶å±åºä½ID" prop="parentLocationId"> |
| | | <el-input v-model="form.parentLocationId" placeholder="请è¾å
¥é¶å±åºä½ID" /> |
| | | </el-form-item> --> |
| | | <el-form-item label="ä»åº" prop="lgort"> |
| | | <el-input v-model="form.lgort" placeholder="请è¾å
¥ä»åº" /> |
| | | </el-form-item> |
| | | <el-form-item label="åºä½åºå·" prop="locationNo"> |
| | | <el-input v-model="form.locationNo" placeholder="请è¾å
¥åºä½åºå·" /> |
| | | </el-form-item> |
| | | <el-form-item label="å称" prop="locationName"> |
| | | <el-input v-model="form.locationName" placeholder="请è¾å
¥å称" /> |
| | | </el-form-item> |
| | | <el-form-item label="å·¥å" prop="werks"> |
| | | <!-- <el-input v-model="form.werks" placeholder="请è¾å
¥å·¥å" /> --> |
| | | <el-select |
| | | v-model="form.werks" |
| | | placeholder="请éæ©å·¥å" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="dict in werksList" |
| | | :key="dict.werks" |
| | | :label="dict.werksName" |
| | | :value="dict.werks" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="ä½ç§¯éå¶" prop="volumeRestriction"> |
| | | <el-input |
| | | v-model.number="form.volumeRestriction" |
| | | placeholder="请è¾å
¥ä½ç§¯éå¶" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="éééå¶" prop="weightLimit"> |
| | | <el-input |
| | | v-model.number="form.weightLimit" |
| | | placeholder="请è¾å
¥éééå¶" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="ç®±æ°éå¶" prop="containerNumberLimit"> |
| | | <el-input |
| | | v-model.number="form.containerNumberLimit" |
| | | placeholder="请è¾å
¥ç®±æ°éå¶" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="æ°ééå¶" prop="quantitativeRestrictions"> |
| | | <el-input |
| | | v-model.number="form.quantitativeRestrictions" |
| | | placeholder="请è¾å
¥æ°ééå¶" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="æçéå¶" prop="trayLimit"> |
| | | <el-input v-model="form.trayLimit" placeholder="请è¾å
¥æçéå¶" /> |
| | | </el-form-item> |
| | | <el-form-item label="é¿åº¦" prop="length"> |
| | | <el-input v-model.number="form.length" placeholder="请è¾å
¥é¿åº¦" /> |
| | | </el-form-item> |
| | | <el-form-item label="宽" prop="width"> |
| | | <el-input v-model.number="form.width" placeholder="请è¾å
¥å®½" /> |
| | | </el-form-item> |
| | | <el-form-item label="é«" prop="height"> |
| | | <el-input v-model.number="form.height" placeholder="请è¾å
¥é«" /> |
| | | </el-form-item> |
| | | <el-form-item label="åæ X" prop="coordinateX"> |
| | | <el-input v-model="form.coordinateX" placeholder="请è¾å
¥åæ X" /> |
| | | </el-form-item> |
| | | <el-form-item label="åæ Y" prop="coordinateY"> |
| | | <el-input v-model="form.coordinateY" placeholder="请è¾å
¥åæ Y" /> |
| | | </el-form-item> |
| | | <el-form-item label="åæ Z" prop="coordinateZ"> |
| | | <el-input v-model="form.coordinateZ" placeholder="请è¾å
¥åæ Z" /> |
| | | </el-form-item> |
| | | <el-form-item label="åç´ X" prop="pixelX"> |
| | | <el-input v-model="form.pixelX" placeholder="请è¾å
¥åç´ X" /> |
| | | </el-form-item> |
| | | <el-form-item label="åç´ Y" prop="pixelY"> |
| | | <el-input v-model="form.pixelY" placeholder="请è¾å
¥åç´ Y" /> |
| | | </el-form-item> |
| | | <el-form-item label="空é´å±æ°" prop="paceLayer"> |
| | | <el-input v-model="form.paceLayer" placeholder="请è¾å
¥ç©ºé´å±æ°" /> |
| | | </el-form-item> |
| | | <el-form-item label="æ¯å¦å
许" prop="allowMixedProduct"> |
| | | <el-input |
| | | v-model="form.allowMixedProduct" |
| | | placeholder="请è¾å
¥1-å
许" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="æ¯å¦å
许" prop="allowMixedProductLot"> |
| | | <el-input |
| | | v-model="form.allowMixedProductLot" |
| | | placeholder="请è¾å
¥1-å
许" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="å±çº§" prop="layer"> |
| | | <el-input v-model="form.layer" placeholder="请è¾å
¥å±çº§" /> |
| | | </el-form-item> |
| | | <el-form-item label="æ¯å¦åå¨" prop="hasChild"> |
| | | <el-input v-model="form.hasChild" placeholder="请è¾å
¥1-åå¨" /> |
| | | </el-form-item> |
| | | <el-form-item label="è·¯å¾" prop="path"> |
| | | <el-input v-model="form.path" placeholder="请è¾å
¥è·¯å¾" /> |
| | | </el-form-item> |
| | | <el-form-item label="æè¿°" prop="description"> |
| | | <el-input v-model="form.description" placeholder="请è¾å
¥æè¿°" /> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="ç¶æ" prop="state"> |
| | | <el-input v-model="form.state" placeholder="请è¾å
¥ç¶æ" /> |
| | | </el-form-item> --> |
| | | <!-- <el-form-item label="æåæ´æ°äººid" prop="lastUpdatedUserId"> |
| | | <el-input v-model="form.lastUpdatedUserId" placeholder="请è¾å
¥æåæ´æ°äººid" /> |
| | | </el-form-item> |
| | | <el-form-item label="æåæ´æ°äººå§å" prop="lastUpdatedUserName"> |
| | | <el-input v-model="form.lastUpdatedUserName" placeholder="请è¾å
¥æåæ´æ°äººå§å" /> |
| | | </el-form-item> |
| | | <el-form-item label="æåæ´æ°æ¶é´" prop="lastUpdatedDateTime"> |
| | | <el-date-picker clearable |
| | | v-model="form.lastUpdatedDateTime" |
| | | type="datetime" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | placeholder="请éæ©æåæ´æ°æ¶é´"> |
| | | </el-date-picker> |
| | | </el-form-item> --> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button :loading="buttonLoading" type="primary" @click="submitForm" |
| | | >ç¡® å®</el-button |
| | | > |
| | | <el-button @click="cancel">å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | import { |
| | | listLocation, |
| | | getLocation, |
| | | delLocation, |
| | | addLocation, |
| | | updateLocation, |
| | | listWaresList, |
| | | listwerkshouse, |
| | | } from "@/api/basicData/location"; |
| | | |
| | | } |
| | | export default { |
| | | name: "Location", |
| | | data() { |
| | | return { |
| | | // æé®loading |
| | | buttonLoading: false, |
| | | // é®ç½©å± |
| | | loading: true, |
| | | // éä¸æ°ç» |
| | | ids: [], |
| | | // éå个ç¦ç¨ |
| | | single: true, |
| | | // éå¤ä¸ªç¦ç¨ |
| | | multiple: true, |
| | | // æ¾ç¤ºæç´¢æ¡ä»¶ |
| | | showSearch: true, |
| | | // æ»æ¡æ° |
| | | total: 0, |
| | | // åºä½è¡¨æ ¼æ°æ® |
| | | locationList: [], |
| | | // å¼¹åºå±æ é¢ |
| | | title: "", |
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå± |
| | | open: false, |
| | | // æ¥è¯¢åæ° |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | lgort: undefined, |
| | | locationName: undefined, |
| | | warehouseName:undefined, |
| | | werks:undefined, |
| | | lgort:undefined, |
| | | type: undefined, |
| | | state: undefined, |
| | | }, |
| | | // 表ååæ° |
| | | form: {}, |
| | | werksList: [], |
| | | leftListdata: [], |
| | | currentIndex: null, |
| | | defaultProps: { |
| | | children: "detailList", |
| | | label: "werksName", |
| | | }, |
| | | // 表åæ ¡éª |
| | | rules: { |
| | | // locationId: [ |
| | | // { required: true, message: "åºä½IDä¸è½ä¸ºç©º", trigger: "blur" } |
| | | // ], |
| | | parentLocationId: [ |
| | | { required: true, message: "é¶å±åºä½IDä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | ], |
| | | lgort: [{ required: true, message: "ä»åºä¸è½ä¸ºç©º", trigger: "blur" }], |
| | | locationNo: [ |
| | | { required: true, message: "åºä½åºå·ä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | ], |
| | | locationName: [ |
| | | { required: true, message: "å称ä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | ], |
| | | werks: [{ required: true, message: "å·¥åä¸è½ä¸ºç©º", trigger: "blur" }], |
| | | type: [{ required: true, message: "ç±»åä¸è½ä¸ºç©º", trigger: "change" }], |
| | | volumeRestriction: [ |
| | | { required: true, message: "ä½ç§¯éå¶ä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | ], |
| | | weightLimit: [ |
| | | { required: true, message: "éééå¶ä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | ], |
| | | containerNumberLimit: [ |
| | | { required: true, message: "ç®±æ°éå¶ä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | ], |
| | | quantitativeRestrictions: [ |
| | | { required: true, message: "æ°ééå¶ä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | ], |
| | | trayLimit: [ |
| | | { required: true, message: "æçéå¶ä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | ], |
| | | length: [{ required: true, message: "é¿åº¦ä¸è½ä¸ºç©º", trigger: "blur" }], |
| | | width: [{ required: true, message: "宽ä¸è½ä¸ºç©º", trigger: "blur" }], |
| | | height: [{ required: true, message: "é«ä¸è½ä¸ºç©º", trigger: "blur" }], |
| | | coordinateX: [ |
| | | { required: true, message: "åæ Xä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | ], |
| | | coordinateY: [ |
| | | { required: true, message: "åæ Yä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | ], |
| | | coordinateZ: [ |
| | | { required: true, message: "åæ Zä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | ], |
| | | pixelX: [{ required: true, message: "åç´ Xä¸è½ä¸ºç©º", trigger: "blur" }], |
| | | pixelY: [{ required: true, message: "åç´ Yä¸è½ä¸ºç©º", trigger: "blur" }], |
| | | paceLayer: [ |
| | | { required: true, message: "空é´å±æ°ä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | ], |
| | | allowMixedProduct: [ |
| | | { required: true, message: "1-å
许ä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | ], |
| | | allowMixedProductLot: [ |
| | | { required: true, message: "1-å
许ä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | ], |
| | | layer: [{ required: true, message: "å±çº§ä¸è½ä¸ºç©º", trigger: "blur" }], |
| | | hasChild: [ |
| | | { required: true, message: "1-åå¨ä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | ], |
| | | path: [{ required: true, message: "è·¯å¾ä¸è½ä¸ºç©º", trigger: "blur" }], |
| | | description: [ |
| | | { required: true, message: "æè¿°ä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | ], |
| | | // state: [{ required: true, message: "ç¶æä¸è½ä¸ºç©º", trigger: "blur" }], |
| | | displayOrder: [ |
| | | { required: true, message: "æåºä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | ], |
| | | createdUserId: [ |
| | | { required: true, message: "å建人idä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | ], |
| | | createdUserName: [ |
| | | { required: true, message: "å建人å§åä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | ], |
| | | createdDateTime: [ |
| | | { required: true, message: "å建æ¥ææ¶é´ä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | ], |
| | | lastUpdatedUserId: [ |
| | | { required: true, message: "æåæ´æ°äººidä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | ], |
| | | lastUpdatedUserName: [ |
| | | { |
| | | required: true, |
| | | message: "æåæ´æ°äººå§åä¸è½ä¸ºç©º", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | lastUpdatedDateTime: [ |
| | | { required: true, message: "æåæ´æ°æ¶é´ä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | ], |
| | | isDeleted: [ |
| | | { required: true, message: "æ¯å¦å é¤ä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | ], |
| | | }, |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | this.leftList(); |
| | | }, |
| | | methods: { |
| | | /** æ¥è¯¢åºä½å表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | listLocation(this.queryParams).then((response) => { |
| | | this.locationList = response.rows; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | leftList() { |
| | | listWaresList().then((res) => { |
| | | console.log(res, "左侧æ°æ®ä¿¡æ¯"); |
| | | this.leftListdata = res.data; |
| | | }); |
| | | |
| | | listwerkshouse({ |
| | | pageNum: 1, |
| | | pageSize: 99, |
| | | }).then((res) => { |
| | | console.log(res, "å·¥å"); |
| | | this.werksList = res.rows; |
| | | }); |
| | | }, |
| | | // åæ¶æé® |
| | | cancel() { |
| | | this.open = false; |
| | | this.reset(); |
| | | }, |
| | | // 表åéç½® |
| | | reset() { |
| | | this.form = { |
| | | locationId: undefined, |
| | | parentLocationId: undefined, |
| | | lgort: undefined, |
| | | locationNo: undefined, |
| | | locationName: undefined, |
| | | werks: undefined, |
| | | type: undefined, |
| | | volumeRestriction: undefined, |
| | | weightLimit: undefined, |
| | | containerNumberLimit: undefined, |
| | | quantitativeRestrictions: undefined, |
| | | trayLimit: undefined, |
| | | length: undefined, |
| | | width: undefined, |
| | | height: undefined, |
| | | coordinateX: undefined, |
| | | coordinateY: undefined, |
| | | coordinateZ: undefined, |
| | | pixelX: undefined, |
| | | pixelY: undefined, |
| | | paceLayer: undefined, |
| | | allowMixedProduct: undefined, |
| | | allowMixedProductLot: undefined, |
| | | layer: undefined, |
| | | hasChild: undefined, |
| | | path: undefined, |
| | | description: undefined, |
| | | state: undefined, |
| | | displayOrder: undefined, |
| | | createdUserId: undefined, |
| | | createdUserName: undefined, |
| | | createdDateTime: undefined, |
| | | lastUpdatedUserId: undefined, |
| | | lastUpdatedUserName: undefined, |
| | | lastUpdatedDateTime: undefined, |
| | | isDeleted: undefined, |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | | /** æç´¢æé®æä½ */ |
| | | handleQuery() { |
| | | this.queryParams.pageNum = 1; |
| | | this.getList(); |
| | | }, |
| | | /** éç½®æé®æä½ */ |
| | | resetQuery() { |
| | | this.resetForm("queryForm"); |
| | | this.handleQuery(); |
| | | }, |
| | | // å¤éæ¡éä¸æ°æ® |
| | | handleSelectionChange(selection) { |
| | | this.ids = selection.map((item) => item.locationId); |
| | | this.single = selection.length !== 1; |
| | | this.multiple = !selection.length; |
| | | }, |
| | | /** æ°å¢æé®æä½ */ |
| | | handleAdd() { |
| | | this.reset(); |
| | | this.open = true; |
| | | this.title = "æ·»å åºä½"; |
| | | }, |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | handleUpdate(row) { |
| | | this.loading = true; |
| | | this.reset(); |
| | | const locationId = row.locationId || this.ids; |
| | | getLocation(locationId).then((response) => { |
| | | this.loading = false; |
| | | this.form = response.data; |
| | | this.open = true; |
| | | this.title = "ä¿®æ¹åºä½"; |
| | | }); |
| | | }, |
| | | /** æ交æé® */ |
| | | submitForm() { |
| | | this.$refs["form"].validate((valid) => { |
| | | if (valid) { |
| | | this.buttonLoading = true; |
| | | if (this.form.locationId != null) { |
| | | updateLocation(this.form) |
| | | .then((response) => { |
| | | this.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }) |
| | | .finally(() => { |
| | | this.buttonLoading = false; |
| | | }); |
| | | } else { |
| | | addLocation(this.form) |
| | | .then((response) => { |
| | | this.$modal.msgSuccess("æ°å¢æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }) |
| | | .finally(() => { |
| | | this.buttonLoading = false; |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | /** å é¤æé®æä½ */ |
| | | handleDelete(row) { |
| | | const locationIds = row.locationId || this.ids; |
| | | this.$modal |
| | | .confirm('æ¯å¦ç¡®è®¤å é¤åºä½ç¼å·ä¸º"' + locationIds + '"çæ°æ®é¡¹ï¼') |
| | | .then(() => { |
| | | this.loading = true; |
| | | return delLocation(locationIds); |
| | | }) |
| | | .then(() => { |
| | | this.loading = false; |
| | | this.getList(); |
| | | this.$modal.msgSuccess("å é¤æå"); |
| | | }) |
| | | .catch(() => {}) |
| | | .finally(() => { |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | /** 导åºæé®æä½ */ |
| | | handleExport() { |
| | | this.download( |
| | | "system/location/export", |
| | | { |
| | | ...this.queryParams, |
| | | }, |
| | | `location_${new Date().getTime()}.xlsx` |
| | | ); |
| | | }, |
| | | handleClick(item, index) { |
| | | this.currentIndex = index; |
| | | if (item.lgort) { |
| | | this.queryParams.lgort = item.lgort; |
| | | this.getList(); |
| | | }else{ |
| | | this.queryParams.werks = item.werks; |
| | | this.getList(); |
| | | } |
| | | console.log(item); // å¤çç¹å»äºä»¶ï¼å¯ä»¥å¨è¿éè·åå°å½åç¹å»è¡çä¿¡æ¯ |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | |
| | | <style scoped> |
| | | .box{ |
| | | .box { |
| | | width: 100%; |
| | | height: calc(100vh - 124px); |
| | | display: flex; |
| | | padding: 20px; |
| | | padding: 20px 10px 0; |
| | | background-color: #f0f0f0; |
| | | } |
| | | .box-card1{ |
| | | .box-card1 { |
| | | width: 20%; |
| | | height: 100%; |
| | | background-color: #4b0f0f; |
| | | background-color: #fff; |
| | | margin-right: 10px; |
| | | } |
| | | .box-card2{ |
| | | .box-card2 { |
| | | width: 80%; |
| | | height: 100%; |
| | | background-color: #58c8eb; |
| | | background-color: #fff; |
| | | } |
| | | .box1 { |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | |
| | | .is-active { |
| | | background-color: #2d8cf0 !important; /* é«äº®é¢è² */ |
| | | } |
| | | |
| | | ::v-deep .el-menu-item { |
| | | border: none !important; /* ä½¿ç¨ !important æ¥ç¡®ä¿è¦çé»è®¤æ ·å¼ */ |
| | | } |
| | | |
| | | /* å¦æè¾¹æ¡æ¯ç± submenu å¼èµ·çï¼å¯ä»¥è¿æ ·å */ |
| | | ::v-deep .el-submenu .el-submenu__title { |
| | | border: none !important; |
| | | } |
| | | |
| | | ::v-deep .box-card1 > .el-card__body{ |
| | | padding: 20px 0 10px 10px !important; |
| | | } |
| | | </style> |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import * as vars from "@/variableSet/columns"; |
| | | |
| | | |
| | | export const columns = [ |
| | | { |
| | | label: 'æ£éªé¡¹ç®ç¼å·', |
| | | align: 'left', |
| | | prop: 'checkItemNo', |
| | | width: vars.checkItemNo, |
| | | fixed: 'left', |
| | | tooltip: true, |
| | | }, |
| | | { |
| | | label: 'æ£éªé¡¹ç®å称', |
| | | align: 'left', |
| | | prop: 'checkItemName', |
| | | width: vars.checkItemName, |
| | | fixed: 'left', |
| | | }, |
| | | { |
| | | label: 'ç»è®¡ç±»å', |
| | | prop: 'checkType', |
| | | width: vars.checkType, |
| | | dataType: 'slot', |
| | | slot: 'checkType' |
| | | }, |
| | | { |
| | | label: 'ææ¯è¦æ±', |
| | | align: 'left', |
| | | prop: 'checkStandard', |
| | | width: vars.checkStandard, |
| | | }, |
| | | { |
| | | label: 'åèæ åå¼', |
| | | align: 'left', |
| | | prop: 'standardVal', |
| | | width: vars.standardVal, |
| | | }, |
| | | { |
| | | label: 'åèä¸éå¼', |
| | | align: 'left', |
| | | prop: 'standardHigh', |
| | | width: vars.standardHigh, |
| | | }, |
| | | { |
| | | label: 'åèä¸éå¼', |
| | | align: 'left', |
| | | prop: 'standardLow', |
| | | width: vars.standardLow, |
| | | }, |
| | | { |
| | | label: 'æ£éªå·¥å
·', |
| | | align: 'left', |
| | | prop: 'checkTool', |
| | | width: vars.checkTool, |
| | | }, |
| | | { |
| | | label: 'æ¯å¦èªå¨å¤æ', |
| | | align: 'left', |
| | | prop: 'isAutoCheck', |
| | | width: vars.isAutoCheck, |
| | | dataType: 'slot', |
| | | slot: 'isAutoCheck' |
| | | |
| | | |
| | | }, |
| | | { |
| | | label: 'æ¯å¦å¿
å¡«', |
| | | align: 'left', |
| | | prop: 'isRequired', |
| | | width: vars.isRequired, |
| | | dataType: 'slot', |
| | | slot: 'isRequired' |
| | | }, |
| | | { |
| | | label: 'æ¯å¦SPC', |
| | | align: 'left', |
| | | prop: 'isToSpc', |
| | | width: vars.isToSpc, |
| | | dataType: 'slot', |
| | | slot: 'isToSpc' |
| | | }, |
| | | { |
| | | label: 'åä½', |
| | | align: 'left', |
| | | prop: 'unit', |
| | | width: vars.unit, |
| | | }, |
| | | { |
| | | label: 'æ¯å¦å¯ç¨', |
| | | prop: 'status', |
| | | width: vars.status, |
| | | dataType: 'slot', |
| | | slot: 'status' |
| | | }, |
| | | { |
| | | label: 'å¤æ³¨', |
| | | align: 'left', |
| | | prop: 'description', |
| | | width: vars.description, |
| | | tooltip: true, |
| | | }, |
| | | { |
| | | label: 'æåæ´æ°äººå§å', |
| | | align: 'left', |
| | | prop: 'lastUpdatedUserName', |
| | | width: vars.lastUpdatedUserName, |
| | | }, |
| | | { |
| | | label: 'æåæ´æ°æ¥ææ¶é´', |
| | | align: 'left', |
| | | prop: 'lastUpdatedDateTime', |
| | | width: vars.lastUpdatedDateTime, |
| | | }, |
| | | { |
| | | dataType: 'option', |
| | | label: 'æä½', |
| | | width: '80', |
| | | align: 'center', |
| | | fixed: 'right', |
| | | hasPermi: 'iqc_checkItem_check', |
| | | operation: [ |
| | | { |
| | | name: 'æ¥ç', |
| | | size: 'mini', |
| | | plain: true, |
| | | typeText: 4 |
| | | } |
| | | ] |
| | | |
| | | } |
| | | ]; |
| | | export const searchFormSchema = [ |
| | | { |
| | | field: 'checkItemNo', |
| | | label: 'æ£éªé¡¹ç®ç¼å·:', |
| | | labelWidth: 80, |
| | | component: 'Input', |
| | | componentProps: { |
| | | placeholder: '请è¾å
¥', |
| | | }, |
| | | }, |
| | | { |
| | | field: 'checkItemName', |
| | | label: 'æ£éªé¡¹ç®å称:', |
| | | labelWidth: 80, |
| | | component: 'Input', |
| | | componentProps: { |
| | | placeholder: '请è¾å
¥', |
| | | }, |
| | | }, |
| | | { |
| | | field: 'checkType', |
| | | label: 'ç»è®¡ç±»å:', |
| | | labelWidth: 80, |
| | | component: 'Select', |
| | | componentProps: { |
| | | options: [ |
| | | { label: 'å®æ§', value: 1 }, |
| | | { label: 'å®é', value: 3 }, |
| | | ], |
| | | }, |
| | | multiple: false, |
| | | }, |
| | | { |
| | | field: 'checkStandard', |
| | | label: 'ææ¯è¦æ±:', |
| | | labelWidth: 80, |
| | | component: 'Input', |
| | | componentProps: { |
| | | placeholder: '请è¾å
¥', |
| | | }, |
| | | }, |
| | | ]; |
| | | |
| | | export const formatData = { |
| | | checkItemId: undefined, |
| | | checkItemNo: undefined, |
| | | checkItemName: undefined, |
| | | bizType: 10, |
| | | checkItemType: undefined, |
| | | materialId: undefined, |
| | | materialCatagoryId: undefined, |
| | | procedureId: undefined, |
| | | checkItemCategoryId: undefined, |
| | | checkItemControlId: undefined, |
| | | checkItemControlType: undefined, |
| | | checkItemControlParameter: undefined, |
| | | checkTool: undefined, |
| | | checkType: undefined, |
| | | checkStandard: undefined, |
| | | standardVal: undefined, |
| | | upperDeviation: undefined, |
| | | lowerDeviation: undefined, |
| | | standardHigh: undefined, |
| | | standardLow: undefined, |
| | | unit: undefined, |
| | | isRequired: undefined, |
| | | isSelfExternal: undefined, |
| | | isAutoCheck: undefined, |
| | | isToSpc: undefined, |
| | | isSupplierCheckItem: undefined, |
| | | description: undefined, |
| | | displayOrder: undefined, |
| | | status: undefined, |
| | | createdUserId: undefined, |
| | | createdUserName: undefined, |
| | | createdDateTime: undefined, |
| | | lastUpdatedUserId: undefined, |
| | | lastUpdatedUserName: undefined, |
| | | lastUpdatedDateTime: undefined, |
| | | isDeleted: undefined |
| | | }; |
| | | |
| | | export const formrRquired = { |
| | | checkItemName: [ |
| | | { required: true, message: "æ£éªé¡¹ç®å称ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | checkType: [ |
| | | { required: true, message: "ç»è®¡ç±»å", trigger: "change" } |
| | | ], |
| | | unit: [ |
| | | { required: true, message: "计éåä½ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | upperDeviation: [{ |
| | | required: true, |
| | | message: "ä¸åå·®ä¸è½ä¸ºç©º", |
| | | trigger: "blur" |
| | | }], |
| | | lowerDeviation: [{ |
| | | required: true, |
| | | message: "ä¸åå·®ä¸è½ä¸ºç©º", |
| | | trigger: "blur" |
| | | }], |
| | | unit: [ |
| | | { required: true, message: "计éåä½ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | standardHigh: [{ |
| | | required: true, |
| | | message: "åèä¸éå¼ä¸è½ä¸ºç©º", |
| | | trigger: "blur" |
| | | }], |
| | | standardLow: [{ |
| | | required: true, |
| | | message: "åèä¸éå¼ä¸è½ä¸ºç©º", |
| | | trigger: "blur" |
| | | }], |
| | | } |
| | | export const formatDataItem = [ |
| | | { |
| | | label: "æ£éªé¡¹ç®ç¼å·", |
| | | prop: 'checkItemNo', |
| | | component: 'input', |
| | | readonly: true |
| | | }, |
| | | { |
| | | label: "æ£éªé¡¹ç®å称", |
| | | prop: 'checkItemName', |
| | | component: 'input' |
| | | |
| | | }, |
| | | { |
| | | label: "ç»è®¡ç±»å", |
| | | prop: 'checkType', |
| | | component: 'select', |
| | | }, |
| | | |
| | | { |
| | | label: "åºä½ç»", |
| | | prop: 'locationGroupNo', |
| | | component: 'select', |
| | | }, |
| | | { |
| | | label: "ææ¯è¦æ±", |
| | | prop: 'checkStandard', |
| | | component: 'input' |
| | | }, |
| | | { |
| | | label: "æ£éªå·¥å
·", |
| | | prop: 'checkTool', |
| | | component: 'input' |
| | | }, |
| | | { |
| | | label: "åèæ åå¼", |
| | | prop: 'standardVal', |
| | | component: 'inputNumber' |
| | | }, |
| | | { |
| | | label: "ä¸å
¬å·®", |
| | | prop: 'upperDeviation', |
| | | component: 'inputNumber' |
| | | }, |
| | | { |
| | | label: "ä¸å
¬å·®", |
| | | prop: 'lowerDeviation', |
| | | component: 'inputNumber' |
| | | }, |
| | | { |
| | | label: "åèä¸éå¼", |
| | | prop: 'standardHigh', |
| | | component: 'inputNumber' |
| | | }, |
| | | { |
| | | label: "åèä¸éå¼", |
| | | prop: 'standardLow', |
| | | component: 'inputNumber' |
| | | }, |
| | | { |
| | | label: "æ¯å¦èªå¨å¤æ", |
| | | prop: 'isAutoCheck', |
| | | component: 'select' |
| | | }, |
| | | { |
| | | label: "æ¯å¦å¿
å¡«", |
| | | prop: 'isRequired', |
| | | component: 'select' |
| | | }, |
| | | { |
| | | label: "æ¯å¦SPC", |
| | | prop: 'isToSpc', |
| | | component: 'select' |
| | | }, |
| | | { |
| | | label: "åä½", |
| | | prop: 'unit', |
| | | component: 'input' |
| | | }, |
| | | { |
| | | label: "å¤æ³¨", |
| | | prop: 'description', |
| | | component: 'textarea' |
| | | }, |
| | | { |
| | | label: "ç¶æ", |
| | | prop: 'status', |
| | | component: 'select' |
| | | }, |
| | | ] |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <!-- æ·»å æä¿®æ¹IQCæ£éªé¡¹ç®å¯¹è¯æ¡ --> |
| | | <el-dialog |
| | | :title="title" |
| | | :visible.sync="open" |
| | | width="750px" |
| | | custom-class="madelClass" |
| | | :destroyOnClose="true" |
| | | > |
| | | <div class="contbox"> |
| | | <el-form |
| | | ref="form" |
| | | v-if="open" |
| | | :model="form" |
| | | :rules="rules" |
| | | :disabled="isCheck" |
| | | > |
| | | <el-form-item |
| | | v-for="(item, index) in formItem" |
| | | :key="index" |
| | | :label="item.label" |
| | | :prop="item.prop" |
| | | label-width="120px" |
| | | :class="item.component == 'inputNumber' ? 'itemFixed' : ''" |
| | | > |
| | | <template v-if="item.component == 'input'"> |
| | | <el-input |
| | | v-model="form[item.prop]" |
| | | :readonly="item.readonly" |
| | | :placeholder=" |
| | | item.prop == 'checkItemNo' ? 'èªå¨çæ' : '请è¾å
¥' + item.label |
| | | " |
| | | /> |
| | | </template> |
| | | <template v-if="item.component == 'inputNumber'"> |
| | | <el-input-number |
| | | v-model="form[item.prop]" |
| | | :label="'请è¾å
¥' + item.label" |
| | | ></el-input-number> |
| | | </template> |
| | | <template v-if="item.component == 'textarea'"> |
| | | <el-input |
| | | type="textarea" |
| | | :rows="2" |
| | | :placeholder="'请è¾å
¥' + item.label" |
| | | v-model="form[item.prop]" |
| | | > |
| | | </el-input> |
| | | </template> |
| | | <template v-if="item.component == 'select'"> |
| | | <template v-if="item.prop == 'checkType'"> |
| | | <el-select |
| | | v-model="form[item.prop]" |
| | | :placeholder="'请éæ©' + item.label" |
| | | v-if="item.prop == 'checkType'" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="dict in dict.type.check_type" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </template> |
| | | |
| | | <template v-if="item.prop == 'isAutoCheck'"> |
| | | <el-select |
| | | v-model="form[item.prop]" |
| | | :placeholder="'请éæ©' + item.label" |
| | | |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="dict in dict.type.is_auto_check" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </template> |
| | | <template v-if="item.prop == 'isRequired'"> |
| | | <el-select |
| | | v-model="form[item.prop]" |
| | | :placeholder="'请éæ©' + item.label" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="dict in dict.type.is_required" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </template> |
| | | <template v-if="item.prop == 'isToSpc'"> |
| | | <el-select |
| | | v-model="form[item.prop]" |
| | | :placeholder="'请éæ©' + item.label" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="dict in dict.type.is_to_spc" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </template> |
| | | |
| | | <template v-if="item.prop == 'werks'"> |
| | | <el-select |
| | | v-model="form[item.prop]" |
| | | :placeholder="'请éæ©' + item.label" |
| | | v-if="item.prop == 'werks'" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="dict in werksList" |
| | | :key="dict.werks" |
| | | :label="dict.werksName" |
| | | :value="dict.werks" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </template> |
| | | <template v-if="item.prop == 'status'"> |
| | | <el-select |
| | | v-model="form[item.prop]" |
| | | :placeholder="'请éæ©' + item.label" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="dict in dict.type.status" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | |
| | | </template> |
| | | </template> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button |
| | | v-if="!isCheck" |
| | | :loading="buttonLoading" |
| | | type="primary" |
| | | @click="submitForm" |
| | | >ç¡® å®</el-button |
| | | > |
| | | <el-button @click="cancel">å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import { formatData, formrRquired, formatDataItem } from "./info.data"; |
| | | import { listwerkshouse } from "@/api/basicData/location"; |
| | | import { getLocationGroup, addLocationGroup, updateLocationGroup } from "@/api/basicData/locationGroup"; |
| | | export default { |
| | | name: "checkItemAdd", |
| | | components: {}, |
| | | dicts: ["check_type", "is_auto_check", "is_required", "is_to_spc", "status"], |
| | | data() { |
| | | return { |
| | | form: JSON.parse(JSON.stringify(formatData)), |
| | | rules: formrRquired, |
| | | open: false, |
| | | title: "", |
| | | buttonLoading: false, |
| | | isCheck: false, |
| | | werksList: [], |
| | | }; |
| | | }, |
| | | |
| | | computed: { |
| | | formItem() { |
| | | return formatDataItem; |
| | | }, |
| | | }, |
| | | watch:{ |
| | | open(val){ |
| | | if(!val){ |
| | | this.$refs["form"].resetFields(); |
| | | |
| | | } |
| | | |
| | | } |
| | | }, |
| | | mounted() { |
| | | |
| | | listwerkshouse({ |
| | | pageNum: 1, |
| | | pageSize: 99, |
| | | }).then(res =>{ |
| | | console.log(res, 'å·¥å'); |
| | | this.werksList = res.rows; |
| | | }) |
| | | }, |
| | | methods: { |
| | | /** æ交æé® */ |
| | | submitForm() { |
| | | this.$refs["form"].validate((valid) => { |
| | | if (valid) { |
| | | this.buttonLoading = true; |
| | | if (this.form.locationGroupId != null) { |
| | | updateLocationGroup(this.form) |
| | | .then((response) => { |
| | | this.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | this.open = false; |
| | | this.$emit("getList"); |
| | | }) |
| | | .finally(() => { |
| | | this.buttonLoading = false; |
| | | }); |
| | | } else { |
| | | addLocationGroup(this.form) |
| | | .then((response) => { |
| | | this.$modal.msgSuccess("æ°å¢æå"); |
| | | this.open = false; |
| | | this.$emit("getList"); |
| | | }) |
| | | .finally(() => { |
| | | this.buttonLoading = false; |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | // åæ¶æé® |
| | | cancel() { |
| | | this.reset(); |
| | | }, |
| | | reset() { |
| | | this.$refs["form"].resetFields(); |
| | | this.open = false; |
| | | this.isCheck = false; |
| | | }, |
| | | elDialogShow(type, info = "") { |
| | | this.open = true; |
| | | if (type == 1) { |
| | | this.title = "æ£æµé¡¹ç®æ·»å "; |
| | | this.isCheck = false; |
| | | } else if (type == 2) { |
| | | this.isCheck = false; |
| | | this.getDetailse(info); |
| | | this.title = "æ£æµé¡¹ç®ç¼è¾"; |
| | | } else { |
| | | this.title = "æ£æµé¡¹ç®æ¥ç"; |
| | | this.isCheck = true; |
| | | this.getDetailse(info); |
| | | } |
| | | this.$nextTick(()=>{ |
| | | |
| | | }) |
| | | }, |
| | | getDetailse(id) { |
| | | getLocationGroup(id).then((res) => { |
| | | if (res.code === 200) { |
| | | this.form = res.data; |
| | | } |
| | | }); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | .contbox { |
| | | max-height: 60vh !important; |
| | | overflow: auto; |
| | | box-sizing: border-box; |
| | | padding: 0 20px; |
| | | } |
| | | .itemFixed { |
| | | display: inline-block !important; |
| | | } |
| | | .itemFixed:first-child { |
| | | display: block !important; |
| | | } |
| | | ::v-deep .is-disabled .el-input__inner { |
| | | color: #606266 !important; |
| | | } |
| | | // ::v-deep .el-input.is-disabled .el-input__inner |
| | | </style> |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="åºä½ç»ç¼å·" prop="locationGroupNo"> |
| | | <el-input |
| | | v-model="queryParams.locationGroupNo" |
| | | placeholder="请è¾å
¥åºä½ç»ç¼å·" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="åºä½ç»å称" prop="locationGroupName"> |
| | | <el-input |
| | | v-model="queryParams.locationGroupName" |
| | | placeholder="请è¾å
¥åºä½ç»å称" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="ä»åºç¼å·" prop="lgort"> |
| | | <el-input |
| | | v-model="queryParams.lgort" |
| | | placeholder="请è¾å
¥ä»åºç¼å·" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="el-icon-plus" |
| | | size="mini" |
| | | @click="handleAdd" |
| | | v-hasPermi="['system:locationGroup:add']" |
| | | >æ°å¢</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="success" |
| | | plain |
| | | icon="el-icon-edit" |
| | | size="mini" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['system:locationGroup:edit']" |
| | | >ä¿®æ¹</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="el-icon-delete" |
| | | size="mini" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['system:locationGroup:remove']" |
| | | >å é¤</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="el-icon-download" |
| | | size="mini" |
| | | @click="handleExport" |
| | | v-hasPermi="['system:locationGroup:export']" |
| | | >导åº</el-button> |
| | | </el-col> |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table v-loading="loading" border :data="locationGroupList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column |
| | | label="åºå·" |
| | | type="index" |
| | | fixed |
| | | width="50" /> |
| | | <!-- <el-table-column label="åºä½ç»ID" align="center" prop="locationGroupId" v-if="true"/> --> |
| | | <el-table-column label="åºä½ç»ç¼å·" align="center" prop="locationGroupNo" /> |
| | | <el-table-column label="å·¥å" align="center" prop="werks" /> |
| | | <el-table-column label="åºä½ç»å称" align="center" prop="locationGroupName" /> |
| | | <el-table-column label="ä»åºç¼å·" align="center" prop="lgort" /> |
| | | <el-table-column label="æè¿°" align="center" prop="description" /> |
| | | <el-table-column label="ç¶æ" align="center" prop="state" /> |
| | | <el-table-column label="å®¡æ ¸ç¶æ" align="center" prop="auditState" /> |
| | | <el-table-column label="å®¡æ ¸äººID" align="center" prop="auditUserId" /> |
| | | <el-table-column label="å®¡æ ¸äººå§å" align="center" prop="auditUserName" /> |
| | | <el-table-column label="å®¡æ ¸æ¥ææ¶é´" align="center" prop="auditDateTime" width="180"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ parseTime(scope.row.auditDateTime, '{y}-{m}-{d}') }}</span> |
| | | <el-main class="contbox" ref="contBox"> |
| | | <div class="head" ref="headBox"> |
| | | <BaseSearch |
| | | @getList="getList" |
| | | :formItemList="searchFormSchema" |
| | | @search="getList" |
| | | @showSearchChange="getElHeight(28)" |
| | | > |
| | | <template #actionButton> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="el-icon-plus" |
| | | size="mini" |
| | | @click="handleAdd" |
| | | v-hasPermi="['iqc_checkItem_create']" |
| | | >æ°å¢</el-button |
| | | > |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="success" |
| | | plain |
| | | icon="el-icon-edit" |
| | | size="mini" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['iqc_checkItem_edit']" |
| | | >ä¿®æ¹</el-button |
| | | > |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="el-icon-delete" |
| | | size="mini" |
| | | @click="handleDelete" |
| | | v-hasPermi="['iqc_checkItem_delete']" |
| | | >å é¤</el-button |
| | | > |
| | | </el-col> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="å®¡æ ¸æè§" align="center" prop="auditOpinion" /> |
| | | <el-table-column label="æåæ´æ°äººid" align="center" prop="lastUpdatedUserId" /> |
| | | <el-table-column label="æåæ´æ°äººå§å" align="center" prop="lastUpdatedUserName" /> |
| | | <el-table-column label="æåæ´æ°æ¶é´" align="center" prop="lastUpdatedDateTime" width="180"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ parseTime(scope.row.lastUpdatedDateTime, '{y}-{m}-{d}') }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['system:locationGroup:edit']" |
| | | >ä¿®æ¹</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['system:locationGroup:remove']" |
| | | >å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="total>0" |
| | | :total="total" |
| | | :page.sync="queryParams.pageNum" |
| | | :limit.sync="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | |
| | | <!-- æ·»å æä¿®æ¹åºä½ç»å¯¹è¯æ¡ --> |
| | | <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="åºä½ç»ç¼å·" prop="locationGroupNo"> |
| | | <el-input v-model="form.locationGroupNo" placeholder="请è¾å
¥åºä½ç»ç¼å·" /> |
| | | </el-form-item> |
| | | <el-form-item label="å·¥å" prop="werks"> |
| | | <el-input v-model="form.werks" placeholder="请è¾å
¥å·¥å" /> |
| | | </el-form-item> |
| | | <el-form-item label="åºä½ç»å称" prop="locationGroupName"> |
| | | <el-input v-model="form.locationGroupName" placeholder="请è¾å
¥åºä½ç»å称" /> |
| | | </el-form-item> |
| | | <el-form-item label="ä»åºç¼å·" prop="lgort"> |
| | | <el-input v-model="form.lgort" placeholder="请è¾å
¥ä»åºç¼å·" /> |
| | | </el-form-item> |
| | | <el-form-item label="æè¿°" prop="description"> |
| | | <el-input v-model="form.description" placeholder="请è¾å
¥æè¿°" /> |
| | | </el-form-item> |
| | | <el-form-item label="ç¶æ" prop="state"> |
| | | <el-input v-model="form.state" placeholder="请è¾å
¥ç¶æ" /> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="æåæ´æ°äººid" prop="lastUpdatedUserId"> |
| | | <el-input v-model="form.lastUpdatedUserId" placeholder="请è¾å
¥æåæ´æ°äººid" /> |
| | | </el-form-item> |
| | | <el-form-item label="æåæ´æ°äººå§å" prop="lastUpdatedUserName"> |
| | | <el-input v-model="form.lastUpdatedUserName" placeholder="请è¾å
¥æåæ´æ°äººå§å" /> |
| | | </el-form-item> |
| | | <el-form-item label="æåæ´æ°æ¶é´" prop="lastUpdatedDateTime"> |
| | | <el-date-picker clearable |
| | | v-model="form.lastUpdatedDateTime" |
| | | type="datetime" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | placeholder="请éæ©æåæ´æ°æ¶é´"> |
| | | </el-date-picker> |
| | | </el-form-item> --> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button :loading="buttonLoading" type="primary" @click="submitForm">ç¡® å®</el-button> |
| | | <el-button @click="cancel">å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </BaseSearch> |
| | | </div> |
| | | <TableCom |
| | | :column="tabiInfo.columns" |
| | | :table-data="tabiInfo.tableData" |
| | | :table-loading="tabiInfo.tableLoading" |
| | | :isSelection="tabiInfo.isSelection" |
| | | :height="elementHeight" |
| | | rowKey="locationGroupId" |
| | | ref="tabel" |
| | | @checkData="checkData" |
| | | @checkLook="checkInfo" |
| | | > |
| | | <template slot="checkType" slot-scope="scope"> |
| | | <dict-tag |
| | | :options="dict.type.check_type" |
| | | :value="scope.row.checkType" |
| | | /> |
| | | </template> |
| | | <template slot="isAutoCheck" slot-scope="scope"> |
| | | <dict-tag |
| | | :options="dict.type.is_auto_check" |
| | | :value="scope.row.isAutoCheck" |
| | | /> |
| | | </template> |
| | | <template slot="isRequired" slot-scope="scope"> |
| | | <dict-tag |
| | | :options="dict.type.is_required" |
| | | :value="scope.row.isRequired" |
| | | /> |
| | | </template> |
| | | <template slot="auditState" slot-scope="scope"> |
| | | <dict-tag :options="dict.type.audit_status" :value="scope.row.auditState" /> |
| | | </template> |
| | | <template slot="status" slot-scope="scope"> |
| | | <dict-tag :options="dict.type.status" :value="scope.row.status" /> |
| | | </template> |
| | | </TableCom> |
| | | <div class="pagination" ref="pagination"> |
| | | <pagination |
| | | v-show="pageInfo.pageTotal > 0" |
| | | :total="pageInfo.pageTotal" |
| | | :page.sync="pageInfo.currentPage" |
| | | :limit.sync="pageInfo.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | </div> |
| | | <AddaddModal ref="addaddModal" @getList="getList" /> |
| | | </el-main> |
| | | </template> |
| | | |
| | | <script> |
| | | import { listLocationGroup, getLocationGroup, delLocationGroup, addLocationGroup, updateLocationGroup } from "@/api/basicData/locationGroup"; |
| | | import TableCom from "@/components/Table/index"; |
| | | import BaseSearch from "@/components/Table/BaseSearch"; |
| | | |
| | | import { columns, searchFormSchema } from "./info.data"; |
| | | import mixin from "@/components/Table/mixins/resize"; |
| | | |
| | | import { listLocationGroup, delLocationGroup } from "@/api/basicData/locationGroup"; |
| | | import AddaddModal from "./addModal"; |
| | | |
| | | export default { |
| | | name: "LocationGroup", |
| | | components: { TableCom, BaseSearch, AddaddModal }, |
| | | mixins: [mixin], |
| | | dicts: ["audit_status", "status"], |
| | | data() { |
| | | return { |
| | | // æé®loading |
| | | buttonLoading: false, |
| | | // é®ç½©å± |
| | | loading: true, |
| | | // éä¸æ°ç» |
| | | ids: [], |
| | | // éå个ç¦ç¨ |
| | | single: true, |
| | | // éå¤ä¸ªç¦ç¨ |
| | | multiple: true, |
| | | // æ¾ç¤ºæç´¢æ¡ä»¶ |
| | | showSearch: true, |
| | | // æ»æ¡æ° |
| | | total: 0, |
| | | // åºä½ç»è¡¨æ ¼æ°æ® |
| | | locationGroupList: [], |
| | | // å¼¹åºå±æ é¢ |
| | | title: "", |
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå± |
| | | open: false, |
| | | // æ¥è¯¢åæ° |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | locationGroupNo: undefined, |
| | | locationGroupName: undefined, |
| | | lgort: undefined, |
| | | searchFormSchema: searchFormSchema, |
| | | tabiInfo: { |
| | | columns: columns, |
| | | tableData: [], |
| | | tableLoading: false, |
| | | isSelection: true, |
| | | rowClassName: "rowClassName", |
| | | }, |
| | | // 表ååæ° |
| | | form: {}, |
| | | // 表åæ ¡éª |
| | | rules: { |
| | | locationGroupId: [ |
| | | { required: true, message: "åºä½ç»IDä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | locationGroupNo: [ |
| | | { required: true, message: "åºä½ç»ç¼å·ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | werks: [ |
| | | { required: true, message: "å·¥åä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | locationGroupName: [ |
| | | { required: true, message: "åºä½ç»å称ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | lgort: [ |
| | | { required: true, message: "ä»åºç¼å·ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | description: [ |
| | | { required: true, message: "æè¿°ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | state: [ |
| | | { required: true, message: "ç¶æä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | displayOrder: [ |
| | | { required: true, message: "æåºä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | createdUserId: [ |
| | | { required: true, message: "å建人idä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | createdUserName: [ |
| | | { required: true, message: "å建人å§åä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | createdDateTime: [ |
| | | { required: true, message: "å建æ¥ææ¶é´ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | auditState: [ |
| | | { required: true, message: "å®¡æ ¸ç¶æä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | auditUserId: [ |
| | | { required: true, message: "å®¡æ ¸äººIDä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | auditUserName: [ |
| | | { required: true, message: "å®¡æ ¸äººå§åä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | auditDateTime: [ |
| | | { required: true, message: "å®¡æ ¸æ¥ææ¶é´ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | auditOpinion: [ |
| | | { required: true, message: "å®¡æ ¸æè§ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | lastUpdatedUserId: [ |
| | | { required: true, message: "æåæ´æ°äººidä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | lastUpdatedUserName: [ |
| | | { required: true, message: "æåæ´æ°äººå§åä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | lastUpdatedDateTime: [ |
| | | { required: true, message: "æåæ´æ°æ¶é´ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | isDeleted: [ |
| | | { required: true, message: "æ¯å¦å é¤ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ] |
| | | } |
| | | pageInfo: { |
| | | pageSize: 10, |
| | | pageTotal: 0, |
| | | currentPage: 1, |
| | | }, |
| | | visible: false, |
| | | ids: [], |
| | | open: false, |
| | | }; |
| | | }, |
| | | created() { |
| | | mounted() { |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | /** æ¥è¯¢åºä½ç»å表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | listLocationGroup(this.queryParams).then(response => { |
| | | this.locationGroupList = response.rows; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | // åæ¶æé® |
| | | cancel() { |
| | | this.open = false; |
| | | this.reset(); |
| | | }, |
| | | // 表åéç½® |
| | | reset() { |
| | | this.form = { |
| | | locationGroupId: undefined, |
| | | locationGroupNo: undefined, |
| | | werks: undefined, |
| | | locationGroupName: undefined, |
| | | lgort: undefined, |
| | | description: undefined, |
| | | state: undefined, |
| | | displayOrder: undefined, |
| | | createdUserId: undefined, |
| | | createdUserName: undefined, |
| | | createdDateTime: undefined, |
| | | auditState: undefined, |
| | | auditUserId: undefined, |
| | | auditUserName: undefined, |
| | | auditDateTime: undefined, |
| | | auditOpinion: undefined, |
| | | lastUpdatedUserId: undefined, |
| | | lastUpdatedUserName: undefined, |
| | | lastUpdatedDateTime: undefined, |
| | | isDeleted: undefined |
| | | getList(info = {}) { |
| | | this.ids = []; |
| | | this.tabiInfo.tableLoading = true; |
| | | let params = { |
| | | pageSize: this.pageInfo.pageSize, |
| | | pageNum: this.pageInfo.currentPage, |
| | | bizType: 10, |
| | | ...info, |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | | /** æç´¢æé®æä½ */ |
| | | handleQuery() { |
| | | this.queryParams.pageNum = 1; |
| | | this.getList(); |
| | | }, |
| | | /** éç½®æé®æä½ */ |
| | | resetQuery() { |
| | | this.resetForm("queryForm"); |
| | | this.handleQuery(); |
| | | }, |
| | | // å¤éæ¡éä¸æ°æ® |
| | | handleSelectionChange(selection) { |
| | | this.ids = selection.map(item => item.locationGroupId) |
| | | this.single = selection.length!==1 |
| | | this.multiple = !selection.length |
| | | }, |
| | | /** æ°å¢æé®æä½ */ |
| | | handleAdd() { |
| | | this.reset(); |
| | | this.open = true; |
| | | this.title = "æ·»å åºä½ç»"; |
| | | }, |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | handleUpdate(row) { |
| | | this.loading = true; |
| | | this.reset(); |
| | | const locationGroupId = row.locationGroupId || this.ids |
| | | getLocationGroup(locationGroupId).then(response => { |
| | | this.loading = false; |
| | | this.form = response.data; |
| | | this.open = true; |
| | | this.title = "ä¿®æ¹åºä½ç»"; |
| | | }); |
| | | }, |
| | | /** æ交æé® */ |
| | | submitForm() { |
| | | this.$refs["form"].validate(valid => { |
| | | if (valid) { |
| | | this.buttonLoading = true; |
| | | if (this.form.locationGroupId != null) { |
| | | updateLocationGroup(this.form).then(response => { |
| | | this.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }).finally(() => { |
| | | this.buttonLoading = false; |
| | | }); |
| | | } else { |
| | | addLocationGroup(this.form).then(response => { |
| | | this.$modal.msgSuccess("æ°å¢æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }).finally(() => { |
| | | this.buttonLoading = false; |
| | | }); |
| | | } |
| | | listLocationGroup(params).then((res) => { |
| | | if (res.code == 200) { |
| | | this.pageInfo.pageTotal = res.total; |
| | | this.tabiInfo.tableData = res.rows; |
| | | this.tabiInfo.tableLoading = false; |
| | | } |
| | | }); |
| | | }, |
| | | /** å é¤æé®æä½ */ |
| | | handleDelete(row) { |
| | | const locationGroupIds = row.locationGroupId || this.ids; |
| | | this.$modal.confirm('æ¯å¦ç¡®è®¤å é¤åºä½ç»ç¼å·ä¸º"' + locationGroupIds + '"çæ°æ®é¡¹ï¼').then(() => { |
| | | this.loading = true; |
| | | return delLocationGroup(locationGroupIds); |
| | | }).then(() => { |
| | | this.loading = false; |
| | | this.getList(); |
| | | this.$modal.msgSuccess("å é¤æå"); |
| | | }).catch(() => { |
| | | }).finally(() => { |
| | | this.loading = false; |
| | | }); |
| | | checkData(data) { |
| | | if (data.length) { |
| | | this.ids = data.map((item) => { |
| | | return item.locationGroupId; |
| | | }); |
| | | } else { |
| | | this.ids = []; |
| | | } |
| | | }, |
| | | /** 导åºæé®æä½ */ |
| | | handleExport() { |
| | | this.download('system/locationGroup/export', { |
| | | ...this.queryParams |
| | | }, `locationGroup_${new Date().getTime()}.xlsx`) |
| | | } |
| | | } |
| | | handleAdd() { |
| | | this.$refs.addaddModal.elDialogShow(1); |
| | | }, |
| | | checkInfo(info) { |
| | | this.$refs.addaddModal.elDialogShow(3, info.locationGroupId); |
| | | }, |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | handleUpdate() { |
| | | if (this.ids.length > 1) { |
| | | this.$message({ |
| | | message: "åªè½æä½åæ¡æ°æ®ï¼", |
| | | type: "warning", |
| | | }); |
| | | return; |
| | | } else if (this.ids.length < 1) { |
| | | this.$message({ |
| | | message: "请éæ©æ°æ®", |
| | | type: "warning", |
| | | }); |
| | | return; |
| | | } |
| | | this.$refs.addaddModal.elDialogShow(2, this.ids[0]); |
| | | }, |
| | | handleDelete() { |
| | | const locationGroupIds = this.ids; |
| | | |
| | | if (locationGroupIds.length) { |
| | | this.$modal |
| | | .confirm( |
| | | 'æ¯å¦ç¡®è®¤å é¤å·²éä¸çæ°æ®é¡¹ï¼' |
| | | ) |
| | | .then(() => { |
| | | this.tabiInfo.tableLoading = true; |
| | | return delLocationGroup(locationGroupIds); |
| | | }) |
| | | .then(() => { |
| | | this.tabiInfo.tableLoading = false; |
| | | this.ids = []; |
| | | this.getList(); |
| | | this.$message({ |
| | | message: "å é¤æå", |
| | | type: "success", |
| | | }); |
| | | }) |
| | | .catch(() => {}) |
| | | .finally(() => { |
| | | this.tabiInfo.tableLoading = false; |
| | | }); |
| | | } else { |
| | | this.$message({ |
| | | message: "请éæ©æ°æ®", |
| | | type: "warning", |
| | | }); |
| | | } |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | .rowClassName { |
| | | height: 50px; |
| | | } |
| | | .contbox { |
| | | width: 100; |
| | | height: 100%; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import * as vars from "@/variableSet/columns"; |
| | | |
| | | |
| | | export const columns = [ |
| | | { |
| | | label: 'ç¼å·', |
| | | align: 'left', |
| | | prop: 'locationGroupNo', |
| | | width: vars.timeWidth, |
| | | fixed: 'left', |
| | | tooltip: true, |
| | | }, |
| | | { |
| | | label: 'å称', |
| | | align: 'left', |
| | | prop: 'locationGroupName', |
| | | width: vars.timeWidth, |
| | | fixed: 'left', |
| | | }, |
| | | { |
| | | label: 'å·¥å', |
| | | align: 'left', |
| | | prop: 'werks', |
| | | fixed: 'left', |
| | | width: vars.timeWidth, |
| | | }, |
| | | { |
| | | label: 'ä»åºç¼å·', |
| | | align: 'left', |
| | | prop: 'lgort', |
| | | width: vars.timeWidth, |
| | | |
| | | }, |
| | | |
| | | { |
| | | label: 'æè¿°', |
| | | align: 'left', |
| | | prop: 'description', |
| | | width: vars.timeWidth, |
| | | tooltip: true, |
| | | }, |
| | | { |
| | | label: 'å®¡æ ¸ç¶æ', |
| | | align: 'left', |
| | | prop: 'auditState', |
| | | dataType: 'slot', |
| | | slot: 'auditState', |
| | | width: vars.timeWidth, |
| | | }, |
| | | { |
| | | label: 'å®¡æ ¸äººå§å', |
| | | align: 'left', |
| | | prop: 'auditUserName', |
| | | width: vars.timeWidth, |
| | | }, |
| | | { |
| | | label: 'å®¡æ ¸æ¥ææ¶é´', |
| | | align: 'left', |
| | | prop: 'auditDateTime', |
| | | width: vars.timeWidth, |
| | | }, |
| | | |
| | | { |
| | | label: 'æåæ´æ°äººå§å', |
| | | align: 'left', |
| | | prop: 'lastUpdatedUserName', |
| | | width: vars.lastUpdatedUserName, |
| | | }, |
| | | { |
| | | label: 'æåæ´æ°æ¥ææ¶é´', |
| | | align: 'left', |
| | | prop: 'lastUpdatedDateTime', |
| | | width: vars.lastUpdatedDateTime, |
| | | }, |
| | | { |
| | | dataType: 'option', |
| | | label: 'æä½', |
| | | width: '80', |
| | | align: 'center', |
| | | fixed: 'right', |
| | | hasPermi: 'iqc_checkItem_check', |
| | | operation: [ |
| | | { |
| | | name: 'æ¥ç', |
| | | size: 'mini', |
| | | plain: true, |
| | | typeText: 4 |
| | | } |
| | | ] |
| | | |
| | | } |
| | | ]; |
| | | export const searchFormSchema = [ |
| | | |
| | | { |
| | | field: 'locationGroupName', |
| | | label: 'å称:', |
| | | labelWidth: 80, |
| | | component: 'Input', |
| | | componentProps: { |
| | | placeholder: '请è¾å
¥', |
| | | }, |
| | | }, |
| | | { |
| | | field: 'locationGroupNo', |
| | | label: 'ç¼å·:', |
| | | labelWidth: 80, |
| | | component: 'Input', |
| | | componentProps: { |
| | | placeholder: '请è¾å
¥', |
| | | }, |
| | | }, |
| | | { |
| | | field: 'lgort', |
| | | label: 'ä»åºç¼å·:', |
| | | labelWidth: 80, |
| | | component: 'Input', |
| | | componentProps: { |
| | | placeholder: '请è¾å
¥', |
| | | }, |
| | | }, |
| | | // { |
| | | // field: 'state', |
| | | // label: 'ç¶æ:', |
| | | // labelWidth: 80, |
| | | // component: 'Select', |
| | | // componentProps: { |
| | | // options: [ |
| | | // { label: 'å¯ç¨', value: '1' }, |
| | | // { label: 'ç¦ç¨', value: '0' }, |
| | | // ], |
| | | // }, |
| | | // multiple: false, |
| | | // }, |
| | | |
| | | ]; |
| | | |
| | | export const formatData = { |
| | | locationGroupId: undefined, |
| | | locationGroupNo: undefined, |
| | | werks: undefined, |
| | | locationGroupName: undefined, |
| | | lgort: undefined, |
| | | description: undefined, |
| | | state: undefined, |
| | | displayOrder: undefined, |
| | | createdUserId: undefined, |
| | | createdUserName: undefined, |
| | | createdDateTime: undefined, |
| | | auditState: undefined, |
| | | auditUserId: undefined, |
| | | auditUserName: undefined, |
| | | auditDateTime: undefined, |
| | | auditOpinion: undefined, |
| | | lastUpdatedUserId: undefined, |
| | | lastUpdatedUserName: undefined, |
| | | lastUpdatedDateTime: undefined, |
| | | isDeleted: undefined |
| | | }; |
| | | |
| | | export const formrRquired = { |
| | | locationGroupId: [ |
| | | { required: true, message: "åºä½ç»IDä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | locationGroupNo: [ |
| | | { required: true, message: "åºä½ç»ç¼å·ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | werks: [ |
| | | { required: true, message: "å·¥åä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | locationGroupName: [ |
| | | { required: true, message: "åºä½ç»å称ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | lgort: [ |
| | | { required: true, message: "ä»åºç¼å·ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | description: [ |
| | | { required: true, message: "æè¿°ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | state: [ |
| | | { required: true, message: "ç¶æä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | displayOrder: [ |
| | | { required: true, message: "æåºä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | createdUserId: [ |
| | | { required: true, message: "å建人idä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | createdUserName: [ |
| | | { required: true, message: "å建人å§åä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | createdDateTime: [ |
| | | { required: true, message: "å建æ¥ææ¶é´ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | auditState: [ |
| | | { required: true, message: "å®¡æ ¸ç¶æä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | auditUserId: [ |
| | | { required: true, message: "å®¡æ ¸äººIDä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | auditUserName: [ |
| | | { required: true, message: "å®¡æ ¸äººå§åä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | auditDateTime: [ |
| | | { required: true, message: "å®¡æ ¸æ¥ææ¶é´ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | auditOpinion: [ |
| | | { required: true, message: "å®¡æ ¸æè§ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | lastUpdatedUserId: [ |
| | | { required: true, message: "æåæ´æ°äººidä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | lastUpdatedUserName: [ |
| | | { required: true, message: "æåæ´æ°äººå§åä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | lastUpdatedDateTime: [ |
| | | { required: true, message: "æåæ´æ°æ¶é´ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | isDeleted: [ |
| | | { required: true, message: "æ¯å¦å é¤ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ] |
| | | } |
| | | export const formatDataItem = [ |
| | | { |
| | | label: "ç¼å·", |
| | | prop: 'locationGroupNo', |
| | | component: 'input', |
| | | // readonly: true |
| | | }, |
| | | { |
| | | label: "å称", |
| | | prop: 'locationGroupName', |
| | | component: 'input' |
| | | |
| | | }, |
| | | { |
| | | label: "å·¥å", |
| | | prop: 'werks', |
| | | component: 'select', |
| | | }, |
| | | { |
| | | label: "ä»åºç¼å·", |
| | | prop: 'lgort', |
| | | component: 'input' |
| | | }, |
| | | // { |
| | | // label: "æ¯å¦å¯ç¨", |
| | | // prop: 'isUseLocation', |
| | | // component: 'select' |
| | | // }, |
| | | // { |
| | | // label: "管çåå称", |
| | | // prop: 'userId', |
| | | // component: 'input' |
| | | // }, |
| | | // { |
| | | // label: "管çåçµè¯", |
| | | // prop: 'userPhone', |
| | | // component: 'input' |
| | | // }, |
| | | // { |
| | | // label: "åæ X", |
| | | // prop: 'lowerDeviation', |
| | | // component: 'inputNumber' |
| | | // }, |
| | | // { |
| | | // label: "åæ Y", |
| | | // prop: 'standardHigh', |
| | | // component: 'inputNumber' |
| | | // }, |
| | | |
| | | { |
| | | label: "æè¿°", |
| | | prop: 'description', |
| | | component: 'textarea' |
| | | }, |
| | | |
| | | ] |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="åºä½ç»ç¼å·" prop="locationGroupNo"> |
| | | <el-input |
| | | v-model="queryParams.locationGroupNo" |
| | | placeholder="请è¾å
¥åºä½ç»ç¼å·" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="åºä½ç»å称" prop="locationGroupName"> |
| | | <el-input |
| | | v-model="queryParams.locationGroupName" |
| | | placeholder="请è¾å
¥åºä½ç»å称" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="ä»åºç¼å·" prop="lgort"> |
| | | <el-input |
| | | v-model="queryParams.lgort" |
| | | placeholder="请è¾å
¥ä»åºç¼å·" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="el-icon-plus" |
| | | size="mini" |
| | | @click="handleAdd" |
| | | v-hasPermi="['system:locationGroup:add']" |
| | | >æ°å¢</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="success" |
| | | plain |
| | | icon="el-icon-edit" |
| | | size="mini" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['system:locationGroup:edit']" |
| | | >ä¿®æ¹</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="el-icon-delete" |
| | | size="mini" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['system:locationGroup:remove']" |
| | | >å é¤</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="el-icon-download" |
| | | size="mini" |
| | | @click="handleExport" |
| | | v-hasPermi="['system:locationGroup:export']" |
| | | >导åº</el-button> |
| | | </el-col> |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table v-loading="loading" border :data="locationGroupList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column |
| | | label="åºå·" |
| | | type="index" |
| | | fixed |
| | | width="50" /> |
| | | <!-- <el-table-column label="åºä½ç»ID" align="center" prop="locationGroupId" v-if="true"/> --> |
| | | <el-table-column label="åºä½ç»ç¼å·" align="center" prop="locationGroupNo" /> |
| | | <el-table-column label="å·¥å" align="center" prop="werks" /> |
| | | <el-table-column label="åºä½ç»å称" align="center" prop="locationGroupName" /> |
| | | <el-table-column label="ä»åºç¼å·" align="center" prop="lgort" /> |
| | | <el-table-column label="æè¿°" align="center" prop="description" /> |
| | | <!-- <el-table-column label="ç¶æ" align="center" prop="state" /> --> |
| | | <el-table-column label="å®¡æ ¸ç¶æ" align="center" prop="auditState" /> |
| | | <el-table-column label="å®¡æ ¸äººID" align="center" prop="auditUserId" /> |
| | | <el-table-column label="å®¡æ ¸äººå§å" align="center" prop="auditUserName" /> |
| | | <el-table-column label="å®¡æ ¸æ¥ææ¶é´" align="center" prop="auditDateTime" width="180"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ parseTime(scope.row.auditDateTime, '{y}-{m}-{d}') }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="å®¡æ ¸æè§" align="center" prop="auditOpinion" /> |
| | | <el-table-column label="æåæ´æ°äººid" align="center" prop="lastUpdatedUserId" /> |
| | | <el-table-column label="æåæ´æ°äººå§å" align="center" prop="lastUpdatedUserName" /> |
| | | <el-table-column label="æåæ´æ°æ¶é´" align="center" prop="lastUpdatedDateTime" width="180"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ parseTime(scope.row.lastUpdatedDateTime, '{y}-{m}-{d}') }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['system:locationGroup:edit']" |
| | | >ä¿®æ¹</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['system:locationGroup:remove']" |
| | | >å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="total>0" |
| | | :total="total" |
| | | :page.sync="queryParams.pageNum" |
| | | :limit.sync="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | |
| | | <!-- æ·»å æä¿®æ¹åºä½ç»å¯¹è¯æ¡ --> |
| | | <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="åºä½ç»ç¼å·" prop="locationGroupNo"> |
| | | <el-input v-model="form.locationGroupNo" placeholder="请è¾å
¥åºä½ç»ç¼å·" /> |
| | | </el-form-item> |
| | | <el-form-item label="å·¥å" prop="werks"> |
| | | <!-- <el-input v-model="form.werks" placeholder="请è¾å
¥å·¥å" /> --> |
| | | </el-form-item> |
| | | <el-form-item label="åºä½ç»å称" prop="locationGroupName"> |
| | | <el-input v-model="form.locationGroupName" placeholder="请è¾å
¥åºä½ç»å称" /> |
| | | </el-form-item> |
| | | <el-form-item label="ä»åºç¼å·" prop="lgort"> |
| | | <el-input v-model="form.lgort" placeholder="请è¾å
¥ä»åºç¼å·" /> |
| | | </el-form-item> |
| | | <el-form-item label="æè¿°" prop="description"> |
| | | <el-input v-model="form.description" placeholder="请è¾å
¥æè¿°" /> |
| | | </el-form-item> |
| | | <el-form-item label="ç¶æ" prop="state"> |
| | | <el-input v-model="form.state" placeholder="请è¾å
¥ç¶æ" /> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="æåæ´æ°äººid" prop="lastUpdatedUserId"> |
| | | <el-input v-model="form.lastUpdatedUserId" placeholder="请è¾å
¥æåæ´æ°äººid" /> |
| | | </el-form-item> |
| | | <el-form-item label="æåæ´æ°äººå§å" prop="lastUpdatedUserName"> |
| | | <el-input v-model="form.lastUpdatedUserName" placeholder="请è¾å
¥æåæ´æ°äººå§å" /> |
| | | </el-form-item> |
| | | <el-form-item label="æåæ´æ°æ¶é´" prop="lastUpdatedDateTime"> |
| | | <el-date-picker clearable |
| | | v-model="form.lastUpdatedDateTime" |
| | | type="datetime" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | placeholder="请éæ©æåæ´æ°æ¶é´"> |
| | | </el-date-picker> |
| | | </el-form-item> --> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button :loading="buttonLoading" type="primary" @click="submitForm">ç¡® å®</el-button> |
| | | <el-button @click="cancel">å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { listLocationGroup, getLocationGroup, delLocationGroup, addLocationGroup, updateLocationGroup } from "@/api/basicData/locationGroup"; |
| | | |
| | | export default { |
| | | name: "LocationGroup", |
| | | data() { |
| | | return { |
| | | // æé®loading |
| | | buttonLoading: false, |
| | | // é®ç½©å± |
| | | loading: true, |
| | | // éä¸æ°ç» |
| | | ids: [], |
| | | // éå个ç¦ç¨ |
| | | single: true, |
| | | // éå¤ä¸ªç¦ç¨ |
| | | multiple: true, |
| | | // æ¾ç¤ºæç´¢æ¡ä»¶ |
| | | showSearch: true, |
| | | // æ»æ¡æ° |
| | | total: 0, |
| | | // åºä½ç»è¡¨æ ¼æ°æ® |
| | | locationGroupList: [], |
| | | // å¼¹åºå±æ é¢ |
| | | title: "", |
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå± |
| | | open: false, |
| | | // æ¥è¯¢åæ° |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | locationGroupNo: undefined, |
| | | locationGroupName: undefined, |
| | | lgort: undefined, |
| | | }, |
| | | // 表ååæ° |
| | | form: {}, |
| | | // 表åæ ¡éª |
| | | rules: { |
| | | locationGroupId: [ |
| | | { required: true, message: "åºä½ç»IDä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | locationGroupNo: [ |
| | | { required: true, message: "åºä½ç»ç¼å·ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | werks: [ |
| | | { required: true, message: "å·¥åä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | locationGroupName: [ |
| | | { required: true, message: "åºä½ç»å称ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | lgort: [ |
| | | { required: true, message: "ä»åºç¼å·ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | description: [ |
| | | { required: true, message: "æè¿°ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | state: [ |
| | | { required: true, message: "ç¶æä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | displayOrder: [ |
| | | { required: true, message: "æåºä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | createdUserId: [ |
| | | { required: true, message: "å建人idä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | createdUserName: [ |
| | | { required: true, message: "å建人å§åä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | createdDateTime: [ |
| | | { required: true, message: "å建æ¥ææ¶é´ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | auditState: [ |
| | | { required: true, message: "å®¡æ ¸ç¶æä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | auditUserId: [ |
| | | { required: true, message: "å®¡æ ¸äººIDä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | auditUserName: [ |
| | | { required: true, message: "å®¡æ ¸äººå§åä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | auditDateTime: [ |
| | | { required: true, message: "å®¡æ ¸æ¥ææ¶é´ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | auditOpinion: [ |
| | | { required: true, message: "å®¡æ ¸æè§ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | lastUpdatedUserId: [ |
| | | { required: true, message: "æåæ´æ°äººidä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | lastUpdatedUserName: [ |
| | | { required: true, message: "æåæ´æ°äººå§åä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | lastUpdatedDateTime: [ |
| | | { required: true, message: "æåæ´æ°æ¶é´ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | isDeleted: [ |
| | | { required: true, message: "æ¯å¦å é¤ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ] |
| | | } |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | /** æ¥è¯¢åºä½ç»å表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | listLocationGroup(this.queryParams).then(response => { |
| | | this.locationGroupList = response.rows; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | // åæ¶æé® |
| | | cancel() { |
| | | this.open = false; |
| | | this.reset(); |
| | | }, |
| | | // 表åéç½® |
| | | reset() { |
| | | this.form = { |
| | | locationGroupId: undefined, |
| | | locationGroupNo: undefined, |
| | | werks: undefined, |
| | | locationGroupName: undefined, |
| | | lgort: undefined, |
| | | description: undefined, |
| | | state: undefined, |
| | | displayOrder: undefined, |
| | | createdUserId: undefined, |
| | | createdUserName: undefined, |
| | | createdDateTime: undefined, |
| | | auditState: undefined, |
| | | auditUserId: undefined, |
| | | auditUserName: undefined, |
| | | auditDateTime: undefined, |
| | | auditOpinion: undefined, |
| | | lastUpdatedUserId: undefined, |
| | | lastUpdatedUserName: undefined, |
| | | lastUpdatedDateTime: undefined, |
| | | isDeleted: undefined |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | | /** æç´¢æé®æä½ */ |
| | | handleQuery() { |
| | | this.queryParams.pageNum = 1; |
| | | this.getList(); |
| | | }, |
| | | /** éç½®æé®æä½ */ |
| | | resetQuery() { |
| | | this.resetForm("queryForm"); |
| | | this.handleQuery(); |
| | | }, |
| | | // å¤éæ¡éä¸æ°æ® |
| | | handleSelectionChange(selection) { |
| | | this.ids = selection.map(item => item.locationGroupId) |
| | | this.single = selection.length!==1 |
| | | this.multiple = !selection.length |
| | | }, |
| | | /** æ°å¢æé®æä½ */ |
| | | handleAdd() { |
| | | this.reset(); |
| | | this.open = true; |
| | | this.title = "æ·»å åºä½ç»"; |
| | | }, |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | handleUpdate(row) { |
| | | this.loading = true; |
| | | this.reset(); |
| | | const locationGroupId = row.locationGroupId || this.ids |
| | | getLocationGroup(locationGroupId).then(response => { |
| | | this.loading = false; |
| | | this.form = response.data; |
| | | this.open = true; |
| | | this.title = "ä¿®æ¹åºä½ç»"; |
| | | }); |
| | | }, |
| | | /** æ交æé® */ |
| | | submitForm() { |
| | | this.$refs["form"].validate(valid => { |
| | | if (valid) { |
| | | this.buttonLoading = true; |
| | | if (this.form.locationGroupId != null) { |
| | | updateLocationGroup(this.form).then(response => { |
| | | this.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }).finally(() => { |
| | | this.buttonLoading = false; |
| | | }); |
| | | } else { |
| | | addLocationGroup(this.form).then(response => { |
| | | this.$modal.msgSuccess("æ°å¢æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }).finally(() => { |
| | | this.buttonLoading = false; |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | /** å é¤æé®æä½ */ |
| | | handleDelete(row) { |
| | | const locationGroupIds = row.locationGroupId || this.ids; |
| | | this.$modal.confirm('æ¯å¦ç¡®è®¤å é¤åºä½ç»ç¼å·ä¸º"' + locationGroupIds + '"çæ°æ®é¡¹ï¼').then(() => { |
| | | this.loading = true; |
| | | return delLocationGroup(locationGroupIds); |
| | | }).then(() => { |
| | | this.loading = false; |
| | | this.getList(); |
| | | this.$modal.msgSuccess("å é¤æå"); |
| | | }).catch(() => { |
| | | }).finally(() => { |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | /** 导åºæé®æä½ */ |
| | | handleExport() { |
| | | this.download('system/locationGroup/export', { |
| | | ...this.queryParams |
| | | }, `locationGroup_${new Date().getTime()}.xlsx`) |
| | | } |
| | | } |
| | | }; |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <!-- æ·»å æä¿®æ¹IQCæ£éªé¡¹ç®å¯¹è¯æ¡ --> |
| | | <el-dialog |
| | | :title="title" |
| | | :visible.sync="open" |
| | | width="750px" |
| | | custom-class="madelClass" |
| | | :destroyOnClose="true" |
| | | > |
| | | <div class="contbox"> |
| | | <el-form |
| | | ref="form" |
| | | v-if="open" |
| | | :model="form" |
| | | :rules="rules" |
| | | :disabled="isCheck" |
| | | > |
| | | <el-form-item |
| | | v-for="(item, index) in formItem" |
| | | :key="index" |
| | | :label="item.label" |
| | | :prop="item.prop" |
| | | label-width="120px" |
| | | :class="item.component == 'inputNumber' ? 'itemFixed' : ''" |
| | | > |
| | | <template v-if="item.component == 'input'"> |
| | | <el-input |
| | | v-model="form[item.prop]" |
| | | :readonly="item.readonly" |
| | | :placeholder=" |
| | | item.prop == 'checkItemNo' ? 'èªå¨çæ' : '请è¾å
¥' + item.label |
| | | " |
| | | /> |
| | | </template> |
| | | <template v-if="item.component == 'inputNumber'"> |
| | | <el-input-number |
| | | v-model="form[item.prop]" |
| | | :label="'请è¾å
¥' + item.label" |
| | | ></el-input-number> |
| | | </template> |
| | | <template v-if="item.component == 'textarea'"> |
| | | <el-input |
| | | type="textarea" |
| | | :rows="2" |
| | | :placeholder="'请è¾å
¥' + item.label" |
| | | v-model="form[item.prop]" |
| | | > |
| | | </el-input> |
| | | </template> |
| | | <template v-if="item.component == 'select'"> |
| | | <template v-if="item.prop == 'werks'"> |
| | | <el-select |
| | | v-model="form[item.prop]" |
| | | :placeholder="'请éæ©' + item.label" |
| | | v-if="item.prop == 'werks'" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="dict in werksList" |
| | | :key="dict.werks" |
| | | :label="dict.werksName" |
| | | :value="dict.werks" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </template> |
| | | |
| | | <template v-if="item.prop == 'type'"> |
| | | <el-select |
| | | v-model="form[item.prop]" |
| | | :placeholder="'请éæ©' + item.label" |
| | | v-if="item.prop == 'type'" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="dict in werksList" |
| | | :key="dict.werks" |
| | | :label="dict.werksName" |
| | | :value="dict.werks" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </template> |
| | | |
| | | <template v-if="item.prop == 'isUseLocation'"> |
| | | <el-select |
| | | v-model="form[item.prop]" |
| | | :placeholder="'请éæ©' + item.label" |
| | | v-if="item.prop == 'isUseLocation'" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="dict in dict.type.isenable" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </template> |
| | | </template> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button |
| | | v-if="!isCheck" |
| | | :loading="buttonLoading" |
| | | type="primary" |
| | | @click="submitForm" |
| | | >ç¡® å®</el-button |
| | | > |
| | | <el-button @click="cancel">å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import { formatData, formrRquired, formatDataItem } from "./info.data"; |
| | | import { getWarehouse, addWarehouse, updateWarehouse } from "@/api/basicData/warehouse"; |
| | | import { listwerkshouse } from "@/api/basicData/location"; |
| | | export default { |
| | | name: "checkItemAdd", |
| | | components: {}, |
| | | dicts: ["isenable"], |
| | | data() { |
| | | return { |
| | | form: JSON.parse(JSON.stringify(formatData)), |
| | | rules: formrRquired, |
| | | open: false, |
| | | title: "", |
| | | buttonLoading: false, |
| | | isCheck: false, |
| | | werksList: [], |
| | | }; |
| | | }, |
| | | |
| | | computed: { |
| | | formItem() { |
| | | return formatDataItem; |
| | | }, |
| | | }, |
| | | watch:{ |
| | | open(val){ |
| | | if(!val){ |
| | | this.$refs["form"].resetFields(); |
| | | |
| | | } |
| | | |
| | | } |
| | | }, |
| | | mounted() { |
| | | listwerkshouse({ |
| | | pageNum: 1, |
| | | pageSize: 99, |
| | | }).then(res =>{ |
| | | console.log(res, 'å·¥å'); |
| | | this.werksList = res.rows; |
| | | }) |
| | | }, |
| | | methods: { |
| | | /** æ交æé® */ |
| | | submitForm() { |
| | | this.$refs["form"].validate((valid) => { |
| | | if (valid) { |
| | | this.buttonLoading = true; |
| | | if (this.form.warehouseId != null) { |
| | | updateWarehouse(this.form) |
| | | .then((response) => { |
| | | this.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | this.open = false; |
| | | this.$emit("getList"); |
| | | }) |
| | | .finally(() => { |
| | | this.buttonLoading = false; |
| | | }); |
| | | } else { |
| | | addWarehouse(this.form) |
| | | .then((response) => { |
| | | this.$modal.msgSuccess("æ°å¢æå"); |
| | | this.open = false; |
| | | this.$emit("getList"); |
| | | }) |
| | | .finally(() => { |
| | | this.buttonLoading = false; |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | // åæ¶æé® |
| | | cancel() { |
| | | this.reset(); |
| | | }, |
| | | reset() { |
| | | this.$refs["form"].resetFields(); |
| | | this.open = false; |
| | | this.isCheck = false; |
| | | }, |
| | | elDialogShow(type, info = "") { |
| | | this.open = true; |
| | | if (type == 1) { |
| | | this.title = "æ£æµé¡¹ç®æ·»å "; |
| | | this.isCheck = false; |
| | | } else if (type == 2) { |
| | | this.isCheck = false; |
| | | this.getDetailse(info); |
| | | this.title = "æ£æµé¡¹ç®ç¼è¾"; |
| | | } else { |
| | | this.title = "æ£æµé¡¹ç®æ¥ç"; |
| | | this.isCheck = true; |
| | | this.getDetailse(info); |
| | | } |
| | | this.$nextTick(()=>{ |
| | | |
| | | }) |
| | | }, |
| | | getDetailse(id) { |
| | | getWarehouse(id).then((res) => { |
| | | if (res.code === 200) { |
| | | this.form = res.data; |
| | | } |
| | | }); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | .contbox { |
| | | max-height: 60vh !important; |
| | | overflow: auto; |
| | | box-sizing: border-box; |
| | | padding: 0 20px; |
| | | } |
| | | .itemFixed { |
| | | display: inline-block !important; |
| | | } |
| | | .itemFixed:first-child { |
| | | display: block !important; |
| | | } |
| | | ::v-deep .is-disabled .el-input__inner { |
| | | color: #606266 !important; |
| | | } |
| | | // ::v-deep .el-input.is-disabled .el-input__inner |
| | | </style> |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="å·¥å" prop="werks"> |
| | | <el-input |
| | | v-model.trim="queryParams.werks" |
| | | placeholder="请è¾å
¥å·¥å" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="å称" prop="warehouseName"> |
| | | <el-input |
| | | v-model.trim="queryParams.warehouseName" |
| | | placeholder="请è¾å
¥å称" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="ç¼å·" prop="lgort"> |
| | | <el-input |
| | | v-model.trim="queryParams.lgort" |
| | | placeholder="请è¾å
¥ç¼å·" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="ç¶æ" prop="state"> |
| | | <el-input |
| | | v-model.trim="queryParams.state" |
| | | placeholder="请è¾å
¥ç¶æ" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="el-icon-plus" |
| | | size="mini" |
| | | @click="handleAdd" |
| | | v-hasPermi="['system:warehouse:add']" |
| | | >æ°å¢</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="success" |
| | | plain |
| | | icon="el-icon-edit" |
| | | size="mini" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['system:warehouse:edit']" |
| | | >ä¿®æ¹</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="el-icon-delete" |
| | | size="mini" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['system:warehouse:remove']" |
| | | >å é¤</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="el-icon-download" |
| | | size="mini" |
| | | @click="handleExport" |
| | | v-hasPermi="['system:warehouse:export']" |
| | | >导åº</el-button> |
| | | </el-col> |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table v-loading="loading" border :data="warehouseList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column |
| | | label="åºå·" |
| | | type="index" |
| | | fixed |
| | | width="50" /> |
| | | <!-- <el-table-column label="ä»åºID" align="center" prop="warehouseId" v-if="true"/> --> |
| | | <el-table-column label="ä»åºç¼å·" align="center" prop="lgort" /> |
| | | <el-table-column label="å称" align="center" prop="warehouseName" /> |
| | | <el-table-column label="å·¥å" align="center" prop="werks" /> |
| | | <el-table-column label="ç±»å«" align="center" prop="type" /> |
| | | <el-table-column label="æ¯å¦å¯ç¨" align="center" prop="isUseLocation" > |
| | | <template slot-scope="scope"> |
| | | <dict-tag :options="dict.type.isenable" :value="scope.row.isUseLocation"/> |
| | | <el-main class="contbox" ref="contBox"> |
| | | <div class="head" ref="headBox"> |
| | | <BaseSearch |
| | | @getList="getList" |
| | | :formItemList="searchFormSchema" |
| | | @search="getList" |
| | | @showSearchChange="getElHeight(28)" |
| | | > |
| | | <template #actionButton> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="el-icon-plus" |
| | | size="mini" |
| | | @click="handleAdd" |
| | | v-hasPermi="['iqc_checkItem_create']" |
| | | >æ°å¢</el-button |
| | | > |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="success" |
| | | plain |
| | | icon="el-icon-edit" |
| | | size="mini" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['iqc_checkItem_edit']" |
| | | >ä¿®æ¹</el-button |
| | | > |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="el-icon-delete" |
| | | size="mini" |
| | | @click="handleDelete" |
| | | v-hasPermi="['iqc_checkItem_delete']" |
| | | >å é¤</el-button |
| | | > |
| | | </el-col> |
| | | </template> |
| | | </el-table-column> |
| | | <!-- <el-table-column label="管çåID" align="center" prop="userId" /> --> |
| | | <el-table-column label="管çåå称" align="center" prop="userName" /> |
| | | <el-table-column label="管çåçµè¯" align="center" prop="userPhone" /> |
| | | <el-table-column label="åæ X" align="center" prop="coordinateX" /> |
| | | <el-table-column label="åæ Y" align="center" prop="coordinateY" /> |
| | | <el-table-column label="æè¿°" align="center" prop="description" /> |
| | | <!-- <el-table-column label="ç¶æ" align="center" prop="state" /> --> |
| | | <el-table-column label="æåæ´æ°äººid" align="center" prop="lastUpdatedUserId" /> |
| | | <el-table-column label="æåæ´æ°äººå§å" align="center" prop="lastUpdatedUserName" /> |
| | | <el-table-column label="æåæ´æ°æ¶é´" align="center" prop="lastUpdatedDateTime" width="180"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ parseTime(scope.row.lastUpdatedDateTime, '{y}-{m}-{d}') }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['system:warehouse:edit']" |
| | | >ä¿®æ¹</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['system:warehouse:remove']" |
| | | >å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="total>0" |
| | | :total="total" |
| | | :page.sync="queryParams.pageNum" |
| | | :limit.sync="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | |
| | | <!-- æ·»å æä¿®æ¹ä»åºå¯¹è¯æ¡ --> |
| | | <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="ä»åºç¼å·" prop="lgort"> |
| | | <el-input v-model.trim="form.lgort" placeholder="请è¾å
¥ä»åºç¼å·" /> |
| | | </el-form-item> |
| | | <el-form-item label="å称" prop="warehouseName"> |
| | | <el-input v-model.trim="form.warehouseName" placeholder="请è¾å
¥å称" /> |
| | | </el-form-item> |
| | | <el-form-item label="å·¥å" prop="werks"> |
| | | <el-input v-model.trim="form.werks" placeholder="请è¾å
¥å·¥å" /> |
| | | </el-form-item> |
| | | <el-form-item label="ç±»å«" prop="type"> |
| | | <el-input v-model.trim="form.type" placeholder="请è¾å
¥ç±»å«" /> |
| | | </el-form-item> |
| | | <el-form-item label="æ¯å¦å¯ç¨" prop="isUseLocation"> |
| | | <!-- <el-input v-model.trim="form.isUseLocation" placeholder="请è¾å
¥0,ä¸å¯ç¨ |
| | | 1,å¯ç¨" /> --> |
| | | <el-select v-model="form.isUseLocation" placeholder="æ¯å¦å¯ç¨" clearable> |
| | | <el-option |
| | | v-for="dict in dict.type.isenable" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="管çåå称" prop="userId"> |
| | | <el-input v-model.trim="form.userName" placeholder="请è¾å
¥ç®¡çåå称" /> |
| | | </el-form-item> |
| | | <el-form-item label="管çåçµè¯" prop="userPhone"> |
| | | <el-input v-model.trim="form.userPhone" placeholder="请è¾å
¥ç®¡çåçµè¯" /> |
| | | </el-form-item> |
| | | <el-form-item label="åæ X" prop="coordinateX"> |
| | | <el-input v-model.trim="form.coordinateX" placeholder="请è¾å
¥åæ X" /> |
| | | </el-form-item> |
| | | <el-form-item label="åæ Y" prop="coordinateY"> |
| | | <el-input v-model.trim="form.coordinateY" placeholder="请è¾å
¥åæ Y" /> |
| | | </el-form-item> |
| | | <el-form-item label="æè¿°" prop="description"> |
| | | <el-input v-model.trim="form.description" placeholder="请è¾å
¥æè¿°" /> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="ç¶æ" prop="state"> |
| | | <el-input v-model.trim="form.state" placeholder="请è¾å
¥ç¶æ" /> |
| | | </el-form-item> --> |
| | | <!-- <el-form-item label="æåæ´æ°äººid" prop="lastUpdatedUserId"> |
| | | <el-input v-model.trim="form.lastUpdatedUserId" placeholder="请è¾å
¥æåæ´æ°äººid" /> |
| | | </el-form-item> |
| | | <el-form-item label="æåæ´æ°äººå§å" prop="lastUpdatedUserName"> |
| | | <el-input v-model.trim="form.lastUpdatedUserName" placeholder="请è¾å
¥æåæ´æ°äººå§å" /> |
| | | </el-form-item> |
| | | <el-form-item label="æåæ´æ°æ¶é´" prop="lastUpdatedDateTime"> |
| | | <el-date-picker clearable |
| | | v-model="form.lastUpdatedDateTime" |
| | | type="datetime" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | placeholder="请éæ©æåæ´æ°æ¶é´"> |
| | | </el-date-picker> |
| | | </el-form-item> --> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button :loading="buttonLoading" type="primary" @click="submitForm">ç¡® å®</el-button> |
| | | <el-button @click="cancel">å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </BaseSearch> |
| | | </div> |
| | | <TableCom |
| | | :column="tabiInfo.columns" |
| | | :table-data="tabiInfo.tableData" |
| | | :table-loading="tabiInfo.tableLoading" |
| | | :isSelection="tabiInfo.isSelection" |
| | | :height="elementHeight" |
| | | rowKey="warehouseId" |
| | | ref="tabel" |
| | | @checkData="checkData" |
| | | @checkLook="checkInfo" |
| | | > |
| | | <template slot="checkType" slot-scope="scope"> |
| | | <dict-tag |
| | | :options="dict.type.check_type" |
| | | :value="scope.row.checkType" |
| | | /> |
| | | </template> |
| | | <template slot="isAutoCheck" slot-scope="scope"> |
| | | <dict-tag |
| | | :options="dict.type.is_auto_check" |
| | | :value="scope.row.isAutoCheck" |
| | | /> |
| | | </template> |
| | | <template slot="isRequired" slot-scope="scope"> |
| | | <dict-tag |
| | | :options="dict.type.is_required" |
| | | :value="scope.row.isRequired" |
| | | /> |
| | | </template> |
| | | <template slot="isToSpc" slot-scope="scope"> |
| | | <dict-tag :options="dict.type.is_to_spc" :value="scope.row.isToSpc" /> |
| | | </template> |
| | | <template slot="status" slot-scope="scope"> |
| | | <dict-tag :options="dict.type.status" :value="scope.row.status" /> |
| | | </template> |
| | | </TableCom> |
| | | <div class="pagination" ref="pagination"> |
| | | <pagination |
| | | v-show="pageInfo.pageTotal > 0" |
| | | :total="pageInfo.pageTotal" |
| | | :page.sync="pageInfo.currentPage" |
| | | :limit.sync="pageInfo.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | </div> |
| | | <AddaddModal ref="addaddModal" @getList="getList" /> |
| | | </el-main> |
| | | </template> |
| | | |
| | | <script> |
| | | import { listWarehouse, getWarehouse, delWarehouse, addWarehouse, updateWarehouse } from "@/api/basicData/warehouse"; |
| | | import TableCom from "@/components/Table/index"; |
| | | import BaseSearch from "@/components/Table/BaseSearch"; |
| | | |
| | | import { columns, searchFormSchema } from "./info.data"; |
| | | import mixin from "@/components/Table/mixins/resize"; |
| | | import { listWarehouse, delWarehouse } from "@/api/basicData/warehouse"; |
| | | import AddaddModal from "./addModal"; |
| | | |
| | | export default { |
| | | name: "Warehouse", |
| | | dicts: ['isenable'], |
| | | components: { TableCom, BaseSearch, AddaddModal }, |
| | | mixins: [mixin], |
| | | dicts: ["check_type", "is_auto_check", "is_required", "is_to_spc", "status"], |
| | | data() { |
| | | return { |
| | | // æé®loading |
| | | buttonLoading: false, |
| | | // é®ç½©å± |
| | | loading: true, |
| | | // éä¸æ°ç» |
| | | ids: [], |
| | | // éå个ç¦ç¨ |
| | | single: true, |
| | | // éå¤ä¸ªç¦ç¨ |
| | | multiple: true, |
| | | // æ¾ç¤ºæç´¢æ¡ä»¶ |
| | | showSearch: true, |
| | | // æ»æ¡æ° |
| | | total: 0, |
| | | // ä»åºè¡¨æ ¼æ°æ® |
| | | warehouseList: [], |
| | | // å¼¹åºå±æ é¢ |
| | | title: "", |
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå± |
| | | open: false, |
| | | // æ¥è¯¢åæ° |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | warehouseName: undefined, |
| | | werks: undefined, |
| | | type: undefined, |
| | | state: undefined, |
| | | searchFormSchema: searchFormSchema, |
| | | tabiInfo: { |
| | | columns: columns, |
| | | tableData: [], |
| | | tableLoading: false, |
| | | isSelection: true, |
| | | rowClassName: "rowClassName", |
| | | }, |
| | | // 表ååæ° |
| | | form: {}, |
| | | // 表åæ ¡éª |
| | | rules: { |
| | | warehouseId: [ |
| | | { required: true, message: "ä»åºIDä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | lgort: [ |
| | | { required: true, message: "ä»åºç¼å·ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | warehouseName: [ |
| | | { required: true, message: "å称ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | werks: [ |
| | | { required: true, message: "å·¥åä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | type: [ |
| | | { required: true, message: "ç±»å«ä¸è½ä¸ºç©º", trigger: "change" } |
| | | ], |
| | | // isUseLocation: [ |
| | | // { required: true, message: "0,ä¸å¯ç¨ |
| | | // 1,å¯ç¨ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | // ], |
| | | userId: [ |
| | | { required: true, message: "管çåIDä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | userPhone: [ |
| | | { required: true, message: "管çåçµè¯ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | coordinateX: [ |
| | | { required: true, message: "åæ Xä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | coordinateY: [ |
| | | { required: true, message: "åæ Yä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | description: [ |
| | | { required: true, message: "æè¿°ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | state: [ |
| | | { required: true, message: "ç¶æä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | |
| | | } |
| | | pageInfo: { |
| | | pageSize: 10, |
| | | pageTotal: 0, |
| | | currentPage: 1, |
| | | }, |
| | | visible: false, |
| | | ids: [], |
| | | open: false, |
| | | }; |
| | | }, |
| | | created() { |
| | | mounted() { |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | /** æ¥è¯¢ä»åºå表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | listWarehouse(this.queryParams).then(response => { |
| | | this.warehouseList = response.rows; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | // åæ¶æé® |
| | | cancel() { |
| | | this.open = false; |
| | | this.reset(); |
| | | }, |
| | | // 表åéç½® |
| | | reset() { |
| | | this.form = { |
| | | warehouseId: undefined, |
| | | lgort: undefined, |
| | | warehouseName: undefined, |
| | | werks: undefined, |
| | | type: undefined, |
| | | isUseLocation: undefined, |
| | | userId: undefined, |
| | | userPhone: undefined, |
| | | coordinateX: undefined, |
| | | coordinateY: undefined, |
| | | description: undefined, |
| | | state: undefined, |
| | | displayOrder: undefined, |
| | | createdUserId: undefined, |
| | | createdUserName: undefined, |
| | | createdDateTime: undefined, |
| | | lastUpdatedUserId: undefined, |
| | | lastUpdatedUserName: undefined, |
| | | lastUpdatedDateTime: undefined, |
| | | isDeleted: undefined |
| | | getList(info = {}) { |
| | | this.ids = []; |
| | | this.tabiInfo.tableLoading = true; |
| | | let params = { |
| | | pageSize: this.pageInfo.pageSize, |
| | | pageNum: this.pageInfo.currentPage, |
| | | bizType: 10, |
| | | ...info, |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | | /** æç´¢æé®æä½ */ |
| | | handleQuery() { |
| | | this.queryParams.pageNum = 1; |
| | | this.getList(); |
| | | }, |
| | | /** éç½®æé®æä½ */ |
| | | resetQuery() { |
| | | this.resetForm("queryForm"); |
| | | this.handleQuery(); |
| | | }, |
| | | // å¤éæ¡éä¸æ°æ® |
| | | handleSelectionChange(selection) { |
| | | this.ids = selection.map(item => item.warehouseId) |
| | | this.single = selection.length!==1 |
| | | this.multiple = !selection.length |
| | | }, |
| | | /** æ°å¢æé®æä½ */ |
| | | handleAdd() { |
| | | this.reset(); |
| | | this.open = true; |
| | | this.title = "æ·»å ä»åº"; |
| | | }, |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | handleUpdate(row) { |
| | | this.loading = true; |
| | | this.reset(); |
| | | const warehouseId = row.warehouseId || this.ids |
| | | getWarehouse(warehouseId).then(response => { |
| | | this.loading = false; |
| | | this.form = response.data; |
| | | this.open = true; |
| | | this.title = "ä¿®æ¹ä»åº"; |
| | | }); |
| | | }, |
| | | /** æ交æé® */ |
| | | submitForm() { |
| | | this.$refs["form"].validate(valid => { |
| | | if (valid) { |
| | | this.buttonLoading = true; |
| | | if (this.form.warehouseId != null) { |
| | | updateWarehouse(this.form).then(response => { |
| | | this.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }).finally(() => { |
| | | this.buttonLoading = false; |
| | | }); |
| | | } else { |
| | | addWarehouse(this.form).then(response => { |
| | | this.$modal.msgSuccess("æ°å¢æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }).finally(() => { |
| | | this.buttonLoading = false; |
| | | }); |
| | | } |
| | | listWarehouse(params).then((res) => { |
| | | if (res.code == 200) { |
| | | this.pageInfo.pageTotal = res.total; |
| | | this.tabiInfo.tableData = res.rows; |
| | | this.tabiInfo.tableLoading = false; |
| | | } |
| | | }); |
| | | }, |
| | | /** å é¤æé®æä½ */ |
| | | handleDelete(row) { |
| | | const warehouseIds = row.warehouseId || this.ids; |
| | | this.$modal.confirm('æ¯å¦ç¡®è®¤å é¤ä»åºç¼å·ä¸º"' + warehouseIds + '"çæ°æ®é¡¹ï¼').then(() => { |
| | | this.loading = true; |
| | | return delWarehouse(warehouseIds); |
| | | }).then(() => { |
| | | this.loading = false; |
| | | this.getList(); |
| | | this.$modal.msgSuccess("å é¤æå"); |
| | | }).catch(() => { |
| | | }).finally(() => { |
| | | this.loading = false; |
| | | }); |
| | | checkData(data) { |
| | | if (data.length) { |
| | | this.ids = data.map((item) => { |
| | | return item.warehouseId; |
| | | }); |
| | | } else { |
| | | this.ids = []; |
| | | } |
| | | }, |
| | | /** 导åºæé®æä½ */ |
| | | handleExport() { |
| | | this.download('system/warehouse/export', { |
| | | ...this.queryParams |
| | | }, `warehouse_${new Date().getTime()}.xlsx`) |
| | | } |
| | | } |
| | | handleAdd() { |
| | | this.$refs.addaddModal.elDialogShow(1); |
| | | }, |
| | | checkInfo(info) { |
| | | this.$refs.addaddModal.elDialogShow(3, info.warehouseId); |
| | | }, |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | handleUpdate() { |
| | | if (this.ids.length > 1) { |
| | | this.$message({ |
| | | message: "åªè½æä½åæ¡æ°æ®ï¼", |
| | | type: "warning", |
| | | }); |
| | | return; |
| | | } else if (this.ids.length < 1) { |
| | | this.$message({ |
| | | message: "请éæ©æ°æ®", |
| | | type: "warning", |
| | | }); |
| | | return; |
| | | } |
| | | this.$refs.addaddModal.elDialogShow(2, this.ids[0]); |
| | | }, |
| | | handleDelete() { |
| | | const warehouseIds = this.ids; |
| | | |
| | | if (warehouseIds.length) { |
| | | this.$modal |
| | | .confirm( |
| | | 'æ¯å¦ç¡®è®¤å é¤å·²éä¸çæ°æ®é¡¹ï¼' |
| | | ) |
| | | .then(() => { |
| | | this.tabiInfo.tableLoading = true; |
| | | return delWarehouse(warehouseIds); |
| | | }) |
| | | .then(() => { |
| | | this.tabiInfo.tableLoading = false; |
| | | this.ids = []; |
| | | this.getList(); |
| | | this.$message({ |
| | | message: "å é¤æå", |
| | | type: "success", |
| | | }); |
| | | }) |
| | | .catch(() => {}) |
| | | .finally(() => { |
| | | this.tabiInfo.tableLoading = false; |
| | | }); |
| | | } else { |
| | | this.$message({ |
| | | message: "请éæ©æ°æ®", |
| | | type: "warning", |
| | | }); |
| | | } |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | .rowClassName { |
| | | height: 50px; |
| | | } |
| | | .contbox { |
| | | width: 100; |
| | | height: 100%; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import * as vars from "@/variableSet/columns"; |
| | | |
| | | |
| | | export const columns = [ |
| | | { |
| | | label: 'ç¼å·', |
| | | align: 'left', |
| | | prop: 'lgort', |
| | | width: vars.checkItemNo, |
| | | fixed: 'left', |
| | | tooltip: true, |
| | | }, |
| | | { |
| | | label: 'å称', |
| | | align: 'left', |
| | | prop: 'warehouseName', |
| | | width: vars.checkItemName, |
| | | fixed: 'left', |
| | | }, |
| | | { |
| | | label: 'å·¥å', |
| | | align: 'left', |
| | | prop: 'werks', |
| | | width: vars.checkItemName, |
| | | fixed: 'left', |
| | | }, |
| | | { |
| | | label: 'ç±»å', |
| | | align: 'left', |
| | | prop: 'type', |
| | | width: vars.checkItemName, |
| | | |
| | | }, |
| | | { |
| | | label: 'æ¯å¦å¯ç¨', |
| | | prop: 'isUseLocation', |
| | | width: vars.checkType, |
| | | dataType: 'slot', |
| | | slot: 'isUseLocation' |
| | | }, |
| | | { |
| | | label: '管çåå称', |
| | | align: 'left', |
| | | prop: 'userName', |
| | | width: vars.checkStandard, |
| | | }, |
| | | { |
| | | label: '管çåçµè¯', |
| | | align: 'left', |
| | | prop: 'userPhone', |
| | | width: vars.standardVal, |
| | | }, |
| | | { |
| | | label: 'åæ X', |
| | | align: 'left', |
| | | prop: 'coordinateX', |
| | | width: vars.standardHigh, |
| | | }, |
| | | { |
| | | label: 'åæ Y', |
| | | align: 'left', |
| | | prop: 'coordinateY', |
| | | width: vars.standardLow, |
| | | }, |
| | | { |
| | | label: 'æè¿°', |
| | | align: 'left', |
| | | prop: 'description', |
| | | width: vars.description, |
| | | tooltip: true, |
| | | }, |
| | | { |
| | | label: 'æåæ´æ°äººå§å', |
| | | align: 'left', |
| | | prop: 'lastUpdatedUserName', |
| | | width: vars.lastUpdatedUserName, |
| | | }, |
| | | { |
| | | label: 'æåæ´æ°æ¥ææ¶é´', |
| | | align: 'left', |
| | | prop: 'lastUpdatedDateTime', |
| | | width: vars.lastUpdatedDateTime, |
| | | }, |
| | | { |
| | | dataType: 'option', |
| | | label: 'æä½', |
| | | width: '80', |
| | | align: 'center', |
| | | fixed: 'right', |
| | | hasPermi: 'iqc_checkItem_check', |
| | | operation: [ |
| | | { |
| | | name: 'æ¥ç', |
| | | size: 'mini', |
| | | plain: true, |
| | | typeText: 4 |
| | | } |
| | | ] |
| | | |
| | | } |
| | | ]; |
| | | export const searchFormSchema = [ |
| | | // { |
| | | // field: 'werks', |
| | | // label: 'å·¥å:', |
| | | // labelWidth: 80, |
| | | // component: 'Select', |
| | | // componentProps: { |
| | | // placeholder: '请éæ©', |
| | | // }, |
| | | // }, |
| | | { |
| | | field: 'warehouseName', |
| | | label: 'å称:', |
| | | labelWidth: 80, |
| | | component: 'Input', |
| | | componentProps: { |
| | | placeholder: '请è¾å
¥', |
| | | }, |
| | | }, |
| | | { |
| | | field: 'lgort', |
| | | label: 'ç¼å·:', |
| | | labelWidth: 80, |
| | | component: 'Input', |
| | | componentProps: { |
| | | placeholder: '请è¾å
¥', |
| | | }, |
| | | }, |
| | | // { |
| | | // field: 'state', |
| | | // label: 'ç¶æ:', |
| | | // labelWidth: 80, |
| | | // component: 'Select', |
| | | // componentProps: { |
| | | // options: [ |
| | | // { label: 'å¯ç¨', value: '1' }, |
| | | // { label: 'ç¦ç¨', value: '0' }, |
| | | // ], |
| | | // }, |
| | | // multiple: false, |
| | | // }, |
| | | |
| | | ]; |
| | | |
| | | export const formatData = { |
| | | warehouseId: undefined, |
| | | lgort: undefined, |
| | | warehouseName: undefined, |
| | | werks: undefined, |
| | | type: undefined, |
| | | isUseLocation: undefined, |
| | | userId: undefined, |
| | | userPhone: undefined, |
| | | coordinateX: undefined, |
| | | coordinateY: undefined, |
| | | description: undefined, |
| | | state: undefined, |
| | | displayOrder: undefined, |
| | | createdUserId: undefined, |
| | | createdUserName: undefined, |
| | | createdDateTime: undefined, |
| | | lastUpdatedUserId: undefined, |
| | | lastUpdatedUserName: undefined, |
| | | lastUpdatedDateTime: undefined, |
| | | isDeleted: undefined |
| | | }; |
| | | |
| | | export const formrRquired = { |
| | | warehouseId: [ |
| | | { required: true, message: "ä»åºIDä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | lgort: [ |
| | | { required: true, message: "ä»åºç¼å·ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | warehouseName: [ |
| | | { required: true, message: "å称ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | werks: [ |
| | | { required: true, message: "å·¥åä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | type: [ |
| | | { required: true, message: "ç±»å«ä¸è½ä¸ºç©º", trigger: "change" } |
| | | ], |
| | | // isUseLocation: [ |
| | | // { required: true, message: "0,ä¸å¯ç¨ |
| | | // 1,å¯ç¨ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | // ], |
| | | userId: [ |
| | | { required: true, message: "管çåIDä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | userPhone: [ |
| | | { required: true, message: "管çåçµè¯ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | coordinateX: [ |
| | | { required: true, message: "åæ Xä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | coordinateY: [ |
| | | { required: true, message: "åæ Yä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | // description: [ |
| | | // { required: true, message: "æè¿°ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | // ], |
| | | // state: [ |
| | | // { required: true, message: "ç¶æä¸è½ä¸ºç©º", trigger: "blur" } |
| | | // ], |
| | | } |
| | | export const formatDataItem = [ |
| | | { |
| | | label: "ä»åºç¼å·", |
| | | prop: 'lgort', |
| | | component: 'input', |
| | | // readonly: true |
| | | }, |
| | | { |
| | | label: "å称", |
| | | prop: 'warehouseName', |
| | | component: 'input' |
| | | |
| | | }, |
| | | { |
| | | label: "å·¥å", |
| | | prop: 'werks', |
| | | component: 'select', |
| | | }, |
| | | { |
| | | label: "ç±»å", |
| | | prop: 'type', |
| | | component: 'select' |
| | | }, |
| | | { |
| | | label: "æ¯å¦å¯ç¨", |
| | | prop: 'isUseLocation', |
| | | component: 'select' |
| | | }, |
| | | { |
| | | label: "管çåå称", |
| | | prop: 'userId', |
| | | component: 'input' |
| | | }, |
| | | { |
| | | label: "管çåçµè¯", |
| | | prop: 'userPhone', |
| | | component: 'input' |
| | | }, |
| | | { |
| | | label: "åæ X", |
| | | prop: 'coordinateX', |
| | | component: 'inputNumber' |
| | | }, |
| | | { |
| | | label: "åæ Y", |
| | | prop: 'coordinateY', |
| | | component: 'inputNumber' |
| | | }, |
| | | |
| | | { |
| | | label: "æè¿°", |
| | | prop: 'description', |
| | | component: 'textarea' |
| | | }, |
| | | |
| | | ] |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="å·¥å" prop="werks"> |
| | | <el-input |
| | | v-model.trim="queryParams.werks" |
| | | placeholder="请è¾å
¥å·¥å" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="å称" prop="warehouseName"> |
| | | <el-input |
| | | v-model.trim="queryParams.warehouseName" |
| | | placeholder="请è¾å
¥å称" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="ç¼å·" prop="lgort"> |
| | | <el-input |
| | | v-model.trim="queryParams.lgort" |
| | | placeholder="请è¾å
¥ç¼å·" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="ç¶æ" prop="state"> |
| | | <el-input |
| | | v-model.trim="queryParams.state" |
| | | placeholder="请è¾å
¥ç¶æ" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="el-icon-plus" |
| | | size="mini" |
| | | @click="handleAdd" |
| | | v-hasPermi="['system:warehouse:add']" |
| | | >æ°å¢</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="success" |
| | | plain |
| | | icon="el-icon-edit" |
| | | size="mini" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['system:warehouse:edit']" |
| | | >ä¿®æ¹</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="el-icon-delete" |
| | | size="mini" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['system:warehouse:remove']" |
| | | >å é¤</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="el-icon-download" |
| | | size="mini" |
| | | @click="handleExport" |
| | | v-hasPermi="['system:warehouse:export']" |
| | | >导åº</el-button> |
| | | </el-col> |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table v-loading="loading" border :data="warehouseList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column |
| | | label="åºå·" |
| | | type="index" |
| | | fixed |
| | | width="50" /> |
| | | <!-- <el-table-column label="ä»åºID" align="center" prop="warehouseId" v-if="true"/> --> |
| | | <el-table-column label="ä»åºç¼å·" align="center" prop="lgort" /> |
| | | <el-table-column label="å称" align="center" prop="warehouseName" /> |
| | | <el-table-column label="å·¥å" align="center" prop="werks" /> |
| | | <el-table-column label="ç±»å" align="center" prop="type" /> |
| | | <el-table-column label="æ¯å¦å¯ç¨" align="center" prop="isUseLocation" > |
| | | <template slot-scope="scope"> |
| | | <dict-tag :options="dict.type.isenable" :value="scope.row.isUseLocation"/> |
| | | </template> |
| | | </el-table-column> |
| | | <!-- <el-table-column label="管çåID" align="center" prop="userId" /> --> |
| | | <el-table-column label="管çåå称" align="center" prop="userName" /> |
| | | <el-table-column label="管çåçµè¯" align="center" prop="userPhone" /> |
| | | <el-table-column label="åæ X" align="center" prop="coordinateX" /> |
| | | <el-table-column label="åæ Y" align="center" prop="coordinateY" /> |
| | | <el-table-column label="æè¿°" align="center" prop="description" /> |
| | | <!-- <el-table-column label="ç¶æ" align="center" prop="state" /> --> |
| | | <el-table-column label="æåæ´æ°äººid" align="center" prop="lastUpdatedUserId" /> |
| | | <el-table-column label="æåæ´æ°äººå§å" align="center" prop="lastUpdatedUserName" /> |
| | | <el-table-column label="æåæ´æ°æ¶é´" align="center" prop="lastUpdatedDateTime" width="180"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ parseTime(scope.row.lastUpdatedDateTime, '{y}-{m}-{d}') }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['system:warehouse:edit']" |
| | | >ä¿®æ¹</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['system:warehouse:remove']" |
| | | >å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="total>0" |
| | | :total="total" |
| | | :page.sync="queryParams.pageNum" |
| | | :limit.sync="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | |
| | | <!-- æ·»å æä¿®æ¹ä»åºå¯¹è¯æ¡ --> |
| | | <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="ä»åºç¼å·" prop="lgort"> |
| | | <el-input v-model.trim="form.lgort" placeholder="请è¾å
¥ä»åºç¼å·" /> |
| | | </el-form-item> |
| | | <el-form-item label="å称" prop="warehouseName"> |
| | | <el-input v-model.trim="form.warehouseName" placeholder="请è¾å
¥å称" /> |
| | | </el-form-item> |
| | | <el-form-item label="å·¥å" prop="werks"> |
| | | <el-input v-model.trim="form.werks" placeholder="请è¾å
¥å·¥å" /> |
| | | </el-form-item> |
| | | <el-form-item label="ç±»å«" prop="type"> |
| | | <el-input v-model.trim="form.type" placeholder="请è¾å
¥ç±»å«" /> |
| | | </el-form-item> |
| | | <el-form-item label="æ¯å¦å¯ç¨" prop="isUseLocation"> |
| | | <!-- <el-input v-model.trim="form.isUseLocation" placeholder="请è¾å
¥0,ä¸å¯ç¨ |
| | | 1,å¯ç¨" /> --> |
| | | <el-select v-model="form.isUseLocation" placeholder="æ¯å¦å¯ç¨" clearable> |
| | | <el-option |
| | | v-for="dict in dict.type.isenable" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="管çåå称" prop="userId"> |
| | | <el-input v-model.trim="form.userName" placeholder="请è¾å
¥ç®¡çåå称" /> |
| | | </el-form-item> |
| | | <el-form-item label="管çåçµè¯" prop="userPhone"> |
| | | <el-input v-model.trim="form.userPhone" placeholder="请è¾å
¥ç®¡çåçµè¯" /> |
| | | </el-form-item> |
| | | <el-form-item label="åæ X" prop="coordinateX"> |
| | | <el-input v-model.trim="form.coordinateX" placeholder="请è¾å
¥åæ X" /> |
| | | </el-form-item> |
| | | <el-form-item label="åæ Y" prop="coordinateY"> |
| | | <el-input v-model.trim="form.coordinateY" placeholder="请è¾å
¥åæ Y" /> |
| | | </el-form-item> |
| | | <el-form-item label="æè¿°" prop="description"> |
| | | <el-input v-model.trim="form.description" placeholder="请è¾å
¥æè¿°" /> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="ç¶æ" prop="state"> |
| | | <el-input v-model.trim="form.state" placeholder="请è¾å
¥ç¶æ" /> |
| | | </el-form-item> --> |
| | | <!-- <el-form-item label="æåæ´æ°äººid" prop="lastUpdatedUserId"> |
| | | <el-input v-model.trim="form.lastUpdatedUserId" placeholder="请è¾å
¥æåæ´æ°äººid" /> |
| | | </el-form-item> |
| | | <el-form-item label="æåæ´æ°äººå§å" prop="lastUpdatedUserName"> |
| | | <el-input v-model.trim="form.lastUpdatedUserName" placeholder="请è¾å
¥æåæ´æ°äººå§å" /> |
| | | </el-form-item> |
| | | <el-form-item label="æåæ´æ°æ¶é´" prop="lastUpdatedDateTime"> |
| | | <el-date-picker clearable |
| | | v-model="form.lastUpdatedDateTime" |
| | | type="datetime" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | placeholder="请éæ©æåæ´æ°æ¶é´"> |
| | | </el-date-picker> |
| | | </el-form-item> --> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button :loading="buttonLoading" type="primary" @click="submitForm">ç¡® å®</el-button> |
| | | <el-button @click="cancel">å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { listWarehouse, getWarehouse, delWarehouse, addWarehouse, updateWarehouse } from "@/api/basicData/warehouse"; |
| | | |
| | | export default { |
| | | name: "Warehouse", |
| | | dicts: ['isenable'], |
| | | data() { |
| | | return { |
| | | // æé®loading |
| | | buttonLoading: false, |
| | | // é®ç½©å± |
| | | loading: true, |
| | | // éä¸æ°ç» |
| | | ids: [], |
| | | // éå个ç¦ç¨ |
| | | single: true, |
| | | // éå¤ä¸ªç¦ç¨ |
| | | multiple: true, |
| | | // æ¾ç¤ºæç´¢æ¡ä»¶ |
| | | showSearch: true, |
| | | // æ»æ¡æ° |
| | | total: 0, |
| | | // ä»åºè¡¨æ ¼æ°æ® |
| | | warehouseList: [], |
| | | // å¼¹åºå±æ é¢ |
| | | title: "", |
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå± |
| | | open: false, |
| | | // æ¥è¯¢åæ° |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | warehouseName: undefined, |
| | | werks: undefined, |
| | | type: undefined, |
| | | state: undefined, |
| | | }, |
| | | // 表ååæ° |
| | | form: {}, |
| | | // 表åæ ¡éª |
| | | rules: { |
| | | warehouseId: [ |
| | | { required: true, message: "ä»åºIDä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | lgort: [ |
| | | { required: true, message: "ä»åºç¼å·ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | warehouseName: [ |
| | | { required: true, message: "å称ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | werks: [ |
| | | { required: true, message: "å·¥åä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | type: [ |
| | | { required: true, message: "ç±»å«ä¸è½ä¸ºç©º", trigger: "change" } |
| | | ], |
| | | // isUseLocation: [ |
| | | // { required: true, message: "0,ä¸å¯ç¨ |
| | | // 1,å¯ç¨ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | // ], |
| | | userId: [ |
| | | { required: true, message: "管çåIDä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | userPhone: [ |
| | | { required: true, message: "管çåçµè¯ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | coordinateX: [ |
| | | { required: true, message: "åæ Xä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | coordinateY: [ |
| | | { required: true, message: "åæ Yä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | description: [ |
| | | { required: true, message: "æè¿°ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | state: [ |
| | | { required: true, message: "ç¶æä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | |
| | | } |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | /** æ¥è¯¢ä»åºå表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | listWarehouse(this.queryParams).then(response => { |
| | | this.warehouseList = response.rows; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | // åæ¶æé® |
| | | cancel() { |
| | | this.open = false; |
| | | this.reset(); |
| | | }, |
| | | // 表åéç½® |
| | | reset() { |
| | | this.form = { |
| | | warehouseId: undefined, |
| | | lgort: undefined, |
| | | warehouseName: undefined, |
| | | werks: undefined, |
| | | type: undefined, |
| | | isUseLocation: undefined, |
| | | userId: undefined, |
| | | userPhone: undefined, |
| | | coordinateX: undefined, |
| | | coordinateY: undefined, |
| | | description: undefined, |
| | | state: undefined, |
| | | displayOrder: undefined, |
| | | createdUserId: undefined, |
| | | createdUserName: undefined, |
| | | createdDateTime: undefined, |
| | | lastUpdatedUserId: undefined, |
| | | lastUpdatedUserName: undefined, |
| | | lastUpdatedDateTime: undefined, |
| | | isDeleted: undefined |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | | /** æç´¢æé®æä½ */ |
| | | handleQuery() { |
| | | this.queryParams.pageNum = 1; |
| | | this.getList(); |
| | | }, |
| | | /** éç½®æé®æä½ */ |
| | | resetQuery() { |
| | | this.resetForm("queryForm"); |
| | | this.handleQuery(); |
| | | }, |
| | | // å¤éæ¡éä¸æ°æ® |
| | | handleSelectionChange(selection) { |
| | | this.ids = selection.map(item => item.warehouseId) |
| | | this.single = selection.length!==1 |
| | | this.multiple = !selection.length |
| | | }, |
| | | /** æ°å¢æé®æä½ */ |
| | | handleAdd() { |
| | | this.reset(); |
| | | this.open = true; |
| | | this.title = "æ·»å ä»åº"; |
| | | }, |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | handleUpdate(row) { |
| | | this.loading = true; |
| | | this.reset(); |
| | | const warehouseId = row.warehouseId || this.ids |
| | | getWarehouse(warehouseId).then(response => { |
| | | this.loading = false; |
| | | this.form = response.data; |
| | | this.open = true; |
| | | this.title = "ä¿®æ¹ä»åº"; |
| | | }); |
| | | }, |
| | | /** æ交æé® */ |
| | | submitForm() { |
| | | this.$refs["form"].validate(valid => { |
| | | if (valid) { |
| | | this.buttonLoading = true; |
| | | if (this.form.warehouseId != null) { |
| | | updateWarehouse(this.form).then(response => { |
| | | this.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }).finally(() => { |
| | | this.buttonLoading = false; |
| | | }); |
| | | } else { |
| | | addWarehouse(this.form).then(response => { |
| | | this.$modal.msgSuccess("æ°å¢æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }).finally(() => { |
| | | this.buttonLoading = false; |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | /** å é¤æé®æä½ */ |
| | | handleDelete(row) { |
| | | const warehouseIds = row.warehouseId || this.ids; |
| | | this.$modal.confirm('æ¯å¦ç¡®è®¤å é¤ä»åºç¼å·ä¸º"' + warehouseIds + '"çæ°æ®é¡¹ï¼').then(() => { |
| | | this.loading = true; |
| | | return delWarehouse(warehouseIds); |
| | | }).then(() => { |
| | | this.loading = false; |
| | | this.getList(); |
| | | this.$modal.msgSuccess("å é¤æå"); |
| | | }).catch(() => { |
| | | }).finally(() => { |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | /** 导åºæé®æä½ */ |
| | | handleExport() { |
| | | this.download('system/warehouse/export', { |
| | | ...this.queryParams |
| | | }, `warehouse_${new Date().getTime()}.xlsx`) |
| | | } |
| | | } |
| | | }; |
| | | </script> |