| | |
| | | <template> |
| | | <div class="add-common"> |
| | | <el-dialog |
| | | :title="editCommonConfig.title + '产品'" |
| | | :title="modalTitle + '产品'" |
| | | :visible.sync="editConfig.visible" |
| | | :width="dialogWidth" |
| | | :before-close="handleClose" |
| | | > |
| | | <!-- 头 --> |
| | | <div slot="title" class="dialog-header"> |
| | | <span>{{ editCommonConfig.title + "产品" }}</span> |
| | | <span>{{ modalTitle + "产品" }}</span> |
| | | <div class="header_btns"> |
| | | <span class="btn"> |
| | | <i class="el-icon-printer"></i> |
| | |
| | | label-position="right" |
| | | label-width="110px" |
| | | size="mini" |
| | | style="height: 53vh; overflow-x: hidden" |
| | | > |
| | | <!-- <div class="content-btn"> |
| | | <el-button plain size="mini" disabled>标签打印</el-button> |
| | |
| | | <FormBtnsView |
| | | :add-product="addProduct" |
| | | @inOutBoundClick="inOutBoundClick" |
| | | @inLibraryClick="inLibraryClick" |
| | | :show-procure="showProcure" |
| | | :countObject="statisticsMap" |
| | | :show-sale="showSale" |
| | | /> |
| | | <div class="bottom"> |
| | |
| | | :disabled="!showFooter" |
| | | > |
| | | <el-option |
| | | v-for="item in productCategoryOptions" |
| | | v-for="item in productCategoryListWithDefault" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | |
| | | </div> |
| | | </el-form> |
| | | <!-- 尾 --> |
| | | <div v-if="showFooter" slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" size="small" @click="saveClick('form')">保存</el-button> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" size="small" @click="saveClick('form')" :disabled="!showFooter">保存</el-button> |
| | | <el-button size="small" @click="editConfig.visible = false">取消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | |
| | | return { |
| | | visible: false, |
| | | title: "新建", |
| | | infomation: {} |
| | | infomation: {}, |
| | | autoEdit:false |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | components: {}, |
| | | computed: {}, |
| | | computed: { |
| | | productCategoryListWithDefault(){ |
| | | return [{id:0,name:'请选择'},...(this.productCategoryOptions ?? [])] |
| | | }, |
| | | modalTitle(){ |
| | | if (this.editConfig.title === '编辑' && this.editConfig.autoEdit){ |
| | | return '编辑' |
| | | }else if (this.editConfig.title === '编辑') { |
| | | return !this.showEdit ? '编辑' : '查看' |
| | | }else { |
| | | return '新建' |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | dialogWidth: "50%", |
| | |
| | | memberOptions: [{ name: "管理员", id: 1 }], |
| | | productCategoryOptions: [], // 产品类别 |
| | | productTypeOptions: [ |
| | | { name: "请选择", id: 0 }, |
| | | { name: "能消耗", id: 1 }, |
| | | { name: "服务", id: 2 }, |
| | | { name: "可库存产品", id: 3 } |
| | |
| | | { name: "辅料", id: "辅料" }, |
| | | { name: "耗材", id: "耗材" }, |
| | | { name: "其他", id: "其他" } |
| | | ] |
| | | ], |
| | | statisticsMap: { |
| | | inLibrary: 0 // 在库 |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | this.getProductList() |
| | | this.setTableForm() |
| | | this.setBottonView() |
| | | this.statisticsMap.inLibrary = this.editConfig?.infomation?.amount ?? 0 |
| | | if (this.editConfig.autoEdit){ |
| | | this.editClick() |
| | | } |
| | | }, |
| | | methods: { |
| | | // 获取产品类别 |
| | |
| | | }) |
| | | } |
| | | }, |
| | | // 在库点击 |
| | | inLibraryClick(){ |
| | | if (this.editConfig.title !== "新建") { |
| | | console.log(this.editConfig.infomation) |
| | | this.$router.push({ |
| | | name: "inventoryReport", |
| | | params: { |
| | | name: this.editConfig.infomation.name, |
| | | id: this.editConfig.infomation.id |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | // 可销售/可采购 |
| | | checkboxChange(val, param) { |
| | | if (val === "采购") { |