| | |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="单位" prop="unit"> |
| | | <!-- <el-form-item label="单位old" prop="unit"> |
| | | <el-input |
| | | v-model="editConfig.infomation.unit" |
| | | placeholder="请输入" |
| | | style="width: 85%" |
| | | :disabled="!showFooter" |
| | | ></el-input> |
| | | </el-form-item> --> |
| | | |
| | | <el-form-item label="单位" prop="unit"> |
| | | <el-select |
| | | v-model="editConfig.infomation.unit" |
| | | placeholder="单位" |
| | | filterable |
| | | @change="$forceUpdate()" |
| | | style="width: calc(100% - 30px)" |
| | | > |
| | | <el-option |
| | | v-for="ele in unitList" |
| | | :key="ele.id" |
| | | :label="ele.name" |
| | | :value="ele.name" |
| | | ></el-option> |
| | | </el-select> |
| | | <i |
| | | class="el-icon-setting margin_left_10px cursor_pointer" |
| | | style="font-size: 20px; color: gray" |
| | | @click="handleUnitShow" |
| | | ></i> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="产品标签" prop="productTagName"> |
| | | <el-input |
| | | v-model="editConfig.infomation.productTagName" |
| | |
| | | placeholder="请输入" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="采购类型" prop="purchaseType"> |
| | | <el-radio-group :disabled="!showFooter" v-model="editConfig.infomation.purchaseType"> |
| | | <el-radio v-for="item in purchaseTypeList" :key="item.id" :label="item.id">{{ |
| | | item.name |
| | | }}</el-radio> |
| | | </el-radio-group> |
| | | <el-form-item label="采购类型" prop="purchaseTypeList"> |
| | | <el-checkbox-group |
| | | v-model="editConfig.infomation.purchaseTypeList" |
| | | :disabled="!showFooter" |
| | | > |
| | | <el-checkbox v-for="item in bomPurchaseTypeList" :key="item.id" :label="item.id">{{ item.name }}</el-checkbox> |
| | | </el-checkbox-group> |
| | | </el-form-item> |
| | | <el-form-item label="内部编码" prop="internalReference"> |
| | | <el-input |
| | |
| | | <el-button size="small" @click="editConfig.visible = false">取消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <BomDialog |
| | | ref="editDialog" |
| | | :editRow="editRow" |
| | | @sucessSet="handleGetBomKindDictList" |
| | | @handleConfirmSave="handleConfirmSave" |
| | | :workList="unitList" |
| | | title="计量单位" |
| | | ></BomDialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import { uploadFiles, getUserInfo } from "@/api/common/other" |
| | | import codeMixin from "@/components/mixin/codeMixin" |
| | | import { getDataByType } from "@/api/data" |
| | | import BomDialog from "./components/bomDialog"; |
| | | import {getUnitInfo, } from "@/api/basic/standard"; |
| | | // import { postGetSaveSUnitDict } from "@/api/basic/standard"; |
| | | |
| | | |
| | | export default { |
| | | mixins: [codeMixin], |
| | | name: "AddProductDialog", |
| | |
| | | } |
| | | } |
| | | }, |
| | | components: { IconCropper }, |
| | | components: { |
| | | IconCropper, |
| | | BomDialog, |
| | | }, |
| | | computed: { |
| | | modalTitle() { |
| | | if (this.editConfig.title === "编辑" && this.editConfig.autoEdit) { |
| | |
| | | // salePrice: [{ required: true, message: "请输入销售价格", trigger: "blur" }], |
| | | unit: [{ required: true, message: "请输入单位", trigger: ["change", "blur"] }], |
| | | // 采购类型 |
| | | purchaseType: [{ required: true, message: "请选择", trigger: "blur" }] |
| | | purchaseTypeList: [{ required: true, message: "请选择", trigger: "blur" }] |
| | | }, |
| | | memberOptions: [], |
| | | productCategoryOptions: [], // 产品类别 |
| | |
| | | }, |
| | | isView: false, |
| | | fileFormdata: null, // 上传图片入参 |
| | | purchaseTypeList: getDataByType("purchaseType") |
| | | bomPurchaseTypeList: getDataByType("purchaseType"), |
| | | unitList: [], |
| | | editRow:{ |
| | | editDialogVisible:false, |
| | | BomTableData:[] |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | this.setOptionalFieldsToEmpty() |
| | | this.formInfo() |
| | | this.getUserInfo() |
| | | this.getUnitInfo() |
| | | }, |
| | | methods: { |
| | | // 单位 |
| | | handleUnitShow() { |
| | | this.handleGetBomKindDictList(); |
| | | this.editRow.editDialogVisible = true; |
| | | }, |
| | | // 单位 |
| | | handleGetBomKindDictList(val) { |
| | | console.log(val) |
| | | // postGetUnitDictList().then((res) => { |
| | | // this.unitList = res.data; |
| | | // if (val) { |
| | | // for (let i in this.unitList) { |
| | | // if (this.unitList[i].isDefault) { |
| | | // this.form.unit = this.form.unit |
| | | // ? this.form.unit |
| | | // : this.unitList[i].name; |
| | | // // this.$set(this.form, "unit", this.form.unit); |
| | | // break; |
| | | // } |
| | | // } |
| | | // } |
| | | // }); |
| | | }, |
| | | handleConfirmSave(data) { |
| | | console.log(data) |
| | | // postGetSaveSUnitDict({ data: data }).then((res) => { |
| | | // if (res.code == 200) { |
| | | // this.$message({ |
| | | // message: "操作成功!", |
| | | // type: "success", |
| | | // }); |
| | | // this.$refs.editDialog.editDialogVisible = false; |
| | | // this.handleGetBomKindDictList(); |
| | | // } |
| | | // }); |
| | | this.editRow.editDialogVisible = false; |
| | | |
| | | }, |
| | | // 获取登录用户信息 |
| | | getUserInfo() { |
| | | getUserInfo().then((res) => { |
| | |
| | | // console.log(formdata, "图片数据") |
| | | }, |
| | | // 进出点击 |
| | | inOutBoundClick() { |
| | | inOutBoundClick(val) { |
| | | if (this.editConfig.title !== "新建") { |
| | | console.log(this.editConfig.infomation) |
| | | let url='' |
| | | if(val=='进'){ |
| | | url='inboundOutboundDetail' |
| | | }else{ |
| | | url='outboundDetail' |
| | | } |
| | | this.$router.push({ |
| | | name: "inboundOutboundDetail", |
| | | name:url, |
| | | params: { |
| | | name: this.editConfig.infomation.name, |
| | | id: this.editConfig.infomation.id |
| | |
| | | } else if (val === "销售") { |
| | | this.showSale = param |
| | | } |
| | | }, |
| | | // 获取单位列表数据 |
| | | async getUnitInfo(){ |
| | | await getUnitInfo().then((res)=>{ |
| | | this.editRow.BomTableData = res.data; |
| | | console.log( this.editRow.BomTableData,"看下",res.data) |
| | | }) |
| | | } |
| | | } |
| | | } |