Merge branch 'master' of http://192.168.5.5:10010/r/web/WMS
| | |
| | | id: 4 |
| | | } |
| | | ] |
| | | // 仓库 |
| | | // 仓库 |
| | | // 入向运输 |
| | | const inboundTransportation=[ |
| | | const inboundTransportation = [ |
| | | { |
| | | name:'直接接收产品(1步收货)', |
| | | id:1, |
| | | disabled:false, |
| | | name: "直接接收产品(1步收货)", |
| | | id: 1, |
| | | disabled: false |
| | | }, |
| | | { |
| | | name:'接到产品到收料区,再入库(2步收货)', |
| | | id:2, |
| | | disabled:true, |
| | | name: "接到产品到收料区,再入库(2步收货)", |
| | | id: 2, |
| | | disabled: true |
| | | }, |
| | | { |
| | | name:'接收产品到收料区,检验,然后入库(3步收货)', |
| | | id:3, |
| | | disabled:true, |
| | | name: "接收产品到收料区,检验,然后入库(3步收货)", |
| | | id: 3, |
| | | disabled: true |
| | | } |
| | | ] |
| | | // 出库运输 |
| | | const outboundTransportation=[ |
| | | const outboundTransportation = [ |
| | | { |
| | | name:'直接出库(1步)', |
| | | id:1, |
| | | disabled:false, |
| | | name: "直接出库(1步)", |
| | | id: 1, |
| | | disabled: false |
| | | }, |
| | | { |
| | | name:'送到待出库区,再送货(2步发货)', |
| | | id:2, |
| | | disabled:true, |
| | | name: "送到待出库区,再送货(2步发货)", |
| | | id: 2, |
| | | disabled: true |
| | | }, |
| | | { |
| | | name:'包装产品,发送到待出库区,再送货(3步发货)', |
| | | id:3, |
| | | disabled:true, |
| | | name: "包装产品,发送到待出库区,再送货(3步发货)", |
| | | id: 3, |
| | | disabled: true |
| | | } |
| | | ] |
| | | // 业务类型 |
| | | // 作业类型 |
| | | const baseOperationType=[ |
| | | // 作业类型 |
| | | const baseOperationType = [ |
| | | { |
| | | name: "收货", |
| | | name: "入库", |
| | | id: 1 |
| | | }, |
| | | { |
| | | name: "发货", |
| | | name: "出库", |
| | | id: 2 |
| | | }, |
| | | { |
| | | name: "内部调拨", |
| | | id: 3 |
| | | }, |
| | | } |
| | | ] |
| | | //创建欠单 |
| | | const createBackorder=[ |
| | | const createBackorder = [ |
| | | { |
| | | name: "提问", |
| | | id: 1 |
| | |
| | | { |
| | | name: "从不", |
| | | id: 3 |
| | | }, |
| | | } |
| | | ] |
| | | //保留方式 在预定日期之前=3 |
| | | const reservationMethod=[ |
| | | const reservationMethod = [ |
| | | { |
| | | name: "确认时", |
| | | id: 1 |
| | |
| | | id: 2 |
| | | } |
| | | ] |
| | | // 产品类别 |
| | | // 产品类别 |
| | | // 强制下架策略 |
| | | const forceRemovalStrategy=[ |
| | | const forceRemovalStrategy = [ |
| | | { |
| | | name: "First In First Out (FIFO)", |
| | | id: 1 |
| | |
| | | { |
| | | name: "Closest Location", |
| | | id: 3 |
| | | }, |
| | | } |
| | | ] |
| | | //成本方法 |
| | | const costingMethod=[ |
| | | const costingMethod = [ |
| | | { |
| | | name: "标准价格", |
| | | id: 1 |
| | |
| | | { |
| | | name: "平均成本(AVCO)", |
| | | id: 3 |
| | | }, |
| | | } |
| | | ] |
| | | // 库存计价 |
| | | const inventoryValuation=[ |
| | | const inventoryValuation = [ |
| | | { |
| | | name: "手动", |
| | | id: 1 |
| | |
| | | ] |
| | | // 位置 |
| | | // 位置类型 |
| | | const positionType=[ |
| | | const positionType = [ |
| | | { |
| | | name: "供应商位置", |
| | | id: 1 |
| | |
| | | export const getDataByType = (type) => { |
| | | if (type == "purchaseStatus") { |
| | | return purchaseStatus |
| | | }else if(type=='inboundTransportation'){ |
| | | } else if (type == "inboundTransportation") { |
| | | return inboundTransportation |
| | | }else if(type=='outboundTransportation'){ |
| | | } else if (type == "outboundTransportation") { |
| | | return outboundTransportation |
| | | }else if(type=='baseOperationType'){ |
| | | return baseOperationType; |
| | | }else if(type=='createBackorder'){ |
| | | return createBackorder; |
| | | }else if(type=='reservationMethod'){ |
| | | return reservationMethod; |
| | | }else if(type=='forceRemovalStrategy'){ |
| | | } else if (type == "baseOperationType") { |
| | | return baseOperationType |
| | | } else if (type == "createBackorder") { |
| | | return createBackorder |
| | | } else if (type == "reservationMethod") { |
| | | return reservationMethod |
| | | } else if (type == "forceRemovalStrategy") { |
| | | return forceRemovalStrategy |
| | | }else if(type=='costingMethod'){ |
| | | } else if (type == "costingMethod") { |
| | | return costingMethod |
| | | }else if(type=='inventoryValuation'){ |
| | | } else if (type == "inventoryValuation") { |
| | | return inventoryValuation |
| | | }else if(type=='positionType'){ |
| | | return positionType; |
| | | } else if (type == "positionType") { |
| | | return positionType |
| | | } |
| | | } |
| | |
| | | :data="tableList.tableData" |
| | | style="width: 100%" |
| | | :header-cell-style="{ background: '#f1f3f8', color: '#000009' }" |
| | | :row-class-name="tableRowClassName" |
| | | @row-click="tableRowClick" |
| | | > |
| | | <el-table-column v-if="tableList.selectBox" type="selection" width="40" align="center"> </el-table-column> |
| | | <el-table-column v-if="tableList.selectIndex" type="index" label="序号" width="50"> </el-table-column> |
| | | <el-table-column |
| | | v-for="(item, i) in tableList.tableColumn" |
| | | :key="i" |
| | |
| | | :prop="'tableData.' + scope.$index + '.' + item.prop" |
| | | :rules="[{ required: item.isRequird ? true : false, message: '输入不能为空' }]" |
| | | > |
| | | <el-date-picker v-model="scope.row[item.prop]" type="date" size="mini" style="width: 110px"> |
| | | <span v-if="scope.row.isEdit">{{ scope.row[item.prop] }}</span> |
| | | <el-date-picker v-else v-model="scope.row[item.prop]" type="date" size="mini" style="width: 110px"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item |
| | |
| | | :prop="'tableData.' + scope.$index + '.' + item.prop" |
| | | :rules="[{ required: item.isRequird ? true : false, message: '输入不能为空' }]" |
| | | > |
| | | <span v-if="scope.row.isEdit">{{ scope.row[item.prop] }}</span> |
| | | <el-input-number |
| | | v-else |
| | | v-model="scope.row[item.prop]" |
| | | placeholder="" |
| | | :min="0" |
| | |
| | | </el-select> |
| | | </div> |
| | | </el-form-item> |
| | | <!-- 位置 --> |
| | | <el-form-item v-else-if="item.location" label=" " :prop="'tableData.' + scope.$index + '.' + item.prop"> |
| | | <div class="custom-name"> |
| | | <span v-if="scope.row.isEdit">{{ scope.row[item.prop] }}</span> |
| | | <el-select |
| | | v-else |
| | | v-model="scope.row[item.prop]" |
| | | placeholder="请选择" |
| | | size="mini" |
| | | style="width: 80%" |
| | | @change="selLocationClick" |
| | | > |
| | | <el-option v-for="item in selLocationOptions" :key="item.id" :label="item.name" :value="item.name"> |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | | </el-form-item> |
| | | <!-- 产品 --> |
| | | <el-form-item v-else-if="item.product" label=" " :prop="'tableData.' + scope.$index + '.' + item.prop"> |
| | | <div class="custom-name"> |
| | | <span v-if="scope.row.isEdit">{{ scope.row[item.prop] }}</span> |
| | | <el-select |
| | | v-else |
| | | v-model="scope.row[item.prop]" |
| | | placeholder="请选择" |
| | | size="mini" |
| | | style="width: 80%" |
| | | @change=" |
| | | (val) => { |
| | | selProductClick(val) |
| | | } |
| | | " |
| | | > |
| | | <el-option |
| | | v-for="item in productNameOptions" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="{ value: item.id, label: item.name, amount: item.amount, unit: item.unit }" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | | </el-form-item> |
| | | <!-- 用户 --> |
| | | <el-form-item v-else-if="item.user" label=" " :prop="'tableData.' + scope.$index + '.' + item.prop"> |
| | | <div class="custom-name"> |
| | | <span>{{ "管理员" }}</span> |
| | | <!-- <el-select |
| | | v-else |
| | | v-model="scope.row[item.prop]" |
| | | placeholder="请选择" |
| | | size="mini" |
| | | style="width: 80%" |
| | | @change="selCommonClick" |
| | | > |
| | | <el-option v-for="item in memberOptions" :key="item.id" :label="item.name" :value="item.name"> |
| | | </el-option> |
| | | </el-select> --> |
| | | </div> |
| | | </el-form-item> |
| | | <!-- 公司 --> |
| | | <el-form-item v-else-if="item.company" label=" " :prop="'tableData.' + scope.$index + '.' + item.prop"> |
| | | <div class="custom-name"> |
| | | <span v-if="scope.row.isEdit">{{ scope.row[item.prop] }}</span> |
| | | <el-select v-else v-model="scope.row[item.prop]" placeholder="请选择" size="mini" style="width: 80%"> |
| | | <el-option v-for="item in companyOptions" :key="item.id" :label="item.name" :value="item"> |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | | </el-form-item> |
| | | <span v-else>{{ scope.row[item.prop] }}</span> |
| | | </template> |
| | | <span v-else>{{ scope.row[item.prop] }}</span> |
| | |
| | | <slot name="tableButton" /> |
| | | </el-table> |
| | | </el-form> |
| | | <div v-if="!detailEnter" style="margin: 10px"> |
| | | <div v-if="!detailEnter && !isinventory && !islistingrules" style="margin: 10px"> |
| | | <el-button size="small" type="primary" @click="add">添加明细行</el-button> |
| | | <!-- <el-button size="small" type="primary" @click="empty">清空</el-button> --> |
| | | </div> |
| | |
| | | |
| | | <script> |
| | | import { getProductList } from "@/api/product/product" |
| | | import { getLocationList } from "@/api/warehouseManage/warehouse" |
| | | import { getCompanyList } from "@/api/common/other" |
| | | // import SelectCommonDialog from "@/views/other/commonDialog/SelectCommonDialog" |
| | | export default { |
| | | name: "CommmonFormTableView", |
| | |
| | | type: Object, |
| | | default: () => { |
| | | return { |
| | | selectBox: false, |
| | | selectIndex: false, |
| | | tableData: [], // 接口返回数据 |
| | | tableColumn: [ |
| | | // table表单 |
| | |
| | | ] |
| | | } |
| | | } |
| | | }, |
| | | isinventory: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | islistingrules: { |
| | | type: Boolean, |
| | | default: false |
| | | } |
| | | }, |
| | | data() { |
| | |
| | | }, |
| | | productIndex: 0, |
| | | productNameOptions: [], |
| | | memberOptions: [{ id: 1, name: "管理员" }], |
| | | selOptions: [ |
| | | { id: 1, name: "件" }, |
| | | { id: 2, name: "打" } |
| | | ] |
| | | ], |
| | | selLocationOptions: [], // 位置 |
| | | companyOptions: [] // 公司 |
| | | } |
| | | }, |
| | | created() { |
| | | this.getProductList() |
| | | if (this.isinventory) { |
| | | this.getLocationList() |
| | | } |
| | | if (this.islistingrules) { |
| | | this.getLocationList() |
| | | this.getCompanyList() |
| | | } |
| | | this.tableList = this.productTableList |
| | | }, |
| | | computed: {}, |
| | |
| | | } |
| | | }) |
| | | }, |
| | | // 位置 |
| | | async getLocationList() { |
| | | await getLocationList({ |
| | | keyword: "", |
| | | page: 1, |
| | | pageSize: 100 |
| | | }).then((res) => { |
| | | if (res.code === 200) { |
| | | const list = res.data ? res.data : [] |
| | | this.selLocationOptions = list |
| | | } |
| | | }) |
| | | }, |
| | | // 获取公司列表 |
| | | async getCompanyList() { |
| | | await getCompanyList().then((res) => { |
| | | console.log(res) |
| | | if (res.data.code === 200) { |
| | | this.companyOptions = res.data.data |
| | | } |
| | | }) |
| | | }, |
| | | // 选择产品 |
| | | selProductClick(item) { |
| | | this.tableList.tableData.map((ite) => { |
| | |
| | | }) |
| | | console.log(this.tableList.tableData) |
| | | }, |
| | | // 选择单位 |
| | | // 选择位置 |
| | | selLocationClick(item) { |
| | | console.log(item) |
| | | console.log(this.tableList.tableData) |
| | | // this.tableList.tableData.map((ite) => { |
| | | // if (ite.location.label === item.label) { |
| | | // ite.location = item.label |
| | | // } |
| | | // if (ite.subLocation.label === item.label) { |
| | | // ite.subLocation = item.label |
| | | // } |
| | | // }) |
| | | }, |
| | | // 选择单位/用户 |
| | | selCommonClick(item) { |
| | | console.log(item) |
| | | }, |
| | |
| | | return true |
| | | } |
| | | this.tableList.tableData.splice(scope.$index, 1) |
| | | }, |
| | | // 行点击 |
| | | tableRowClick(row) { |
| | | this.$emit("tableRowClick", row, row.index) |
| | | }, |
| | | // 单选行相关 |
| | | tableRowClassName({ row, rowIndex }) { |
| | | row.index = rowIndex |
| | | } |
| | | } |
| | | } |
| | |
| | | margin-bottom: 0; |
| | | .custom-name { |
| | | display: flex; |
| | | justify-content: center; |
| | | .common-select-btn { |
| | | margin-left: 5px; |
| | | font-size: 18px; |
| | |
| | | <div class="search-top"> |
| | | <div class="left"> |
| | | <el-button v-if="showAdd" 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" /> |
| | | </div> |
| | | <el-button v-if="showApply" type="text" size="mini" @click="addBtn" style="margin-left: 10px">{{ |
| | | "应用全部" |
| | | }}</el-button> |
| | | <slot name="leftButton" /> |
| | | </div> |
| | | <div v-if="amountView" class="amount"> |
| | |
| | | type: Boolean, |
| | | default: true |
| | | }, |
| | | showDiscard: { |
| | | default: false |
| | | }, |
| | | showDownload: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | | showApply: { |
| | | type: Boolean, |
| | | default: false |
| | | }, |
| | |
| | | addBtn() { |
| | | this.$emit("addCommonClick") |
| | | }, |
| | | // 丢弃 |
| | | discardBtn() { |
| | | this.$emit("discardBtnClick") |
| | | }, |
| | | // 下载 |
| | | downloadClick() { |
| | | this.$emit("downloadClick") |
| | | }, |
| | | // 丢弃 |
| | | applyBtn() { |
| | | this.$emit("applyBtnClick") |
| | | }, |
| | | // 模具-检查配置 |
| | | inspectionConfigClick() { |
| | |
| | | align-items: center; |
| | | .left { |
| | | display: flex; |
| | | width: 150px; |
| | | width: 210px; |
| | | margin-left: 20px; |
| | | .download { |
| | | width: 30px; |
| | |
| | | const allot = (resolve) => require(["@/views/operate/allot/index"], resolve) // 调拨 |
| | | const scrap = (resolve) => require(["@/views/operate/scrap/index"], resolve) // 报废 |
| | | const inventoryAdjustment = (resolve) => require(["@/views/operate/inventoryAdjustment/index"], resolve) // 库存调整 |
| | | const inventoryAdjustmentHistory = (resolve) => |
| | | require(["@/views/operate/inventoryAdjustment/inventoryAdjustmentHistory"], resolve) // 库存调整历史 |
| | | |
| | | const appconfig = [ |
| | | { |
| | |
| | | meta: { |
| | | title: "库存调整" |
| | | } |
| | | }, |
| | | { |
| | | path: "/operate/inventoryAdjustmentHistory", |
| | | name: "inventoryAdjustmentHistory", |
| | | component: inventoryAdjustmentHistory, |
| | | meta: { |
| | | title: "库存调整 / 历史" |
| | | } |
| | | } |
| | | ] |
| | | |
| | |
| | | <div class="rightContent"> |
| | | <div class="top"> |
| | | <SearchCommonView |
| | | :add-title="'新建'" |
| | | :placeholder="'请输入单号'" |
| | | :add-title="addTitle" |
| | | :show-discard="showDiscard" |
| | | :show-apply="true" |
| | | :placeholder="'请输入位置/产品'" |
| | | :amount-view="false" |
| | | @addCommonClick="addBtnClick" |
| | | @addCommonClick="addProductClick" |
| | | @searchClick="getList" |
| | | @discardBtnClick="discardBtnClick" |
| | | @applyBtnClick="applyBtnClick" |
| | | /> |
| | | </div> |
| | | <div class="list-view"> |
| | | <div class="table"> |
| | | <TableCommonView |
| | | ref="tableListRef" |
| | | :table-list="tableList" |
| | | :show-checkcol="false" |
| | | <CommonFormTableView |
| | | :isinventory="true" |
| | | :product-table-list="tableList" |
| | | @inputContent="inputContent" |
| | | @tableRowClick="tableRowClick" |
| | | ></TableCommonView> |
| | | > |
| | | <template slot="tableButton"> |
| | | <el-table-column label="操作" width="180" fixed="right" align="center"> |
| | | <template slot-scope="scope"> |
| | | <span @click="handleHistoryClick(scope.row)"> |
| | | <i class="el-icon-refresh-left"></i> |
| | | <span>历史</span> |
| | | </span> |
| | | <span v-if="scope.row.isSet" @click="handleSetClick(scope)" class="margin_left_5px"> |
| | | <i class="el-icon-setting"></i> |
| | | <span>设置</span> |
| | | </span> |
| | | <template v-else> |
| | | <span @click="handleUseClick(scope)" class="margin_left_5px"> |
| | | <i class="el-icon-document"></i> |
| | | <span>应用</span> |
| | | </span> |
| | | <span @click="handleCleanupClick(scope)" class="margin_left_5px"> |
| | | <i class="el-icon-delete"></i> |
| | | <span>清除</span> |
| | | </span> |
| | | </template> |
| | | </template> |
| | | </el-table-column> |
| | | </template> |
| | | </CommonFormTableView> |
| | | </div> |
| | | <div class="btn-pager"> |
| | | <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> |
| | | </div> |
| | | </div> |
| | | <!-- 新建/编辑 --> |
| | | <AddDialog |
| | | v-if="editConfig.visible" |
| | | @refresh="refresh" |
| | | :positionList="tableList.tableInfomation" |
| | | :edit-common-config="editConfig" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import CommonFormTableView from "@/components/makepager/CommonFormTableView" |
| | | import pageMixin from "@/components/makepager/pager/mixin/pageMixin" |
| | | import { getLocationList } from "@/api/warehouseManage/warehouse" |
| | | import AddDialog from "@/views/warehouseManage/position/AddDialog" |
| | | import { getDataByType } from "@/api/data" |
| | | export default { |
| | | name: "InventoryAdjustment", |
| | | props: {}, |
| | | components: { AddDialog }, |
| | | components: { CommonFormTableView }, |
| | | mixins: [pageMixin], |
| | | computed: {}, |
| | | data() { |
| | | return { |
| | | addTitle: "新建", |
| | | showDiscard: false, |
| | | tableList: {}, |
| | | tableData: [ |
| | | { |
| | | location: "HC/销售区", |
| | | productName: "夏季真丝吊带裙", |
| | | amount: "0.00", |
| | | unit: "件", |
| | | count: "0.00", |
| | | date: "2023-12-31", |
| | | user: "管理员", |
| | | isSet: true, |
| | | isEdit: true |
| | | } |
| | | ], |
| | | searchOptions: [], |
| | | editConfig: { |
| | | visible: false, |
| | | title: "新建", |
| | | infomation: {} |
| | | }, |
| | | positionTypeList: getDataByType("positionType") |
| | | countId: 0, |
| | | isNoProduct: true, // 添加明细行时是否有产品未选择 |
| | | isRowClick: false |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | methods: { |
| | | setTable() { |
| | | this.tableList = { |
| | | tableInfomation: [], |
| | | tableData: this.tableData, |
| | | selectBox: true, |
| | | showcol: this.showcol, |
| | | allcol: [], |
| | | tableColumn: this.setTableColumn(this.showcol) |
| | | tableColumn: [ |
| | | { label: "位置", prop: "location", location: true }, |
| | | { label: "产品", prop: "productName", product: true }, |
| | | { label: "在库数量", prop: "amount" }, |
| | | { label: "计量单位", prop: "unit" }, |
| | | { label: "计数的数量", prop: "count", inputFloat: true }, |
| | | { label: "差异", prop: "difference" }, |
| | | { label: "日期", prop: "date", date: true }, |
| | | { label: "用户", prop: "user", user: true } |
| | | ] |
| | | } |
| | | let allcol = [] |
| | | for (let i = 0; i < this.tableList.tableColumn.length; i++) { |
| | | if (!this.tableList.tableColumn[i].default) { |
| | | const label = this.tableList.tableColumn[i].label |
| | | allcol.push(label) |
| | | }, |
| | | // 操作输入 |
| | | inputContent(val, prop, row) { |
| | | this.countId = row.countId |
| | | this.tableData.map((item) => { |
| | | if (item.countId === row.countId) { |
| | | item[prop] = val |
| | | } |
| | | }) |
| | | }, |
| | | // 新增 |
| | | addProductClick() { |
| | | console.log(this.tableData) |
| | | this.isSel() |
| | | if (this.isNoProduct && this.addTitle === "新建") { |
| | | this.addTitle = "保存" |
| | | this.showDiscard = true |
| | | this.isRowClick = false |
| | | this.countId++ |
| | | this.tableData.push({ |
| | | countId: this.countId, |
| | | productId: "", |
| | | amount: 0, |
| | | unit: "", |
| | | productName: "", |
| | | count: "0.00", |
| | | isSet: true, |
| | | isEdit: false |
| | | }) |
| | | } else if (this.isNoProduct && this.addTitle === "保存") { |
| | | this.addTitle = "新建" |
| | | this.showDiscard = false |
| | | } |
| | | }, |
| | | // 是否选择产品 |
| | | isSel() { |
| | | for (let i = 0; i < this.tableData.length; i++) { |
| | | if (this.tableData[i].productName.length === 0) { |
| | | this.isNoProduct = false |
| | | break |
| | | } else { |
| | | this.isNoProduct = true |
| | | } |
| | | } |
| | | this.tableList.allcol = allcol |
| | | }, |
| | | setTableColumn(showcol) { |
| | | console.log(showcol) |
| | | let tableColumn = [ |
| | | { |
| | | label: "位置", |
| | | prop: "jointName", |
| | | isShowColumn: true, |
| | | default: true |
| | | }, |
| | | { |
| | | label: "位置类型", |
| | | prop: "type", |
| | | isShowColumn: true, |
| | | default: true, |
| | | conversion: true, |
| | | getStatus: this.getTypesList |
| | | } |
| | | ] |
| | | return tableColumn |
| | | }, |
| | | getTypesList(val) { |
| | | let string = "--" |
| | | if (val) { |
| | | for (let i in this.positionTypeList) { |
| | | if (this.positionTypeList[i].id == val) { |
| | | return this.positionTypeList[i].name |
| | | } |
| | | } |
| | | // 取消 |
| | | discardBtnClick() { |
| | | if (this.isRowClick) { |
| | | this.tableData.map((item) => { |
| | | item.isEdit = true |
| | | }) |
| | | } else { |
| | | this.tableData.splice(this.tableData.length - 1, 1) |
| | | } |
| | | return string |
| | | this.addTitle = "新建" |
| | | this.showDiscard = false |
| | | }, |
| | | selTableCol(val) { |
| | | this.showcol = val |
| | | this.tableList.tableColumn = this.setTableColumn(val) |
| | | // 应用全部 |
| | | applyBtnClick() { |
| | | console.log("应用全部") |
| | | }, |
| | | // 历史 |
| | | handleHistoryClick(row) { |
| | | this.isSel() |
| | | console.log(row) |
| | | if (this.isNoProduct) { |
| | | console.log("历史") |
| | | this.$router.push({ |
| | | name: "inventoryAdjustmentHistory", |
| | | params: { id: row.id } |
| | | }) |
| | | } |
| | | }, |
| | | // 设置 |
| | | handleSetClick(scope) { |
| | | this.isSel() |
| | | if (this.isNoProduct) { |
| | | scope.row.isSet = !scope.row.isSet |
| | | } |
| | | }, |
| | | // 应用 |
| | | handleUseClick(scope) { |
| | | scope.row.isSet = !scope.row.isSet |
| | | }, |
| | | // 清除 |
| | | handleCleanupClick(scope) { |
| | | scope.row.isSet = !scope.row.isSet |
| | | }, |
| | | // 行点击 |
| | | tableRowClick(row, rowIndex) { |
| | | console.log(row, rowIndex) |
| | | this.addTitle = "保存" |
| | | this.showDiscard = true |
| | | this.isRowClick = true |
| | | this.isSel() |
| | | if (!this.isNoProduct) { |
| | | this.tableData.splice(this.tableData.length - 1, 1) |
| | | } |
| | | this.tableData.map((item, index) => { |
| | | if (index === rowIndex) { |
| | | item.isEdit = false |
| | | } else { |
| | | item.isEdit = true |
| | | } |
| | | }) |
| | | }, |
| | | // 请求数据 |
| | | async getData() { |
| | |
| | | } |
| | | }) |
| | | }, |
| | | refresh() { |
| | | this.pagerOptions.currPage = 1 |
| | | this.getData() |
| | | }, |
| | | // 搜索 |
| | | getList(val) { |
| | | this.keyword = val |
| | | this.pagerOptions.currPage = 1 |
| | | this.getData() |
| | | }, |
| | | // 行点击 |
| | | tableRowClick(row) { |
| | | console.log(row) |
| | | this.editConfig.title = "编辑" |
| | | this.editConfig.infomation = { ...row } |
| | | this.editConfig.infomation.parentId = Number(this.editConfig.infomation.parentId) |
| | | this.editConfig.visible = true |
| | | }, |
| | | // 新建 |
| | | addBtnClick() { |
New file |
| | |
| | | <template> |
| | | <div class="rightContent"> |
| | | <div class="top"> |
| | | <SearchCommonView |
| | | :show-add="false" |
| | | :placeholder="'请输入单号/产品'" |
| | | :amount-view="false" |
| | | @searchClick="getList" |
| | | /> |
| | | </div> |
| | | <div class="list-view"> |
| | | <div class="table"> |
| | | <TableCommonView ref="tableListRef" :table-list="tableList" @selTableCol="selTableCol"></TableCommonView> |
| | | </div> |
| | | <div class="btn-pager"> |
| | | <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import pageMixin from "@/components/makepager/pager/mixin/pageMixin" |
| | | import { getAllList } from "@/api/overview/overview" |
| | | |
| | | export default { |
| | | name: "InventoryAdjustmentHistory", |
| | | props: {}, |
| | | components: {}, |
| | | mixins: [pageMixin], |
| | | computed: {}, |
| | | data() { |
| | | return { |
| | | tableList: {}, |
| | | showcol: ["状态"], |
| | | searchOptions: [], |
| | | keyword: "" |
| | | } |
| | | }, |
| | | created() { |
| | | this.setTable() |
| | | this.getData() |
| | | }, |
| | | methods: { |
| | | setTable() { |
| | | this.tableList = { |
| | | tableInfomation: [], |
| | | selectBox: true, |
| | | showcol: this.showcol, |
| | | allcol: [], |
| | | tableColumn: this.setTableColumn(this.showcol) |
| | | } |
| | | let allcol = [] |
| | | for (let i = 0; i < this.tableList.tableColumn.length; i++) { |
| | | if (!this.tableList.tableColumn[i].default) { |
| | | const label = this.tableList.tableColumn[i].label |
| | | allcol.push(label) |
| | | } |
| | | } |
| | | this.tableList.allcol = allcol |
| | | }, |
| | | setTableColumn(showcol) { |
| | | let tableColumn = [ |
| | | { |
| | | label: "日期", |
| | | prop: "operationDate", |
| | | isShowColumn: true, |
| | | default: true, |
| | | date: true |
| | | }, |
| | | { |
| | | label: "单号", |
| | | prop: "number", |
| | | isShowColumn: true, |
| | | default: true |
| | | }, |
| | | { |
| | | label: "产品", |
| | | prop: "productName", |
| | | isShowColumn: true, |
| | | default: true |
| | | }, |
| | | { |
| | | label: "从", |
| | | prop: "from", |
| | | isShowColumn: true, |
| | | default: true |
| | | }, |
| | | { |
| | | label: "至", |
| | | prop: "to", |
| | | isShowColumn: true, |
| | | default: true |
| | | }, |
| | | { |
| | | label: "数量", |
| | | prop: "amount", |
| | | isShowColumn: true, |
| | | default: true |
| | | }, |
| | | { |
| | | label: "单位", |
| | | prop: "unit", |
| | | isShowColumn: true, |
| | | default: true |
| | | }, |
| | | { |
| | | label: "状态", |
| | | prop: "status", |
| | | width: 120, |
| | | isShowColumn: showcol.includes("状态"), |
| | | default: false, |
| | | status: true, |
| | | isCallMethod: true, |
| | | getCallMethod: this.getStatus |
| | | }, |
| | | { |
| | | label: "完成者", |
| | | prop: "user", |
| | | isShowColumn: showcol.includes("完成者"), |
| | | default: false |
| | | } |
| | | ] |
| | | return tableColumn |
| | | }, |
| | | selTableCol(val) { |
| | | this.showcol = val |
| | | this.tableList.tableColumn = this.setTableColumn(val) |
| | | }, |
| | | // 请求数据 |
| | | async getData() { |
| | | await getAllList({ |
| | | number: this.keyword, |
| | | page: this.pagerOptions.currPage, |
| | | pageSize: this.pagerOptions.pageSize, |
| | | sourceNumber: this.keyword |
| | | }).then((res) => { |
| | | if (res.code === 200) { |
| | | const list = res.data.map((item) => { |
| | | return { |
| | | ...item, |
| | | from: item.fromLocation.name, |
| | | to: item.toLocation.name |
| | | } |
| | | }) |
| | | this.tableList.tableInfomation = list || [] |
| | | this.pagerOptions.totalCount = res.total |
| | | } |
| | | }) |
| | | }, |
| | | // 搜索 |
| | | getList(val) { |
| | | console.log(val) |
| | | this.keyword = val |
| | | this.pagerOptions.currPage = 1 |
| | | this.getData() |
| | | }, |
| | | // 状态 |
| | | getStatus(val) { |
| | | return val === 1 ? "草稿" : val === 3 ? "就绪" : "完成" |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <!-- Add "scoped" attribute to limit CSS to this component only --> |
| | | <style lang="scss" scoped></style> |
| | |
| | | <div class="rightContent"> |
| | | <div class="top"> |
| | | <SearchCommonView |
| | | :add-title="'新建'" |
| | | :placeholder="'请输入单号'" |
| | | :add-title="addTitle" |
| | | :show-discard="showDiscard" |
| | | :placeholder="'请输入位置/产品'" |
| | | :amount-view="false" |
| | | @addCommonClick="addBtnClick" |
| | | @addCommonClick="addProductClick" |
| | | @searchClick="getList" |
| | | @discardBtnClick="discardBtnClick" |
| | | @applyBtnClick="applyBtnClick" |
| | | /> |
| | | </div> |
| | | <div class="list-view"> |
| | | <div class="table"> |
| | | <TableCommonView |
| | | ref="tableListRef" |
| | | :table-list="tableList" |
| | | :show-checkcol="false" |
| | | <CommonFormTableView |
| | | :islistingrules="true" |
| | | :product-table-list="tableList" |
| | | @inputContent="inputContent" |
| | | @tableRowClick="tableRowClick" |
| | | ></TableCommonView> |
| | | > |
| | | </CommonFormTableView> |
| | | </div> |
| | | <div class="btn-pager"> |
| | | <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" /> |
| | | </div> |
| | | </div> |
| | | <!-- 新建/编辑 --> |
| | | <AddDialog |
| | | v-if="editConfig.visible" |
| | | @refresh="refresh" |
| | | :positionList="tableList.tableInfomation" |
| | | :edit-common-config="editConfig" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import CommonFormTableView from "@/components/makepager/CommonFormTableView" |
| | | import pageMixin from "@/components/makepager/pager/mixin/pageMixin" |
| | | import { getLocationList } from "@/api/warehouseManage/warehouse" |
| | | import AddDialog from "@/views/warehouseManage/position/AddDialog" |
| | | import { getDataByType } from "@/api/data" |
| | | export default { |
| | | name: "ListingRules", |
| | | name: "listingRules", |
| | | props: {}, |
| | | components: { AddDialog }, |
| | | components: { CommonFormTableView }, |
| | | mixins: [pageMixin], |
| | | computed: {}, |
| | | data() { |
| | | return { |
| | | addTitle: "新建", |
| | | showDiscard: false, |
| | | tableList: {}, |
| | | tableData: [ |
| | | { |
| | | location: "HC/销售区", |
| | | productName: "夏季真丝吊带裙", |
| | | amount: "0.00", |
| | | unit: "件", |
| | | count: "0.00", |
| | | date: "2023-12-31", |
| | | user: "管理员", |
| | | isSet: true, |
| | | isEdit: true |
| | | }, |
| | | { |
| | | location: "HM/销售区", |
| | | productName: "夏季真丝吊带裙", |
| | | productCategory: "", |
| | | subLocation: "A区", |
| | | companyName: "贝思科", |
| | | isSet: true, |
| | | isEdit: true |
| | | } |
| | | ], |
| | | searchOptions: [], |
| | | editConfig: { |
| | | visible: false, |
| | | title: "新建", |
| | | infomation: {} |
| | | }, |
| | | positionTypeList: getDataByType("positionType") |
| | | countId: 0, |
| | | isNoProduct: true, // 添加明细行时是否有产品未选择 |
| | | isRowClick: false |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | methods: { |
| | | setTable() { |
| | | this.tableList = { |
| | | tableInfomation: [], |
| | | tableData: this.tableData, |
| | | selectBox: true, |
| | | showcol: this.showcol, |
| | | allcol: [], |
| | | tableColumn: this.setTableColumn(this.showcol) |
| | | tableColumn: [ |
| | | { label: "当产品到达", prop: "location", location: true }, |
| | | { label: "产品", prop: "productName", product: true }, |
| | | // { label: "产品类别", prop: "productCategory", productCategory: true }, |
| | | { label: "存储到子位置", prop: "subLocation", location: true }, |
| | | { label: "公司", prop: "companyName", company: true } |
| | | ] |
| | | } |
| | | let allcol = [] |
| | | for (let i = 0; i < this.tableList.tableColumn.length; i++) { |
| | | if (!this.tableList.tableColumn[i].default) { |
| | | const label = this.tableList.tableColumn[i].label |
| | | allcol.push(label) |
| | | } |
| | | } |
| | | this.tableList.allcol = allcol |
| | | }, |
| | | setTableColumn(showcol) { |
| | | console.log(showcol) |
| | | let tableColumn = [ |
| | | { |
| | | label: "位置", |
| | | prop: "jointName", |
| | | isShowColumn: true, |
| | | default: true |
| | | }, |
| | | { |
| | | label: "位置类型", |
| | | prop: "type", |
| | | isShowColumn: true, |
| | | default: true, |
| | | conversion: true, |
| | | getStatus: this.getTypesList |
| | | // 操作输入 |
| | | inputContent(val, prop, row) { |
| | | this.countId = row.countId |
| | | this.tableData.map((item) => { |
| | | if (item.countId === row.countId) { |
| | | item[prop] = val |
| | | } |
| | | ] |
| | | return tableColumn |
| | | }) |
| | | }, |
| | | getTypesList(val) { |
| | | let string = "--" |
| | | if (val) { |
| | | for (let i in this.positionTypeList) { |
| | | if (this.positionTypeList[i].id == val) { |
| | | return this.positionTypeList[i].name |
| | | // 新增 |
| | | addProductClick() { |
| | | console.log(this.tableData) |
| | | this.isSel() |
| | | if (this.isNoProduct && this.addTitle === "新建") { |
| | | this.addTitle = "保存" |
| | | this.showDiscard = true |
| | | this.isRowClick = false |
| | | this.countId++ |
| | | this.tableData.push({ |
| | | countId: this.countId, |
| | | productId: "", |
| | | location: 0, |
| | | subLocation: "", |
| | | productName: "", |
| | | companyName: "", |
| | | isSet: true, |
| | | isEdit: false |
| | | }) |
| | | } else if (this.isNoProduct && this.addTitle === "保存") { |
| | | this.addTitle = "新建" |
| | | this.showDiscard = false |
| | | this.tableData.map((item) => { |
| | | item.isEdit = true |
| | | console.log(item) |
| | | if (typeof item.location === "object") { |
| | | item.location = item.location.name |
| | | } |
| | | if (typeof item.subLocation === "object") { |
| | | item.location = item.subLocation.name |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | // 是否选择产品 |
| | | isSel() { |
| | | for (let i = 0; i < this.tableData.length; i++) { |
| | | if (this.tableData[i].productName.length === 0) { |
| | | this.isNoProduct = false |
| | | break |
| | | } else { |
| | | this.isNoProduct = true |
| | | } |
| | | } |
| | | return string |
| | | }, |
| | | selTableCol(val) { |
| | | this.showcol = val |
| | | this.tableList.tableColumn = this.setTableColumn(val) |
| | | // 取消 |
| | | discardBtnClick() { |
| | | if (this.isRowClick) { |
| | | this.tableData.map((item) => { |
| | | item.isEdit = true |
| | | }) |
| | | } else { |
| | | this.tableData.splice(this.tableData.length - 1, 1) |
| | | } |
| | | this.addTitle = "新建" |
| | | this.showDiscard = false |
| | | }, |
| | | // 应用全部 |
| | | applyBtnClick() { |
| | | console.log("应用全部") |
| | | }, |
| | | // 历史 |
| | | handleHistoryClick(row) { |
| | | this.isSel() |
| | | console.log(row) |
| | | if (this.isNoProduct) { |
| | | console.log("历史") |
| | | this.$router.push({ |
| | | name: "inventoryAdjustmentHistory", |
| | | params: { id: row.id } |
| | | }) |
| | | } |
| | | }, |
| | | // 设置 |
| | | handleSetClick(scope) { |
| | | this.isSel() |
| | | if (this.isNoProduct) { |
| | | scope.row.isSet = !scope.row.isSet |
| | | } |
| | | }, |
| | | // 应用 |
| | | handleUseClick(scope) { |
| | | scope.row.isSet = !scope.row.isSet |
| | | }, |
| | | // 清除 |
| | | handleCleanupClick(scope) { |
| | | scope.row.isSet = !scope.row.isSet |
| | | }, |
| | | // 行点击 |
| | | tableRowClick(row, rowIndex) { |
| | | console.log(row, rowIndex) |
| | | this.addTitle = "保存" |
| | | this.showDiscard = true |
| | | this.isRowClick = true |
| | | this.isSel() |
| | | if (!this.isNoProduct) { |
| | | this.tableData.splice(this.tableData.length - 1, 1) |
| | | } |
| | | this.tableData.map((item, index) => { |
| | | if (index === rowIndex) { |
| | | item.isEdit = false |
| | | } else { |
| | | item.isEdit = true |
| | | } |
| | | }) |
| | | }, |
| | | // 请求数据 |
| | | async getData() { |
| | |
| | | } |
| | | }) |
| | | }, |
| | | refresh() { |
| | | this.pagerOptions.currPage = 1 |
| | | this.getData() |
| | | }, |
| | | // 搜索 |
| | | getList(val) { |
| | | this.keyword = val |
| | | this.pagerOptions.currPage = 1 |
| | | this.getData() |
| | | }, |
| | | // 行点击 |
| | | tableRowClick(row) { |
| | | console.log(row) |
| | | this.editConfig.title = "编辑" |
| | | this.editConfig.infomation = { ...row } |
| | | this.editConfig.infomation.parentId = Number(this.editConfig.infomation.parentId) |
| | | this.editConfig.visible = true |
| | | }, |
| | | // 新建 |
| | | addBtnClick() { |
| | |
| | | > |
| | | <div> |
| | | <!-- <div>aaa</div> --> |
| | | <FormBtnsView :showPosition="true" :showWarehouse=false @productClick="productClick" /> |
| | | <FormBtnsView :showPosition="true" :showWarehouse="false" @productClick="productClick" /> |
| | | </div> |
| | | <div class="basic-info"> |
| | | <div class="basic-info-view"> |
| | | |
| | | <el-row> |
| | | <el-col :span="24" class="line_height_30px"> |
| | | <el-form-item label="位置名称" prop="name"> |
| | | <el-input |
| | | :disabled="!showFooter" |
| | | :disabled="!showFooter" |
| | | v-model="editConfig.infomation.name" |
| | | placeholder="请输入" |
| | | ></el-input> |
| | |
| | | style="width: 45%" |
| | | :disabled="!showFooter" |
| | | > |
| | | <el-option |
| | | v-for="item in positionList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | > |
| | | <el-option v-for="item in positionList" :key="item.id" :label="item.name" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | </el-row> |
| | | </div> |
| | | <div class="bottom"> |
| | | <div class="left"> |
| | | <div class="second-label">其他信息</div> |
| | | <el-form-item label="位置类型" prop="type"> |
| | | <el-select |
| | | v-model="editConfig.infomation.type" |
| | | filterable |
| | | :disabled="!showFooter" |
| | | placeholder="请选择" |
| | | style="width: 100%" |
| | | no-data-text="暂无数据" |
| | | > |
| | | <el-option |
| | | v-for="item in positionTypeList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="是一个报废位置" v-if="editConfig.infomation.type==3||editConfig.infomation.type==5" prop="isScrapLocation"> |
| | | <el-checkbox |
| | | <div class="left"> |
| | | <div class="second-label">其他信息</div> |
| | | <el-form-item label="位置类型" prop="type"> |
| | | <el-select |
| | | v-model="editConfig.infomation.type" |
| | | filterable |
| | | :disabled="!showFooter" |
| | | v-model="editConfig.infomation.isScrapLocation" |
| | | > |
| | | </el-checkbox> |
| | | </el-form-item> |
| | | <el-form-item label="是一个退回位置" prop="isReturnLocation"> |
| | | <el-checkbox |
| | | placeholder="请选择" |
| | | style="width: 100%" |
| | | no-data-text="暂无数据" |
| | | > |
| | | <el-option v-for="item in positionTypeList" :key="item.id" :label="item.name" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item |
| | | label="是一个报废位置" |
| | | v-if="editConfig.infomation.type == 3 || editConfig.infomation.type == 5" |
| | | prop="isScrapLocation" |
| | | > |
| | | <el-checkbox :disabled="!showFooter" v-model="editConfig.infomation.isScrapLocation"> </el-checkbox> |
| | | </el-form-item> |
| | | <el-form-item label="是一个退回位置" prop="isReturnLocation"> |
| | | <el-checkbox :disabled="!showFooter" v-model="editConfig.infomation.isReturnLocation"> </el-checkbox> |
| | | </el-form-item> |
| | | <el-form-item label="补充位置" v-if="editConfig.infomation.type == 3" prop="replenishLocation"> |
| | | <el-checkbox :disabled="!showFooter" v-model="editConfig.infomation.replenishLocation"> </el-checkbox> |
| | | </el-form-item> |
| | | </div> |
| | | <div class="left" v-if="editConfig.infomation.type == 3 || editConfig.infomation.type == 7"> |
| | | <div class="second-label">循环计数</div> |
| | | <el-form-item label="盘点频率(天)" prop="countFrequency"> |
| | | <el-input |
| | | :disabled="!showFooter" |
| | | v-model="editConfig.infomation.isReturnLocation" |
| | | > |
| | | </el-checkbox> |
| | | </el-form-item> |
| | | <el-form-item label="补充位置" v-if="editConfig.infomation.type==3" prop="replenishLocation"> |
| | | <el-checkbox |
| | | v-model="editConfig.infomation.countFrequency" |
| | | placeholder="请输入" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="最近有效盘点" prop="recentlyCount"> |
| | | <el-date-picker |
| | | :disabled="!showFooter" |
| | | v-model="editConfig.infomation.replenishLocation" |
| | | > |
| | | </el-checkbox> |
| | | </el-form-item> |
| | | </div> |
| | | <div class="left" v-if="editConfig.infomation.type==3||editConfig.infomation.type==7"> |
| | | <div class="second-label">循环计数</div> |
| | | <el-form-item label="盘点频率(天)" prop="countFrequency"> |
| | | <el-input |
| | | :disabled="!showFooter" |
| | | v-model="editConfig.infomation.countFrequency" |
| | | placeholder="请输入" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="最近有效盘点" prop="recentlyCount"> |
| | | <el-date-picker |
| | | :disabled="!showFooter" |
| | | v-model="editConfig.infomation.recentlyCount" |
| | | type="date" |
| | | placeholder="选择日期" |
| | | value-format="yyyy-MM-dd" |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="预计下一次盘点" prop="nextCount"> |
| | | <el-date-picker |
| | | :disabled="!showFooter" |
| | | v-model="editConfig.infomation.nextCount" |
| | | type="date" |
| | | placeholder="选择日期" |
| | | value-format="yyyy-MM-dd" |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </div> |
| | | v-model="editConfig.infomation.recentlyCount" |
| | | type="date" |
| | | placeholder="选择日期" |
| | | value-format="yyyy-MM-dd" |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="预计下一次盘点" prop="nextCount"> |
| | | <el-date-picker |
| | | :disabled="!showFooter" |
| | | v-model="editConfig.infomation.nextCount" |
| | | type="date" |
| | | placeholder="选择日期" |
| | | value-format="yyyy-MM-dd" |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </div> |
| | | </div> |
| | | <el-form-item label="" prop="notes" label-width="20px"> |
| | | <el-input |
| | | :disabled="!showFooter" |
| | | type="textarea" |
| | | placeholder="外部备注" |
| | | :autosize="{ minRows: 3, maxRows: 4 }" |
| | | maxlength="500" |
| | | clearable |
| | | v-model="editConfig.infomation.notes" |
| | | ></el-input> |
| | | <el-input |
| | | :disabled="!showFooter" |
| | | type="textarea" |
| | | placeholder="外部备注" |
| | | :autosize="{ minRows: 3, maxRows: 4 }" |
| | | maxlength="500" |
| | | clearable |
| | | v-model="editConfig.infomation.notes" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <div class="bottom"> |
| | | <!-- <div class="left"> --> |
| | | <!-- <div class="second-label">物流</div> --> |
| | | <!-- <el-form-item label="下载策略" prop="desc"> |
| | | <!-- <div class="second-label">物流</div> --> |
| | | <!-- <el-form-item label="下载策略" prop="desc"> |
| | | <el-select |
| | | v-model="editConfig.value1" |
| | | filterable |
| | |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> --> |
| | | <!-- </div> --> |
| | | <!-- </div> --> |
| | | </div> |
| | | </div> |
| | | </el-form> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { addLocation,updateLocation,deleteLocation } from "@/api/warehouseManage/warehouse" |
| | | import { getDataByType } from "@/api/data"; |
| | | import { addLocation, updateLocation, deleteLocation } from "@/api/warehouseManage/warehouse" |
| | | import { getDataByType } from "@/api/data" |
| | | export default { |
| | | name: "AddScrapDialog", |
| | | props: { |
| | |
| | | } |
| | | } |
| | | }, |
| | | positionList:{ |
| | | type:[Array] |
| | | positionList: { |
| | | type: [Array] |
| | | } |
| | | }, |
| | | components: {}, |
| | |
| | | editConfig: this.editCommonConfig, |
| | | rules: { |
| | | name: [{ required: true, message: "请输入", trigger: "change" }], |
| | | countFrequency: [{ |
| | | countFrequency: [ |
| | | { |
| | | required: false, |
| | | message: "请填写不小于0的数字", |
| | | trigger: "change", |
| | | trigger: "change" |
| | | }, |
| | | { |
| | | validator: this.validatorNum, |
| | | trigger: "blur", |
| | | },], |
| | | trigger: "blur" |
| | | } |
| | | ] |
| | | }, |
| | | showEdit: false, // 是否显示编辑按钮 |
| | | showFooter: false, // 是否显示取消保存 |
| | | positionTypeList: getDataByType("positionType"), |
| | | positionTypeList: getDataByType("positionType") |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | validatorNum(rule, value, callback) { |
| | | if (value) { |
| | | if (value == undefined || value == null) { |
| | | callback(new Error("请输入有效数字")); |
| | | callback(new Error("请输入有效数字")) |
| | | } else { |
| | | var reg = /^\+?[0-9]\d*$/; |
| | | var reg = /^\+?[0-9]\d*$/ |
| | | if (!reg.test(value)) { |
| | | callback(new Error("请填写不小于0的数字")); |
| | | callback(new Error("请填写不小于0的数字")) |
| | | } else { |
| | | callback(); |
| | | callback() |
| | | } |
| | | } |
| | | } else { |
| | | callback(); |
| | | callback() |
| | | } |
| | | }, |
| | | // 路线 |
| | | productClick() { |
| | | |
| | | }, |
| | | productClick() {}, |
| | | // 设置删除/打印/编辑是否显示 |
| | | setBottonView() { |
| | | if (this.editConfig.title === "新建") { |
| | |
| | | }, |
| | | // 刪除 |
| | | deleteClick() { |
| | | let data = JSON.parse(JSON.stringify(this.editConfig.infomation)); |
| | | let data = JSON.parse(JSON.stringify(this.editConfig.infomation)) |
| | | deleteLocation({ id: data.id }).then((res) => { |
| | | if (res.code == 200) { |
| | | this.editConfig.visible = false; |
| | | this.$message.success("刪除成功!"); |
| | | this.$emit("refresh"); |
| | | this.editConfig.visible = false |
| | | this.$message.success("刪除成功!") |
| | | this.$emit("refresh") |
| | | } else { |
| | | this.$message.warning(res.msg?res.msg:"删除失败!") |
| | | } |
| | | }); |
| | | this.$message.warning(res.msg ? res.msg : "删除失败!") |
| | | } |
| | | }) |
| | | }, |
| | | // 编辑 |
| | | editClick() { |
| | |
| | | this.showFooter = true |
| | | }, |
| | | saveParams() { |
| | | let data =JSON.parse(JSON.stringify(this.editConfig.infomation)); |
| | | |
| | | let data = JSON.parse(JSON.stringify(this.editConfig.infomation)) |
| | | |
| | | let params = { |
| | | name:data.name, |
| | | parentId:data.parentId+'', |
| | | type:data.type, |
| | | isScrapLocation:data.isScrapLocation, |
| | | isReturnLocation:data.isReturnLocation, |
| | | replenishLocation:data.replenishLocation, |
| | | countFrequency:data.countFrequency?Number(data.countFrequency):0, |
| | | recentlyCount:data.recentlyCount, |
| | | nextCount:data.nextCount, |
| | | notes:data.notes, |
| | | name: data.name, |
| | | parentId: data.parentId, |
| | | type: data.type, |
| | | isScrapLocation: data.isScrapLocation, |
| | | isReturnLocation: data.isReturnLocation, |
| | | replenishLocation: data.replenishLocation, |
| | | countFrequency: data.countFrequency ? Number(data.countFrequency) : 0, |
| | | recentlyCount: data.recentlyCount, |
| | | nextCount: data.nextCount, |
| | | notes: data.notes |
| | | } |
| | | if(data.id){ |
| | | params.id=data.id |
| | | if (data.id) { |
| | | params.id = data.id |
| | | } |
| | | return params; |
| | | return params |
| | | }, |
| | | // 保存 |
| | | saveClick(formName) { |
| | | this.$refs[formName].validate((valid) => { |
| | | if (valid) { |
| | | const params = this.saveParams(); |
| | | if (this.editConfig.title === "新建") { |
| | | addLocation(params).then((res) => { |
| | | if (res.code == 200) { |
| | | this.editConfig.visible = false; |
| | | this.$message.success("添加成功!"); |
| | | this.$emit('refresh') |
| | | } else { |
| | | this.$message.warning(res.msg?res.msg:"添加失败!") |
| | | } |
| | | }); |
| | | } else { |
| | | updateLocation(params).then((res) => { |
| | | if (res.code == 200) { |
| | | this.editConfig.visible = false; |
| | | this.$message.success("编辑成功!"); |
| | | this.$emit('refresh') |
| | | } else { |
| | | this.$message.warning(res.msg?res.msg:"编辑失败!") |
| | | } |
| | | }); |
| | | } |
| | | }else { |
| | | console.log("error submit"); |
| | | return false; |
| | | const params = this.saveParams() |
| | | if (this.editConfig.title === "新建") { |
| | | addLocation(params).then((res) => { |
| | | if (res.code == 200) { |
| | | this.editConfig.visible = false |
| | | this.$message.success("添加成功!") |
| | | this.$emit("refresh") |
| | | } else { |
| | | this.$message.warning(res.msg ? res.msg : "添加失败!") |
| | | } |
| | | }) |
| | | } else { |
| | | updateLocation(params).then((res) => { |
| | | if (res.code == 200) { |
| | | this.editConfig.visible = false |
| | | this.$message.success("编辑成功!") |
| | | this.$emit("refresh") |
| | | } else { |
| | | this.$message.warning(res.msg ? res.msg : "编辑失败!") |
| | | } |
| | | }) |
| | | } |
| | | } else { |
| | | console.log("error submit") |
| | | return false |
| | | } |
| | | }); |
| | | }) |
| | | } |
| | | } |
| | | } |
| | |
| | | -webkit-box-shadow: inset 0 0 2px #dee2e6; |
| | | .basic-info-view { |
| | | margin-top: 20px; |
| | | padding:0 20px; |
| | | |
| | | padding: 0 20px; |
| | | } |
| | | .bottom{ |
| | | .bottom { |
| | | display: flex; |
| | | margin-left: 20px; |
| | | .left { |
| | | width: calc(50% - 10px); |
| | | margin-right:20px; |
| | | margin-right: 20px; |
| | | } |
| | | .right { |
| | | width: calc(50% - 10px); |
| | | } |
| | | .second-label { |
| | | |
| | | border-bottom: 1px solid #d9d9d9; |
| | | margin-bottom: 10px; |
| | | } |
| | | ::v-deep .el-tabs__content{ |
| | | ::v-deep .el-tabs__content { |
| | | padding: 0 20px; |
| | | } |
| | | } |
| | | |
| | | } |
| | | .purchase-view { |
| | | display: flex; |
| | |
| | | </div> |
| | | </div> |
| | | <!-- 新建/编辑 --> |
| | | <AddDialog v-if="editConfig.visible" @refresh="refresh" :positionList="tableList.tableInfomation" :edit-common-config="editConfig" /> |
| | | <AddDialog |
| | | v-if="editConfig.visible" |
| | | @refresh="refresh" |
| | | :positionList="tableList.tableInfomation" |
| | | :edit-common-config="editConfig" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import pageMixin from "@/components/makepager/pager/mixin/pageMixin" |
| | | import { getLocationList } from "@/api/warehouseManage/warehouse" |
| | | import AddDialog from "@/views/warehouseManage/position/AddDialog" |
| | | import { getDataByType } from "@/api/data"; |
| | | import { getDataByType } from "@/api/data" |
| | | export default { |
| | | name: "WarehouseView", |
| | | props: {}, |
| | |
| | | title: "新建", |
| | | infomation: {} |
| | | }, |
| | | positionTypeList: getDataByType("positionType"), |
| | | positionTypeList: getDataByType("positionType") |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | isShowColumn: true, |
| | | default: true, |
| | | conversion: true, |
| | | getStatus: this.getTypesList, |
| | | getStatus: this.getTypesList |
| | | } |
| | | ] |
| | | return tableColumn |
| | | }, |
| | | getTypesList(val){ |
| | | let string='--' |
| | | if(val){ |
| | | getTypesList(val) { |
| | | let string = "--" |
| | | if (val) { |
| | | for (let i in this.positionTypeList) { |
| | | if (this.positionTypeList[i].id == val) { |
| | | return this.positionTypeList[i].name; |
| | | return this.positionTypeList[i].name |
| | | } |
| | | } |
| | | } |
| | | return string; |
| | | return string |
| | | }, |
| | | selTableCol(val) { |
| | | this.showcol = val |
| | |
| | | pageSize: this.pagerOptions.pageSize |
| | | }).then((res) => { |
| | | if (res.code === 200) { |
| | | const list = res.data?res.data:[] |
| | | const list = res.data ? res.data : [] |
| | | this.tableList.tableInfomation = list |
| | | this.pagerOptions.totalCount = res.total |
| | | } |
| | | }) |
| | | }, |
| | | refresh(){ |
| | | this.pagerOptions.currPage=1 |
| | | refresh() { |
| | | this.pagerOptions.currPage = 1 |
| | | this.getData() |
| | | }, |
| | | // 搜索 |
| | | getList(val) { |
| | | this.keyword=val; |
| | | this.pagerOptions.currPage=1 |
| | | this.keyword = val |
| | | this.pagerOptions.currPage = 1 |
| | | this.getData() |
| | | }, |
| | | // 行点击 |
| | |
| | | console.log(row) |
| | | this.editConfig.title = "编辑" |
| | | this.editConfig.infomation = { ...row } |
| | | this.editConfig.infomation.parentId=Number(this.editConfig.infomation.parentId); |
| | | this.editConfig.infomation.parentId = Number(this.editConfig.infomation.parentId) |
| | | this.editConfig.visible = true |
| | | }, |
| | | // 新建 |
| | | addBtnClick() { |
| | | this.editConfig.infomation={ |
| | | name:'', |
| | | parentId:null, |
| | | type:3, |
| | | isScrapLocation:null, |
| | | isReturnLocation:null, |
| | | replenishLocation:null, |
| | | countFrequency:0, |
| | | recentlyCount:'', |
| | | nextCount:'', |
| | | notes:'', |
| | | this.editConfig.infomation = { |
| | | name: "", |
| | | parentId: null, |
| | | type: 3, |
| | | isScrapLocation: null, |
| | | isReturnLocation: null, |
| | | replenishLocation: null, |
| | | countFrequency: 0, |
| | | recentlyCount: "", |
| | | nextCount: "", |
| | | notes: "" |
| | | } |
| | | this.editConfig.visible = true |
| | | this.editConfig.title = "新建" |