| | |
| | | :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] = '' |
| | | 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 => { |
| | | let arr = ["productType", "categoryId"] |
| | | arr |
| | | .filter((filed) => this.editConfig.infomation[filed] === "") |
| | | .forEach((filed) => { |
| | | this.editConfig.infomation[filed] = 0 |
| | | }) |
| | | }, |
| | |
| | | }) |
| | | } |
| | | }, |
| | | // 上架规则 |
| | | 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 === "采购") { |
| | |
| | | this.pagerOptions.currPage = 1 |
| | | this.searchTaskMap = query.id ? [{ categoryId: this.categoryId, title: query.categoryName }] : [] |
| | | } |
| | | |
| | | this.getData() |
| | | }, |
| | | methods: { |
| | |
| | | size="mini" |
| | | > |
| | | <div class="basic-info"> |
| | | <FormBtnsView :showProduct="true" :countObject="statisticsMap" @productClick="productClick" /> |
| | | <FormBtnsView |
| | | :showProduct="true" |
| | | :countObject="statisticsMap" |
| | | @productClick="productClick" |
| | | @listingRulesClick="listingRulesClick" |
| | | /> |
| | | <div class="basic-info-view"> |
| | | <!-- <el-row> --> |
| | | <!-- <el-col :span="24"> |
| | |
| | | import { addProductCategory, updateProductCategory, deleteProductCategory } from "@/api/product/productCategory" |
| | | |
| | | import { getDataByType } from "@/api/data" |
| | | import {getProductList} from "@/api/product/product"; |
| | | import { getProductList } from "@/api/product/product" |
| | | export default { |
| | | name: "AddProductCategoryDialog", |
| | | props: { |
| | |
| | | visible: false, |
| | | title: "新建", |
| | | infomation: { type: [] }, |
| | | autoEdit: false, |
| | | autoEdit: false |
| | | } |
| | | } |
| | | }, |
| | |
| | | components: {}, |
| | | computed: { |
| | | modalTitle(){ |
| | | if (this.editConfig.title === '编辑' && this.editConfig.autoEdit){ |
| | | return '编辑' |
| | | }else if (this.editConfig.title === '编辑') { |
| | | return !this.showEdit ? '编辑' : '查看' |
| | | if (this.editConfig.title === "编辑" && this.editConfig.autoEdit) { |
| | | return "编辑" |
| | | } else if (this.editConfig.title === "编辑") { |
| | | return !this.showEdit ? "编辑" : "查看" |
| | | }else { |
| | | return '新建' |
| | | return "新建" |
| | | } |
| | | } |
| | | }, |
| | |
| | | * 非必填项后端返回的是数字 0,表单需要空串才能视为未选择回显 |
| | | */ |
| | | setOptionalFieldsToEmpty(){ |
| | | ['parentId','costingMethod','inventoryValuation','forceRemovalStrategy'] |
| | | .filter(filed => this.editConfig.infomation[filed] === 0) |
| | | .forEach(filed => { |
| | | this.editConfig.infomation[filed] = '' |
| | | let arr = ["parentId", "costingMethod", "inventoryValuation", "forceRemovalStrategy"] |
| | | arr |
| | | .filter((filed) => this.editConfig.infomation[filed] === 0) |
| | | .forEach((filed) => { |
| | | this.editConfig.infomation[filed] = "" |
| | | }) |
| | | }, |
| | | /** |
| | | * 后端只接受数字形式, 保存时还得再转回去 |
| | | */ |
| | | unsetFieldsToNumber(){ |
| | | ['parentId','costingMethod','inventoryValuation','forceRemovalStrategy'] |
| | | .filter(filed => this.editConfig.infomation[filed] === '') |
| | | .forEach(filed => { |
| | | let arr = ["parentId", "costingMethod", "inventoryValuation", "forceRemovalStrategy"] |
| | | arr |
| | | .filter((filed) => this.editConfig.infomation[filed] === "") |
| | | .forEach((filed) => { |
| | | this.editConfig.infomation[filed] = 0 |
| | | }) |
| | | }, |
| | | // 获取产品数量 |
| | | getProductCount(){ |
| | | getProductList({ |
| | | keyWord: '', |
| | | keyWord: "", |
| | | categoryId: this.editConfig.title === "新建" ? null : this.editConfig.infomation.id, |
| | | page: 1, |
| | | pageSize: 1 |
| | | }).then((res) => { |
| | | }) |
| | | .then((res) => { |
| | | if (res.code === 200) { |
| | | this.statisticsMap.product = res?.total ?? 0 |
| | | }else{ |
| | | this.statisticsMap.product = 0 |
| | | } |
| | | }).catch(err=>{ |
| | | }) |
| | | .catch((err) => { |
| | | console.error(err) |
| | | this.statisticsMap.product = 0 |
| | | }) |
| | |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | // 上架规则 |
| | | listingRulesClick() { |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | this.$router.push({ |
| | | path: "/warehouseManage/listingRules", |
| | | query: { |
| | | categoryName: this.editConfig.infomation.name, |
| | | id: this.editConfig.title === "新建" ? "" : this.editConfig.infomation.id |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | |
| | | <SearchCommonView |
| | | :add-title="addTitle" |
| | | :show-discard="showDiscard" |
| | | :placeholder="'请输入位置/产品'" |
| | | :placeholder="'请输入产品/产品类别'" |
| | | :amount-view="false" |
| | | :search-task-map="searchTaskMap" |
| | | @addCommonClick="addProductClick" |
| | | @searchClick="getList" |
| | | @discardBtnClick="discardBtnClick" |
| | | @applyBtnClick="applyBtnClick" |
| | | @delSelectClick="delSelectClick" |
| | | /> |
| | | </div> |
| | | <div class="list-view"> |
| | |
| | | currentRowId: 0, |
| | | rowIndex:-1, |
| | | RuleType:0, |
| | | queryProductId: null, |
| | | categoryId: null, |
| | | searchTaskMap: [] |
| | | } |
| | | }, |
| | | created() { |
| | | this.setTable() |
| | | let query = this.$route.query |
| | | if (query) { |
| | | console.log("aaaaaaaaaaaaa", query) |
| | | this.queryProductId = query.productId?.length ? query.productId : null |
| | | this.categoryId = query.id ? Number(query.id) : null |
| | | this.pagerOptions.currPage = 1 |
| | | this.searchTaskMap = |
| | | query?.id > 0 |
| | | ? [{ categoryId: this.categoryId, title: query.categoryName }] |
| | | : query.productId?.length > 0 |
| | | ? [{ productId: this.queryProductId, title: query.productName }] |
| | | : [] |
| | | console.log(this.searchTaskMap) |
| | | } |
| | | this.getData() |
| | | }, |
| | | methods: { |
| | |
| | | // 请求数据 |
| | | async getData() { |
| | | await getListingRulesList({ |
| | | // keyword: this.keyword, |
| | | productId: this.queryProductId ? this.queryProductId : null, |
| | | productCategoryId: this.categoryId ? this.categoryId : null, |
| | | page: this.pagerOptions.currPage, |
| | | pageSize: this.pagerOptions.pageSize |
| | | }).then((res) => { |
| | |
| | | } else { |
| | | if (this.areaId === 0) { |
| | | this.$message.error("请选择当前产品到达位置") |
| | | } else if (this.productId === 0 && this.productCategoryId==='') { |
| | | } else if (this.productId === 0 && this.productCategoryId === "") { |
| | | this.$message.error("请选择产品或产品类别") |
| | | } else if (this.subLocationId === 0) { |
| | | this.$message.error("请选择存储到子位置") |
| | |
| | | id: this.currentRowId, |
| | | areaId: this.areaId, |
| | | locationId: this.subLocationId, |
| | | productCategoryId: this.productCategoryId||'', |
| | | productId: this.productId||'' |
| | | productCategoryId: this.productCategoryId || "", |
| | | productId: this.productId || "" |
| | | }).then((res) => { |
| | | console.log(res) |
| | | if (res.code === 200) { |
| | |
| | | this.subLocationId = row.locationId |
| | | this.productCategoryId = row.productCategoryId |
| | | this.productId = row.productId |
| | | if(this.tableList.tableData[rowIndex].productName===""||this.tableList.tableData[rowIndex].productName===" "){ |
| | | if ( |
| | | this.tableList.tableData[rowIndex].productName === "" || |
| | | this.tableList.tableData[rowIndex].productName === " " |
| | | ) { |
| | | this.tableList.tableColumn[1].product=false |
| | | this.tableList.tableColumn[2].productType=true |
| | | }else{ |
| | |
| | | this.productCategoryId=item.value |
| | | }else{ |
| | | this.tableList.tableColumn[1].product=false |
| | | this.tableList.tableData[this.rowIndex].productName=' ' |
| | | this.productId='' |
| | | this.tableList.tableData[this.rowIndex].productName = " " |
| | | this.productId = "" |
| | | this.productCategoryId=this.tableList.tableData[this.rowIndex].productCategoryId |
| | | } |
| | | }, |
| | |
| | | this.getData() |
| | | } |
| | | }) |
| | | }, |
| | | // 删除产品类型 |
| | | delSelectClick() { |
| | | this.categoryId = 0 |
| | | this.queryProductId = "" |
| | | this.getData() |
| | | } |
| | | }, |
| | | watch:{ |