From f27ae4aa1a3b72bf8dc934efd6f084ba5a101a48 Mon Sep 17 00:00:00 2001 From: Fixiaobai <fixiaobai@163.com> Date: 星期五, 03 十一月 2023 09:10:13 +0800 Subject: [PATCH] modified: src/api/basic/post.js modified: src/views/basic/division/division-form.vue modified: src/views/basic/param/index.vue modified: src/views/basic/param/param-form.vue modified: src/views/basic/post/index.vue modified: src/views/basic/post/post-form.vue modified: src/views/basic/staff/index.vue modified: src/views/basic/staff/staff-form.vue modified: src/views/basic/warehouse/warehouse-form.vue modified: src/views/technology/document/document-form.vue --- src/views/basic/param/index.vue | 168 ++++++ src/views/basic/staff/staff-form.vue | 233 ++++++--- src/views/basic/post/post-form.vue | 110 +++ src/views/technology/document/document-form.vue | 577 +++++------------------- src/views/basic/staff/index.vue | 18 src/views/basic/warehouse/warehouse-form.vue | 10 src/views/basic/division/division-form.vue | 82 +-- src/views/basic/post/index.vue | 27 + src/views/basic/param/param-form.vue | 98 ++- src/api/basic/post.js | 14 10 files changed, 686 insertions(+), 651 deletions(-) diff --git a/src/api/basic/post.js b/src/api/basic/post.js index 80abd1d..45c4d70 100644 --- a/src/api/basic/post.js +++ b/src/api/basic/post.js @@ -45,3 +45,17 @@ data: obj }) } + +export function getDivisionByFactoryId(id,factoryId) { + return request({ + url: '/mes/division/getDivisionByFactoryId?id=' + id+"&factoryId="+factoryId, + method: 'get' + }) +} + +export function getObjById(id,factoryId,divisionId) { + return request({ + url: '/mes/post/getObjById?id=' + id+"&factoryId="+factoryId+"&divisionId="+divisionId, + method: 'get' + }) +} \ No newline at end of file diff --git a/src/views/basic/division/division-form.vue b/src/views/basic/division/division-form.vue index dd0fcaa..dd96889 100644 --- a/src/views/basic/division/division-form.vue +++ b/src/views/basic/division/division-form.vue @@ -1,50 +1,25 @@ <template> - <el-dialog - :title="!dataForm.id ? '鏂板' : '淇敼'" - :close-on-click-modal="false" - :visible.sync="visible" - > - <el-form - :model="dataForm" - :rules="dataRule" - ref="dataForm" - label-width="80px" - class="l-mes" - > + <el-dialog :title="!dataForm.id ? '鏂板' : '淇敼'" :close-on-click-modal="false" :visible.sync="visible"> + <el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="80px" class="l-mes"> <el-row> <el-col :span="12"> <el-form-item label="閮ㄩ棬缂栧彿" prop="divisionNo"> - <el-input - v-model="dataForm.divisionNo" - placeholder="閮ㄩ棬缂栧彿" - ></el-input> + <el-input v-model="dataForm.divisionNo" placeholder="閮ㄩ棬缂栧彿"></el-input> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="閮ㄩ棬鍚嶇О" prop="divisionName"> - <el-input - v-model="dataForm.divisionName" - placeholder="閮ㄩ棬鍚嶇О" - ></el-input> + <el-input v-model="dataForm.divisionName" placeholder="閮ㄩ棬鍚嶇О"></el-input> </el-form-item> </el-col> </el-row> <el-row> <el-col :span="12"> <el-form-item label="鍏徃" prop="companyId"> - <el-select - @change="changeCompany" - v-model="dataForm.companyId" - filterable - placeholder="璇烽�夋嫨" - style="width: 100%;" - > - <el-option - v-for="(item, index) in this.companyOptions" - :key="index" - :label="item.companyName" - :value="item.id" - > + <el-select @change="changeCompany" v-model="dataForm.companyId" filterable placeholder="璇烽�夋嫨" + style="width: 100%;"> + <el-option v-for="(item, index) in this.companyOptions" :key="index" :label="item.companyName" + :value="item.id"> </el-option> </el-select> </el-form-item> @@ -68,12 +43,7 @@ </el-form> <span slot="footer" class="dialog-footer"> <el-button @click="visible = false">鍙栨秷</el-button> - <el-button - type="primary" - :disabled="isSubmit" - v-thinclick="`dataFormSubmit`" - >纭畾</el-button - > + <el-button type="primary" :disabled="isSubmit" v-thinclick="`dataFormSubmit`">纭畾</el-button> </span> </el-dialog> </template> @@ -93,7 +63,7 @@ data() { return { visible: false, - factotyOption:[], + factotyOption: [], dataForm: { id: 0, divisionNo: '', @@ -137,22 +107,29 @@ /* this.initCompanySelect(); this.initStaffSelect(); */ if (this.dataForm.id) { + console.log(111); getObj(this.dataForm.id).then((response) => { this.dataForm = response.data.data + this.dataForm.factotyId = response.data.data.factoryId + this.changeCompany() }) } }) }, changeCompany() { - console.log(this.dataForm.companyId); loadFactoryListByCompany(this.dataForm.companyId).then((res) => { - console.log(res.data); this.factotyOption = res.data.data }) + // if (this.dataForm.factotyId != '') { + // let datas = this.factotyOption.filter(item => { + // return item.id == this.dataForm.factotyId + // }); + // console.log(datas); + // } }, - changeFactory(){ - this.dataForm.factotyName=this.factotyOption.filter(item=>{ - return item.id==this.dataForm.factotyId + changeFactory() { + this.dataForm.factotyName = this.factotyOption.filter(item => { + return item.id == this.dataForm.factotyId })[0].factoryName; console.log(this.dataForm); }, @@ -166,8 +143,8 @@ staffId: this.dataForm.staffId, companyId: this.dataForm.companyId, id: this.dataForm.id, + factoryId: this.dataForm.factotyId, factoryName: this.dataForm.factotyName, - factotyId: this.dataForm.factotyId } this.$refs.dataForm.validate((valid) => { if (valid) { @@ -210,6 +187,19 @@ created() { this.initCompanySelect() this.initStaffSelect() + }, + watch: { + 'dataForm.companyId': { + handler(newValue, oldValue) { + if (newValue != ''&&oldValue!='') { + if(oldValue!=newValue){ + this.dataForm.factotyId=null + } + } + }, + immediate: true, + deep: true + } } } </script> diff --git a/src/views/basic/param/index.vue b/src/views/basic/param/index.vue index c3f0223..217e2ef 100644 --- a/src/views/basic/param/index.vue +++ b/src/views/basic/param/index.vue @@ -1,8 +1,10 @@ <template> <div class="mod-config"> <basic-container> - <ttable + <!-- <ttable :table="table" + :row-key="id" + :tree-props="{children: 'children', hasChildren: 'hasChildren'}" @handleSelectionChange="handleSelectionChange" :uploadInfo="uploadInfo" :prelang="prelang" @@ -11,13 +13,70 @@ ref="paramTable" > <template #toolbar></template> - </ttable> + </ttable> --> + <el-row style="margin-left: 10px;"> + <el-form :inline="true" :model="table" class="demo-form-inline"> + <el-form-item label="鍙傛暟椤�"> + <el-input v-model="table.param" placeholder="鍙傛暟椤�"></el-input> + </el-form-item> + <el-form-item label="鍙傛暟缂栧彿"> + <el-input v-model="table.code" placeholder="鍙傛暟缂栧彿"></el-input> + </el-form-item> + <el-form-item> + <el-button type="primary" @click="onSearch">鏌ヨ</el-button> + </el-form-item> + </el-form> + </el-row> + <el-row style="margin-left: 10px;height: 80vh;"> + <el-row> + <el-button type="defult" @click="addOrUpdateHandle">鏂板</el-button> + <el-button type="defult" @click="onSearch">瀵煎叆</el-button> + <!-- <el-button type="defult" @click="isExpandAllClick">灞曞紑/鎶樺彔</el-button> --> + </el-row> + <el-row style="padding-top: 20px;"> + <!-- 琛ㄦ牸鏁版嵁鍖�--> + <el-table height="480" style="width: 100%;" :data="table.data" row-key="id" + :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"> + <el-table-column type="index" label="搴忓彿" width="50"> + </el-table-column> + <el-table-column prop="code" label="鍙傛暟缂栧彿"></el-table-column> + <el-table-column prop="parameterItem" label="鍙傛暟椤�"></el-table-column> + <el-table-column prop="type" label="鍙傛暟绫诲瀷"> + <template slot-scope="scope"> + <el-col v-show="scope.row.bianJi===false">{{ scope.row.type }}</el-col> + <el-col v-show="scope.row.bianJi"> + 111 + <!-- <el-select v-model="scope.row.type" filterable placeholder="璇烽�夋嫨鍙傛暟绫诲瀷" style="width:100%" + @change="changeType"> + <el-option v-for="(item, index) in this.typeOptions" :label="item.label" :value="item.value" + :key="item.value"> + </el-option> + </el-select> --> + </el-col> + </template> + </el-table-column> + <el-table-column prop="parameterFormat" label="鍙傛暟鏍煎紡"></el-table-column> + <el-table-column prop="unit" label="鍗曚綅"></el-table-column> + <el-table-column prop="code" label="鎿嶄綔"> + <template slot-scope="scope"> + <el-row style=" display: flex;width: 100%;"> + <el-col><el-button type="text">鍒犻櫎</el-button></el-col> + <el-col v-if="scope.row.isBianji"> + <el-button @click="bianji(scope.row)" type="text">{{ scope.row.bianJiBtn }}</el-button> + </el-col> + </el-row> + </template> + </el-table-column> + </el-table> + <el-row style="display: flex; justify-content: end;"> + <el-pagination :current-page="table.currentPage" @current-change="handlesCurrentChange" + @size-change="sizeChangeHandle" :page-sizes="[10, 20, 50, 100]" :page-size="table.pageSize" + layout="total, sizes, prev, pager, next, jumper" :total="table.total"></el-pagination> + </el-row> + </el-row> + </el-row> <!-- 寮圭獥, 鏂板 / 淇敼 --> - <table-form - v-if="addOrUpdateVisible" - ref="addOrUpdate" - @refreshDataList="getData" - ></table-form> + <table-form v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getData"></table-form> </basic-container> </div> </template> @@ -30,6 +89,9 @@ export default { data() { return { + isExpandAll: false, + // 閲嶆柊娓叉煋琛ㄦ牸鐘舵�� + refreshTable: true, ajaxFun: fetchList, typeOptions: [], multipleSelection: [], @@ -47,14 +109,16 @@ border: true, // 鏄惁鏈夌旱鍚戣竟妗� lazy: false, // 鏄惁闇�瑕佹噿鍔犺浇 fit: true, // 鍒楃殑瀹藉害鏄惁鑷拺寮� - multiSelect: true, // + multiSelect: false, // seqNo: true, isShowHide: true, // 鏄惁鏄剧ず鏄惧奖鎸夐挳 - isSearch: true, // 楂樼骇鏌ヨ鎸夐挳 + isSearch: false, // 楂樼骇鏌ヨ鎸夐挳 defaultOrderBy: { column: 'createTime', direction: 'desc' } }, table: { + param: null, total: 0, + code: null, currentPage: 1, pageSize: 20, data: [], @@ -77,6 +141,24 @@ sort: true, isTrue: true, isSearch: true, + searchInfoType: 'text' + }, + { + minWidth: '120', + prop: 'second', + label: '浜岀骇鍙傛暟', + sort: true, + isTrue: true, + isSearch: false, + searchInfoType: 'text' + }, + { + minWidth: '130', + prop: 'third', + label: '涓夌骇鍙傛暟', + sort: true, + isTrue: true, + isSearch: false, searchInfoType: 'text' }, { @@ -182,11 +264,68 @@ }, created() { this.getParamType() + this.getData() }, methods: { + changeType(){}, + bianji(row){ + // this.$set(row.bianJi,false,true) + row.bianJi=true + row.bianJiBtn='淇濆瓨' + console.log(row) + }, + isExpandAllClick() { + // console.log(1111); + this.isExpandAll = !this.isExpandAll; + this.$nextTick(() => { + this.refreshTable = true; + }); + // console.log(this.isExpandAll); + }, + handlesCurrentChange() { }, + sizeChangeHandle() { }, + onSearch() { }, // 鑾峰彇鏁版嵁鍒楄〃 getData() { - this.$refs.paramTable.getDataList() + let param = { + parentId: 0, + code: this.table.code, + size: this.table.pageSize, + current: this.table.currentPage, + parameterItem: this.table.param + } + fetchList(param).then((res) => { + console.log(res.data); + this.table.total = res.data.data.total + this.table.data = res.data.data.records + let datas=JSON.parse(JSON.stringify(this.table.data)) + datas.forEach(l => { + l.bianJi = false + if (l.children.length < 1) { + l.isBianji = true + l.bianJiBtn='缂栬緫' + } + if (l.children.length > 0) { + l.isBianji = false + l.children.forEach(c => { + c.bianji = false + if (c.children.length < 1) { + c.isBianji = true + c.bianJiBtn='缂栬緫' + } else { + l.isBianji = false + c.children.forEach(cc => { + cc.bianJi = false + cc.isBianji = true + c.bianJiBtn='缂栬緫' + }) + } + }) + } + }) + this.table.data=datas + console.log(this.table.data); + }) }, // 鏂板 / 淇敼 addOrUpdateHandle(row) { @@ -222,7 +361,7 @@ cancelButtonText: '鍙栨秷', type: 'warning' }) - .then(function() { + .then(function () { return delObj(row.id) }) .then((data) => { @@ -233,3 +372,10 @@ } } </script> +<style scoped> +table, +tr, +td { + text-align: center; +} +</style> diff --git a/src/views/basic/param/param-form.vue b/src/views/basic/param/param-form.vue index fa7f914..e7a113e 100644 --- a/src/views/basic/param/param-form.vue +++ b/src/views/basic/param/param-form.vue @@ -1,27 +1,25 @@ <template> - <el-dialog - v-diadrag - :title="!dataForm.id ? '鏂板' : '淇敼'" - :close-on-click-modal="false" - :visible.sync="visible" - > - <el-form - :model="dataForm" - :rules="dataRule" - ref="dataForm" - label-width="80px" - class="l-mes" - > + <el-dialog v-diadrag :title="!dataForm.id ? '鏂板' : '淇敼'" :close-on-click-modal="false" :visible.sync="visible"> + <el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="80px" class="l-mes"> <el-form-item label="鍙傛暟缂栧彿" prop="code"> <el-input v-model="dataForm.code" placeholder="鍙傛暟缂栧彿"></el-input> </el-form-item> <el-form-item label="鍙傛暟椤�" prop="parameterItem"> - <el-input - v-model="dataForm.parameterItem" - placeholder="鍙傛暟椤�" - ></el-input> + <el-input v-model="dataForm.parameterItem" placeholder="鍙傛暟椤�"></el-input> </el-form-item> - <el-form-item label="鍙傛暟绫诲瀷" prop="type"> + <el-form-item label="浜岀骇鍙傛暟" prop="secondId"> + <el-select v-model="dataForm.secondId" multiple collapse-tags style="width: 100%;" placeholder="璇烽�夋嫨"> + <el-option v-for="item in optionsSecond" :key="item.id" :label="item.label" :value="item.id"> + </el-option> + </el-select> + </el-form-item> + <el-form-item label="涓夌骇绾у弬鏁�" prop="thirdId"> + <el-select v-model="dataForm.thirdId" multiple collapse-tags style="width: 100%;" placeholder="璇烽�夋嫨"> + <el-option v-for="item in optionsThird" :key="item.id" :label="item.label" :value="item.id"> + </el-option> + </el-select> + </el-form-item> + <!-- <el-form-item label="鍙傛暟绫诲瀷" prop="type"> <el-select v-model="dataForm.type" filterable @@ -66,7 +64,7 @@ </el-form-item> <el-form-item label="鍗曚綅" prop="unit"> <el-input v-model="dataForm.unit" placeholder="鍗曚綅"></el-input> - </el-form-item> + </el-form-item> --> </el-form> <span slot="footer" class="dialog-footer"> <el-button @click="visible = false">鍙栨秷</el-button> @@ -84,11 +82,15 @@ return { typeOptions: [], dictOptions: [], + optionsSecond: [], + optionsThird: [], visible: false, dataForm: { id: 0, code: '', parameterItem: '', + secondId: null, + thirdId: null, type: '', parameterFormat: '', unit: '', @@ -98,6 +100,8 @@ updateTime: '', dict: '' }, + secondParam: null, + thirdParam: null, dataRule: { code: [ { required: true, message: '鍙傛暟缂栧彿涓嶈兘涓虹┖', trigger: 'blur' } @@ -105,10 +109,10 @@ parameterItem: [ { required: true, message: '鍙傛暟椤逛笉鑳戒负绌�', trigger: 'blur' } ], - type: [ - { required: true, message: '鍙傛暟绫诲瀷涓嶈兘涓虹┖', trigger: 'blur' } - ], - unit: [{ required: true, message: '鍗曚綅涓嶈兘涓虹┖', trigger: 'blur' }] + // type: [ + // { required: true, message: '鍙傛暟绫诲瀷涓嶈兘涓虹┖', trigger: 'blur' } + // ], + // unit: [{ required: true, message: '鍗曚綅涓嶈兘涓虹┖', trigger: 'blur' }] }, clickDateArr: [] } @@ -116,6 +120,16 @@ created() { this.getParamType() this.getDictOptions() + remote('second_param').then((response) => { + if (response.data.code === 0) { + this.optionsSecond = response.data.data + } + }) + remote('third_param').then((response) => { + if (response.data.code === 0) { + this.optionsThird = response.data.data + } + }) }, methods: { init(id) { @@ -171,7 +185,7 @@ if (this.clickDateArr.length > 1) { if ( this.clickDateArr[this.clickDateArr.length - 1] - - this.clickDateArr[this.clickDateArr.length - 2] < + this.clickDateArr[this.clickDateArr.length - 2] < 2000 ) { // 灏忎簬2绉掑垯璁や负閲嶅鎻愪氦 @@ -185,23 +199,24 @@ if (!response.data.data) { this.addOrUpdate() } else { - // 澧炲姞鍙傛暟椤瑰唴瀹归噸澶嶆彁绀� - this.$confirm( - '鍙傛暟椤瑰唴瀹归噸澶嶏紝缂栧彿锛�' + - response.data.data + - '锛岃纭鏄惁缁х画', - '鎻愮ず', - { - confirmButtonText: '纭畾', - cancelButtonText: '鍙栨秷', - closeOnClickModal: false, - type: 'warning' - } - ) - .then(() => { - this.addOrUpdate() - }) - .catch(() => {}) + this.message.error('缂栧彿閲嶅锛�') + // // 澧炲姞鍙傛暟椤瑰唴瀹归噸澶嶆彁绀� + // this.$confirm( + // '鍙傛暟椤瑰唴瀹归噸澶嶏紝缂栧彿锛�' + + // response.data.data + + // '锛岃纭鏄惁缁х画', + // '鎻愮ず', + // { + // confirmButtonText: '纭畾', + // cancelButtonText: '鍙栨秷', + // closeOnClickModal: false, + // type: 'warning' + // } + // ) + // .then(() => { + // this.addOrUpdate() + // }) + // .catch(() => { }) } }) } @@ -221,6 +236,7 @@ } }) } else { + addObj(this.dataForm).then((response) => { const data = response.data.data if (data.code === 0) { diff --git a/src/views/basic/post/index.vue b/src/views/basic/post/index.vue index 8ca0d4a..8913ed4 100644 --- a/src/views/basic/post/index.vue +++ b/src/views/basic/post/index.vue @@ -104,6 +104,33 @@ isSearch: true, searchInfoType: 'text' }, + { + minWidth: '120', + prop: 'companyName', + label: '鍏徃鍚嶇О', + sort: true, + isTrue: true, + isSearch: true, + searchInfoType: 'text' + }, + { + minWidth: '120', + prop: 'factoryName', + label: '宸ュ巶鍚嶇О', + sort: true, + isTrue: true, + isSearch: true, + searchInfoType: 'text' + }, + { + minWidth: '120', + prop: 'divisionName', + label: '閮ㄩ棬鍚嶇О', + sort: true, + isTrue: true, + isSearch: true, + searchInfoType: 'text' + }, // 鎻忚堪 { minWidth: '120', diff --git a/src/views/basic/post/post-form.vue b/src/views/basic/post/post-form.vue index 4ce7d29..36b2294 100644 --- a/src/views/basic/post/post-form.vue +++ b/src/views/basic/post/post-form.vue @@ -3,17 +3,17 @@ <el-form :model="dataForm" :rules="dataRule" ref="dataForm" label-width="120px" class="l-mes"> <el-row> <el-col :span="12"> - <el-form-item label="鍏徃" prop="company"> - <el-select style="width: 100%;" v-model="dataForm.company" placeholder="璇烽�夋嫨"> - <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> + <el-form-item label="鍏徃" prop="companyId"> + <el-select @change="changeCompany" style="width: 100%;" v-model="dataForm.companyId" placeholder="璇烽�夋嫨"> + <el-option v-for="item in options" :key="item.id" :label="item.companyName" :value="item.id"> </el-option> </el-select> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="宸ュ巶" prop="factory"> - <el-select style="width: 100%;" v-model="dataForm.factory" placeholder="璇烽�夋嫨"> - <el-option v-for="item in optionsfactory" :key="item.value" :label="item.label" :value="item.value"> + <el-form-item label="宸ュ巶" prop="factoryId"> + <el-select @change="changeFactory" style="width: 100%;" v-model="dataForm.factoryId" placeholder="璇烽�夋嫨"> + <el-option v-for="item in optionsfactory" :key="item.id" :label="item.factoryName" :value="item.id"> </el-option> </el-select> </el-form-item> @@ -21,9 +21,9 @@ </el-row> <el-row> <el-col :span="12"> - <el-form-item label="閮ㄩ棬" prop="division"> - <el-select style="width: 100%;" v-model="dataForm.division" placeholder="璇烽�夋嫨"> - <el-option v-for="item in optionsdepartment" :key="item.value" :label="item.label" :value="item.value"> + <el-form-item label="閮ㄩ棬" prop="divisionId"> + <el-select @change="changeDivision" style="width: 100%;" v-model="dataForm.divisionId" placeholder="璇烽�夋嫨"> + <el-option v-for="item in optionsdepartment" :key="item.id" :label="item.divisionName" :value="item.id"> </el-option> </el-select> </el-form-item> @@ -55,21 +55,29 @@ </template> <script> -import { getObj, addObj, putObj } from '@/api/basic/post' - +import { getObj, addObj, putObj, getDivisionByFactoryId } from '@/api/basic/post' +import { + loadStaff, + dataFormTransfer, + loadFactoryListByCompany +} from '@/api/basic/division' +import { loadCompany } from '@/api/basic/factory' export default { data() { return { ruleOptions: [], visible: false, options: [], - optionsfactory:[], + optionsfactory: [], optionsdepartment: [], dataForm: { id: 0, - company: null, - factory: null, - division: null, + companyId: null, + companyName: null, + factoryId: null, + factoryName: null, + divisionId: null, + divisionName: null, postNo: '', postName: '', remark: '' @@ -81,13 +89,13 @@ postNo: [ { required: true, message: '宀椾綅缂栧彿涓嶈兘涓虹┖', trigger: 'blur' } ], - company: [ + companyId: [ { required: true, message: '鍏徃鍚嶇О涓嶈兘涓虹┖', trigger: 'blur' } ], - factory: [ + factoryId: [ { required: true, message: '宸ュ巶鍚嶇О涓嶈兘涓虹┖', trigger: 'blur' } - ], - division: [ + ], + divisionId: [ { required: true, message: '閮ㄩ棬鍚嶇О涓嶈兘涓虹┖', trigger: 'blur' } ] }, @@ -95,9 +103,36 @@ } }, mounted() { - this.initTestRuleSelect() + // this.initTestRuleSelect() + this.initCompanySelect() }, methods: { + changeDivision(){ + this.dataForm.divisionName = this.optionsdepartment.filter(item => { + return item.id == this.dataForm.divisionId + })[0].divisionName; + }, + changeCompany() { + loadFactoryListByCompany(this.dataForm.companyId).then((res) => { + this.optionsfactory = res.data.data + }) + this.dataForm.companyName = this.options.filter(item => { + return item.id == this.dataForm.companyId + })[0].companyName; + }, + changeFactory() { + getDivisionByFactoryId(this.dataForm.companyId, this.dataForm.factoryId).then((res) => { + this.optionsdepartment=res.data.data + }) + this.dataForm.factoryName = this.optionsfactory.filter(item => { + return item.id == this.dataForm.factoryId + })[0].factoryName; + }, + initCompanySelect() { + loadCompany().then((res) => { + this.options = res.data + }) + }, init(id) { this.dataForm.id = id || 0 this.visible = true @@ -106,6 +141,8 @@ if (this.dataForm.id) { getObj(this.dataForm.id).then((response) => { this.dataForm = response.data.data + this.changeCompany() + this.changeFactory() }) } }) @@ -134,7 +171,38 @@ this.isSubmit = false } }) - } + }, + }, + watch: { + 'dataForm.companyId': { + handler(newValue, oldValue) { + if (newValue != ''&&oldValue!=''&&oldValue!=undefined&&newValue!=undefined) { + console.log(newValue); + console.log(oldValue); + if(oldValue!=newValue){ + this.dataForm.factoryId=null + this.dataForm.divisionId=null + this.optionsdepartment=[] + } + } + }, + immediate: true, + deep: true + }, + 'dataForm.factoryId': { + handler(newValue, oldValue) { + if (newValue != ''&&oldValue!=''&&oldValue!=undefined&&newValue!=undefined) { + console.log(newValue); + console.log(oldValue); + if(oldValue!=newValue){ + this.dataForm.divisionId=null + this.optionsdepartment=[] + } + } + }, + immediate: true, + deep: true + }, } } </script> diff --git a/src/views/basic/staff/index.vue b/src/views/basic/staff/index.vue index b9a98fd..ac172ee 100644 --- a/src/views/basic/staff/index.vue +++ b/src/views/basic/staff/index.vue @@ -103,6 +103,24 @@ return formatVal } }, + { + minWidth: '120', + prop: 'companyName', + label: '鍏徃', + sort: true, + isTrue: true, + isSearch: true, + searchInfoType: 'text' + }, + { + minWidth: '120', + prop: 'factoryName', + label: '宸ュ巶', + sort: true, + isTrue: true, + isSearch: true, + searchInfoType: 'text' + }, // 閮ㄩ棬 { minWidth: '120', diff --git a/src/views/basic/staff/staff-form.vue b/src/views/basic/staff/staff-form.vue index 411fdf5..a1d6969 100644 --- a/src/views/basic/staff/staff-form.vue +++ b/src/views/basic/staff/staff-form.vue @@ -1,56 +1,52 @@ <template> - <el-dialog - :title="!dataForm.id ? '鏂板' : '淇敼'" - :close-on-click-modal="false" - :visible.sync="visible" - > - <el-form - :model="dataForm" - :rules="rules" - ref="dataForm" - label-width="100px" - class="l-mes" - > + <el-dialog :title="!dataForm.id ? '鏂板' : '淇敼'" :close-on-click-modal="false" :visible.sync="visible"> + <el-form :model="dataForm" :rules="rules" ref="dataForm" label-width="100px" class="l-mes"> <el-row> <el-col :span="12"> <el-form-item label="浜哄憳缂栧彿" prop="staffNo"> - <el-input - v-model="dataForm.staffNo" - placeholder="浜哄憳缂栧彿" - ></el-input> + <el-input v-model="dataForm.staffNo" placeholder="浜哄憳缂栧彿"></el-input> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="浜哄憳鍚嶇О" prop="staffName"> - <el-input - v-model="dataForm.staffName" - placeholder="浜哄憳鍚嶇О" - ></el-input> + <el-input v-model="dataForm.staffName" placeholder="浜哄憳鍚嶇О"></el-input> + </el-form-item> + </el-col> + </el-row> + <el-row> + <el-col :span="12"> + <el-form-item label="鍏徃" prop="companyId"> + <el-select @change="changeCompany" style="width: 100%;" v-model="dataForm.companyId" placeholder="璇烽�夋嫨"> + <el-option v-for="item in options" :key="item.id" :label="item.companyName" :value="item.id"> + </el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="宸ュ巶" prop="factoryId"> + <el-select @change="changeFactory" style="width: 100%;" v-model="dataForm.factoryId" placeholder="璇烽�夋嫨"> + <el-option v-for="item in optionsfactory" :key="item.id" :label="item.factoryName" :value="item.id"> + </el-option> + </el-select> </el-form-item> </el-col> </el-row> <el-row> <el-col :span="12"> <el-form-item label="閮ㄩ棬" prop="divisionId"> - <el-select - v-model="dataForm.divisionId" - filterable - placeholder="璇烽�夋嫨" - style="width: 100%;" - > - <el-option - v-for="(item, index) in this.divisionOptions" - :key="index" - :label="item.divisionName" - :value="item.id" - > + <el-select @change="changeDivision" v-model="dataForm.divisionId" filterable placeholder="璇烽�夋嫨" style="width: 100%;"> + <el-option v-for="(item, index) in this.divisionOptions" :key="index" :label="item.divisionName" + :value="item.id"> </el-option> </el-select> </el-form-item> </el-col> <el-col :span="12"> - <el-form-item label="鐢佃瘽" prop="phone"> - <el-input v-model="dataForm.phone" placeholder="鐢佃瘽"></el-input> + <el-form-item label="宀椾綅" prop="postId"> + <el-select v-model="dataForm.postId" filterable placeholder="璇烽�夋嫨" style="width: 100%;"> + <el-option v-for="item in this.postOptions" :key="item.id" :label="item.postName" :value="item.id"> + </el-option> + </el-select> </el-form-item> </el-col> </el-row> @@ -60,84 +56,57 @@ <el-input v-model="dataForm.email" placeholder="閭"></el-input> </el-form-item> </el-col> + <el-col :span="12"> + <el-form-item label="鐢佃瘽" prop="phone"> + <el-input v-model="dataForm.phone" placeholder="鐢佃瘽"></el-input> + </el-form-item> + </el-col> <!-- <el-col :span="12"> <el-form-item label="宀椾綅" prop="post"> <el-input v-model="dataForm.post" placeholder="宀椾綅"></el-input> </el-form-item> </el-col>--> - <el-col :span="12"> - <el-form-item label="宀椾綅" prop="postId"> - <el-select - v-model="dataForm.postId" - filterable - placeholder="璇烽�夋嫨" - style="width: 100%;" - > - <el-option - v-for="item in this.postOptions" - :key="item.id" - :label="item.postName" - :value="item.id" - > - </el-option> - </el-select> - </el-form-item> - </el-col> </el-row> <el-row> <el-col :span="12"> <el-form-item label="浜哄憳绯绘暟" prop="personnelFactor"> - <el-input - v-model="dataForm.personnelFactor" - placeholder="浜哄憳绯绘暟" - ></el-input> + <el-input v-model="dataForm.personnelFactor" placeholder="浜哄憳绯绘暟"></el-input> </el-form-item> </el-col> </el-row> <el-row> <el-col :span="12"> <el-form-item label="浜哄憳鎬ц川" prop="personNature"> - <el-select - v-model="dataForm.personNature" - placeholder="璇烽�夋嫨" - style="width: 100%;" - > - <el-option - v-for="item in this.personNatureOptions" - :key="item.value" - :label="item.label" - :value="item.value" - > + <el-select v-model="dataForm.personNature" placeholder="璇烽�夋嫨" style="width: 100%;"> + <el-option v-for="item in this.personNatureOptions" :key="item.value" :label="item.label" + :value="item.value"> </el-option> </el-select> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="璇曠敤鎴鏃ユ湡" prop="trialDeadline"> - <el-input - v-model="dataForm.trialDeadline" - placeholder="" - ></el-input> + <el-input v-model="dataForm.trialDeadline" placeholder=""></el-input> </el-form-item> </el-col> </el-row> </el-form> <span slot="footer" class="dialog-footer"> <el-button @click="visible = false">鍙栨秷</el-button> - <el-button - type="primary" - :disabled="isSubmit" - v-thinclick="`dataFormSubmit`" - >纭畾</el-button - > + <el-button type="primary" :disabled="isSubmit" v-thinclick="`dataFormSubmit`">纭畾</el-button> </span> </el-dialog> </template> <script> import { getObj, loadDivision, dataFormTransfer } from '@/api/basic/staff' -import { getList } from '@/api/basic/post' +import { getList, getDivisionByFactoryId ,getObjById} from '@/api/basic/post' import { dateFormat, dateFormatYearMonthDate } from '@/util/date' +import { + loadFactoryListByCompany +} from '@/api/basic/division' + +import { loadCompany } from '@/api/basic/factory' export default { props: { @@ -151,6 +120,8 @@ data() { return { visible: false, + options: [], + optionsfactory: [], dataForm: { id: 0, staffNo: '', @@ -166,7 +137,11 @@ updateUser: '', divisionId: '', personNature: '', - trialDeadline: '' + trialDeadline: '', + companyId: null, + companyName: null, + factoryId: null, + factoryName: null, }, divisionOptions: [], postOptions: [], @@ -175,7 +150,7 @@ } }, computed: { - rules: function() { + rules: function () { return { divisionId: [ { required: true, message: '閮ㄩ棬涓嶈兘涓虹┖', trigger: 'blur' } @@ -186,11 +161,45 @@ ], staffName: [ { required: true, message: '浜哄憳鍚嶇О涓嶈兘涓虹┖', trigger: 'blur' } + ], + companyId: [ + { required: true, message: '鍏徃鍚嶇О涓嶈兘涓虹┖', trigger: 'blur' } + ], + factoryId: [ + { required: true, message: '宸ュ巶鍚嶇О涓嶈兘涓虹┖', trigger: 'blur' } ] } } }, methods: { + changeDivision(){ + getObjById(this.dataForm.companyId,this.dataForm.factoryId,this.dataForm.divisionId).then((response) => { + this.postOptions = response.data.data + }) + }, + changeCompany() { + loadFactoryListByCompany(this.dataForm.companyId).then((res) => { + this.optionsfactory = res.data.data + }) + // this.divisionOptions=[] + // this.dataForm.divisionId='' + this.dataForm.companyName = this.options.filter(item => { + return item.id == this.dataForm.companyId + })[0].companyName; + }, + changeFactory() { + getDivisionByFactoryId(this.dataForm.companyId, this.dataForm.factoryId).then((res) => { + this.divisionOptions=res.data.data + }) + this.dataForm.factoryName = this.optionsfactory.filter(item => { + return item.id == this.dataForm.factoryId + })[0].factoryName; + }, + initCompanySelect() { + loadCompany().then((res) => { + this.options = res.data + }) + }, init(id) { this.dataForm.id = id || 0 this.visible = true @@ -199,6 +208,9 @@ if (this.dataForm.id) { getObj(this.dataForm.id).then((response) => { this.dataForm = response.data.data + this.changeCompany() + this.changeFactory() + this.changeDivision() }) } else { const trialDeadline = new Date() @@ -224,7 +236,11 @@ id: this.dataForm.id, personnelFactor: this.dataForm.personnelFactor, personNature: this.dataForm.personNature, - trialDeadline: this.dataForm.trialDeadline + trialDeadline: this.dataForm.trialDeadline, + factoryId: this.dataForm.factoryId, + factoryName: this.dataForm.factoryName, + companyId: this.dataForm.companyId, + companyName: this.dataForm.companyName } this.$refs.dataForm.validate((valid) => { if (valid) { @@ -265,10 +281,61 @@ } }, created() { - this.initDivisionSelect() - this.initPostSelect() + // this.initDivisionSelect() + // this.initPostSelect() + this.initCompanySelect() + if(this.dataForm.staffNo!=''){ + console.log(121212); + this.changeCompany() + this.changeDivision() + } }, watch: { + 'dataForm.divisionId': { + handler(newValue, oldValue) { + if (newValue != ''&&oldValue!=''&&oldValue!=undefined&&newValue!=undefined) { + if(oldValue!=newValue){ + this.dataForm.postId=null + this.postOptions=[] + } + } + }, + immediate: true, + deep: true + }, + 'dataForm.companyId': { + handler(newValue, oldValue) { + if (newValue != ''&&oldValue!=''&&oldValue!=undefined&&newValue!=undefined) { + console.log(newValue); + console.log(oldValue); + if(oldValue!=newValue){ + this.dataForm.factoryId=null + this.dataForm.divisionId=null + this.divisionOptions=[] + this.dataForm.postId=null + this.postOptions=[] + } + } + }, + immediate: true, + deep: true + }, + 'dataForm.factoryId': { + handler(newValue, oldValue) { + if (newValue != ''&&oldValue!=''&&oldValue!=undefined&&newValue!=undefined) { + console.log(newValue); + console.log(oldValue); + if(oldValue!=newValue){ + this.dataForm.divisionId=null + this.divisionOptions=[] + this.dataForm.postId=null + this.postOptions=[] + } + } + }, + immediate: true, + deep: true + }, 'dataForm.personNature': { handler(newValue, oldValue) { if ( diff --git a/src/views/basic/warehouse/warehouse-form.vue b/src/views/basic/warehouse/warehouse-form.vue index 43f537b..98b4454 100644 --- a/src/views/basic/warehouse/warehouse-form.vue +++ b/src/views/basic/warehouse/warehouse-form.vue @@ -109,8 +109,8 @@ </el-col> </el-row> <el-row> - <el-col :span="12"> - <el-form-item label="浠撳簱鍦板浘" prop="warehouseMap"> + <!-- <el-col :span="12"> --> + <!-- <el-form-item label="浠撳簱鍦板浘" prop="warehouseMap"> <el-upload ref="upload" action="/mes/warehouse/upload" @@ -130,9 +130,9 @@ <div slot="tip" class="el-upload__tip"> 鍙兘涓婁紶jpg/png鏂囦欢锛屼笖涓嶈秴杩�500kb </div> - </el-upload> - </el-form-item> - </el-col> + </el-upload> --> + <!-- </el-form-item> + </el-col> --> <el-col :span="12"> <el-form-item label="浠撳簱鐘舵��" prop="warehouseStatus"> <el-switch diff --git a/src/views/technology/document/document-form.vue b/src/views/technology/document/document-form.vue index 36bee24..745bbab 100644 --- a/src/views/technology/document/document-form.vue +++ b/src/views/technology/document/document-form.vue @@ -12,22 +12,12 @@ </div> <div class="page-main"> <div class="document-basic"> - <el-form - :model="dataForm" - :rules="dataRule" - ref="dataForm" - style="width: 100%" - class="l-mes" - :disabled="!editable" - label-width="110px" - > + <el-form :model="dataForm" :rules="dataRule" ref="dataForm" style="width: 100%" class="l-mes" + :disabled="!editable" label-width="110px"> <el-row> <el-col :span="5"> <el-form-item prop="name" label="鏂囦欢鍚嶇О"> - <el-input - v-model="dataForm.name" - placeholder="鏂囦欢鍚嶇О" - ></el-input> + <el-input v-model="dataForm.name" placeholder="鏂囦欢鍚嶇О"></el-input> </el-form-item> </el-col> <el-col :span="4"> @@ -38,27 +28,16 @@ </el-col> <el-col :span="4"> <el-form-item prop="docType" label="绫诲瀷"> - <el-select - v-model="dataForm.docType" - placeholder="璇烽�夋嫨绫诲瀷" - style="width:100%" - > - <el-option - v-for="(item, index) in bomTypeDbOptions" - :label="item.label" - :value="item.value" - :key="index" - > + <el-select v-model="dataForm.docType" placeholder="璇烽�夋嫨绫诲瀷" style="width:100%"> + <el-option v-for="(item, index) in bomTypeDbOptions" :label="item.label" :value="item.value" + :key="index"> </el-option> </el-select> </el-form-item> </el-col> <el-col :span="3"> <el-form-item prop="version" label="鐗堟湰鍙�"> - <el-input - v-model="dataForm.version" - placeholder="鐗堟湰鍙�" - ></el-input> + <el-input v-model="dataForm.version" placeholder="鐗堟湰鍙�"></el-input> </el-form-item> </el-col> <!-- <el-col :span="3"> @@ -113,11 +92,7 @@ <el-col :span="5"> <el-form-item label="浜у搧闆朵欢鍙�" prop="partNo"> <el-input v-model="dataForm.partNo" placeholder="璇烽�夋嫨闆朵欢"> - <el-button - slot="append" - icon="el-icon-search" - @click="openPartDialog()" - ></el-button> + <el-button slot="append" icon="el-icon-search" @click="openPartDialog()"></el-button> </el-input> </el-form-item> </el-col> @@ -128,12 +103,7 @@ </el-col> <el-col :span="5"> <el-form-item label="澶囨敞" prop="remark"> - <el-input - type="textarea" - v-model="dataForm.remark" - placeholder="澶囨敞" - style="width:360px" - ></el-input> + <el-input type="textarea" v-model="dataForm.remark" placeholder="澶囨敞" style="width:360px"></el-input> </el-form-item> </el-col> </el-row> @@ -142,61 +112,24 @@ <div class="document-detail"> <el-tabs type="card" style="width: 100%;height: 100%"> - <el-tab-pane - label="鍘熸潗鐢ㄩ噺" - style="height: 100%" - class="orimaterial-quantity" - > - <el-card - shadow="never" - style="margin-top: 12px;border: 1px solid #cfd5de;" - > + <el-tab-pane label="鍘熸潗鐢ㄩ噺" style="height: 100%" class="orimaterial-quantity"> + <el-card shadow="never" style="margin-top: 12px;border: 1px solid #cfd5de;"> <div slot="header"> <div> - <el-button - type="text" - size="small" - class="blue-but" - v-if="editable" - @click="calcMaterialCost()" - >璁$畻鐢ㄩ噺 + <el-button type="text" size="small" class="blue-but" v-if="editable" @click="calcMaterialCost()">璁$畻鐢ㄩ噺 </el-button> - <el-button - type="text" - size="small" - @click="exportMaterialCost()" - >瀵煎嚭 + <el-button type="text" size="small" @click="exportMaterialCost()">瀵煎嚭 </el-button> </div> </div> - <el-table - :data="materialCostList" - border - height="650" - :span-method="objectSpanMethod" - :header-cell-style="{ color: '#999' }" - class="document-materialcost-table" - show-summary - :summary-method="getSummaries" - ref="summeryTable" - > - <el-table-column - label="鎴愬搧" - prop="finishedProduct" - align="center" - > + <el-table :data="materialCostList" border height="650" :span-method="objectSpanMethod" + :header-cell-style="{ color: '#999' }" class="document-materialcost-table" show-summary + :summary-method="getSummaries" ref="summeryTable"> + <el-table-column label="鎴愬搧" prop="finishedProduct" align="center"> </el-table-column> - <el-table-column - label="Bom缂栧彿" - prop="bomNumber" - align="center" - > + <el-table-column label="Bom缂栧彿" prop="bomNumber" align="center"> </el-table-column> - <el-table-column - label="宸ュ簭" - prop="operationName" - align="center" - > + <el-table-column label="宸ュ簭" prop="operationName" align="center"> </el-table-column> <el-table-column label="鐗╂枡" prop="partName" align="center"> </el-table-column> @@ -207,163 +140,63 @@ </el-table> </el-card> </el-tab-pane> - <el-tab-pane - class="final-product-checkout" - label="鎴愬搧妫�娴�" - style="height: 100%" - > - <TeststandardDialog - :editable="editable" - :documentId="Number(dataForm.id)" - > + <el-tab-pane class="final-product-checkout" label="鎴愬搧妫�娴�" style="height: 100%"> + <TeststandardDialog :editable="editable" :documentId="Number(dataForm.id)"> </TeststandardDialog> </el-tab-pane> <el-tab-pane label="浜у搧缁撴瀯宸ュ簭鍙傛暟" style="height: 100%"> <div class="document-related-stock-part"> - <div - style="padding-left:18px;font-size:14px;font-weight:700;color:#000;height:20px;line-height:20px;" - > + <div style="padding-left:18px;font-size:14px;font-weight:700;color:#000;height:20px;line-height:20px;"> <span>鐩稿叧搴撳瓨闆朵欢</span> </div> - <el-table - :data="relatedStockPartList" - @row-click="clickRelatedStockPart" - highlight-current-row - height="188px" - :header-cell-style="relatedStockPartTableHeaderCellStyle" - :row-style="{ height: '0' }" - :cell-style="{ padding: '1px' }" - > - <el-table-column - label="闆朵欢缂栧彿" - prop="partNo" - align="center" - :show-overflow-tooltip="true" - > + <el-table :data="relatedStockPartList" @row-click="clickRelatedStockPart" highlight-current-row + height="188px" :header-cell-style="relatedStockPartTableHeaderCellStyle" :row-style="{ height: '0' }" + :cell-style="{ padding: '1px' }"> + <el-table-column label="闆朵欢缂栧彿" prop="partNo" align="center" :show-overflow-tooltip="true"> </el-table-column> - <el-table-column - label="闆朵欢鎻忚堪" - prop="partName" - align="center" - width="400" - :show-overflow-tooltip="true" - > + <el-table-column label="闆朵欢鎻忚堪" prop="partName" align="center" width="400" :show-overflow-tooltip="true"> </el-table-column> - <el-table-column - label="宸ヨ壓璺嚎缂栧彿" - prop="routingNo" - align="center" - :show-overflow-tooltip="true" - > + <el-table-column label="宸ヨ壓璺嚎缂栧彿" prop="routingNo" align="center" :show-overflow-tooltip="true"> </el-table-column> - <el-table-column - label="宸ヨ壓璺嚎鐗堟湰" - prop="routingVersion" - align="center" - :show-overflow-tooltip="true" - > + <el-table-column label="宸ヨ壓璺嚎鐗堟湰" prop="routingVersion" align="center" :show-overflow-tooltip="true"> </el-table-column> - <el-table-column - label="宸ヨ壓鏇夸唬鍙�" - prop="routingAlternativeNo" - align="center" - :show-overflow-tooltip="true" - > + <el-table-column label="宸ヨ壓鏇夸唬鍙�" prop="routingAlternativeNo" align="center" :show-overflow-tooltip="true"> </el-table-column> - <el-table-column - label="宸ヨ壓鏇夸唬鎻忚堪" - prop="routingAlternativeDesc" - align="center" - :show-overflow-tooltip="true" - > + <el-table-column label="宸ヨ壓鏇夸唬鎻忚堪" prop="routingAlternativeDesc" align="center" + :show-overflow-tooltip="true"> </el-table-column> - <el-table-column - label="BOM鍙�" - prop="bomNo" - align="center" - :show-overflow-tooltip="true" - > + <el-table-column label="BOM鍙�" prop="bomNo" align="center" :show-overflow-tooltip="true"> </el-table-column> - <el-table-column - label="BOM鐗堟湰" - prop="bomVersion" - align="center" - :show-overflow-tooltip="true" - > + <el-table-column label="BOM鐗堟湰" prop="bomVersion" align="center" :show-overflow-tooltip="true"> </el-table-column> - <el-table-column - label="BOM鏇夸唬鍙�" - prop="bomAlternativeNo" - align="center" - :show-overflow-tooltip="true" - > + <el-table-column label="BOM鏇夸唬鍙�" prop="bomAlternativeNo" align="center" :show-overflow-tooltip="true"> </el-table-column> - <el-table-column - label="BOM鏇夸唬鎻忚堪" - prop="bomAlternativeDesc" - align="center" - :show-overflow-tooltip="true" - > + <el-table-column label="BOM鏇夸唬鎻忚堪" prop="bomAlternativeDesc" align="center" :show-overflow-tooltip="true"> </el-table-column> </el-table> </div> <el-card class="document-bom" header="BOM-宸ュ簭鍙傛暟"> <div slot="header"> <span>BOM-宸ュ簭鍙傛暟</span> - <el-tooltip - class="item" - effect="dark" - content="鍒犻櫎宸ヨ壓璺嚎" - placement="top-start" - v-if="editable" - style="margin-left:5px ;" - > - <el-button - style="float: right; padding: 3px 0px 3px 5px;color:red" - type="text" - @click="delCompleteproductstructure()" - >鍒犻櫎 + <el-tooltip class="item" effect="dark" content="鍒犻櫎宸ヨ壓璺嚎" placement="top-start" v-if="editable" + style="margin-left:5px ;"> + <el-button style="float: right; padding: 3px 0px 3px 5px;color:red" type="text" + @click="delCompleteproductstructure()">鍒犻櫎 </el-button> </el-tooltip> - <el-tooltip - class="item" - effect="dark" - content="閫夋嫨宸ヨ壓璺嚎" - placement="top-start" - v-if="editable" - > - <el-button - style="float: right; padding: 3px 0" - type="text" - @click="addTechnology()" - >娣诲姞 + <el-tooltip class="item" effect="dark" content="閫夋嫨宸ヨ壓璺嚎" placement="top-start" v-if="editable"> + <el-button style="float: right; padding: 3px 0" type="text" @click="addTechnology()">娣诲姞 </el-button> </el-tooltip> </div> - <el-collapse - v-model="currTechnologyBomPartName" - accordion - @change="handleCompleteproductstructureChange" - > - <el-collapse-item - v-for="(item, i) in completeproductstructureData" - :key="i" - :name="item.bomRoutingId" - > + <el-collapse v-model="currTechnologyBomPartName" accordion @change="handleCompleteproductstructureChange"> + <el-collapse-item v-for="(item, i) in completeproductstructureData" :key="i" :name="item.bomRoutingId"> <template slot="title"> - <el-checkbox - class="completeproductstructure-checkout" - v-model="item.expand" - disabled - > - <span style="font-weight:bold">宸ヨ壓璺嚎缂栧彿锛�</span - >{{ item.routingNo }} - <span style="font-weight:bold">闆朵欢鍙凤細</span - >{{ item.partNo }} - <span style="font-weight:bold">闆朵欢鍚嶇О锛�</span - >{{ item.partName }} - <span style="font-weight:bold">Bom缂栧彿锛�</span - >{{ item.number == null ? '鏃�' : item.number }} + <el-checkbox class="completeproductstructure-checkout" v-model="item.expand" disabled> + <span style="font-weight:bold">宸ヨ壓璺嚎缂栧彿锛�</span>{{ item.routingNo }} + <span style="font-weight:bold">闆朵欢鍙凤細</span>{{ item.partNo }} + <span style="font-weight:bold">闆朵欢鍚嶇О锛�</span>{{ item.partName }} + <span style="font-weight:bold">Bom缂栧彿锛�</span>{{ item.number == null ? '鏃�' : item.number }} </el-checkbox> </template> <div style="display:flex;"> @@ -373,9 +206,7 @@ item.showBom ? 'highlight-tab-class' : 'unhighlight-tab-class' - ]" - @click="item.showBom = true" - > + ]" @click="item.showBom = true"> BOM缁撴瀯 </div> <div @@ -384,44 +215,23 @@ !item.showBom ? 'highlight-tab-class' : 'unhighlight-tab-class' - ]" - @click="item.showBom = false" - > + ]" @click="item.showBom = false"> 宸ュ簭鍙傛暟 </div> </div> <div class="document-bom-div" v-show="item.showBom"> - <el-tooltip - class="item" - effect="dark" - content="娣诲姞鎴栨洿鎹OM缁撴瀯" - placement="top-start" - v-if="editable" - style="margin-right:20px;" - > - <el-button - style="float: right; padding: 3px 0px;color:#67c23a" - type="text" - @click="addCompleteproductstructure()" - >娣诲姞 + <el-tooltip class="item" effect="dark" content="娣诲姞鎴栨洿鎹OM缁撴瀯" placement="top-start" v-if="editable" + style="margin-right:20px;"> + <el-button style="float: right; padding: 3px 0px;color:#67c23a" type="text" + @click="addCompleteproductstructure()">娣诲姞 </el-button> </el-tooltip> - <el-table - :data="item.completeproductstructureDetail" - row-key="id" - border - height="440" - default-expand-all - class="structure-detail-table" - > + <el-table :data="item.completeproductstructureDetail" row-key="id" border height="440" + default-expand-all class="structure-detail-table"> <el-table-column prop="partNo" label="闆朵欢鍙�" width="240"> </el-table-column> - <el-table-column - prop="partName" - label="闆朵欢鍚嶇О" - width="400" - > + <el-table-column prop="partName" label="闆朵欢鍚嶇О" width="400"> </el-table-column> <el-table-column prop="qpa" label="鏁伴噺" width="180"> </el-table-column> @@ -430,165 +240,75 @@ </el-table> </div> <div class="document-technology-div" v-show="!item.showBom"> - <div - style="border: 1px solid #ebeef5;height: 440px;overflow: auto;" - > - <el-collapse - v-model="currTechnologyOperationName" - accordion - @change=" - handleTechnologyOperationChange( - $event, - item.bomRoutingId - ) - " - > - <el-collapse-item - v-for="(ele, j) in item.technologyOperationData" - :key="j" - :name="ele.id" - > - <template slot="title" - ><span style="font-weight:300" - > 宸ュ簭鍚嶇О锛�</span - >{{ ele.operationName }} - <span style="font-weight:300">宸ュ簭缂栧彿锛�</span - >{{ ele.operationNo }} + <div style="border: 1px solid #ebeef5;height: 440px;overflow: auto;"> + <el-collapse v-model="currTechnologyOperationName" accordion @change=" + handleTechnologyOperationChange( + $event, + item.bomRoutingId + ) + "> + <el-collapse-item v-for="(ele, j) in item.technologyOperationData" :key="j" :name="ele.id"> + <template slot="title"><span style="font-weight:300"> 宸ュ簭鍚嶇О锛�</span>{{ + ele.operationName }} + <span style="font-weight:300">宸ュ簭缂栧彿锛�</span>{{ ele.operationNo }} </template> <el-tabs v-model="activeTemplateName" type="card"> - <el-tab-pane - v-for="(paramTab, index) in paramTabs" - :key="index" - :label="paramTab.label" - :name="paramTab.name" - > + <el-tab-pane v-for="(paramTab, index) in paramTabs" :key="index" :label="paramTab.label" + :name="paramTab.name"> <el-table :data="paramTab.params"> - <el-table-column - prop="parameterItem" - label="鍚嶇О" - align="center" - > + <el-table-column prop="parameterItem" label="鍚嶇О" align="center"> <template slot-scope="scope"> - <span - >{{ scope.row.parameterItem }}({{ - scope.row.unit - }})</span - > + <span>{{ scope.row.parameterItem }}({{ + scope.row.unit + }})</span> </template> </el-table-column> - <el-table-column - prop="paramValue" - label="鍊�" - align="center" - ></el-table-column> + <el-table-column prop="paramValue" label="鍊�" align="center"></el-table-column> </el-table> </el-tab-pane> <el-tab-pane label="澶囨敞" style="height: 100%"> - <rich-text - :editorId=" - 'fwb' + item.id + '-' + ele.id + '-' + j - " - :richContent="ele.remark" - ></rich-text> + <rich-text :editorId="'fwb' + item.id + '-' + ele.id + '-' + j + " :richContent="ele.remark"></rich-text> </el-tab-pane> <el-tab-pane label="妫�娴嬫爣鍑�"> - <checkStandardTable - ref="documentTestStandardTable" - :dataFormId="dataForm.id" - :routingOperationId="ele.id" - :operationId="ele.operationId" - :operationName="ele.operationName" - :paramTypeOptions="paramTypeOptions" - :bomRoutingId=" - currTechnologyBomPart == null - ? null - : currTechnologyBomPart.bomRoutingId - " - :everyBomRoutingId="item.bomRoutingId" - :editable="editable" - @refreshTestStandardInfo=" - refreshTestStandardInfo - " - ></checkStandardTable> + <checkStandardTable ref="documentTestStandardTable" :dataFormId="dataForm.id" + :routingOperationId="ele.id" :operationId="ele.operationId" + :operationName="ele.operationName" :paramTypeOptions="paramTypeOptions" :bomRoutingId="currTechnologyBomPart == null + ? null + : currTechnologyBomPart.bomRoutingId + " :everyBomRoutingId="item.bomRoutingId" :editable="editable" + @refreshTestStandardInfo="refreshTestStandardInfo"></checkStandardTable> </el-tab-pane> <el-tab-pane label="鎶芥瑙勫垯"> <div> <div style="padding: 0px 20px;"> - <el-button - type="primary" - @click="openAddSpotCheckRuleDialog" - >鏂板</el-button - > + <el-button type="primary" @click="openAddSpotCheckRuleDialog">鏂板</el-button> </div> <div> - <el-table - :data="spotCheckRuleList" - style="width: 100%" - > - <el-table-column - prop="ruleNo" - label="瑙勫垯缂栧彿" - align="center" - > + <el-table :data="spotCheckRuleList" style="width: 100%"> + <el-table-column prop="ruleNo" label="瑙勫垯缂栧彿" align="center"> </el-table-column> - <el-table-column - prop="ruleName" - label="瑙勫垯鍚嶇О" - align="center" - > + <el-table-column prop="ruleName" label="瑙勫垯鍚嶇О" align="center"> </el-table-column> - <el-table-column - prop="samplingOperationName" - label="鎶芥宸ュ簭" - align="center" - > + <el-table-column prop="samplingOperationName" label="鎶芥宸ュ簭" align="center"> </el-table-column> - <el-table-column - prop="retrospectOperationName" - label="杩芥函宸ュ簭" - align="center" - > + <el-table-column prop="retrospectOperationName" label="杩芥函宸ュ簭" align="center"> </el-table-column> - <el-table-column - prop="applyType" - label="妫�娴嬬被鍨�" - align="center" - :formatter="applyTypeFormatter" - > + <el-table-column prop="applyType" label="妫�娴嬬被鍨�" align="center" + :formatter="applyTypeFormatter"> </el-table-column> - <el-table-column - prop="measurement" - label="鎶芥姣斾緥" - align="center" - :formatter="measurementFormatter" - > + <el-table-column prop="measurement" label="鎶芥姣斾緥" align="center" + :formatter="measurementFormatter"> </el-table-column> - <el-table-column - prop="samplingPosition" - label="鎶芥浣嶇疆" - align="center" - > + <el-table-column prop="samplingPosition" label="鎶芥浣嶇疆" align="center"> </el-table-column> - <el-table-column - label="鎿嶄綔" - width="100" - align="center" - > + <el-table-column label="鎿嶄綔" width="100" align="center"> <template slot-scope="scope"> - <el-button - type="text" - size="small" - @click=" - openEditSpotCheckRule(scope.row) - " - >缂栬緫</el-button - > - <el-button - type="text" - size="small" - @click="delSpotCheckRule(scope.row)" - >鍒犻櫎</el-button - > + <el-button type="text" size="small" @click=" + openEditSpotCheckRule(scope.row) + ">缂栬緫</el-button> + <el-button type="text" size="small" + @click="delSpotCheckRule(scope.row)">鍒犻櫎</el-button> </template> </el-table-column> </el-table> @@ -609,21 +329,11 @@ <div slot="header"> <span>缁撴瀯鍥�</span> </div> - <el-upload - class="upload-demo" - action="/mes/document/uploadJgt" - :headers="headers" - :on-preview="handleStructurePreview" - :on-remove="handleStructureRemove" - :on-success="handleStructureSuccess" - :data="paramStructureDatas" - :file-list="fileStructureList" - :on-exceed="handleStructureExceed" - :before-upload="beforeStructureAvatarUpload" - list-type="picture" - multiple - :with-credentials="true" - > + <el-upload class="upload-demo" action="/mes/document/uploadJgt" :headers="headers" + :on-preview="handleStructurePreview" :on-remove="handleStructureRemove" + :on-success="handleStructureSuccess" :data="paramStructureDatas" :file-list="fileStructureList" + :on-exceed="handleStructureExceed" :before-upload="beforeStructureAvatarUpload" list-type="picture" + multiple :with-credentials="true"> <el-button size="small" type="primary">鐐瑰嚮涓婁紶</el-button> <div slot="tip" class="el-upload__tip"> 鍙兘涓婁紶jpg鍥剧墖锛屼笖涓嶈秴杩�2MB @@ -695,33 +405,18 @@ </el-tabs> </div> </div> - <completeproductstructureDialog - :currshowlist.sync="showCompleteproductstructure" - :queryParam="bomQueryParam" - @listenToCompleteproductstructureEvent="selectCompleteproductstructure" - /> - <routingDialog - :currshowlist.sync="showTechnology" - :queryParam="queryParam" - @listenToRoutingEvent="selectTechnology" - /> - <qualityStandardDialog - :currshowlist.sync="showQualityStandard" - @listenToSelectTestStandardEvent="selectQualityStandard" - /> + <completeproductstructureDialog :currshowlist.sync="showCompleteproductstructure" :queryParam="bomQueryParam" + @listenToCompleteproductstructureEvent="selectCompleteproductstructure" /> + <routingDialog :currshowlist.sync="showTechnology" :queryParam="queryParam" + @listenToRoutingEvent="selectTechnology" /> + <qualityStandardDialog :currshowlist.sync="showQualityStandard" + @listenToSelectTestStandardEvent="selectQualityStandard" /> <partDialog :currshowlist.sync="showPart" @listenToPartEvent="selectPart" /> - <spotCheckRule - :currshowlist.sync="spotCheckRuleShow" - :docBomId="currDocBomId" - :routingOperationId="currRoutingOperationId" - :routingOperationName="currRoutingOperationName" - @refreshSpotCheckRuleList="refreshSpotCheckRuleList" - /> - <spotCheckRuleEdit - :currshowlist.sync="editSpotCheckRuleShow" - :documentSamplingRuleId="currDocumentSamplingRuleId" - @refreshSpotCheckRuleList="refreshSpotCheckRuleList" - /> + <spotCheckRule :currshowlist.sync="spotCheckRuleShow" :docBomId="currDocBomId" + :routingOperationId="currRoutingOperationId" :routingOperationName="currRoutingOperationName" + @refreshSpotCheckRuleList="refreshSpotCheckRuleList" /> + <spotCheckRuleEdit :currshowlist.sync="editSpotCheckRuleShow" :documentSamplingRuleId="currDocumentSamplingRuleId" + @refreshSpotCheckRuleList="refreshSpotCheckRuleList" /> </div> </template> @@ -873,7 +568,7 @@ spotCheckRuleEdit }, computed: { - editable: function() { + editable: function () { if (!this.dataForm.id) { return true } @@ -962,15 +657,15 @@ } // flowTemp.loadData(jsondata) // 淇濆瓨鎸夐挳浜嬩欢 - _this.flowTemp.onBtnSaveClick = function() { + _this.flowTemp.onBtnSaveClick = function () { _this.saveFlow() } // 閲嶇疆鎸夐挳浜嬩欢 - _this.flowTemp.onFreshClick = function() { + _this.flowTemp.onFreshClick = function () { _this.getFlow() } // 鎵撳嵃鎸夐挳浜嬩欢 - _this.flowTemp.onPrintClick = function() { + _this.flowTemp.onPrintClick = function () { _this.flowTemp.exportDiagram('娴佺▼鍥�') } }, @@ -1874,8 +1569,7 @@ }, handleFlowExceed(files, fileList) { this.$message.warning( - `褰撳墠闄愬埗閫夋嫨 1 涓祦绋嬪浘鏂囦欢锛屾湰娆¢�夋嫨浜� ${ - files.length + `褰撳墠闄愬埗閫夋嫨 1 涓祦绋嬪浘鏂囦欢锛屾湰娆¢�夋嫨浜� ${files.length } 涓祦绋嬪浘鏂囦欢锛屽叡閫夋嫨浜� ${files.length + fileList.length} 涓祦绋嬪浘鏂囦欢` ) }, @@ -2053,9 +1747,10 @@ padding: 10px 20px; box-sizing: border-box; } -.el-card.is-always-shadow{ - width: 100%; - } + +.el-card.is-always-shadow { + width: 100%; +} .document-flow { background-color: #fff; @@ -2069,30 +1764,22 @@ } /*鑷畾涔塪isabled鐘舵�佷笅checkbox鐨勬牱寮�*/ -.completeproductstructure-checkout - .el-checkbox__input.is-disabled.is-checked - .el-checkbox__inner { +.completeproductstructure-checkout .el-checkbox__input.is-disabled.is-checked .el-checkbox__inner { background-color: #006eff; border-color: #006eff; } -.completeproductstructure-checkout - .el-checkbox__input.is-disabled.is-checked - + span.el-checkbox__label { +.completeproductstructure-checkout .el-checkbox__input.is-disabled.is-checked+span.el-checkbox__label { color: #006eff; border-color: #006eff; } -.completeproductstructure-checkout - .el-checkbox__input.is-disabled - .el-checkbox__inner { +.completeproductstructure-checkout .el-checkbox__input.is-disabled .el-checkbox__inner { background-color: #ffffff; cursor: pointer; } -.completeproductstructure-checkout - .el-checkbox__input.is-disabled - + span.el-checkbox__label { +.completeproductstructure-checkout .el-checkbox__input.is-disabled+span.el-checkbox__label { color: #606266; cursor: pointer; } @@ -2161,11 +1848,13 @@ .GooFlow .ico .ico_start:before { color: red; } + .highlight-tab-class { color: #006eff; background: #e4e7ed; border-top: 1px solid #006eff; } + .unhighlight-tab-class { border: 1px solid #e4e7ed; border-bottom: none; -- Gitblit v1.9.3