| | |
| | | <el-input |
| | | style="width: 85%" |
| | | :disabled="!showFooter" |
| | | clearable |
| | | v-model="editConfig.infomation.specs" |
| | | placeholder="请输入" |
| | | ></el-input> |
| | |
| | | v-model="editConfig.infomation.productType" |
| | | placeholder="请选择" |
| | | size="mini" |
| | | clearable |
| | | style="width: 85%" |
| | | :disabled="!showFooter" |
| | | > |
| | |
| | | placeholder="单位" |
| | | filterable |
| | | @change="Gtechange" |
| | | style="width: 85%" |
| | | style="width: calc(85% - 120px)" |
| | | > |
| | | <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"> |
| | |
| | | v-model="editConfig.infomation.categoryId" |
| | | placeholder="请选择" |
| | | size="mini" |
| | | clearable |
| | | filterable |
| | | style="width: 85%" |
| | | :disabled="!showFooter" |
| | | > |
| | |
| | | <el-input |
| | | style="width: 85%" |
| | | :disabled="!showFooter" |
| | | filterable |
| | | v-model="editConfig.infomation.type" |
| | | placeholder="请输入" |
| | | ></el-input> |
| | |
| | | v-model="editConfig.infomation.principal" |
| | | placeholder="请选择" |
| | | size="mini" |
| | | style="width: 85%" |
| | | style="width: 88%" |
| | | disabled |
| | | > |
| | | <el-option |
| | |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="重量" prop="weight" label-width="80px"> |
| | | <!-- <el-form-item label="重量" prop="weight" label-width="80px"> |
| | | <el-input-number |
| | | v-model="editConfig.infomation.weight" |
| | | placeholder="请输入" |
| | |
| | | :disabled="!showFooter" |
| | | ></el-input-number> |
| | | <span> kg</span> |
| | | </el-form-item> |
| | | </el-form-item> --> |
| | | <el-form-item label="毛重" prop="grossWeight" label-width="80px"> |
| | | <el-col :span="15" |
| | | > |
| | | <el-input |
| | | v-model="editConfig.infomation.grossWeight" |
| | | placeholder="请输入" |
| | | :disabled="!showFooter" |
| | | ></el-input> |
| | | </el-col> |
| | | <el-col :span="1"> </el-col> |
| | | <el-col :span="5"> |
| | | <el-select |
| | | v-model="editConfig.infomation.grossUnit" |
| | | placeholder="单位" |
| | | filterable |
| | | :disabled="!showFooter" |
| | | style="width: 100%; float: right" |
| | | :popper-append-to-body="false" |
| | | > |
| | | <el-option |
| | | v-for="ele in grossUnitList" |
| | | :key="ele.id" |
| | | :label="ele.name" |
| | | :value="ele.name" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-col> |
| | | </el-form-item> |
| | | <el-form-item label="净重" prop="netWeight" label-width="80px"> |
| | | <el-col :span="15" |
| | | > |
| | | <el-input |
| | | v-model="editConfig.infomation.netWeight" |
| | | :disabled="!showFooter" |
| | | placeholder="请输入" |
| | | ></el-input> |
| | | </el-col> |
| | | <el-col :span="1"> </el-col> |
| | | <el-col :span="5"> |
| | | <el-select |
| | | v-model="editConfig.infomation.netUnit" |
| | | placeholder="单位" |
| | | filterable |
| | | :disabled="!showFooter" |
| | | style="width: 100%; float: right" |
| | | :popper-append-to-body="false" |
| | | > |
| | | <el-option |
| | | v-for="ele in grossUnitList" |
| | | :key="ele.id" |
| | | :label="ele.name" |
| | | :value="ele.name" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-col> |
| | | </el-form-item> |
| | | <el-form-item label="体积" prop="volume" label-width="80px"> |
| | | <el-input-number |
| | | v-model="editConfig.infomation.volume" |
| | |
| | | :workList="unitList" |
| | | title="计量单位" |
| | | ></BomDialog> |
| | | <UnitMoreDialog |
| | | ref="unitMoreDialog" |
| | | @saveUnitMore="saveUnitMore" |
| | | @cancelUnitMore='cancelUnitMore' |
| | | :workList="unitList" |
| | | :unitRight='editConfig.infomation.unit' |
| | | :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() { |
| | |
| | | // salePrice: [{ required: true, message: "请输入销售价格", trigger: "blur" }], |
| | | unit: [{ required: true, message: "请输入单位", trigger: ["blur"] }], |
| | | // 采购类型 |
| | | purchaseTypeList: [{ required: true, message: "请选择", trigger: "blur" }] |
| | | purchaseTypeList: [{ required: true, message: "请选择", trigger: "blur" }], |
| | | netWeight: [ |
| | | { |
| | | required: false, |
| | | message: "请填写", |
| | | trigger: "change", |
| | | }, |
| | | { |
| | | validator: this.validatorNumFour, |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | grossWeight: [ |
| | | { |
| | | required: false, |
| | | message: "请填写", |
| | | trigger: "change", |
| | | }, |
| | | { |
| | | validator: this.validatorNumFour, |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | memberOptions: [], |
| | | productCategoryOptions: [], // 产品类别 |
| | |
| | | isView: false, |
| | | fileFormdata: null, // 上传图片入参 |
| | | bomPurchaseTypeList: getDataByType("purchaseType"), |
| | | grossUnitList:getDataByType("grossUnit"), |
| | | unitList: [], |
| | | editRow:{ |
| | | editDialogVisible:false, |
| | |
| | | this.getUnitInfo() |
| | | }, |
| | | methods: { |
| | | validatorNumFour(rule, value, callback) { |
| | | if (value != "") { |
| | | if (value == undefined || value == null) { |
| | | callback(new Error("请输入有效数字")); |
| | | } else { |
| | | let reg2 = |
| | | /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/; |
| | | if (!reg2.test(value) || value == 0) { |
| | | callback(new Error("请填写大于零的2位小数的数字")); |
| | | } else { |
| | | callback(); |
| | | } |
| | | } |
| | | } else { |
| | | callback(); |
| | | } |
| | | }, |
| | | // 单位 |
| | | 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.moreUnit=true |
| | | this.editConfig.infomation.moreUnitList=list |
| | | }, |
| | | cancelUnitMore(){ |
| | | this.editConfig.infomation.moreUnit=false |
| | | }, |
| | | // 启用多单位的开关 |
| | | moreUnitChange(){ |
| | | // let string=false; |
| | | if(this.editConfig.infomation.unit){ |
| | | // 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(this.editConfig.infomation.moreUnit){ |
| | | // this.editConfig.infomation.moreUnit=false |
| | | // this.$message.error('请先配置多单位!') |
| | | this.$refs.unitMoreDialog.editDialogVisible = true; |
| | | } |
| | | }else{ |
| | | 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&¶ms.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 |