| | |
| | | style="width: 100%"/> |
| | | </el-form-item> |
| | | <el-form-item label="物品分类" prop="categoryId"> |
| | | <!-- <el-select v-model="formData.categoryId" clearable placeholder="请选择" style="width: 100%"> |
| | | <el-option v-for="item in categoryList" :key="item.id" :label="item.categoryName" |
| | | :value="item.id"></el-option> |
| | | </el-select>--> |
| | | <el-cascader |
| | | clearable |
| | | filterable |
| | |
| | | <el-row :gutter="20" v-for="(m, i) in formData.models"> |
| | | <el-col :span="9"> |
| | | <el-form-item label="规格型号" :prop="`models.${i}.modelName`" :rules="rules.modelName"> |
| | | <el-input v-model="m.modelName" placeholder="请输入规格型号名称" clearable maxlength="20" show-word-limit |
| | | <el-input :disabled="!!setting.id" v-model="m.modelName" placeholder="请输入规格型号名称" clearable maxlength="20" show-word-limit |
| | | style="width: 100%"/> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <script> |
| | | import winMd from '@/components/win/win-md' |
| | | import myButton from '@/components/myButton/myButton' |
| | | import * as finsystenant from '@/api/baseSetting/finsystenant' |
| | | import {addGoods,editGoods,goodsDetail} from "@/api/foudation/material"; |
| | | import {getTree} from '@/api/foudation/classification'; |
| | | import {mapGetters} from 'vuex' |
| | | |
| | |
| | | }, |
| | | async created() { |
| | | if (this.setting.id) { |
| | | await finsystenant.editmaterial(this.setting.id).then(res => { |
| | | await goodsDetail(this.setting.id).then(res => { |
| | | this.formData = res |
| | | if (!this.formData.agencyId) { |
| | | this.formData.agencyId = this.userInfo.tenantId |
| | |
| | | this.loading = true |
| | | if (this.setting.id) { |
| | | // 编辑接口 |
| | | finsystenant.editcode(params).then(res => { |
| | | editGoods(params).then(res => { |
| | | this.loading = false |
| | | if (res) { |
| | | this.$message.success('保存成功!') |
| | |
| | | } else { |
| | | this.$message.error('保存失败') |
| | | } |
| | | }).catch(() => { |
| | | this.loading = false |
| | | }); |
| | | }) |
| | | } else { |
| | | params.orgId = this.setting.orgId |
| | | finsystenant.addcode(params).then(res => { |
| | | addGoods(params).then(res => { |
| | | this.loading = false |
| | | if (res) { |
| | | this.$message.success('保存成功!') |
| | |
| | | } else { |
| | | this.$message.error('保存失败') |
| | | } |
| | | }).catch(() => { |
| | | this.loading = false |
| | | }); |
| | | }) |
| | | } |
| | | } else { |
| | | this.$message.error('校验未通过,请检查。') |