| | |
| | | placeholder="单位" |
| | | filterable |
| | | @change="Gtechange" |
| | | style="width: 85%" |
| | | style="width: calc(85% - 110px)" |
| | | > |
| | | <el-option |
| | | v-for="ele in unitList" |
| | |
| | | style="font-size: 20px; color: gray" |
| | | @click="handleUnitShow" |
| | | ></i> |
| | | <el-checkbox |
| | | class="margin_left_10px" |
| | | :disabled="editConfig.infomation.unit&&showFooter?false:true" |
| | | v-model="editConfig.infomation.moreUnit" |
| | | @change="moreUnitChange" |
| | | ></el-checkbox |
| | | > |
| | | <span class="margin_left_10px cursor_pointer" @click="handleUnitMore">启用多单位</span> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="产品标签" prop="productTagName"> |
| | |
| | | :workList="unitList" |
| | | title="计量单位" |
| | | ></BomDialog> |
| | | <UnitMoreDialog |
| | | ref="unitMoreDialog" |
| | | @saveUnitMore="saveUnitMore" |
| | | :workList="unitList" |
| | | :dataList="editConfig.infomation.moreUnitList" |
| | | title="启用多单位" |
| | | ></UnitMoreDialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import BomDialog from "./components/bomDialog"; |
| | | import {getUnitInfo, } from "@/api/basic/standard"; |
| | | // import { postGetSaveSUnitDict } from "@/api/basic/standard"; |
| | | |
| | | import UnitMoreDialog from "./components/UnitMoreDialog"; |
| | | |
| | | export default { |
| | | mixins: [codeMixin], |
| | |
| | | components: { |
| | | IconCropper, |
| | | BomDialog, |
| | | UnitMoreDialog, |
| | | }, |
| | | computed: { |
| | | modalTitle() { |
| | |
| | | // 单位 |
| | | handleUnitShow() { |
| | | this.editRow.editDialogVisible = true; |
| | | }, |
| | | // 启用多单位 |
| | | handleUnitMore(){ |
| | | if(this.editConfig.infomation.unit){ |
| | | this.$refs.unitMoreDialog.editDialogVisible = true; |
| | | }else{ |
| | | this.$message.error('请先选择单位!') |
| | | } |
| | | }, |
| | | saveUnitMore(list){ |
| | | this.editConfig.infomation.moreUnitList=list |
| | | }, |
| | | // 启用多单位的开关 |
| | | moreUnitChange(){ |
| | | let string=false; |
| | | if(this.editConfig.infomation.moreUnitList&&this.editConfig.infomation.moreUnitList.length>0){ |
| | | for(let i in this.editConfig.infomation.moreUnitList){ |
| | | if(this.editConfig.infomation.moreUnitList[i].unit&&this.editConfig.infomation.moreUnitList[i].amount){ |
| | | string=true; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | if(!string){ |
| | | this.editConfig.infomation.moreUnit=false |
| | | this.$message.error('请先配置多单位!') |
| | | } |
| | | }, |
| | | handleConfirmSave(dataList) { |
| | | saveUnitDict({ data: dataList }).then((res) => { |
| | |
| | | params.codeStandardID = this.autoCodeObj.codeStandardID |
| | | params.autoIncr = this.autoCodeObj.maxAutoIncr |
| | | } |
| | | if(params.moreUnitList.length>0){ |
| | | for(let i in params.moreUnitList){ |
| | | params.moreUnitList[i].amount=Number(params.moreUnitList[i].amount) |
| | | } |
| | | } |
| | | requestUrl(params).then((res) => { |
| | | console.log(res) |
| | | this.editConfig.visible = false |