From 0211b730e5f0b1f10a8a3243e30fe599e22f2238 Mon Sep 17 00:00:00 2001 From: cuijian <cuijian@xalxzn.com> Date: 星期二, 01 七月 2025 18:12:04 +0800 Subject: [PATCH] 质量-检验工具,检验项目 --- src/components/jeecgbiz/modal/JSelectFactoryModal.vue | 310 ++++++++ src/views/qms/InspectionToolsList.vue | 317 +++++++++ src/views/qms/modules/inspectionTools/InspectionToolsModel.vue | 228 ++++++ src/views/base/ShiftGroupManager.vue | 18 src/views/base/FactoryManager.vue | 4 src/views/base/modules/shift/ShiftModel.vue | 27 src/views/modules/message/SysMessageTemplateList.vue | 2 src/views/qms/modules/inspectionItem/InspectionItemModel.vue | 274 +++++++ src/views/base/modules/warehouse/WarehouseModel.vue | 57 + src/views/qms/InspectionItemList.vue | 332 +++++++++ src/views/base/SupplierList.vue | 83 +- src/views/base/modules/group/GroupModal.vue | 50 src/views/system/modules/UserModal.vue | 50 src/components/jeecgbiz/JSelectFactory.vue | 180 +++++ src/views/base/WarehouseList.vue | 58 - src/views/base/modules/supplier/SupplierModel.vue | 32 src/views/base/ShiftManager.vue | 52 + 17 files changed, 1,878 insertions(+), 196 deletions(-) diff --git a/src/components/jeecgbiz/JSelectFactory.vue b/src/components/jeecgbiz/JSelectFactory.vue new file mode 100644 index 0000000..1af1e2f --- /dev/null +++ b/src/components/jeecgbiz/JSelectFactory.vue @@ -0,0 +1,180 @@ +<template> + <div class="components-input-demo-presuffix"> + <!----> + <a-input @click="openModal" placeholder="璇风偣鍑婚�夋嫨杞﹂棿" v-model="textVals" readOnly :disabled="disabled"> + <a-icon slot="prefix" type="cluster" title="杞﹂棿閫夋嫨鎺т欢"/> + <a-icon v-if="storeVals" slot="suffix" type="close-circle" @click="handleEmpty" title="娓呯┖"/> + </a-input> + <j-select-factory-modal + ref="factorySelectModal" + :modal-width="modalWidth" + :multi="multi" + :rootOpened="rootOpened" + :factory-id="value" + :store="storeField" + :text="textField" + :treeFactoryOpera="treeFactoryOpera" + @ok="handleOK" + @initComp="initComp"> + + </j-select-factory-modal> + </div> +</template> + +<script> + import JSelectFactoryModal from './modal/JSelectFactoryModal' + import { underLinetoHump } from '@/components/_util/StringUtil' + export default { + name: 'JSelectFactory', + components:{ + JSelectFactoryModal + }, + props:{ + modalWidth:{ + type:Number, + default:500, + required:false + }, + multi:{ + type:Boolean, + default:false, + required:false + }, + rootOpened:{ + type:Boolean, + default:true, + required:false + }, + value:{ + type:String, + required:false + }, + disabled:{ + type: Boolean, + required: false, + default: false + }, + // 鑷畾涔夎繑鍥炲瓧娈碉紝榛樿杩斿洖 id + customReturnField: { + type: String, + default: '' + }, + backProduction: { + type: Boolean, + default: false, + required: false + }, + // 瀛樺偍瀛楁 [key field] + store: { + type: String, + default: 'id', + required: false + }, + // 鏄剧ず瀛楁 [label field] + text: { + type: String, + default: 'factoryName', + required: false + }, + treeFactoryOpera: { + type: Boolean, + default: false, + required: false + } + + }, + data(){ + return { + visible:false, + confirmLoading:false, + storeVals: '', //[key values] + textVals: '' //[label values] + } + }, + computed:{ + storeField(){ + let field = this.customReturnField + if(!field){ + field = this.store; + } + return underLinetoHump(field) + }, + textField(){ + return underLinetoHump(this.text) + } + }, + mounted(){ + this.storeVals = this.value + }, + watch:{ + value(val){ + this.storeVals = val + } + }, + methods:{ + initComp(textVals){ + this.textVals = textVals + }, + //杩斿洖閫変腑鐨勮溅闂翠俊鎭� + backProductInfo(){ + if(this.backProduction===true){ + if(this.storeVals && this.storeVals.length>0){ + let arr1 = this.storeVals.split(',') + let arr2 = this.textVals.split(',') + let info = [] + for(let i=0;i<arr1.length;i++){ + info.push({ + value: arr1[i], + text: arr2[i] + }) + } + this.$emit('back', info) + } + } + }, + openModal(){ + this.$refs.factorySelectModal.show() + }, + handleOK(rows) { + if (!rows && rows.length <= 0) { + this.textVals = '' + this.storeVals = '' + } else { + let arr1 = [] + let arr2 = [] + for(let dep of rows){ + arr1.push(dep[this.storeField]) + arr2.push(dep[this.textField]) + } + this.storeVals = arr1.join(',') + this.textVals = arr2.join(',') + } + this.$emit("change", this.storeVals) + this.backProductInfo() + }, + + handleEmpty(){ + this.handleOK('') + } + }, + model: { + prop: 'value', + event: 'change' + } + } +</script> + +<style scoped> + .components-input-demo-presuffix .anticon-close-circle { + cursor: pointer; + color: #ccc; + transition: color 0.3s; + font-size: 12px; + } + .components-input-demo-presuffix .anticon-close-circle:hover { + color: #f5222d; + } + .components-input-demo-presuffix .anticon-close-circle:active { + color: #666; + } +</style> \ No newline at end of file diff --git a/src/components/jeecgbiz/modal/JSelectFactoryModal.vue b/src/components/jeecgbiz/modal/JSelectFactoryModal.vue new file mode 100644 index 0000000..e5f0b44 --- /dev/null +++ b/src/components/jeecgbiz/modal/JSelectFactoryModal.vue @@ -0,0 +1,310 @@ +<template> + <j-modal + title="閫夋嫨杞﹂棿" + :width="modalWidth" + :visible="visible" + :confirmLoading="confirmLoading" + @ok="handleSubmit" + @cancel="handleCancel" + @update:fullscreen="isFullscreen" + wrapClassName="j-production-select-modal" + switchFullscreen + cancelText="鍏抽棴"> + <a-spin tip="Loading..." :spinning="false"> + <a-input-search style="margin-bottom: 1px" placeholder="璇疯緭鍏ヨ溅闂村悕绉版寜鍥炶溅杩涜鎼滅储" @search="onSearch" /> + <a-tree + checkable + :class="treeScreenClass" + :treeData="treeData" + :checkStrictly="checkStrictly" + @check="onCheck" + @select="onSelect" + @expand="onExpand" + :autoExpandParent="autoExpandParent" + :expandedKeys="expandedKeys" + :checkedKeys="checkedKeys"> + + <template slot="title" slot-scope="{title}"> + <span v-if="title.indexOf(searchValue) > -1"> + {{title.substr(0, title.indexOf(searchValue))}} + <span style="color: #f50">{{searchValue}}</span> + {{title.substr(title.indexOf(searchValue) + searchValue.length)}} + </span> + <span v-else>{{title}}</span> + </template> + </a-tree> + </a-spin> + <!--搴曢儴鐖跺瓙鍏宠仈鎿嶄綔鍜岀‘璁ゅ彇娑堟寜閽�--> + <!--<template slot="footer">--> + <!--<div class="drawer-bootom-button">--> + <!--<a-dropdown style="float: left" :trigger="['click']" placement="topCenter">--> + <!--<a-menu slot="overlay">--> + <!--<a-menu-item key="1" @click="switchCheckStrictly(1)">鐖跺瓙鍏宠仈</a-menu-item>--> + <!--<a-menu-item key="2" @click="switchCheckStrictly(2)">鍙栨秷鍏宠仈</a-menu-item>--> + <!--</a-menu>--> + <!--<a-button>--> + <!--鏍戞搷浣� <a-icon type="up" />--> + <!--</a-button>--> + <!--</a-dropdown>--> + <!--<a-button @click="handleCancel" type="primary" style="margin-right: 0.8rem">鍏抽棴</a-button>--> + <!--<a-button @click="handleSubmit" type="primary" >纭</a-button>--> + <!--</div>--> + <!--</template>--> + </j-modal> +</template> + +<script> + import { queryFactoryTreeList } from '@/api/api' + export default { + name: 'JSelectFactoryModal', + props:['modalWidth','multi','rootOpened','factoryId', 'store', 'text','treeOpera'], + data(){ + return { + visible:false, + confirmLoading:false, + treeData:[], + autoExpandParent:true, + expandedKeys:[], + dataList:[], + checkedKeys:[], + checkedRows:[], + searchValue:"", + checkStrictly: false, + fullscreen:false + } + }, + created(){ + this.loadFactory(); + }, + watch:{ + factoryId(){ + this.initFactoryComponent() + }, + visible: { + handler() { + this.initFactoryComponent(true) + } + } + }, + computed:{ + treeScreenClass() { + return { + 'my-factory-select-tree': true, + 'fullscreen': this.fullscreen, + } + }, + }, + methods:{ + show(){ + this.visible=true + this.checkedRows=[] + this.checkedKeys=[] + }, + loadFactory(){ + // 杩欎釜鏂规硶鏄壘鍒版墍鏈夌殑杞﹂棿淇℃伅 + queryFactoryTreeList().then(res=>{ + if(res.success){ + let arr = [...res.result] + this.reWriterWithSlot(arr) + this.treeData = arr + this.initFactoryComponent() + if(this.rootOpened){ + this.initExpandedKeys(res.result) + } + } + }) + }, + initFactoryComponent(flag){ + let arr = [] + //璇ユ柟娉曚袱涓湴鏂圭敤 1.visible鏀瑰彉浜嬩欢閲嶆柊璁剧疆閫変腑椤� 2.缁勪欢缂栬緫椤甸潰鍥炴樉 + let fieldName = flag==true?'key':this.text + if(this.factoryId){ + let arr2 = this.factoryId.split(',') + for(let item of this.dataList){ + if(arr2.indexOf(item[this.store])>=0){ + arr.push(item[fieldName]) + } + } + } + if(flag==true){ + this.checkedKeys = [...arr] + }else{ + this.$emit("initComp", arr.join(',')) + } + }, + reWriterWithSlot(arr){ + for(let item of arr){ + if(item.children && item.children.length>0){ + this.reWriterWithSlot(item.children) + let temp = Object.assign({},item) + temp.children = {} + this.dataList.push(temp) + }else{ + this.dataList.push(item) + item.scopedSlots={ title: 'title' } + } + } + }, + initExpandedKeys(arr){ + if(arr && arr.length>0){ + let keys = [] + for(let item of arr){ + if(item.children && item.children.length>0){ + keys.push(item.id) + } + } + this.expandedKeys=[...keys] + //鍏ㄩ儴keys + //this.allTreeKeys = [...keys] + }else{ + this.expandedKeys=[] + //this.allTreeKeys = [] + } + }, + onCheck (checkedKeys,info) { + if(!this.multi){ + let arr = checkedKeys.checked.filter(item => this.checkedKeys.indexOf(item) < 0) + this.checkedKeys = [...arr] + this.checkedRows = (this.checkedKeys.length === 0) ? [] : [info.node.dataRef] + }else{ + if(this.checkStrictly){ + this.checkedKeys = checkedKeys.checked + }else{ + this.checkedKeys = checkedKeys + } + this.checkedRows = this.getCheckedRows(this.checkedKeys) + } + }, + onSelect(selectedKeys,info) { + //鍙栨秷鍏宠仈鐨勬儏鍐典笅鎵嶈蛋onSelect鐨勯�昏緫 + if(this.checkStrictly){ + let keys = [] + keys.push(selectedKeys[0]) + if(!this.checkedKeys || this.checkedKeys.length===0 || !this.multi){ + this.checkedKeys = [...keys] + this.checkedRows=[info.node.dataRef] + }else{ + let currKey = info.node.dataRef.key + if(this.checkedKeys.indexOf(currKey)>=0){ + this.checkedKeys = this.checkedKeys.filter(item=> item !==currKey) + }else{ + this.checkedKeys.push(...keys) + } + } + this.checkedRows = this.getCheckedRows(this.checkedKeys) + } + }, + onExpand (expandedKeys) { + this.expandedKeys = expandedKeys + this.autoExpandParent = false + }, + handleSubmit(){ + if(!this.checkedKeys || this.checkedKeys.length==0){ + this.$emit("ok",'') + }else{ + let checkRow = this.getCheckedRows(this.checkedKeys) + let keyStr = this.checkedKeys.join(",") + this.$emit("ok", checkRow, keyStr) + } + this.handleClear() + }, + handleCancel(){ + this.handleClear() + }, + handleClear(){ + this.visible=false + this.checkedKeys=[] + }, + getParentKey(currKey,treeData){ + let parentKey + for (let i = 0; i < treeData.length; i++) { + const node = treeData[i] + if (node.children) { + if (node.children.some(item => item.key === currKey)) { + parentKey = node.key + } else if (this.getParentKey(currKey, node.children)) { + parentKey = this.getParentKey(currKey, node.children) + } + } + } + return parentKey + }, + onSearch(value){ + const expandedKeys = this.dataList.map((item) => { + if (item.title.indexOf(value) > -1) { + return this.getParentKey(item.key,this.treeData) + } + return null + }).filter((item, i, self) => item && self.indexOf(item) === i) + + Object.assign(this, { + expandedKeys, + searchValue: value, + autoExpandParent: true, + }) + + + }, + // 鏍规嵁 checkedKeys 鑾峰彇 rows + getCheckedRows(checkedKeys) { + const forChildren = (list, key) => { + for (let item of list) { + if (item.id === key) { + return item + } + if (item.children instanceof Array) { + let value = forChildren(item.children, key) + if (value != null) { + return value + } + } + } + return null + } + + let rows = [] + for (let key of checkedKeys) { + let row = forChildren(this.treeData, key) + if (row != null) { + rows.push(row) + } + } + return rows + }, + switchCheckStrictly (v) { + if(v==1){ + this.checkStrictly = false + }else if(v==2){ + this.checkStrictly = true + } + }, + isFullscreen(val){ + this.fullscreen=val + } + } + } + +</script> + +<style lang="less" scoped> + // 闄愬埗閮ㄩ棬閫夋嫨鏍戦珮搴︼紝閬垮厤閮ㄩ棬澶鏃剁偣鍑荤‘瀹氫笉渚� + .my-factory-select-tree{ + height:350px; + + &.fullscreen{ + height: calc(100vh - 250px); + } + overflow-y: scroll; + } + .drawer-bootom-button { + position: absolute; + bottom: 0; + width: 100%; + border-top: 1px solid #e8e8e8; + padding: 10px 16px; + text-align: right; + left: 0; + background: #fff; + border-radius: 0 0 2px 2px; + } +</style> \ No newline at end of file diff --git a/src/views/base/FactoryManager.vue b/src/views/base/FactoryManager.vue index c2f7347..8d11dc0 100644 --- a/src/views/base/FactoryManager.vue +++ b/src/views/base/FactoryManager.vue @@ -119,11 +119,11 @@ </a-row> </template> <script> - import UserFactory from './modules/FactoryManager/UserFactory' + import UserFactory from './modules/factoryManager/UserFactory' import { queryFactoryTreeList, searchByKeywords, deleteByFactory } from '@/api/api' import { httpAction, deleteAction } from '@/api/manage' import { JeecgListMixin } from '@/mixins/JeecgListMixin' - import FactoryModal from './modules/FactoryManager/FactoryModal' + import FactoryModal from './modules/factoryManager/FactoryModal' export default { name: 'FactoryManager', diff --git a/src/views/base/ShiftGroupManager.vue b/src/views/base/ShiftGroupManager.vue index 532d70a..1da4708 100644 --- a/src/views/base/ShiftGroupManager.vue +++ b/src/views/base/ShiftGroupManager.vue @@ -15,7 +15,7 @@ <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> <a-col :md="12" :sm="24"> <a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 21px">鏌ヨ</a-button> - <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> </a-col> </span> </a-row> @@ -221,6 +221,21 @@ title: '鐝粍鍚嶇О', align: 'center', dataIndex: 'groupName' + }, + { + title: '鐝粍闀�', + align: 'center', + dataIndex: 'groupManager_dictText' + }, + { + title: '鐝', + align: 'center', + dataIndex: 'shiftId_dictText' + }, + { + title: '浜х嚎', + align: 'center', + dataIndex: 'factoryId_dictText' }, { title: '鍒涘缓鏃堕棿', @@ -456,6 +471,7 @@ this.$message.error('璇烽�夋嫨涓�涓彮缁�!') } else { this.$refs.selectUserModal.visible = true + this.$refs.selectUserModal.selectedRowKeys = [] } }, handleOpen(record) { diff --git a/src/views/base/ShiftManager.vue b/src/views/base/ShiftManager.vue index 28075cc..31f6d33 100644 --- a/src/views/base/ShiftManager.vue +++ b/src/views/base/ShiftManager.vue @@ -36,7 +36,7 @@ slot="shiftStatus" slot-scope="text, record" > - <span v-if="text == 0" style="color:red;">鍋滅敤</span> + <span v-if="text == 0" style="color:red;">绂佺敤</span> <span v-if="text == 1" style="color:green;">鍚敤</span> </span> <span @@ -46,16 +46,52 @@ <span v-if="text == '1'">鏄�</span> <span v-if="text == '0'">鍚�</span> </span> - <span + + <span slot="action" slot-scope="text, record" > - <a v-if="record.shiftStatus == 1" @click="handleEdit(record)">缂栬緫</a> - <a-divider type="vertical" v-if="record.shiftStatus == 1"/> - <a v-if="record.shiftStatus == 0" @click="handleStatus(record.id,1)">鍚敤</a> - <a v-if="record.shiftStatus == 1" @click="handleStatus(record.id,0)">鍋滅敤</a> - <a-divider type="vertical" /> - <a @click="handleDelete(record.id)">鍒犻櫎</a> + <a + href="javascript:;" + @click="handleDetail(record)" + >璇︽儏</a> + + <a-divider type="vertical" /> + <a-dropdown> + <a class="ant-dropdown-link">鏇村 + <a-icon type="down" /> + </a> + <a-menu slot="overlay"> + <a-menu-item> + <a v-if="record.shiftStatus == 1" @click="handleEdit(record)">缂栬緫</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm + title="纭畾鍒犻櫎鍚�?" + @confirm="() => handleDelete(record.id)" + > + <a>鍒犻櫎</a> + </a-popconfirm> + + </a-menu-item> + <a-menu-item v-if="record.shiftStatus == 0"> + <a-popconfirm + title="纭畾鍚敤鍚�?" + @confirm="() => handleStatus(record.id,1)" + > + <a>鍚敤</a> + </a-popconfirm> + </a-menu-item> + <a-menu-item v-if="record.shiftStatus == 1"> + <a-popconfirm + title="纭畾绂佺敤鍚�?" + @confirm="() => handleStatus(record.id,0)" + > + <a>绂佺敤</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> </span> </a-table> </div> diff --git a/src/views/base/SupplierList.vue b/src/views/base/SupplierList.vue index 701e9a6..bbc0a89 100644 --- a/src/views/base/SupplierList.vue +++ b/src/views/base/SupplierList.vue @@ -1,7 +1,6 @@ <template> <a-card :bordered="false" - title="渚涘簲鍟�" > <!-- 鏌ヨ鍖哄煙 --> <div class="table-page-search-wrapper"> @@ -11,10 +10,7 @@ > <a-row :gutter="30"> - <a-col - :md="6" - :sm="24" - > + <a-col :xl="4" :lg="7" :md="8" :sm="24"> <a-form-item label="渚涘簲鍟嗙紪鍙�"> <j-input placeholder="璇疯緭鍏ヤ緵搴斿晢缂栧彿妫�绱�" @@ -23,16 +19,20 @@ </a-form-item> </a-col> - <a-col - :md="6" - :sm="24" - > + <a-col :xl="4" :lg="7" :md="8" :sm="24"> <a-form-item label="渚涘簲鍟嗗悕绉�"> <j-input placeholder="璇疯緭鍏ヤ緵搴斿晢鍚嶇О妫�绱�" v-model="queryParam.supplierName" ></j-input> </a-form-item> + </a-col> + + <a-col :xl="4" :lg="7" :md="8" :sm="24"> + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + </span> </a-col> </a-row> </a-form> @@ -41,20 +41,14 @@ <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> <div class="table-operator"> <a-button - type="primary" - @click="searchQuery" - icon="search" - >鏌ヨ</a-button> - <a-button - type="primary" - @click="searchReset" - icon="reload" - >閲嶇疆</a-button> - <a-button @click="handleAdd" type="primary" icon="plus" >鏂板</a-button> + <!-- <a-button type="primary" @click="exportToExcel('渚涘簲鍟嗕俊鎭鍏ユā鏉�')" icon="export" style="margin-left: 8px" >涓嬭浇瀵煎叆妯℃澘</a-button> + <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> + <a-button type="primary" icon="import" :disabled="!nodeSelected.key || nodeSelected.entity.leafFlag === '2'">瀵煎叆</a-button> + </a-upload> --> </div> <!-- table鍖哄煙-begin --> @@ -70,17 +64,7 @@ :dataSource="dataSource" :pagination="ipagination" :loading="loading" - :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:type}" - @change="handleTableChange" - :customRow="clickThenCheck" > - <span - slot="partCount" - slot-scope="text,record" - class="fontweight" - > - {{record.partCount}} - </span> <!--鐘舵�佹爮涓�у睍绀�--> <span slot="status" @@ -181,9 +165,7 @@ }, data() { return { - selectedRowRecord: {}, dataSource: [], - partCount: "", /* 鍒嗛〉鍙傛暟 */ ipagination: { current: 1, @@ -265,7 +247,6 @@ scopedSlots: { customRender: 'action' }, } ], - type: "radio", url: { list: '/base/supplier/list', delete: '/base/supplier/delete', @@ -274,9 +255,7 @@ } }, mounted() { - this.$bus.$on('refreshParentPage', (data) => { - this.loadData(); - }) + }, methods: { loadData(arg) { @@ -319,18 +298,30 @@ } }); }, - clickThenCheck(record) { - return { - on: { - click: (e) => { - this.selectedRowRecord = record; - this.onSelectChange(record.id.split(","), [record]); - } + exportToExcel(fileName) { + this.loading = true // 鏄剧ず鍔犺浇閬僵 + this.queryParam.paraTypeFlag = this.paraTypeFlag + var params = this.getQueryParams() + downFile(this.url.loadTemplate,params).then((data)=>{ + if (!data) { + this.$message.warning("鏂囦欢涓嬭浇澶辫触") + return } - }; - }, - onSelectChange(selectedRowKeys) { - this.selectedRowKeys = selectedRowKeys; + if (typeof window.navigator.msSaveBlob !== 'undefined') { + window.navigator.msSaveBlob(new Blob([data],{type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'}), fileName+'.xlsx') + }else{ + let url = window.URL.createObjectURL(new Blob([data],{type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'})) + let link = document.createElement('a') + link.style.display = 'none' + link.href = url + link.setAttribute('download', fileName+'.xlsx') + document.body.appendChild(link) + link.click() + document.body.removeChild(link); //涓嬭浇瀹屾垚绉婚櫎鍏冪礌 + window.URL.revokeObjectURL(url); //閲婃斁鎺塨lob瀵硅薄 + } + this.loading = false // 闅愯棌閬僵 + }) }, }, diff --git a/src/views/base/WarehouseList.vue b/src/views/base/WarehouseList.vue index cfbe06e..0d13ebd 100644 --- a/src/views/base/WarehouseList.vue +++ b/src/views/base/WarehouseList.vue @@ -1,7 +1,6 @@ <template> <a-card :bordered="false" - title="渚涘簲鍟�" > <!-- 鏌ヨ鍖哄煙 --> <div class="table-page-search-wrapper"> @@ -11,10 +10,7 @@ > <a-row :gutter="30"> - <a-col - :md="6" - :sm="24" - > + <a-col :xl="4" :lg="7" :md="8" :sm="24"> <a-form-item label="浠撳簱缂栧彿"> <j-input placeholder="璇疯緭鍏ヤ粨搴撶紪鍙锋绱�" @@ -23,10 +19,7 @@ </a-form-item> </a-col> - <a-col - :md="6" - :sm="24" - > + <a-col :xl="4" :lg="7" :md="8" :sm="24"> <a-form-item label="浠撳簱鍚嶇О"> <j-input placeholder="璇疯緭鍏ヤ粨搴撳悕绉版绱�" @@ -34,22 +27,19 @@ ></j-input> </a-form-item> </a-col> + + <a-col :xl="4" :lg="7" :md="8" :sm="24"> + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + </span> + </a-col> </a-row> </a-form> </div> <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> <div class="table-operator"> - <a-button - type="primary" - @click="searchQuery" - icon="search" - >鏌ヨ</a-button> - <a-button - type="primary" - @click="searchReset" - icon="reload" - >閲嶇疆</a-button> <a-button @click="handleAdd" type="primary" @@ -70,17 +60,7 @@ :dataSource="dataSource" :pagination="ipagination" :loading="loading" - :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:type}" - @change="handleTableChange" - :customRow="clickThenCheck" > - <span - slot="partCount" - slot-scope="text,record" - class="fontweight" - > - {{record.partCount}} - </span> <!--鐘舵�佹爮涓�у睍绀�--> <span slot="status" @@ -181,9 +161,7 @@ }, data() { return { - selectedRowRecord: {}, dataSource: [], - partCount: "", /* 鍒嗛〉鍙傛暟 */ ipagination: { current: 1, @@ -238,7 +216,6 @@ scopedSlots: { customRender: 'action' }, } ], - type: "radio", url: { list: '/base/lineSideWarehouse/list', delete: '/base/lineSideWarehouse/delete', @@ -247,9 +224,7 @@ } }, mounted() { - this.$bus.$on('refreshParentPage', (data) => { - this.loadData(); - }) + }, methods: { loadData(arg) { @@ -291,19 +266,6 @@ that.$message.warning(res.message); } }); - }, - clickThenCheck(record) { - return { - on: { - click: (e) => { - this.selectedRowRecord = record; - this.onSelectChange(record.id.split(","), [record]); - } - } - }; - }, - onSelectChange(selectedRowKeys) { - this.selectedRowKeys = selectedRowKeys; }, }, diff --git a/src/views/base/modules/group/GroupModal.vue b/src/views/base/modules/group/GroupModal.vue index d067b93..a7d7e2d 100644 --- a/src/views/base/modules/group/GroupModal.vue +++ b/src/views/base/modules/group/GroupModal.vue @@ -12,13 +12,13 @@ <a-spin :spinning="confirmLoading"> <a-form-model ref="form" v-bind="layout" :model="model" :rules="validatorRules"> - <a-form-model-item label="鐝粍缂栫爜" required prop="groupCode"> + <a-form-model-item label="鐝粍缂栫爜" required prop="groupCode" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-input v-model="model.groupCode" :disabled="roleDisabled" placeholder="璇疯緭鍏ョ彮缁勭紪鐮�"/> </a-form-model-item> - <a-form-model-item label="鐝粍鍚嶇О" required prop="groupName"> + <a-form-model-item label="鐝粍鍚嶇О" required prop="groupName" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-input v-model="model.groupName" placeholder="璇疯緭鍏ョ彮缁勫悕绉�"/> </a-form-model-item> - <a-form-model-item label="鐝粍闀�" prop="groupManager"> + <a-form-model-item label="鐝粍闀�" prop="groupManager" :labelCol="labelCol" :wrapperCol="wrapperCol"> <j-dict-select-tag type="list" v-model="model.groupManager" @@ -27,16 +27,16 @@ placeholder="璇烽�夋嫨鐝粍闀�" /> </a-form-model-item> - <a-form-model-item label="浜х嚎" prop="factoryId"> - <j-dict-select-tag - type="list" - v-model="model.factoryId" - :trigger-change="true" - dictCode="base_factory,factory_name,id" - placeholder="璇烽�夋嫨浜х嚎" - /> + <a-form-model-item label="浜х嚎" prop="factoryId" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-select-factory + v-model="model.factoryId" + :multi="true" + @back="backFactoryInfo" + :backProduction="true" + :treeProductOpera="true" + ></j-select-factory> </a-form-model-item> - <a-form-model-item label="鐝" prop="shiftId"> + <a-form-model-item label="鐝" prop="shiftId" :labelCol="labelCol" :wrapperCol="wrapperCol"> <j-dict-select-tag type="list" v-model="model.shiftId" @@ -45,7 +45,7 @@ placeholder="璇烽�夋嫨鐝" /> </a-form-model-item> - <a-form-model-item label="澶囨敞" prop="remark"> + <a-form-model-item label="澶囨敞" prop="remark" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-textarea :rows="5" v-model="model.remark" placeholder="璇疯緭鍏ュ娉�"/> </a-form-model-item> </a-form-model> @@ -57,10 +57,12 @@ import {duplicateCheck } from '@/api/api' import {postAction,requestPut} from '@/api/manage' import JDictSelectTag from '@/components/dict/JDictSelectTag' + import JSelectFactory from '../../../../components/jeecgbiz/JSelectFactory' export default { name: "GroupModal", components: { JDictSelectTag, + JSelectFactory }, data () { return { @@ -68,9 +70,13 @@ visible: false, roleDisabled: false, model: {}, - layout: { - labelCol: { span: 3 }, - wrapperCol: { span: 14 }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, }, confirmLoading: false, validatorRules:{ @@ -90,7 +96,8 @@ url: { add: "/base/shiftGroup/add", edit: "/base/shiftGroup/edit", - } + }, + nextFactoryOptions: [], } }, created () { @@ -161,7 +168,14 @@ } }); } - } + }, + backFactoryInfo(info) { + this.model.factoryIds = this.model.factoryId + this.nextFactoryOptions = info.map((item, index, arr) => { + let c = { label: item.text, value: item.value + '' } + return c + }) + }, } } </script> diff --git a/src/views/base/modules/shift/ShiftModel.vue b/src/views/base/modules/shift/ShiftModel.vue index 872d4b8..dce3877 100644 --- a/src/views/base/modules/shift/ShiftModel.vue +++ b/src/views/base/modules/shift/ShiftModel.vue @@ -1,30 +1,30 @@ <template> - <a-modal :title="title" :width="800" :visible="visible" :confirmLoading="confirmLoading" + <a-modal :title="title" :width="800" :visible="visible" :confirmLoading="confirmLoading" :okButtonProps="{ props: {disabled: disableSubmit} }" @ok="handleOk" @cancel="handleCancel" cancelText="鍏抽棴"> <a-spin :spinning="confirmLoading"> <a-form :form="form"> <a-row :gutter="24"> <a-col :span="12"> <a-form-item label="鐝缂栫爜" :labelCol="labelCol" :wrapperCol="wrapperCol"> - <a-input allow-clear placeholder="璇疯緭鍏ョ彮娆$紪鐮�" + <a-input allow-clear placeholder="璇疯緭鍏ョ彮娆$紪鐮�" :disabled="disableSubmit" v-decorator="['shiftCode',validatorRules.shiftCode]"/> </a-form-item> </a-col> <a-col :span="12"> <a-form-item label="鐝鍚嶇О" :labelCol="labelCol" :wrapperCol="wrapperCol"> - <a-input allow-clear placeholder="璇疯緭鍏ョ彮娆″悕绉�" v-decorator="['shiftName',validatorRules.shiftName]"/> + <a-input allow-clear placeholder="璇疯緭鍏ョ彮娆″悕绉�" :disabled="disableSubmit" v-decorator="['shiftName',validatorRules.shiftName]"/> </a-form-item> </a-col> </a-row> <a-row :gutter="24"> <a-col :span="12"> <a-form-item label="寮�濮嬫椂闂�" :labelCol="labelCol" :wrapperCol="wrapperCol"> - <a-time-picker v-decorator="['startTime',validatorRules.startTime]"/> + <a-time-picker :disabled="disableSubmit" v-decorator="['startTime',validatorRules.startTime]"/> </a-form-item> </a-col> <a-col :span="12"> <a-form-item label="缁撴潫鏃堕棿" :labelCol="labelCol" :wrapperCol="wrapperCol"> - <a-time-picker v-decorator="['endTime',validatorRules.endTime]"/> + <a-time-picker :disabled="disableSubmit" v-decorator="['endTime',validatorRules.endTime]"/> </a-form-item> </a-col> </a-row> @@ -32,12 +32,12 @@ <a-row :gutter="24"> <a-col :span="12"> <a-form-item label="宸ヤ綔鏃堕暱" :labelCol="labelCol" :wrapperCol="wrapperCol"> - <a-input-number v-decorator="['workHours',validatorRules.workHours]" placeholder="璇疯緭鍏ュ伐浣滄椂闀�(灏忔椂)" style="width: 100%" /> + <a-input-number :disabled="disableSubmit" v-decorator="['workHours',validatorRules.workHours]" placeholder="璇疯緭鍏ュ伐浣滄椂闀�(灏忔椂)" style="width: 100%" /> </a-form-item> </a-col> <a-col :span="12"> <a-form-item label="鏄惁璺ㄥぉ" :labelCol="labelCol" :wrapperCol="wrapperCol"> - <a-switch v-model="crossDayFlag" checked-children="鏄�" un-checked-children="鍚�"/> + <a-switch :disabled="disableSubmit" v-model="crossDayFlag" checked-children="鏄�" un-checked-children="鍚�"/> </a-form-item> </a-col> </a-row> @@ -154,8 +154,8 @@ this.$nextTick(() => { this.form.setFieldsValue(pick(this.model, 'shiftCode', 'shiftName', 'startTime', 'endTime','workHours')) this.form.setFieldsValue({ - startTime: moment(this.model.startTime, 'HH:mm:ss'), - endTime: moment(this.model.endTime, 'HH:mm:ss') + startTime: moment(this.model.startTime, 'HH:mm'), + endTime: moment(this.model.endTime, 'HH:mm') }) if (record.crossDayFlag == '1') { this.crossDayFlag = true @@ -181,8 +181,8 @@ }else if(that.crossDayFlag == false){ formData.crossDayFlag = '0' } - formData.startTime = moment(formData.startTime).format('HH:mm:ss') - formData.endTime = moment(formData.endTime).format('HH:mm:ss') + formData.startTime = moment(formData.startTime).format('HH:mm') + formData.endTime = moment(formData.endTime).format('HH:mm') if (formData.crossDayFlag == '0') { let startTimeOne = formData.startTime.replace(/:/g, '') let endTimeOne = formData.endTime.replace(/:/g, '') @@ -297,7 +297,10 @@ } }) }, - +// 鍏抽棴寮圭獥鏃舵竻闄よ〃鍗曟牎楠� + removeValidate() { + if (this.$refs.form) this.$refs.form.clearValidate() + } } } </script> diff --git a/src/views/base/modules/supplier/SupplierModel.vue b/src/views/base/modules/supplier/SupplierModel.vue index 098050f..8f5aa30 100644 --- a/src/views/base/modules/supplier/SupplierModel.vue +++ b/src/views/base/modules/supplier/SupplierModel.vue @@ -20,7 +20,7 @@ label="渚涘簲鍟嗙紪鍙�" > <a-input - :readOnly="disableSubmit" + :disabled="disableSubmit" allow-clear placeholder="璇疯緭鍏ヤ緵搴斿晢缂栧彿" v-decorator="['supplierCode', validatorRules.supplierCode ]" @@ -37,7 +37,7 @@ label="渚涘簲鍟嗗悕绉�" > <a-input - :readOnly="disableSubmit" + :disabled="disableSubmit" allow-clear placeholder="璇疯緭鍏ヤ緵搴斿晢鍚嶇О" v-decorator="['supplierName', validatorRules.supplierName ]" @@ -53,7 +53,7 @@ label="鍥藉" > <a-input - :readOnly="disableSubmit" + :disabled="disableSubmit" allow-clear placeholder="璇疯緭鍏ュ浗瀹�" v-decorator="['country', validatorRules.country ]" @@ -74,7 +74,7 @@ label="鐪佷唤" > <a-input - :readOnly="disableSubmit" + :disabled="disableSubmit" allow-clear placeholder="璇疯緭鍏ョ渷浠�" v-decorator="['province', validatorRules.province ]" @@ -91,7 +91,7 @@ label="鍩庡競" > <a-input - :readOnly="disableSubmit" + :disabled="disableSubmit" allow-clear placeholder="璇疯緭鍏ュ煄甯�" v-decorator="['city', validatorRules.city ]" @@ -105,7 +105,7 @@ label="鑱旂郴浜�" > <a-input - :readOnly="disableSubmit" + :disabled="disableSubmit" allow-clear placeholder="璇疯緭鍏ヨ仈绯讳汉" v-decorator="['contact', validatorRules.contact]" @@ -122,7 +122,7 @@ label="璇︾粏鍦板潃" > <a-input - :readOnly="disableSubmit" + :disabled="disableSubmit" allow-clear placeholder="璇疯緭鍏ヨ缁嗗湴鍧�" v-decorator="['address', validatorRules.address]" @@ -139,7 +139,7 @@ label="閭" > <a-input - :readOnly="disableSubmit" + :disabled="disableSubmit" allow-clear placeholder="璇疯緭鍏ラ偖绠�" v-decorator="['email', validatorRules.email]" @@ -153,7 +153,7 @@ label="閭紪" > <a-input - :readOnly="disableSubmit" + :disabled="disableSubmit" allow-clear placeholder="璇疯緭鍏ラ偖缂�" v-decorator="['postcode', validatorRules.postcode]" @@ -170,7 +170,7 @@ label="浼犵湡" > <a-input - :readOnly="disableSubmit" + :disabled="disableSubmit" allow-clear placeholder="璇疯緭鍏ヤ紶鐪�" v-decorator="['fax', validatorRules.fax]" @@ -184,7 +184,7 @@ label="鎵嬫満鍙风爜" > <a-input - :readOnly="disableSubmit" + :disabled="disableSubmit" allow-clear placeholder="璇疯緭鍏ユ墜鏈哄彿鐮�" v-decorator="['phone', validatorRules.phone]" @@ -201,7 +201,7 @@ label="鍏徃鐢佃瘽" > <a-input - :readOnly="disableSubmit" + :disabled="disableSubmit" allow-clear placeholder="璇疯緭鍏ュ叕鍙哥數璇�" v-decorator="['companyTelephone', validatorRules.companyTelephone]" @@ -215,7 +215,7 @@ label="瀹樻柟缃戠珯" > <a-input - :readOnly="disableSubmit" + :disabled="disableSubmit" allow-clear placeholder="璇疯緭鍏ュ畼鏂圭綉绔�" v-decorator="['officialWebsite', validatorRules.officialWebsite]" @@ -232,7 +232,7 @@ label="澶囨敞" > <a-textarea - :readOnly="disableSubmit" + :disabled="disableSubmit" placeholder="璇疯緭鍏ュ娉�" allow-clear v-decorator="['remark', validatorRules.remark]" @@ -495,6 +495,10 @@ } } }, + // 鍏抽棴寮圭獥鏃舵竻闄よ〃鍗曟牎楠� + removeValidate() { + if (this.$refs.form) this.$refs.form.clearValidate() + } } } </script> diff --git a/src/views/base/modules/warehouse/WarehouseModel.vue b/src/views/base/modules/warehouse/WarehouseModel.vue index dfde18b..c268b71 100644 --- a/src/views/base/modules/warehouse/WarehouseModel.vue +++ b/src/views/base/modules/warehouse/WarehouseModel.vue @@ -15,12 +15,12 @@ <a-row :gutter="24"> <a-col :span="24"> <a-form-item - :labelCol="{span:3}" - :wrapperCol="{span:21}" + :labelCol="labelCol" + :wrapperCol="wrapperCol" label="绾胯竟搴撶紪鍙�" > <a-input - :readOnly="disableSubmit" + :disabled="disableSubmit" allow-clear placeholder="璇疯緭鍏ョ嚎杈瑰簱缂栧彿" v-decorator="['warehouseCode', validatorRules.warehouseCode ]" @@ -32,12 +32,12 @@ <a-row :gutter="24"> <a-col :span="24"> <a-form-item - :labelCol="{span:3}" - :wrapperCol="{span:21}" + :labelCol="labelCol" + :wrapperCol="wrapperCol" label="绾胯竟搴撳悕绉�" > <a-input - :readOnly="disableSubmit" + :disabled="disableSubmit" allow-clear placeholder="璇疯緭鍏ョ嚎杈瑰簱鍚嶇О" v-decorator="['warehouseName', validatorRules.warehouseName ]" @@ -46,19 +46,20 @@ </a-col> </a-row> <a-row :gutter="24"> - <a-col :span="12"> + <a-col :span="24"> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="浜х嚎" > - <j-dict-select-tag - type="list" - v-model="model.factoryId" - :trigger-change="true" - dictCode="base_factory,factory_name,id" - placeholder="璇烽�夋嫨浜х嚎" - /> + <j-select-factory + :disabled="disableSubmit" + v-model="model.factoryId" + :multi="true" + @back="backFactoryInfo" + :backProduction="true" + :treeProductOpera="true" + ></j-select-factory> </a-form-item> </a-col> </a-row> @@ -74,12 +75,14 @@ import moment from 'moment' import { duplicateCheck } from '@/api/api'//閲嶅鏍¢獙 import JTreeDict from '@/components/jeecg/JTreeDict'//鍒嗙被瀛楀吀鏍戝舰涓嬫媺缁勪欢 +import JSelectFactory from '../../../../components/jeecgbiz/JSelectFactory' export default { name: "WarehouseModal", components: { JDate, JTreeDict, + JSelectFactory }, data() { return { @@ -90,13 +93,13 @@ treeData: [], warehouseId: "", //淇濆瓨绾胯竟搴搃d labelCol: { - xs: { span: 24 }, - sm: { span: 6 }, - }, - wrapperCol: { - xs: { span: 24 }, - sm: { span: 18 }, - }, + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, confirmLoading: false, form: this.$form.createForm(this), @@ -120,6 +123,7 @@ add: "/base/lineSideWarehouse/add", edit: "/base/lineSideWarehouse/edit", }, + nextFactoryOptions: [], } }, created() { @@ -212,6 +216,17 @@ } }) }, + backFactoryInfo(info) { + this.model.factoryIds = this.model.factoryId + this.nextFactoryOptions = info.map((item, index, arr) => { + let c = { label: item.text, value: item.value + '' } + return c + }) + }, + // 鍏抽棴寮圭獥鏃舵竻闄よ〃鍗曟牎楠� + removeValidate() { + if (this.$refs.form) this.$refs.form.clearValidate() + } } } </script> diff --git a/src/views/modules/message/SysMessageTemplateList.vue b/src/views/modules/message/SysMessageTemplateList.vue index cef9048..b07a746 100644 --- a/src/views/modules/message/SysMessageTemplateList.vue +++ b/src/views/modules/message/SysMessageTemplateList.vue @@ -101,7 +101,7 @@ <a @click="handleUse(record)">搴旂敤</a> </a-menu-item> <a-menu-item> - <a @click="handleNotUse(record)">鍋滅敤</a> + <a @click="handleNotUse(record)">绂佺敤</a> </a-menu-item> <a-menu-item> diff --git a/src/views/qms/InspectionItemList.vue b/src/views/qms/InspectionItemList.vue new file mode 100644 index 0000000..cf9db17 --- /dev/null +++ b/src/views/qms/InspectionItemList.vue @@ -0,0 +1,332 @@ +<template> + <a-card + :bordered="false" + > + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form + layout="inline" + @keyup.enter.native="searchQuery" + > + <a-row :gutter="30"> + + <a-col :xl="4" :lg="7" :md="8" :sm="24"> + <a-form-item label="妫�楠岄」鐩紪鍙�"> + <j-input + placeholder="璇疯緭鍏ユ楠岄」鐩紪鍙锋绱�" + v-model="queryParam.itemCode" + ></j-input> + </a-form-item> + </a-col> + + <a-col :xl="4" :lg="7" :md="8" :sm="24"> + <a-form-item label="妫�楠岄」鐩悕绉�"> + <j-input + placeholder="璇疯緭鍏ユ楠岄」鐩悕绉版绱�" + v-model="queryParam.itemName" + ></j-input> + </a-form-item> + </a-col> + + <a-col :xl="4" :lg="7" :md="8" :sm="24"> + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + </span> + </a-col> + </a-row> + </a-form> + </div> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button + @click="handleAdd" + type="primary" + icon="plus" + >鏂板</a-button> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + filterMultiple="filterMultiple" + :columns="columns" + :rowClassName="tableRowClass" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + > + <!--鐘舵�佹爮涓�у睍绀�--> + <span + slot="status" + slot-scope="text,record" + > + <a-badge + v-if="record.itemStatus==1" + status="success" + /> + <span + v-if="record.itemStatus==1" + class="success" + >鍚敤</span> + <a-badge + v-if="record.itemStatus==0" + status="error" + /> + <span + v-if="record.itemStatus==0" + class="error" + >绂佺敤</span> + </span> + <span + slot="action" + slot-scope="text, record" + > + <a + href="javascript:;" + @click="handleDetail(record)" + >璇︽儏</a> + + <a-divider type="vertical" /> + <a-dropdown> + <a class="ant-dropdown-link">鏇村 + <a-icon type="down" /> + </a> + <a-menu slot="overlay"> + <a-menu-item> + <a @click="handleEdit(record)">缂栬緫</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm + title="纭畾鍒犻櫎鍚�?" + @confirm="() => handleDelete(record.id)" + > + <a>鍒犻櫎</a> + </a-popconfirm> + + </a-menu-item> + <a-menu-item v-if="record.itemStatus == 0"> + <a-popconfirm + title="纭畾鍚敤鍚�?" + @confirm="() => handleActive(record.id)" + > + <a>鍚敤</a> + </a-popconfirm> + </a-menu-item> + <a-menu-item v-if="record.itemStatus == 1"> + <a-popconfirm + title="纭畾绂佺敤鍚�?" + @confirm="() => handleActive(record.id)" + > + <a>绂佺敤</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + </div> + <!-- table鍖哄煙-end --> + + <!-- 琛ㄥ崟鍖哄煙 --> + <inspection-item-model + ref="modalForm" + @ok="modalFormOk" + ></inspection-item-model> + </a-card> +</template> + +<script> +//鎸夐渶寮曞叆 缁勪欢 +import InspectionItemModel from './modules/inspectionItem/InspectionItemModel' + +import { deleteAction, requestPut, getAction } from '@/api/manage' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import JEllipsis from '@/components/jeecg/JEllipsis' +import JInput from '@/components/jeecg/JInput' + +export default { + name: 'InspectionItemList', + mixins: [JeecgListMixin], + components: { + InspectionItemModel, + JEllipsis, + JInput, + }, + data() { + return { + dataSource: [], + /* 鍒嗛〉鍙傛暟 */ + ipagination: { + current: 1, + pageSize: 5, + pageSizeOptions: ['5', '10', '20'], + showTotal: (total, range) => { + return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�" + }, + total: 0 + }, + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: "center", + customRender: function (t, r, index) { + return parseInt(index) + 1; + } + }, + { + title: '妫�楠岄」鐩紪鍙�', + align: "center", + dataIndex: 'itemCode' + }, + { + title: '妫�楠岄」鐩悕绉�', + align: "center", + dataIndex: 'itemName' + }, + { + title: '妫�楠岄」鐩垎绫�', + align: "center", + dataIndex: 'itemCategory' + }, + { + title: '瀹氶噺/瀹氭��', + align: "center", + dataIndex: 'qualitativeOrQuantitative' + }, + { + title: '娴嬮噺宸ュ叿', + align: "center", + dataIndex: 'inspectionTools' + }, + { + title: '澶囨敞', + align: 'center', + dataIndex: 'remark' + }, + { + width: 100, + title: '鐘舵��', + align: 'center', + scopedSlots: { + customRender: 'status', + }, + dataIndex: 'itemStatus' + }, + { + width: 150, + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + scopedSlots: { customRender: 'action' }, + } + ], + url: { + list: '/qms/inspectionItem/list', + delete: '/qms/inspectionItem/delete', + active: '/qms/inspectionItem/active', + }, + } + }, + mounted() { + }, + methods: { + loadData(arg) { + if (arg === 1) { + this.ipagination.current = 1; + } + var params = this.getQueryParams();//鏌ヨ鏉′欢 + this.loading = true; + getAction(this.url.list, params).then((res) => { + if (res.success) { + this.dataSource = res.result.records; + this.ipagination.total = res.result.total; + } + if (res.code === 510) { + this.$message.warning(res.message) + } + this.loading = false; + }) + }, + //绂佺敤鐘舵�佹牱寮� + tableRowClass(record, index) { + if (record.warehouseStatus != "1") { + return "frozenRowClass"; + } + return ""; + }, + //鍚敤绂佺敤 + handleActive(id) { + if (!this.url.active) { + this.$message.error("璇疯缃畊rl.active!") + return + } + let that = this; + requestPut(that.url.active, {}, { id: id }).then((res) => { + if (res.success) { + that.$message.success(res.message); + that.loadData(); + } else { + that.$message.warning(res.message); + } + }); + }, + }, + +} +</script> +<style lang="less" scoped> +@import '~@assets/less/common.less'; +.frozenRowClass { + color: #c9c9c9; +} +.success { + color: green; +} +.error { + color: red; +} +.fontweight { + font-weight: bold; +} +.ant-card-body .table-operator { + margin-bottom: 18px; +} + +.ant-table-tbody .ant-table-row td { + padding-top: 15px; + padding-bottom: 15px; +} + +.anty-row-operator button { + margin: 0 5px; +} + +/deep/.ant-btn-danger { + background-color: #ffffff; +} + +.ant-modal-cust-warp { + height: 100%; +} + +.ant-modal-cust-warp .ant-modal-body { + height: calc(100% - 110px) !important; + overflow-y: auto; +} + +.ant-modal-cust-warp .ant-modal-content { + height: 90% !important; + overflow-y: hidden; +} +</style> \ No newline at end of file diff --git a/src/views/qms/InspectionToolsList.vue b/src/views/qms/InspectionToolsList.vue new file mode 100644 index 0000000..94d5217 --- /dev/null +++ b/src/views/qms/InspectionToolsList.vue @@ -0,0 +1,317 @@ +<template> + <a-card + :bordered="false" + > + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form + layout="inline" + @keyup.enter.native="searchQuery" + > + <a-row :gutter="30"> + + <a-col :xl="4" :lg="7" :md="8" :sm="24"> + <a-form-item label="妫�楠屽伐鍏风紪鐮�"> + <j-input + placeholder="璇疯緭鍏ユ楠屽伐鍏风紪鐮佹绱�" + v-model="queryParam.toolCode" + ></j-input> + </a-form-item> + </a-col> + + <a-col :xl="4" :lg="7" :md="8" :sm="24"> + <a-form-item label="妫�楠屽伐鍏峰悕绉�"> + <j-input + placeholder="璇疯緭鍏ユ楠屽伐鍏峰悕绉版绱�" + v-model="queryParam.toolName" + ></j-input> + </a-form-item> + </a-col> + + <a-col :xl="4" :lg="7" :md="8" :sm="24"> + <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button type="info" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</a-button> + </span> + </a-col> + </a-row> + </a-form> + </div> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button + @click="handleAdd" + type="primary" + icon="plus" + >鏂板</a-button> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + filterMultiple="filterMultiple" + :columns="columns" + :rowClassName="tableRowClass" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + > + <!--鐘舵�佹爮涓�у睍绀�--> + <span + slot="status" + slot-scope="text,record" + > + <a-badge + v-if="record.toolStatus==1" + status="success" + /> + <span + v-if="record.toolStatus==1" + class="success" + >鍚敤</span> + <a-badge + v-if="record.toolStatus==0" + status="error" + /> + <span + v-if="record.toolStatus==0" + class="error" + >绂佺敤</span> + </span> + <span + slot="action" + slot-scope="text, record" + > + <a + href="javascript:;" + @click="handleDetail(record)" + >璇︽儏</a> + + <a-divider type="vertical" /> + <a-dropdown> + <a class="ant-dropdown-link">鏇村 + <a-icon type="down" /> + </a> + <a-menu slot="overlay"> + <a-menu-item> + <a @click="handleEdit(record)">缂栬緫</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm + title="纭畾鍒犻櫎鍚�?" + @confirm="() => handleDelete(record.id)" + > + <a>鍒犻櫎</a> + </a-popconfirm> + + </a-menu-item> + <a-menu-item v-if="record.toolStatus == 0"> + <a-popconfirm + title="纭畾鍚敤鍚�?" + @confirm="() => handleActive(record.id)" + > + <a>鍚敤</a> + </a-popconfirm> + </a-menu-item> + <a-menu-item v-if="record.toolStatus == 1"> + <a-popconfirm + title="纭畾绂佺敤鍚�?" + @confirm="() => handleActive(record.id)" + > + <a>绂佺敤</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + </div> + <!-- table鍖哄煙-end --> + + <!-- 琛ㄥ崟鍖哄煙 --> + <inspection-tools-model + ref="modalForm" + @ok="modalFormOk" + ></inspection-tools-model> + </a-card> +</template> + +<script> +//鎸夐渶寮曞叆 缁勪欢 +import InspectionToolsModel from './modules/inspectionTools/InspectionToolsModel' + +import { deleteAction, requestPut, getAction } from '@/api/manage' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import JEllipsis from '@/components/jeecg/JEllipsis' +import JInput from '@/components/jeecg/JInput' + +export default { + name: 'InspectionToolsList', + mixins: [JeecgListMixin], + components: { + InspectionToolsModel, + JEllipsis, + JInput, + }, + data() { + return { + dataSource: [], + /* 鍒嗛〉鍙傛暟 */ + ipagination: { + current: 1, + pageSize: 5, + pageSizeOptions: ['5', '10', '20'], + showTotal: (total, range) => { + return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�" + }, + total: 0 + }, + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: "center", + customRender: function (t, r, index) { + return parseInt(index) + 1; + } + }, + { + title: '妫�楠屽伐鍏风紪鐮�', + align: "center", + dataIndex: 'toolCode' + }, + { + title: '妫�楠屽伐鍏峰悕绉�', + align: "center", + dataIndex: 'toolName' + }, + { + title: '澶囨敞', + align: 'center', + dataIndex: 'remark' + }, + { + width: 100, + title: '鐘舵��', + align: 'center', + scopedSlots: { + customRender: 'status', + }, + dataIndex: 'toolStatus' + }, + { + width: 150, + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + scopedSlots: { customRender: 'action' }, + } + ], + url: { + list: '/qms/inspectionTools/list', + delete: '/qms/inspectionTools/delete', + active: '/qms/inspectionTools/active', + }, + } + }, + mounted() { + }, + methods: { + loadData(arg) { + if (arg === 1) { + this.ipagination.current = 1; + } + var params = this.getQueryParams();//鏌ヨ鏉′欢 + this.loading = true; + getAction(this.url.list, params).then((res) => { + if (res.success) { + this.dataSource = res.result.records; + this.ipagination.total = res.result.total; + } + if (res.code === 510) { + this.$message.warning(res.message) + } + this.loading = false; + }) + }, + //绂佺敤鐘舵�佹牱寮� + tableRowClass(record, index) { + if (record.warehouseStatus != "1") { + return "frozenRowClass"; + } + return ""; + }, + //鍚敤绂佺敤 + handleActive(id) { + if (!this.url.active) { + this.$message.error("璇疯缃畊rl.active!") + return + } + let that = this; + requestPut(that.url.active, {}, { id: id }).then((res) => { + if (res.success) { + that.$message.success(res.message); + that.loadData(); + } else { + that.$message.warning(res.message); + } + }); + }, + }, + +} +</script> +<style lang="less" scoped> +@import '~@assets/less/common.less'; +.frozenRowClass { + color: #c9c9c9; +} +.success { + color: green; +} +.error { + color: red; +} +.fontweight { + font-weight: bold; +} +.ant-card-body .table-operator { + margin-bottom: 18px; +} + +.ant-table-tbody .ant-table-row td { + padding-top: 15px; + padding-bottom: 15px; +} + +.anty-row-operator button { + margin: 0 5px; +} + +/deep/.ant-btn-danger { + background-color: #ffffff; +} + +.ant-modal-cust-warp { + height: 100%; +} + +.ant-modal-cust-warp .ant-modal-body { + height: calc(100% - 110px) !important; + overflow-y: auto; +} + +.ant-modal-cust-warp .ant-modal-content { + height: 90% !important; + overflow-y: hidden; +} +</style> \ No newline at end of file diff --git a/src/views/qms/modules/inspectionItem/InspectionItemModel.vue b/src/views/qms/modules/inspectionItem/InspectionItemModel.vue new file mode 100644 index 0000000..272f420 --- /dev/null +++ b/src/views/qms/modules/inspectionItem/InspectionItemModel.vue @@ -0,0 +1,274 @@ +<template> + <a-modal + :title="title" + :width="800" + :visible="visible" + :confirmLoading="confirmLoading" + :okButtonProps="{ props: {disabled: disableSubmit} }" + @ok="handleOk" + @cancel="handleCancel" + cancelText="鍏抽棴" + > + <a-spin :spinning="confirmLoading"> + <a-form :form="form"> + + <a-row :gutter="24"> + <a-col :span="24"> + <a-form-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + label="妫�楠岄」鐩紪鍙�" + > + <a-input + :disabled="disableSubmit" + allow-clear + placeholder="璇疯緭鍏ユ楠岄」鐩紪鍙�" + v-decorator="['itemCode', validatorRules.itemCode ]" + /> + </a-form-item> + </a-col> + </a-row> + + <a-row :gutter="24"> + <a-col :span="24"> + <a-form-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + label="妫�楠岄」鐩悕绉�" + > + <a-input + :disabled="disableSubmit" + allow-clear + placeholder="璇疯緭鍏ユ楠岄」鐩悕绉�" + v-decorator="['itemName', validatorRules.itemName ]" + /> + </a-form-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="24"> + <a-form-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + label="妫�楠岄」鐩垎绫�" + > + <j-dict-select-tag + :disabled="disableSubmit" + placeholder="璇疯緭鍏ユ楠岄」鐩垎绫�" + v-decorator="['itemCategory', validatorRules.itemCategory ]" + dictCode="item_category"/> + </a-form-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="24"> + <a-form-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + label="瀹氶噺/瀹氭��" + > + <j-dict-select-tag + :disabled="disableSubmit" + placeholder="璇烽�夋嫨瀹氶噺/瀹氭��" + v-decorator="['qualitativeOrQuantitative', validatorRules.qualitativeOrQuantitative ]" + dictCode="qualitative_or_quantitative"/> + </a-form-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="24"> + <a-form-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + label="娴嬮噺宸ュ叿" + > + <a-input + :disabled="disableSubmit" + allow-clear + placeholder="璇烽�夋嫨娴嬮噺宸ュ叿" + v-decorator="['inspectionTools', validatorRules.inspectionTools ]" + /> + </a-form-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="24"> + <a-form-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + label="澶囨敞" + > + <a-textarea :disabled="disableSubmit" placeholder="璇疯緭鍏ュ娉�" v-decorator="['remark', validatorRules.remark ]"/> + </a-form-item> + </a-col> + </a-row> + </a-form> + </a-spin> + </a-modal> +</template> + +<script> +import { httpAction, getAction } from '@/api/manage' +import pick from 'lodash.pick' +import { duplicateCheck } from '@/api/api'//閲嶅鏍¢獙 + +export default { + name: "InspectionItemModal", + data() { + return { + title: "鎿嶄綔", + visible: false, + disableSubmit: false, + model: {}, + inspectionItemId: "", //淇濆瓨妫�楠岄」鐩甶d + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + + confirmLoading: false, + form: this.$form.createForm(this), + validatorRules: { + itemCode: { + rules: [ + { required: true, message: '璇疯緭鍏ユ楠岄」鐩紪鐮�' }, + { min: 2, max: 30, message: '闀垮害鍦� 2 鍒� 30 涓瓧绗�', trigger: 'blur' }, + { validator: this.validateNum }, + ] + }, + itemName: { + rules: [ + { required: true, message: '璇疯緭鍏ユ楠岄」鐩悕绉�' }, + { min: 0, max: 64, message: '闀垮害涓嶈秴杩� 64 涓瓧绗�', trigger: 'blur' }, + { validator: this.validateName }, + ] + }, + }, + url: { + add: "/qms/inspectionItem/add", + edit: "/qms/inspectionItem/edit", + }, + } + }, + created() { + }, + methods: { + add() { + this.edit({}); + }, + edit(record) { + this.form.resetFields(); + this.model = Object.assign({}, record); + this.inspectionItemId = record.id; + this.visible = true; + this.$nextTick(() => { + this.form.setFieldsValue( + pick(this.model, 'itemCode', 'itemName','itemCategory','qualitativeOrQuantitative','inspectionTools', 'remark') + ) + }); + }, + close() { + this.$emit('close'); + this.visible = false; + }, + handleOk() { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.form.validateFields((err, values) => { + if (!err) { + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + if (!this.model.id) { + httpurl += this.url.add; + method = 'post'; + } else { + httpurl += this.url.edit; + method = 'put'; + } + let formData = Object.assign(this.model, values); + httpAction(httpurl, formData, method).then((res) => { + if (res.success) { + that.$message.success(res.message); + that.$emit('ok'); + } else { + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + that.close(); + }) + } + }) + }, + handleCancel() { + this.close() + }, + //楠岃瘉 缂栧彿 + validateNum(rule, value, callback) { + var params = { + tableName: 'qms_inspection_item', + fieldName: 'item_code', + fieldVal: value, + dataId: this.inspectionItemId, + //鏁版嵁搴撲腑瀛樺湪瀛楁del_flag骞朵娇鐢ㄨ瀛楁浣滀负鏈垹闄ょ瓥鐣ワ紝鐪熷垹闄わ細false 鍋囧垹闄わ細true + delFlag: 'true', + }; + duplicateCheck(params).then((res) => { + if (res.success) { + callback(); + } else { + callback("妫�楠岄」鐩紪鍙峰凡瀛樺湪!"); + } + }) + }, + //楠岃瘉 鍚嶇О + validateName(rule, value, callback) { + var params = { + tableName: 'qms_inspection_items', + fieldName: 'item_name', + fieldVal: value, + dataId: this.inspectionItemId, + //鏁版嵁搴撲腑瀛樺湪瀛楁del_flag骞朵娇鐢ㄨ瀛楁浣滀负鏈垹闄ょ瓥鐣ワ紝鐪熷垹闄わ細false 鍋囧垹闄わ細true + delFlag: 'true', + }; + duplicateCheck(params).then((res) => { + if (res.success) { + callback(); + } else { + callback("妫�楠岄」鐩悕绉板凡瀛樺湪!"); + } + }) + }, + // 鍏抽棴寮圭獥鏃舵竻闄よ〃鍗曟牎楠� + removeValidate() { + if (this.$refs.form) this.$refs.form.clearValidate() + } + } +} +</script> + +<style scoped> +.ant-btn { + padding: 0 10px; + margin-left: 3px; +} + +.ant-form-item-control { + line-height: 0px; +} + +/** 涓昏〃鍗曡闂磋窛 */ +.ant-form .ant-form-item { + margin-bottom: 10px; +} + +/** Tab椤甸潰琛岄棿璺� */ +.ant-tabs-content .ant-form-item { + margin-bottom: 0px; +} +</style> \ No newline at end of file diff --git a/src/views/qms/modules/inspectionTools/InspectionToolsModel.vue b/src/views/qms/modules/inspectionTools/InspectionToolsModel.vue new file mode 100644 index 0000000..84aea64 --- /dev/null +++ b/src/views/qms/modules/inspectionTools/InspectionToolsModel.vue @@ -0,0 +1,228 @@ +<template> + <a-modal + :title="title" + :width="800" + :visible="visible" + :confirmLoading="confirmLoading" + :okButtonProps="{ props: {disabled: disableSubmit} }" + @ok="handleOk" + @cancel="handleCancel" + cancelText="鍏抽棴" + > + <a-spin :spinning="confirmLoading"> + <a-form :form="form"> + + <a-row :gutter="24"> + <a-col :span="24"> + <a-form-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + label="妫�楠屽伐鍏风紪鐮�" + > + <a-input + :disabled="disableSubmit" + allow-clear + placeholder="璇疯緭鍏ユ楠屽伐鍏风紪鐮�" + v-decorator="['toolCode', validatorRules.toolCode ]" + /> + </a-form-item> + </a-col> + </a-row> + + <a-row :gutter="24"> + <a-col :span="24"> + <a-form-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + label="妫�楠屽伐鍏峰悕绉�" + > + <a-input + :disabled="disableSubmit" + allow-clear + placeholder="璇疯緭鍏ユ楠屽伐鍏峰悕绉�" + v-decorator="['toolName', validatorRules.toolName ]" + /> + </a-form-item> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="24"> + <a-form-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + label="澶囨敞" + > + <a-textarea :disabled="disableSubmit" placeholder="璇疯緭鍏ュ娉�" v-decorator="['remark', validatorRules.remark ]"/> + </a-form-item> + </a-col> + </a-row> + </a-form> + </a-spin> + </a-modal> +</template> + +<script> +import { httpAction, getAction } from '@/api/manage' +import pick from 'lodash.pick' +import { duplicateCheck } from '@/api/api'//閲嶅鏍¢獙 + +export default { + name: "InspectionToolsModal", + data() { + return { + title: "鎿嶄綔", + visible: false, + disableSubmit: false, + model: {}, + inspectionToolsId: "", //淇濆瓨妫�楠屽伐鍏穒d + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + + confirmLoading: false, + form: this.$form.createForm(this), + validatorRules: { + toolCode: { + rules: [ + { required: true, message: '璇疯緭鍏ユ楠屽伐鍏风紪鐮�' }, + { min: 2, max: 30, message: '闀垮害鍦� 2 鍒� 30 涓瓧绗�', trigger: 'blur' }, + { validator: this.validateNum }, + ] + }, + toolName: { + rules: [ + { required: true, message: '璇疯緭鍏ユ楠屽伐鍏峰悕绉�' }, + { min: 0, max: 64, message: '闀垮害涓嶈秴杩� 64 涓瓧绗�', trigger: 'blur' }, + { validator: this.validateName }, + ] + }, + }, + url: { + add: "/qms/inspectionTools/add", + edit: "/qms/inspectionTools/edit", + }, + } + }, + created() { + }, + methods: { + add() { + this.edit({}); + }, + edit(record) { + this.form.resetFields(); + this.model = Object.assign({}, record); + this.inspectionToolsId = record.id; + this.visible = true; + this.$nextTick(() => { + this.form.setFieldsValue( + pick(this.model, 'toolCode', 'toolName', 'remark') + ) + }); + }, + close() { + this.$emit('close'); + this.visible = false; + }, + handleOk() { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.form.validateFields((err, values) => { + if (!err) { + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + if (!this.model.id) { + httpurl += this.url.add; + method = 'post'; + } else { + httpurl += this.url.edit; + method = 'put'; + } + let formData = Object.assign(this.model, values); + httpAction(httpurl, formData, method).then((res) => { + if (res.success) { + that.$message.success(res.message); + that.$emit('ok'); + } else { + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + that.close(); + }) + } + }) + }, + handleCancel() { + this.close() + }, + //楠岃瘉 缂栧彿 + validateNum(rule, value, callback) { + var params = { + tableName: 'qms_inspection_tools', + fieldName: 'tool_code', + fieldVal: value, + dataId: this.inspectionToolsId, + //鏁版嵁搴撲腑瀛樺湪瀛楁del_flag骞朵娇鐢ㄨ瀛楁浣滀负鏈垹闄ょ瓥鐣ワ紝鐪熷垹闄わ細false 鍋囧垹闄わ細true + delFlag: 'true', + }; + duplicateCheck(params).then((res) => { + if (res.success) { + callback(); + } else { + callback("妫�楠屽伐鍏风紪鐮佸凡瀛樺湪!"); + } + }) + }, + //楠岃瘉 鍚嶇О + validateName(rule, value, callback) { + var params = { + tableName: 'qms_inspection_tools', + fieldName: 'tool_name', + fieldVal: value, + dataId: this.inspectionToolsId, + //鏁版嵁搴撲腑瀛樺湪瀛楁del_flag骞朵娇鐢ㄨ瀛楁浣滀负鏈垹闄ょ瓥鐣ワ紝鐪熷垹闄わ細false 鍋囧垹闄わ細true + delFlag: 'true', + }; + duplicateCheck(params).then((res) => { + if (res.success) { + callback(); + } else { + callback("妫�楠屽伐鍏峰悕绉板凡瀛樺湪!"); + } + }) + }, + // 鍏抽棴寮圭獥鏃舵竻闄よ〃鍗曟牎楠� + removeValidate() { + if (this.$refs.form) this.$refs.form.clearValidate() + } + } +} +</script> + +<style scoped> +.ant-btn { + padding: 0 10px; + margin-left: 3px; +} + +.ant-form-item-control { + line-height: 0px; +} + +/** 涓昏〃鍗曡闂磋窛 */ +.ant-form .ant-form-item { + margin-bottom: 10px; +} + +/** Tab椤甸潰琛岄棿璺� */ +.ant-tabs-content .ant-form-item { + margin-bottom: 0px; +} +</style> \ No newline at end of file diff --git a/src/views/system/modules/UserModal.vue b/src/views/system/modules/UserModal.vue index 8f3883f..5cd27b2 100644 --- a/src/views/system/modules/UserModal.vue +++ b/src/views/system/modules/UserModal.vue @@ -139,22 +139,22 @@ label="杞﹂棿鍒嗛厤" :labelCol="labelCol" :wrapperCol="wrapperCol" - v-show="!productionDisabled" + v-show="!factoryDisabled" > - <j-select-production - v-model="model.selectedProduction" + <j-select-factory + v-model="model.selectedFactory" :multi="true" - @back="backProductionInfo" + @back="backFactoryInfo" :backProduction="true" :treeProductOpera="true" - ></j-select-production> + ></j-select-factory> </a-form-model-item> <!--<a-form-model-item--> <!--label="閫夋嫨璁惧"--> <!--:labelCol="labelCol"--> <!--:wrapperCol="wrapperCol"--> - <!--v-show="!productionDisabled"--> + <!--v-show="!factoryDisabled"--> <!-->--> <!--<a-input-search--> <!--:readOnly="true"--> @@ -162,7 +162,7 @@ <!--@search="deviceSearch"--> <!--enter-button--> <!--placeholder="璇烽�夋嫨璁惧"--> - <!--:disabled="!model.selectedProduction"--> + <!--:disabled="!model.selectedFactory"--> <!--/>--> <!--</a-form-model-item>--> @@ -350,7 +350,7 @@ import { addUser, editUser, queryUserRole, queryall } from '@/api/api' import { disabledAuthFilter } from '@/utils/authFilter' import { duplicateCheck } from '@/api/api' - import JSelectProduction from '../../../components/jeecgbiz/JSelectProduction' + import JSelectFactory from '../../../components/jeecgbiz/JSelectFactory' import { mapActions } from 'vuex' import { ajaxGetDictItems, getDictItemsFromCache } from '@/api/api' // import SelectDeviceModal from './SelectDeviceModal' @@ -359,12 +359,12 @@ name: 'UserModal', components: { // SelectDeviceModal, - JSelectProduction + JSelectFactory }, data() { return { departDisabled: false, //鏄惁鏄垜鐨勯儴闂ㄨ皟鐢ㄨ椤甸潰 - productionDisabled: false, //鏄惁鏄垜鐨勮溅闂磋皟鐢ㄨ椤甸潰 + factoryDisabled: false, //鏄惁鏄垜鐨勮溅闂磋皟鐢ㄨ椤甸潰 roleDisabled: false, //鏄惁鏄鑹茬淮鎶よ皟鐢ㄨ椤甸潰 modalWidth: 800, drawerWidth: 700, @@ -420,10 +420,10 @@ tenantsOptions: [], rolesOptions: [], nextDepartOptions: [], - nextProductionOptions: [], + nextFactoryOptions: [], isDepartType: '', model: { - selectedProduction: '' + selectedFactory: '' } } }, @@ -433,7 +433,7 @@ if (value) this.initDictData('password_length') } }, - 'model.selectedProduction': { + 'model.selectedFactory': { handler(newVal, oldVal) { if (newVal) { // 濡傛灉杞﹂棿閫夋嫨鍓嶅悗涓嶄竴鑷村垯閲嶇疆閫夋嫨璁惧 @@ -481,7 +481,7 @@ userIdentity: 1, selectedroles: '', selecteddeparts: '', - selectedProduction: '' + selectedFactory: '' }) }, edit(record) { @@ -578,19 +578,19 @@ // 鑾峰彇杞﹂棿鍒嗛厤 getAction(that.url.userProductionList, { userId: userid }).then((res) => { if (res.success) { - let ProductionOptions = [] - let selectProductKeys = [] + let FactoryOptions = [] + let selectFactoryKeys = [] for (let i = 0; i < res.result.length; i++) { - selectProductKeys.push(res.result[i].key) + selectFactoryKeys.push(res.result[i].key) //鏂板璐熻矗閮ㄩ棬閫夋嫨涓嬫媺妗� - ProductionOptions.push({ + FactoryOptions.push({ value: res.result[i].key, label: res.result[i].title }) } - this.$set(this.model, 'selectedProduction', selectProductKeys.join(',')) - that.nextProductionOptions = ProductionOptions + this.$set(this.model, 'selectedFactory', selectFactoryKeys.join(',')) + that.nextFactoryOptions = FactoryOptions } }) //杞﹂棿鐨剈rl @@ -602,9 +602,9 @@ return c }) }, - backProductionInfo(info) { - this.model.productionIds = this.model.selectedProduction - this.nextProductionOptions = info.map((item, index, arr) => { + backFactoryInfo(info) { + this.model.factoryIds = this.model.selectedFactory + this.nextFactoryOptions = info.map((item, index, arr) => { let c = { label: item.text, value: item.value + '' } return c }) @@ -613,7 +613,7 @@ refresh() { this.userId = '' this.nextDepartOptions = [] - this.nextProductionOptions = [] + this.nextFactoryOptions = [] this.departIdShow = false }, close() { @@ -621,7 +621,7 @@ this.visible = false this.disableSubmit = false this.nextDepartOptions = [] - this.nextProductionOptions = [] + this.nextFactoryOptions = [] this.departIdShow = false this.$refs.form.resetFields() }, -- Gitblit v1.9.3