| | |
| | | <div class="custom-name"> |
| | | <el-autocomplete |
| | | v-model="scope.row[item.prop]" |
| | | :fetch-suggestions="querySearchAsync" |
| | | :fetch-suggestions=" |
| | | (queryString, callback) => { |
| | | querySearchAsync(queryString, callback, 'product') |
| | | } |
| | | " |
| | | value-key="name" |
| | | :disabled="!isOperate" |
| | | size="mini" |
| | | @select=" |
| | | (val) => { |
| | | handleSelectClient(val, item.prop, scope.row) |
| | | handleSelectClient(val, item.prop, scope.row,scope) |
| | | } |
| | | " |
| | | ></el-autocomplete> |
| | |
| | | </div> |
| | | </el-form-item> |
| | | <el-form-item |
| | | v-else-if="item.inputFloat" |
| | | v-else-if="item.inputFloat||item.inputFloatValue" |
| | | label=" " |
| | | :prop="'tableData.' + scope.$index + '.' + item.prop" |
| | | :rules="[{ required: item.isRequird ? true : false, message: '输入不能为空' }]" |
| | | > |
| | | <span v-if="scope.row.isEdit">{{ scope.row[item.prop] }}</span> |
| | | <span v-if="scope.row.isEdit||(item.inputFloatValue&&!scope.row[item.isInputFloat])">{{ scope.row[item.prop] }}</span> |
| | | <div v-else @click.stop="commoInput"> |
| | | <el-input-number |
| | | v-model="scope.row[item.prop]" |
| | |
| | | style="width: 80%" |
| | | @change=" |
| | | (val) => { |
| | | selLocationClick(val, item.prop) |
| | | selLocationClick(val, item.prop,scope.row) |
| | | } |
| | | " |
| | | > |
| | |
| | | <slot name="tableButton" /> |
| | | </el-table> |
| | | </el-form> |
| | | <div v-if="!detailEnter && !isinventory && !isReorder" style="margin: 10px"> |
| | | <div v-if="!detailEnter && !isinventory && !isReorder&&isOperateAdd" style="margin: 10px"> |
| | | <el-button size="small" type="primary" @click="add">新增</el-button> |
| | | <el-button size="small" type="primary" @click="empty">清空</el-button> |
| | | </div> |
| | |
| | | import { getProductList } from "@/api/product/product" |
| | | import { getLocationList } from "@/api/warehouseManage/warehouse" |
| | | import { getCompanyList } from "@/api/common/other" |
| | | import { getRuleList } from "@/api/operate/inventoryAdjustment" |
| | | import { getRuleList} from "@/api/operate/inventoryAdjustment" |
| | | import { getProductCategoryList } from "@/api/product/productCategory" |
| | | import SimpleSearchInput from "@/components/makepager/SimpleSearchInput" |
| | | import { getAmountAndPrediction } from "@/api/product/reorderRules" |
| | |
| | | isOperate: { |
| | | type: Boolean, |
| | | default: true |
| | | } |
| | | }, |
| | | // 是否有新增和清空操作 |
| | | isOperateAdd: { |
| | | type: Boolean, |
| | | default: true |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | }) |
| | | }, |
| | | // 下拉搜索 |
| | | async handleSelectClient(value, item) { |
| | | this.$emit("selProductClick", value, item) |
| | | async handleSelectClient(value, item,row,scope) { |
| | | this.$emit("selProductClick", value, item,row,scope) |
| | | if (value === "product") { |
| | | if (item.categoryId === 0 || item.categoryName === "") { |
| | | this.productTypeNameOptions = [] |
| | |
| | | } else if (value === "formLocation") { |
| | | restaurants = this.selLocationOptions |
| | | } |
| | | var results = queryString ? restaurants.filter(this.createStateFilter(queryString, value)) : restaurants |
| | | var results = (queryString&&restaurants) ? restaurants.filter(this.createStateFilter(queryString, value)) : restaurants |
| | | cb(results) |
| | | if (results.length === 0) { |
| | | this.productTypeNameOptions = [] |
| | |
| | | this.locacionName = "" |
| | | await getLocationList({ |
| | | // keyword: "", |
| | | type:3, |
| | | jointName: this.initialPosition ? this.initialPosition : null, |
| | | productId: this.queryProductId ? this.queryProductId : null, |
| | | productCategoryId: this.categoryId ? this.categoryId : null, |
| | |
| | | }, |
| | | // 选择产品 |
| | | selProductClick(item, row) { |
| | | console.log("选择产品",row,item) |
| | | if (this.isReorder) { |
| | | this.productId = item.id |
| | | this.productName = item.name |
| | |
| | | ite.productName = item.name |
| | | ite.categoryId = item.categoryId |
| | | ite.productCategory = item.categoryName |
| | | ite.amount = item.amount |
| | | // ite.amount = item.amount |
| | | ite.unit = item.unit |
| | | } |
| | | }) |
| | | this.$emit("selProductClick", "product", this.tableList.tableData[selIndex]) |
| | | } |
| | | |
| | | if (this.isinventory) { |
| | | getRuleList({ |
| | | locationId: 0, |
| | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // this.$emit("selProductClick", item) |
| | | }, |
| | | // 选择产品类型 |
| | |
| | | }, |
| | | // 选择位置 |
| | | selLocationClick(item, prop, row) { |
| | | console.log("位置选择",item,row) |
| | | if (prop === "areaName") { |
| | | getLocationList({ |
| | | jointName: item.label, |
| | |
| | | this.selSonLocationOptions = list |
| | | } |
| | | }) |
| | | }else if(prop==='locationName'){ |
| | | console.log("locationName") |
| | | } |
| | | if (this.isReorder) { |
| | | this.locacionId = item.value |
| | |
| | | }, |
| | | commoInput() {}, |
| | | selClient(item) { |
| | | let list = this.tableList.tableData.map((item) => item.number) |
| | | if (list.findIndex((v) => v == item.number) == -1) { |
| | | let list = this.tableList.tableData.map((item) => item.id) |
| | | if (list.findIndex((v) => v == item.id) == -1) { |
| | | this.isRecalculate = true |
| | | // this.editConfig.infomation.client_name = row.name |
| | | this.tableList.tableData.map((ite, index) => { |
| | | if (index === this.productIndex) { |
| | | ite.productName = item.name |
| | | ite.productId = item.id |
| | | ite.name = item.name |
| | | ite.amount = item.amount || 1 |
| | | ite.number = item.number |
| | | ite.price = item.price |
| | | ite.total = item.amount ? item.amount * item.price : 1 * item.price |
| | | ite.amount = 1 |
| | | ite.number = item.id |
| | | ite.specs = item.specs |
| | | ite.model = item.model |
| | | // ite.price = item.price |
| | | // ite.total = item.amount ? item.amount * item.price : 1 * item.price |
| | | ite.unit = item.unit |
| | | } |
| | | }) |