| | |
| | | :show-procure="showProcure" |
| | | :countObject="statisticsMap" |
| | | :show-sale="showSale" |
| | | @listingRulesClick="listingRulesClick" |
| | | /> |
| | | <div class="bottom"> |
| | | <el-tabs v-model="activeName" type="card"> |
| | |
| | | /** |
| | | * 非必填项后端返回的是数字 0,表单需要空串才能视为未选择回显 |
| | | */ |
| | | setOptionalFieldsToEmpty(){ |
| | | ['productType','categoryId'] |
| | | .filter(filed => this.editConfig.infomation[filed] === 0) |
| | | .forEach(filed => { |
| | | this.editConfig.infomation[filed] = '' |
| | | }) |
| | | setOptionalFieldsToEmpty() { |
| | | let arr = ["productType", "categoryId"] |
| | | arr |
| | | .filter((filed) => this.editConfig.infomation[filed] === 0) |
| | | .forEach((filed) => { |
| | | this.editConfig.infomation[filed] = "" |
| | | }) |
| | | }, |
| | | /** |
| | | * 后端只接受数字形式, 保存时还得再转回去 |
| | | */ |
| | | unsetFieldsToNumber(){ |
| | | ['productType','categoryId'] |
| | | .filter(filed => this.editConfig.infomation[filed] === '') |
| | | .forEach(filed => { |
| | | this.editConfig.infomation[filed] = 0 |
| | | }) |
| | | unsetFieldsToNumber() { |
| | | let arr = ["productType", "categoryId"] |
| | | arr |
| | | .filter((filed) => this.editConfig.infomation[filed] === "") |
| | | .forEach((filed) => { |
| | | this.editConfig.infomation[filed] = 0 |
| | | }) |
| | | }, |
| | | // 获取产品类别 |
| | | async getProductCategoryList() { |
| | |
| | | this.$message.success("添加成功") |
| | | this.$parent.getData() |
| | | } |
| | | },console.error) |
| | | }, console.error) |
| | | } |
| | | }) |
| | | }, |
| | |
| | | }) |
| | | } |
| | | }, |
| | | // 上架规则 |
| | | listingRulesClick() { |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | this.$router.push({ |
| | | path: "/warehouseManage/listingRules", |
| | | query: { |
| | | productName: this.editConfig.infomation.name, |
| | | productId: this.editConfig.title === "新建" ? "" : this.editConfig.infomation.id |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | // 可销售/可采购 |
| | | checkboxChange(val, param) { |
| | | if (val === "采购") { |