Merge branch 'dev' of http://192.168.5.5:10010/r/web/WMS into dev
| | |
| | | // import request from "@/common/untils/request.js" |
| | | import axios from "axios" |
| | | import request from "@/common/untils/request"; |
| | | |
| | | // 查询公司列表 |
| | | export const getCompanyList = async (data) => { |
| | | return await axios.get(`/api-wms/v1/company/company`, { |
| | | export const getCompanyList = (data) => { |
| | | return request({ |
| | | url: "/api-wms/v1/company/company", |
| | | method: "get", |
| | | params: data |
| | | }) |
| | | } |
| | |
| | | import request from "@/common/untils/request.js" |
| | | import axios from "axios" |
| | | |
| | | // 查询业务类型列表 |
| | | export const getOperationType = async (data) => { |
| | | return await axios.get(`/api-wms/v1/operationType/operationType`, { |
| | | export const getOperationType = (data) => { |
| | | return request({ |
| | | url: "/api-wms/v1/operationType/operationType", |
| | | method: "get", |
| | | params: data |
| | | }) |
| | | } |
| | | // 查询业务类型列表--内部调拨 |
| | | export const getListTransfer = async (data) => { |
| | | return await axios.get(`/api-wms/v1/operationType/listTransfer`, { |
| | | export const getListTransfer = (data) => { |
| | | return request({ |
| | | url: "/api-wms/v1/operationType/listTransfer", |
| | | method: "get", |
| | | params: data |
| | | }) |
| | | } |
| | |
| | | data |
| | | }) |
| | | } |
| | | // 获取位置列表 |
| | | export function getLocationList(data) { |
| | | // 获取位置列表树 |
| | | export function getLocationTreeList() { |
| | | return request({ |
| | | url: "/api-wms/v1/location/getLocationList", |
| | | method: "post", |
| | | data |
| | | url: "/api-wms/v1/location/getLocationTreeList", |
| | | method: "get" |
| | | }) |
| | | } |
| | |
| | | // 库存报表 |
| | | import request from "@/common/untils/request.js" |
| | | import axios from "axios" |
| | | |
| | | |
| | | // 获取库存报表 |
| | |
| | | } |
| | | |
| | | // 仓库类型列表 |
| | | export const getWarehouseList = async (data) => { |
| | | return await axios.get(`/api-wms/v1/warehouse/warehouse`, { |
| | | export const getWarehouseList = (data) => { |
| | | return request({ |
| | | url: "/api-wms/v1/warehouse/warehouse", |
| | | method: "get", |
| | | params: data |
| | | }) |
| | | } |
| | |
| | | import request from "@/common/untils/request.js" |
| | | import axios from "axios" |
| | | |
| | | // 仓库列表 |
| | | export const getWarehouseList = async (data) => { |
| | | return await axios.get(`/api-wms/v1/warehouse/warehouse`, { |
| | | export const getWarehouseList = (data) => { |
| | | return request({ |
| | | url: "/api-wms/v1/warehouse/warehouse", |
| | | method: "get", |
| | | params: data |
| | | }) |
| | | } |
| | |
| | | }) |
| | | } |
| | | // 业务类型 列表 |
| | | export const getOperationTypeList = async (data) => { |
| | | return await axios.get(`/api-wms/v1/operationType/operationType`, { |
| | | export const getOperationTypeList = (data) => { |
| | | return request({ |
| | | url: "/api-wms/v1/operationType/operationType", |
| | | method: "get", |
| | | params: data |
| | | }) |
| | | } |
| | |
| | | |
| | | // import router from '@/router' |
| | | |
| | | // 开发环境下将自己的token复制到这里, 也可以在浏览器中手动添加token到cookie中,cookie中的token优先 |
| | | const DEV_TOKEN = '' |
| | | function environmentType(){ |
| | | let type |
| | | if (location.href.includes('192.168.20.119')) { |
| | | type = 'test' |
| | | } else if (location.href.includes('192.168') || location.href.includes('localhost')) { |
| | | type = 'dev' |
| | | } else { |
| | | type = 'prod' |
| | | } |
| | | |
| | | return type |
| | | } |
| | | const isDev = environmentType() === 'dev' |
| | | |
| | | const getApsPage = () => { |
| | | // 首页部署在各个环境的端口 |
| | | const loginPathMap = { |
| | | prod:`//${window.location.hostname}:9080`, |
| | | test:`//192.168.20.119:9080`, |
| | | // 想跳到本地启动的登录页的话需要把dev改成你本地项目路径 |
| | | dev: `//192.168.20.124:8081` |
| | | } |
| | | |
| | | return loginPathMap[environmentType()] |
| | | } |
| | | |
| | | |
| | | const Axios = axios.create({ |
| | | responseType: "json", |
| | | withCredentials: true // 是否允许带cookie这些 |
| | |
| | | /* //POST传参序列化(添加请求拦截器) */ |
| | | Axios.interceptors.request.use( |
| | | (config) => { |
| | | // 若是有做鉴权token , 就给头部带上token |
| | | // let token = util.cookies.get("token"); |
| | | // if (token != undefined) { |
| | | // config.headers.Authorization = "Bearer " + token; |
| | | // } |
| | | let token = document.cookie.replace( |
| | | /(?:(?:^|.*;\s*)token\s*=\s*([^;]*).*$)|^.*$/, |
| | | "$1", |
| | | ); |
| | | if (isDev){ |
| | | token = token || DEV_TOKEN |
| | | } |
| | | if (token) { |
| | | config.headers.Authorization = "Bearer " + token; |
| | | } |
| | | |
| | | return config |
| | | }, |
| | |
| | | /* //对响应数据做些事 */ |
| | | if (res.data.code === 200) { |
| | | return res.data ? res.data : {} |
| | | }else if([2012,2013,2014,2015].includes(res.data.code)){ |
| | | if (isDev){ |
| | | alert("JWT失效") |
| | | }else { |
| | | // JWT鉴权失效 跳转到登录页 |
| | | window.location = getApsPage()+'/login' |
| | | } |
| | | return Promise.reject(res.data) |
| | | } else { |
| | | Message({ |
| | | message: res.data.msg, |
| | |
| | | } |
| | | }, |
| | | (error) => { |
| | | if (error.response.status === 401){ |
| | | if (isDev){ |
| | | alert("JWT失效") |
| | | }else { |
| | | // JWT鉴权失效 跳转到登录页 |
| | | window.location = getApsPage()+'/login' |
| | | } |
| | | } |
| | | |
| | | let { message } = error |
| | | if (message === "Network Error") { |
| | | message = "后端接口连接异常" |
| | |
| | | async getCompanyList() { |
| | | await getCompanyList().then((res) => { |
| | | console.log(res) |
| | | if (res.data.code === 200) { |
| | | this.companyOptions = res.data.data |
| | | if (res.code === 200) { |
| | | this.companyOptions = res.data |
| | | } |
| | | }) |
| | | }, |
| | |
| | | <div class="right-label">额外的价格</div> |
| | | </div> |
| | | </div> --> |
| | | <div v-if="!showProduct && !showWarehouse && !showPosition && !addProduct" |
| | | <div |
| | | v-if="!showProduct && !showWarehouse && !showPosition && !addProduct" |
| | | class="sub-number left_border cursor_pointer" |
| | | @click="inLibraryClick()" |
| | | > |
| | |
| | | <div class="right-label">BOM</div> |
| | | </div> |
| | | </div> --> |
| | | <div v-if="!showProduct && !showWarehouse && !showPosition" class="sub-number no-cursor"> |
| | | <div |
| | | v-if="!showProduct && !showWarehouse && !showPosition" |
| | | class="sub-number yes-cursor" |
| | | @click="reorderRulesClick" |
| | | > |
| | | <div class="left"><i class="el-icon-refresh"></i></div> |
| | | <div class="right"> |
| | | <div class="right-label">{{ (countObject?.reorderRule ?? 0) }}</div> |
| | | <div class="right-label">{{ countObject?.reorderRule ?? 0 }}</div> |
| | | <div class="right-label">重订货规则</div> |
| | | </div> |
| | | </div> |
| | | <div v-if="showProduct" class="sub-number left_border yes-cursor" @click="productClick"> |
| | | <div class="left"><i class="el-icon-s-fold"></i></div> |
| | | <div class="right"> |
| | | <div class="right-label">{{ (countObject?.product ?? 0) }}</div> |
| | | <div class="right-label">{{ countObject?.product ?? 0 }}</div> |
| | | <div class="right-label">产品</div> |
| | | </div> |
| | | </div> |
| | | <div v-if="!showWarehouse" class="sub-number left_border no-cursor"> |
| | | <div v-if="!showWarehouse" class="sub-number left_border yes-cursor" @click="listingRulesClick"> |
| | | <div class="left"><i class="el-icon-refresh"></i></div> |
| | | <div class="right"> |
| | | <div class="right-one">上架规则</div> |
| | |
| | | // 在库 |
| | | inLibraryClick(){ |
| | | this.$emit("inLibraryClick") |
| | | }, |
| | | // 上架规则 |
| | | listingRulesClick() { |
| | | this.$emit("listingRulesClick") |
| | | }, |
| | | // 重订货规则 |
| | | reorderRulesClick() { |
| | | this.$emit("reorderRulesClick") |
| | | } |
| | | } |
| | | } |
| | |
| | | <div class="search-list"> |
| | | <div class="search-top"> |
| | | <div class="left"> |
| | | <el-button v-if="showAdd" :disabled="isDisabled" type="primary" size="mini" @click="addBtn">{{ addTitle }}</el-button> |
| | | <el-button v-if="showAdd" :disabled="isDisabled" type="primary" size="mini" @click="addBtn">{{ |
| | | addTitle |
| | | }}</el-button> |
| | | <el-button v-if="showDiscard" size="mini" @click="discardBtn" style="margin-left: 0px">{{ "取消" }}</el-button> |
| | | <div class="download" @click="downloadClick" :style="{ cursor: showDownload ? 'pointer' : 'no-drop' }"> |
| | | <img src="@/assets/img/xiazai.png" style="width: 13px" /> |
| | |
| | | @change="searchClick" |
| | | @clear="clearClick" |
| | | > |
| | | <template v-if="selectArr?.length > 0" slot="prepend"> |
| | | <div style="display: flex"> |
| | | <div v-for="(val, i) in selectArr" :key="i" class="pre-views"> |
| | | <span style="margin-left: 5px">{{ val?.title ?? val }}</span> |
| | | <i @click="delSelectClick(val)" class="el-icon-close" style="margint: 0 5px"></i> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <i slot="suffix" class="el-icon-search" style="cursor: pointer" @click="searchClick"></i> |
| | | </el-input> |
| | | </template> |
| | | <div class="search-Btn"> |
| | | <div class="common"> |
| | | <div v-if="showSreen" class="common no-cursor"> |
| | | <img src="@/assets/img/shaixuan.png" style="width: 10px" /> |
| | | <span>筛选</span> |
| | | </div> |
| | | <div class="common"> |
| | | <el-dropdown |
| | | v-else |
| | | style=" |
| | | cursor: pointer; |
| | | font-weight: 500; |
| | | font-size: 16px; |
| | | line-height: 1; |
| | | letter-spacing: 0.09px; |
| | | color: #202224; |
| | | " |
| | | trigger="click" |
| | | :hide-on-click="false" |
| | | placement="bottom" |
| | | @command="switchKeywords($event, selList)" |
| | | > |
| | | <div class="common yes-cursor"> |
| | | <img src="@/assets/img/shaixuan.png" style="width: 10px" /> |
| | | <span>筛选</span> |
| | | </div> |
| | | <el-dropdown-menu slot="dropdown"> |
| | | <el-dropdown-item |
| | | v-for="(item, key) in screenArray" |
| | | :key="key" |
| | | :command="item.title" |
| | | :class="{ selected: status == item.title }" |
| | | > |
| | | <div class="dropdown-view"> |
| | | <i v-show="getClass(selList, item)" class="el-icon-check icon-view"></i> |
| | | {{ item.title }} |
| | | </div> |
| | | </el-dropdown-item> |
| | | </el-dropdown-menu> |
| | | </el-dropdown> |
| | | <div class="common no-cursor"> |
| | | <i class="el-icon-s-fold"></i> |
| | | <span>分组</span> |
| | | </div> |
| | | <div class="common"> |
| | | <div class="common no-cursor"> |
| | | <i class="el-icon-star-on"></i> |
| | | <span>收藏</span> |
| | | </div> |
| | |
| | | inputName: { |
| | | type: String, |
| | | default: "" |
| | | }, |
| | | showSreen: { |
| | | type: Boolean, |
| | | default: true |
| | | }, |
| | | searchTaskMap: { |
| | | type: Array, |
| | | default: () => [] |
| | | }, |
| | | screenArray: { |
| | | type: Array, |
| | | default: () => [] |
| | | } |
| | | }, |
| | | watch: { |
| | |
| | | this.searchInput = val |
| | | } |
| | | }, |
| | | computed: { |
| | | getClass() { |
| | | return function (row, i) { |
| | | return row.includes(i.title) ? "selected" : null |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | searchInput: "", |
| | | searchSelValue: this.searchSel |
| | | searchSelValue: this.searchSel, |
| | | status: "", |
| | | selList: [], |
| | | selectArr: [] |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.searchTaskMap.forEach((ele) => { |
| | | this.selList.push(ele.title) |
| | | }) |
| | | this.selectArr = this.searchTaskMap |
| | | }, |
| | | methods: { |
| | | // 搜索 |
| | |
| | | // 模具-检查配置 |
| | | inspectionConfigClick() { |
| | | this.$emit("inspectionConfigClick") |
| | | }, |
| | | switchKeywords(command, item) { |
| | | console.log("index", command, item) |
| | | this.status = command |
| | | const oldValue = item |
| | | console.log(oldValue) |
| | | this.selectArr = oldValue |
| | | if (item.includes(command)) { |
| | | oldValue.splice( |
| | | oldValue.findIndex((e) => e === command), |
| | | 1 |
| | | ) |
| | | } else { |
| | | oldValue.push(command) |
| | | } |
| | | this.$emit("switchKeywords", item) |
| | | }, |
| | | // 删除筛选内容 |
| | | delSelectClick(item) { |
| | | console.log(item) |
| | | this.selectArr.splice( |
| | | this.selectArr.findIndex((e) => e === item), |
| | | 1 |
| | | ) |
| | | this.$emit("delSelectClick", item) |
| | | } |
| | | } |
| | | } |
| | |
| | | margin-right: 20px; |
| | | margin-left: 20px; |
| | | .el-icon-search { |
| | | margin-top: 22px; |
| | | margin-top: 10px; |
| | | } |
| | | .search-Btn { |
| | | display: flex; |
| | |
| | | .common { |
| | | width: 50px; |
| | | text-align: center; |
| | | cursor: no-drop; |
| | | } |
| | | } |
| | | .pre-views { |
| | | border: 1px solid #c0c0c0; |
| | | font-size: 12px; |
| | | margin-right: 5px; |
| | | border-radius: 3px; |
| | | background: #f0f0f0; |
| | | &:last-child { |
| | | margin-right: 0px; |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | .yellow { |
| | | background: #e6a23c; |
| | | } |
| | | } |
| | | .selected { |
| | | color: #606266; |
| | | } |
| | | .dropdown-view { |
| | | position: relative; |
| | | .icon-view { |
| | | position: absolute; |
| | | left: -15px; |
| | | top: 11px; |
| | | } |
| | | } |
| | | |
| | |
| | | width: 130px; |
| | | } |
| | | .input-with-select .el-input-group__prepend { |
| | | background-color: #da2323; |
| | | padding: 0 10px; |
| | | background-color: #ffffff; |
| | | } |
| | | // .el-input__suffix { |
| | | // // 处理前缀图标不垂直居中的问题 |
| | |
| | | padding-right: 20px; |
| | | } |
| | | } |
| | | .el-dropdown-menu__item { |
| | | padding-left: 20px; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <div class="rightContent"> |
| | | <div class="top"> |
| | | <SearchCommonView :add-title="addTitle" :show-discard="showDiscard" :show-apply="false" :placeholder="'请输入位置/产品'" |
| | | :amount-view="false" @addCommonClick="addProductClick" @searchClick="getList" |
| | | @discardBtnClick="discardBtnClick" /> |
| | | <SearchCommonView |
| | | :add-title="addTitle" |
| | | :show-discard="showDiscard" |
| | | :show-apply="false" |
| | | :placeholder="'请输入位置/产品'" |
| | | :amount-view="false" |
| | | :search-task-map="searchTaskMap" |
| | | :show-sreen="false" |
| | | :screen-array="screenArray" |
| | | @addCommonClick="addProductClick" |
| | | @searchClick="getList" |
| | | @discardBtnClick="discardBtnClick" |
| | | @delSelectClick="delSelectClick" |
| | | @switchKeywords="switchKeywords" |
| | | /> |
| | | </div> |
| | | <div class="content_wrap"> |
| | | <div class="con_left"> |
| | | <p>位置</p> |
| | | <div class="stash"> |
| | | <template> |
| | | <el-tree :data="datas" :props="defaultProps" @node-click="handleNodeClick"></el-tree> |
| | | <el-tree :data="datas" :props="defaultProps" @node-click="handleNodeClick"> |
| | | <span class="span-ellipsis" slot-scope="{ node }"> |
| | | <span :title="node.label">{{ node.label }}</span> |
| | | </span> |
| | | </el-tree> |
| | | </template> |
| | | </div> |
| | | </div> |
| | | <div class="list-view"> |
| | | <div class="table"> |
| | | <CommonFormTableView ref="tablelistRef" :isReorder="true" :product-table-list="tableList" |
| | | @inputContent="inputContent" @selLocationClick="selLocationClick" @selProductClick="selProductClick" |
| | | @tableRowClick="tableRowClick" @selRouteClick="selRouteClick"> |
| | | <CommonFormTableView |
| | | ref="tablelistRef" |
| | | :isReorder="true" |
| | | :product-table-list="tableList" |
| | | @inputContent="inputContent" |
| | | @selLocationClick="selLocationClick" |
| | | @selProductClick="selProductClick" |
| | | @tableRowClick="tableRowClick" |
| | | @selRouteClick="selRouteClick" |
| | | > |
| | | <template slot="tableButton"> |
| | | <el-table-column label="操作" width="180" align="center"> |
| | | <template slot-scope="scope"> |
| | | <span v-if="scope.row.isEdit && scope.row.isView" @click.stop="handleOrderOnceClick(scope.row)" |
| | | class="yes-cursor"> |
| | | <span |
| | | v-if="scope.row.isEdit && scope.row.isView" |
| | | @click.stop="handleOrderOnceClick(scope.row)" |
| | | class="yes-cursor" |
| | | > |
| | | <i class="el-icon-truck"></i> |
| | | <span>订购一次</span> |
| | | </span> |
| | |
| | | <script> |
| | | import CommonFormTableView from "@/components/makepager/CommonFormTableView" |
| | | import pageMixin from "@/components/makepager/pager/mixin/pageMixin" |
| | | import { getReorderRuleList, addReorderRule, updateReorderRule, orderAgain,getLocationList } from "@/api/product/reorderRules" |
| | | import { |
| | | getReorderRuleList, |
| | | addReorderRule, |
| | | updateReorderRule, |
| | | orderAgain, |
| | | getLocationTreeList |
| | | } from "@/api/product/reorderRules" |
| | | import { currentTime } from "@/common/config/index" |
| | | export default { |
| | | name: "ReorderRules", |
| | |
| | | data() { |
| | | return { |
| | | datas:[], |
| | | // datas: [{ |
| | | // label: '一级 1', |
| | | // children: [{ |
| | | // label: '二级 1-1', |
| | | // children: [{ |
| | | // label: '三级 1-1-1' |
| | | // }] |
| | | // }] |
| | | // }, { |
| | | // label: '一级 2', |
| | | // children: [{ |
| | | // label: '二级 2-1', |
| | | // children: [{ |
| | | // label: '三级 2-1-1' |
| | | // }] |
| | | // }, { |
| | | // label: '二级 2-2', |
| | | // children: [{ |
| | | // label: '三级 2-2-1' |
| | | // }] |
| | | // }] |
| | | // }, { |
| | | // label: '一级 3', |
| | | // children: [{ |
| | | // label: '二级 3-1', |
| | | // children: [{ |
| | | // label: '三级 3-1-1' |
| | | // }] |
| | | // }, { |
| | | // label: '二级 3-2', |
| | | // children: [{ |
| | | // label: '三级 3-2-1' |
| | | // }] |
| | | // }] |
| | | // }], |
| | | defaultProps: { |
| | | children: 'children', |
| | | label: 'jointName' |
| | | children: "children", |
| | | label: "jointName" |
| | | }, |
| | | addTitle: "新建", |
| | | showDiscard: false, |
| | |
| | | maxInventory: 0, |
| | | orderNumber: 0, |
| | | unit: "", |
| | | reorderId: 0 |
| | | reorderId: 0, |
| | | searchTaskMap: [], |
| | | type: "bh", |
| | | screenArray: [{ id: "0", type: "bh", title: "重新订购" }] |
| | | } |
| | | }, |
| | | created() { |
| | | this.setTable() |
| | | this.searchTaskMap = [{ id: "0", type: this.type, title: "重新订购" }] |
| | | this.getData() |
| | | this.getLocationList() |
| | | }, |
| | |
| | | } |
| | | }, |
| | | // 请求数据 |
| | | async getData() { |
| | | async getData(data) { |
| | | await getReorderRuleList({ |
| | | locationId: data?.id, |
| | | type: this.type, |
| | | keyWord: data?.jointName, |
| | | page: this.pagerOptions.currPage, |
| | | pageSize: this.pagerOptions.pageSize |
| | | }).then((res) => { |
| | | if (res.code === 200) { |
| | | console.log(res) |
| | | const list = res.data.map((item) => { |
| | | const list = res.data?.map((item) => { |
| | | let orderNum = 0 |
| | | if (parseFloat(item.minInventory) - parseFloat(item.prediction) > 0) { |
| | | orderNum = this.caculateOrderNumber( |
| | |
| | | }, |
| | | //树点击 |
| | | handleNodeClick(data) { |
| | | console.log(data,"sss"); |
| | | getReorderRuleList({ |
| | | locationId:data.id, |
| | | page:1, |
| | | pageSize:15, |
| | | type:"", |
| | | keyWord:data.jointName, |
| | | }).then((res)=>{ |
| | | console.log(res,"res999") |
| | | if (res.code === 200) { |
| | | console.log(res) |
| | | const list = res.data.map((item) => { |
| | | let orderNum = 0 |
| | | if (parseFloat(item.minInventory) - parseFloat(item.prediction) > 0) { |
| | | orderNum = this.caculateOrderNumber( |
| | | parseFloat(item.minInventory), |
| | | parseFloat(item.maxInventory), |
| | | parseFloat(item.prediction) |
| | | ) |
| | | } |
| | | return { |
| | | ...item, |
| | | productName: item.product.name, |
| | | locationName: item.location.name, |
| | | isSet: false, |
| | | isEdit: true, |
| | | editable: true, |
| | | isOrder: true, |
| | | isView: item?.minInventory - item?.prediction > 0 ? true : false, |
| | | orderNumber: orderNum |
| | | } |
| | | }) |
| | | this.tableList.tableData = list || [] |
| | | this.tableData = list || [] |
| | | this.pagerOptions.totalCount = res.total |
| | | } |
| | | }) |
| | | console.log(data, "sss") |
| | | this.getData(data) |
| | | }, |
| | | async getLocationList(){ |
| | | await getLocationList({ |
| | | categoryId:"", |
| | | keyWord:"", |
| | | // page:1, |
| | | // pageSize:, |
| | | }).then((res)=>{ |
| | | this.datas=res.data |
| | | await getLocationTreeList().then((res) => { |
| | | this.datas = [ |
| | | { |
| | | id: 0, |
| | | jointName: "全部", |
| | | children: [] |
| | | }, |
| | | ...res.data |
| | | ] |
| | | console.log(res,"res666") |
| | | }) |
| | | }, |
| | | // 删除type |
| | | delSelectClick() { |
| | | this.type = "" |
| | | this.getData() |
| | | }, |
| | | switchKeywords(item) { |
| | | console.log(item, "switchKeywords") |
| | | this.type = item?.length > 0 ? "bh" : "" |
| | | this.getData() |
| | | } |
| | | } |
| | | } |
| | |
| | | display: flex; |
| | | justify-content: space-between; |
| | | .con_left { |
| | | width: 200px; |
| | | max-height: calc(100% - 40px); |
| | | overflow: hidden; |
| | | width: 190px; |
| | | margin-right: 10px; |
| | | .el-checkbox-group { |
| | | width:100%; |
| | | display: flex; |
| | |
| | | display: flex; |
| | | flex-direction: column; |
| | | .el-tree{ |
| | | background-color: #E6ECF2; |
| | | background-color: #e6ecf2; |
| | | } |
| | | } |
| | | } |
| | |
| | | flex: 1; |
| | | } |
| | | } |
| | | |
| | | .span-ellipsis { |
| | | width: 100%; |
| | | overflow: hidden; |
| | | white-space: nowrap; |
| | | text-overflow: ellipsis; |
| | | font-size: 13px; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | async getCompanyList() { |
| | | await getCompanyList().then((res) => { |
| | | console.log(res) |
| | | if (res.data.code === 200) { |
| | | this.companyOptions = res.data.data |
| | | if (res.code === 200) { |
| | | this.companyOptions = res.data |
| | | } |
| | | }) |
| | | }, |
| | |
| | | page: 0, |
| | | pageSize: 0 |
| | | }).then((res) => { |
| | | console.log(res.data.data) |
| | | if (res.data.code === 200) { |
| | | const list = res.data.data.map((item) => { |
| | | console.log(res.data) |
| | | if (res.code === 200) { |
| | | const list = res.data.map((item) => { |
| | | return { |
| | | name: item.name, |
| | | id: item.id |
| | |
| | | :add-title="'新建'" |
| | | :placeholder="'请输入单号/来源单据'" |
| | | :amount-view="false" |
| | | :search-task-map="searchTaskMap" |
| | | @addCommonClick="addBtnClick" |
| | | @searchClick="getList" |
| | | @delSelectClick="delSelectClick" |
| | | /> |
| | | </div> |
| | | <div class="list-view"> |
| | |
| | | displayEdit: false, |
| | | formLabel: "", |
| | | toLabel: "", |
| | | addName: "" |
| | | addName: "", |
| | | searchTaskMap: [] |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | sessionStorage.setItem("paramsData", JSON.stringify(params)) |
| | | } |
| | | this.params = params |
| | | this.searchTaskMap = |
| | | this.params.status > 0 ? [{ id: this.params.id, title: this.getStatus(this.params.status) }] : [] |
| | | this.getData() |
| | | // console.log(this.$route.params.workType) |
| | | }, |
| | |
| | | }, |
| | | // 状态 |
| | | getStatus(val) { |
| | | return val === 1 ? "草稿" : val === 3 ? "就绪" : "完成" |
| | | return val === 1 ? "草稿" : val === 3 ? "就绪" : val === 4 ? "完成" : "" |
| | | }, |
| | | // 删除搜索状态 |
| | | delSelectClick() { |
| | | this.params.status = 0 |
| | | this.getData() |
| | | } |
| | | } |
| | | } |
| | |
| | | page: this.pagerOptions.currPage, |
| | | pageSize: this.pagerOptions.pageSize |
| | | }).then((res) => { |
| | | console.log(res.data.data) |
| | | if (res.data.code === 200) { |
| | | const list = res.data.data.map((item) => { |
| | | console.log(res.data) |
| | | if (res.code === 200) { |
| | | const list = res.data.map((item) => { |
| | | return { |
| | | ...item |
| | | } |
| | | }) |
| | | this.tableList = list || [] |
| | | this.pagerOptions.totalCount = res.data.total |
| | | this.pagerOptions.totalCount = res.total |
| | | } |
| | | }) |
| | | }, |
| | |
| | | :show-procure="showProcure" |
| | | :countObject="statisticsMap" |
| | | :show-sale="showSale" |
| | | @listingRulesClick="listingRulesClick" |
| | | @reorderRulesClick="reorderRulesClick" |
| | | /> |
| | | <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 |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | // 重订购规则 |
| | | reorderRulesClick() { |
| | | this.$refs.form.validate((valid) => { |
| | | if (valid) { |
| | | this.$router.push({ |
| | | path: "/productManage/reorderRules", |
| | | query: { |
| | | productName: this.editConfig.infomation.name, |
| | | productId: this.editConfig.title === "新建" ? "" : this.editConfig.infomation.id |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | // 可销售/可采购 |
| | | checkboxChange(val, param) { |
| | | if (val === "采购") { |
| | |
| | | :add-title="'新建'" |
| | | :placeholder="'请输入产品名称'" |
| | | :amount-view="false" |
| | | :search-task-map="searchTaskMap" |
| | | @addCommonClick="addBtnClick" |
| | | @searchClick="searchClick" |
| | | @delSelectClick="delSelectClick" |
| | | /> |
| | | </div> |
| | | <div class="list-view"> |
| | |
| | | </div> |
| | | <!-- 列表形式 --> |
| | | <div v-if="isIconIndex === '2'" class="product-list"> |
| | | <TableCommonView |
| | | ref="tableListRef" |
| | | :table-list="tableList" |
| | | @selTableCol="selTableCol" |
| | | > |
| | | <TableCommonView ref="tableListRef" :table-list="tableList" @selTableCol="selTableCol"> |
| | | <template slot="tableButton"> |
| | | <el-table-column label="操作" width="90" align="center"> |
| | | <template slot-scope="scope"> |
| | |
| | | url: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg", |
| | | pageSizes: [15, 30], |
| | | keyWord: "", |
| | | categoryId: null |
| | | categoryId: null, |
| | | searchTaskMap: [] |
| | | } |
| | | }, |
| | | created() { |
| | | this.setTable() |
| | | let query = this.$route.query |
| | | if (query) { |
| | | console.log("ssssss") |
| | | this.categoryId = query.id ? Number(query.id) : null |
| | | this.pagerOptions.currPage = 1 |
| | | this.searchTaskMap = query.id ? [{ categoryId: this.categoryId, title: query.categoryName }] : [] |
| | | } |
| | | this.getData() |
| | | }, |
| | |
| | | this.pagerOptions.pageSize = 15 |
| | | } |
| | | this.getData() |
| | | }, |
| | | // 删除产品类型 |
| | | delSelectClick() { |
| | | this.categoryId = 0 |
| | | this.getData() |
| | | } |
| | | } |
| | | } |
| | |
| | | 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 |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | |
| | | :show-apply="false" |
| | | :placeholder="'请输入位置/产品'" |
| | | :amount-view="false" |
| | | :search-task-map="searchTaskMap" |
| | | @addCommonClick="addProductClick" |
| | | @searchClick="getList" |
| | | @discardBtnClick="discardBtnClick" |
| | | @delSelectClick="delSelectClick" |
| | | /> |
| | | </div> |
| | | <div class="list-view"> |
| | |
| | | maxInventory: 0, |
| | | orderNumber: 0, |
| | | unit: "", |
| | | reorderId: 0 |
| | | reorderId: 0, |
| | | queryProductId: null, |
| | | searchTaskMap: [] |
| | | } |
| | | }, |
| | | created() { |
| | | this.setTable() |
| | | let query = this.$route.query |
| | | if (query) { |
| | | this.queryProductId = query.productId?.length ? query.productId : null |
| | | this.pagerOptions.currPage = 1 |
| | | this.searchTaskMap = |
| | | query.productId?.length > 0 ? [{ productId: this.queryProductId, title: query.productName }] : [] |
| | | console.log(this.searchTaskMap) |
| | | } |
| | | this.getData() |
| | | }, |
| | | methods: { |
| | |
| | | // 请求数据 |
| | | async getData() { |
| | | await getReorderRuleList({ |
| | | productId: this.queryProductId ? this.queryProductId : null, |
| | | page: this.pagerOptions.currPage, |
| | | pageSize: this.pagerOptions.pageSize |
| | | }).then((res) => { |
| | |
| | | // 获取当前时间 |
| | | currentTime() { |
| | | return currentTime() |
| | | }, |
| | | // 删除产品 |
| | | delSelectClick() { |
| | | this.queryProductId = "" |
| | | this.getData() |
| | | } |
| | | } |
| | | } |
| | |
| | | page: this.pagerOptions.currPage, |
| | | pageSize: this.pagerOptions.pageSize |
| | | }).then((res) => { |
| | | if (res.data.code === 200) { |
| | | this.warehouseList = res.data.data |
| | | if (res.code === 200) { |
| | | this.warehouseList = res.data |
| | | } |
| | | }) |
| | | } |
| | |
| | | page: 0, |
| | | pageSize: 0 |
| | | }).then((res) => { |
| | | if (res.data.code == 200) { |
| | | this.warehouseList = res.data.data ? res.data.data : [] |
| | | if (res.code == 200) { |
| | | this.warehouseList = res.data ? res.data : [] |
| | | } |
| | | }) |
| | | }, |
| | |
| | | page: this.pagerOptions.currPage, |
| | | pageSize: this.pagerOptions.pageSize |
| | | }).then((res) => { |
| | | if (res.data.code === 200) { |
| | | const list = res.data.data |
| | | if (res.code === 200) { |
| | | const list = res.data |
| | | this.tableList.tableInfomation = list || [] |
| | | this.pagerOptions.totalCount = res.data.data.total |
| | | this.pagerOptions.totalCount = res.total |
| | | } |
| | | }) |
| | | }, |
| | |
| | | <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:{ |
| | |
| | | :add-title="'新建'" |
| | | :placeholder="'请输入单号'" |
| | | :amount-view="false" |
| | | :search-task-map="searchTaskMap" |
| | | @addCommonClick="addBtnClick" |
| | | @searchClick="getList" |
| | | @delSelectClick="delSelectClick" |
| | | /> |
| | | </div> |
| | | <div class="list-view"> |
| | | <div class="table"> |
| | | <TableCommonView |
| | | ref="tableListRef" |
| | | :table-list="tableList" |
| | | :show-checkcol="false" |
| | | > |
| | | <TableCommonView ref="tableListRef" :table-list="tableList" :show-checkcol="false"> |
| | | <template slot="tableButton"> |
| | | <el-table-column label="操作" width="120" fixed="right"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | @click="tableRowClick(scope.row,'edit')" |
| | | type="text" |
| | | size="small" |
| | | >编辑</el-button |
| | | > |
| | | <el-button |
| | | type="text" |
| | | size="small" |
| | | @click="tableRowClick(scope.row,'look')" |
| | | >查看</el-button |
| | | > |
| | | <el-button @click="tableRowClick(scope.row, 'edit')" type="text" size="small">编辑</el-button> |
| | | <el-button type="text" size="small" @click="tableRowClick(scope.row, 'look')">查看</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </template> |
| | |
| | | title: "新建", |
| | | infomation: {} |
| | | }, |
| | | positionTypeList: getDataByType("positionType") |
| | | positionTypeList: getDataByType("positionType"), |
| | | searchTaskMap: [], |
| | | type: 3 |
| | | } |
| | | }, |
| | | created() { |
| | | this.setTable() |
| | | this.searchTaskMap = [{ id: "3", title: "内部位置" }] |
| | | this.getData() |
| | | }, |
| | | methods: { |
| | |
| | | // 请求数据 |
| | | async getData() { |
| | | await getLocationList({ |
| | | type: this.type, |
| | | keyword: this.keyword, |
| | | page: this.pagerOptions.currPage, |
| | | pageSize: this.pagerOptions.pageSize |
| | |
| | | }, |
| | | // 行点击 |
| | | tableRowClick(row,val) { |
| | | this.editConfig.title = val=='look'?'查看':"编辑" |
| | | this.editConfig.title = val == "look" ? "查看" : "编辑" |
| | | this.editConfig.infomation = { ...row } |
| | | this.editConfig.infomation.parentId = this.editConfig.infomation.parentId?Number(this.editConfig.infomation.parentId):null |
| | | this.editConfig.infomation.parentId = this.editConfig.infomation.parentId |
| | | ? Number(this.editConfig.infomation.parentId) |
| | | : null |
| | | this.editConfig.visible = true |
| | | }, |
| | | // 新建 |
| | |
| | | } |
| | | this.editConfig.visible = true |
| | | this.editConfig.title = "新建" |
| | | }, |
| | | // 删除位置 |
| | | delSelectClick() { |
| | | this.type = 0 |
| | | this.getData() |
| | | } |
| | | } |
| | | } |
| | |
| | | page: this.pagerOptions.currPage, |
| | | pageSize: this.pagerOptions.pageSize |
| | | }).then((res) => { |
| | | if (res.data.code == 200) { |
| | | const list = res.data.data?res.data.data:[] |
| | | if (res.code == 200) { |
| | | const list = res.data?res.data:[] |
| | | this.tableList.tableInfomation = list |
| | | this.pagerOptions.totalCount = res.data.total |
| | | this.pagerOptions.totalCount = res.total |
| | | } |
| | | }) |
| | | }, |