| | |
| | | id: 2 |
| | | } |
| | | ] |
| | | // 位置 |
| | | // 位置类型 |
| | | const positionType=[ |
| | | { |
| | | name: "供应商位置", |
| | | id: 1 |
| | | }, |
| | | { |
| | | name: "视图", |
| | | id: 2 |
| | | }, |
| | | { |
| | | name: "内部位置", |
| | | id: 3 |
| | | }, |
| | | { |
| | | name: "客户位置", |
| | | id: 4 |
| | | }, |
| | | { |
| | | name: "库存损失", |
| | | id: 5 |
| | | }, |
| | | { |
| | | name: "生产", |
| | | id: 6 |
| | | }, |
| | | { |
| | | name: "中转位置", |
| | | id: 7 |
| | | } |
| | | ] |
| | | export const getDataByType = (type) => { |
| | | if (type == "purchaseStatus") { |
| | | return purchaseStatus |
| | |
| | | return costingMethod |
| | | }else if(type=='inventoryValuation'){ |
| | | return inventoryValuation |
| | | }else if(type=='positionType'){ |
| | | return positionType; |
| | | } |
| | | } |
| | |
| | | data |
| | | }) |
| | | } |
| | | // 位置 列表 |
| | | export function getLocationList(data) { |
| | | return request({ |
| | | url: "/api-wms/v1/location/getLocationList", |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
| | | // 创建位置 |
| | | export function addLocation(data) { |
| | | return request({ |
| | | url: "/api-wms/v1/location/addLocation", |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
| | | // 删除位置 |
| | | export function deleteLocation(data) { |
| | | return request({ |
| | | url: "/api-wms/v1/location/deleteLocation/"+data.id, |
| | | method: "delete", |
| | | data |
| | | }) |
| | | } |
| | | // 位置 详情 |
| | | export function getLocationDetails(data) { |
| | | return request({ |
| | | url: "/api-wms/v1/location/getLocationDetails/"+data.id, |
| | | method: "get", |
| | | data |
| | | }) |
| | | } |
| | | // 更新位置 |
| | | export function updateLocation(data) { |
| | | return request({ |
| | | url: "/api-wms/v1/location/updateLocation", |
| | | method: "post", |
| | | data |
| | | }) |
| | | } |
| | | |
| | |
| | | padding: 0; |
| | | } |
| | | } |
| | | |
| | | .color_F56C6C{ |
| | | color:#F56C6C; |
| | | } |
| | | // .el-menu-item { |
| | | // margin: 8px; |
| | | // border-radius: 6px; |
| | |
| | | :style="{ color: new Date().getTime() > new Date(scope.row[item.prop]).getTime() ? '#D23F3A' : '#606266' }" |
| | | >{{ timeAgo(scope.row[item.prop]) }}</span |
| | | > |
| | | <div v-else-if="item.conversion"> |
| | | <span>{{ item.getStatus(scope.row[item.prop]) }}</span> |
| | | </div> |
| | | <span |
| | | v-else-if="item.isClick && scope.row[item.prop]" |
| | | :class="item.className ? item.className : 'sel-name'" |
| | |
| | | <div class="basic-info-view"> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <div style="margin-left: 20px">类别</div> |
| | | <div style="margin-left: 20px"><span class="color_F56C6C">*</span>类别</div> |
| | | <el-form-item label="" prop="name" label-width="20px"> |
| | | <el-input |
| | | v-model="editConfig.infomation.name" |
| | |
| | | updateProductCategory, |
| | | deleteProductCategory, |
| | | } from "@/api/product/productCategory"; |
| | | |
| | | import { getDataByType } from "@/api/data"; |
| | | export default { |
| | | name: "AddProductCategoryDialog", |
| | |
| | | deleteProductCategory({ id: data.id }).then((res) => { |
| | | if (res.code === 200) { |
| | | this.editConfig.visible = false; |
| | | this.$message.success("刪除成功"); |
| | | this.$message.success("刪除成功!"); |
| | | this.$emit("refresh"); |
| | | } |
| | | } else { |
| | | this.$message.warning(res.msg?res.msg:"删除失败!") |
| | | } |
| | | }); |
| | | }, |
| | | // 编辑 |
| | |
| | | addProductCategory(params).then((res) => { |
| | | if (res.code === 200) { |
| | | this.editConfig.visible = false; |
| | | this.$message.success("添加成功"); |
| | | this.$message.success("添加成功!"); |
| | | this.$emit("refresh"); |
| | | } |
| | | } else { |
| | | this.$message.warning(res.msg?res.msg:"添加失败!") |
| | | } |
| | | }); |
| | | } else { |
| | | updateProductCategory(params).then((res) => { |
| | | if (res.code === 200) { |
| | | this.editConfig.visible = false; |
| | | this.$message.success("编辑成功"); |
| | | this.$message.success("编辑成功!"); |
| | | this.$emit("refresh"); |
| | | } |
| | | } else { |
| | | this.$message.warning(res.msg?res.msg:"编辑失败!") |
| | | } |
| | | }); |
| | | } |
| | | } else { |
| | |
| | | <div class="top"> |
| | | <SearchCommonView |
| | | :add-title="'新建'" |
| | | :placeholder="'请输入单号'" |
| | | :placeholder="'请输入产品类型'" |
| | | :amount-view="false" |
| | | @addCommonClick="addBtnClick" |
| | | @searchClick="getList" |
| | |
| | | <span>打印</span> |
| | | </span> |
| | | <span class="btn" style="margin-left: 15px"> |
| | | <i class="el-icon-s-tools"></i> |
| | | <span>动作</span> |
| | | <el-button plain size="mini" style="margin-left: 15px" @click="deleteClick">删除</el-button> |
| | | </span> |
| | | <el-button v-if="showEdit" plain size="mini" style="margin-left: 15px" @click="editClick">编辑</el-button> |
| | | </div> |
| | |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <div style="margin-left: 20px">入库类型</div> |
| | | <el-form-item label="" prop="client_name" label-width="20px"> |
| | | <el-form-item label="" prop="name" label-width="20px"> |
| | | <el-input |
| | | v-model="editConfig.infomation.client_name" |
| | | placeholder="" |
| | | v-model="editConfig.infomation.name" |
| | | placeholder="请填写" |
| | | :disabled="!showFooter" |
| | | style="width: 85%" |
| | | ></el-input> |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="序号前缀" prop="client_name" :label-width="labelWidth"> |
| | | <el-form-item label="序号前缀" prop="prefix" :label-width="labelWidth"> |
| | | <el-input |
| | | v-model="editConfig.infomation.client_name" |
| | | v-model="editConfig.infomation.prefix" |
| | | placeholder="" |
| | | :disabled="!showFooter" |
| | | style="width: 85%" |
| | |
| | | <el-form-item |
| | | v-if="editConfig.infomation.baseOperationType === 1" |
| | | label="预填写作业详情" |
| | | prop="showOperations" |
| | | prop="earlyOperations" |
| | | > |
| | | <el-checkbox v-model="editConfig.infomation.showOperations"></el-checkbox> |
| | | <el-checkbox v-model="editConfig.infomation.earlyOperations"></el-checkbox> |
| | | </el-form-item> |
| | | </div> |
| | | </div> |
| | |
| | | style="width: 85%" |
| | | :disabled="!showFooter" |
| | | > |
| | | <el-option v-for="item in locationList" :key="item.id" :label="item.username" :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> |
| | |
| | | style="width: 85%" |
| | | :disabled="!showFooter" |
| | | > |
| | | <el-option v-for="item in locationList" :key="item.id" :label="item.username" :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> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { addOperationType,updateOperationType,getWarehouseList,deleteOperationType} from "@/api/warehouseManage/warehouse" |
| | | import { addOperationType,updateOperationType,getWarehouseList,deleteOperationType,getLocationList} from "@/api/warehouseManage/warehouse" |
| | | import { getDataByType } from "@/api/data"; |
| | | export default { |
| | | name: "AddBussinessType", |
| | |
| | | editConfig: this.editCommonConfig, |
| | | rules: { |
| | | // 入库类型 |
| | | client_name: [{ required: true, message: "请输入", trigger: "change" }], |
| | | name: [{ required: true, message: "请输入", trigger: "change" }], |
| | | // 前缀 |
| | | number: [{ required: true, message: "请输入", trigger: "change" }], |
| | | prefix: [{ required: true, message: "请输入", trigger: "change" }], |
| | | baseOperationType: [{ required: true, message: "请选择", trigger: "change" }], |
| | | }, |
| | | // 位置 |
| | |
| | | showEdit: false, // 是否显示编辑按钮 |
| | | isDelClick: false, // 删除按钮是否可点击 |
| | | showFooter: false, // 是否显示取消保存 |
| | | labelWidth: "90px" |
| | | labelWidth: "90px", |
| | | positionlist:[], |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | methods: { |
| | | // 仓库 |
| | | async getWarehouse() { |
| | | await getLocationList({ |
| | | keyword:'', |
| | | page: 0, |
| | | pageSize: 0 |
| | | }).then((res) => { |
| | | if (res.code === 200) { |
| | | this.positionlist = res.data?res.data:[] |
| | | this.$forceUpdate() |
| | | } |
| | | }) |
| | | await getWarehouseList({ |
| | | keyword: '', |
| | | page: 0, |
| | |
| | | deleteOperationType({ id: data.id }).then((res) => { |
| | | if (res.code === 200) { |
| | | this.editConfig.visible = false; |
| | | this.$message.success("刪除成功"); |
| | | this.$message.success("刪除成功!"); |
| | | this.$emit("refresh"); |
| | | } |
| | | } else { |
| | | this.$message.warning(res.msg?res.msg:"删除失败!") |
| | | } |
| | | }); |
| | | }, |
| | | // 编辑 |
| | |
| | | let data =JSON.parse(JSON.stringify(this.editConfig.infomation)); |
| | | |
| | | let params = { |
| | | // 入库类型 |
| | | name:data.name, |
| | | // 前缀 |
| | | prefix:data.prefix, |
| | | // 作业类型 |
| | | baseOperationType:data.baseOperationType, |
| | | // 退货类型 |
| | |
| | | warehouseId:data.warehouseId, |
| | | // 显示作业详情 |
| | | showOperations:data.showOperations, |
| | | earlyOperations:data.earlyOperations, |
| | | // 保留方式 |
| | | reservationMethod:data.reservationMethod, |
| | | // 默认原位置 |
| | |
| | | addOperationType(params).then((res) => { |
| | | if (res.code === 200) { |
| | | this.editConfig.visible = false; |
| | | this.$message.success("添加成功"); |
| | | this.$message.success("添加成功!"); |
| | | this.$emit('refresh') |
| | | } else { |
| | | this.$message.warning(res.msg?res.msg:"添加失败!") |
| | | } |
| | | }); |
| | | } else { |
| | | updateOperationType(params).then((res) => { |
| | | if (res.code === 200) { |
| | | this.editConfig.visible = false; |
| | | this.$message.success("编辑成功"); |
| | | this.$message.success("编辑成功!"); |
| | | this.$emit('refresh') |
| | | } else { |
| | | this.$message.warning(res.msg?res.msg:"编辑失败!") |
| | | } |
| | | }); |
| | | } |
| | |
| | | <div class="top"> |
| | | <SearchCommonView |
| | | :add-title="'新建'" |
| | | :placeholder="'请输入单号'" |
| | | :placeholder="'请输入入库类型'" |
| | | :amount-view="false" |
| | | @addCommonClick="addBtnClick" |
| | | @searchClick="getList" |
| | |
| | | let tableColumn = [ |
| | | { |
| | | label: "入库类型", |
| | | prop: "id", |
| | | prop: "name", |
| | | isShowColumn: true, |
| | | default: true |
| | | }, |
| | |
| | | addBtnClick() { |
| | | this.editConfig.title = "新建" |
| | | this.editConfig.infomation={ |
| | | name:'', |
| | | prefix:'', |
| | | // 作业类型 |
| | | baseOperationType:null, |
| | | // 退货类型 |
| | |
| | | warehouseId:null, |
| | | // 显示作业详情 |
| | | showOperations:null, |
| | | earlyOperations:null, |
| | | // 保留方式 |
| | | reservationMethod:null, |
| | | // 默认原位置 |
| | |
| | | <span>打印</span> |
| | | </span> |
| | | <span class="btn" style="margin-left: 15px"> |
| | | <i class="el-icon-s-tools"></i> |
| | | <span>动作</span> |
| | | <el-button plain size="mini" style="margin-left: 15px" @click="deleteClick">删除</el-button> |
| | | </span> |
| | | <el-button v-if="showEdit" plain size="mini" style="margin-left: 15px" @click="editClick">编辑</el-button> |
| | | </div> |
| | |
| | | |
| | | <el-row> |
| | | <el-col :span="24" class="line_height_30px"> |
| | | <el-form-item label="位置名称" prop="client_name"> |
| | | <el-form-item label="位置名称" prop="name"> |
| | | <el-input |
| | | :disabled="showEdit" |
| | | v-model="editConfig.infomation.inspectionScale" |
| | | :disabled="!showFooter" |
| | | v-model="editConfig.infomation.name" |
| | | placeholder="请输入" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="上级位置" prop="client_name"> |
| | | <el-input |
| | | :disabled="showEdit" |
| | | v-model="editConfig.infomation.inspectionScale" |
| | | placeholder="请输入" |
| | | ></el-input> |
| | | <el-form-item label="上级位置" prop="parentId"> |
| | | <el-select |
| | | v-model="editConfig.infomation.parentId" |
| | | placeholder="请选择" |
| | | size="mini" |
| | | style="width: 45%" |
| | | :disabled="!showFooter" |
| | | > |
| | | <el-option |
| | | v-for="item in positionList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | <div class="bottom"> |
| | | <div class="left"> |
| | | <div class="second-label">其他信息</div> |
| | | <el-form-item label="位置类型" prop="desc"> |
| | | <el-form-item label="位置类型" prop="type"> |
| | | <el-select |
| | | v-model="editConfig.value1" |
| | | v-model="editConfig.infomation.type" |
| | | filterable |
| | | :disabled="showEdit" |
| | | clearable |
| | | :disabled="!showFooter" |
| | | placeholder="请选择" |
| | | style="width: 100%" |
| | | no-data-text="暂无数据" |
| | | > |
| | | <el-option |
| | | v-for="item in wareList" |
| | | 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="是一个报废位置" prop="desc"> |
| | | </el-form-item> |
| | | <el-form-item label="是一个报废位置" v-if="editConfig.infomation.type==3||editConfig.infomation.type==5" prop="isScrapLocation"> |
| | | <el-checkbox |
| | | :disabled="showEdit" |
| | | v-model="editConfig.value2" |
| | | :disabled="!showFooter" |
| | | v-model="editConfig.infomation.isScrapLocation" |
| | | > |
| | | </el-checkbox> |
| | | </el-form-item> |
| | | <el-form-item label="是一个退回位置" prop="desc"> |
| | | <el-form-item label="是一个退回位置" prop="isReturnLocation"> |
| | | <el-checkbox |
| | | :disabled="showEdit" |
| | | v-model="editConfig.value2" |
| | | :disabled="!showFooter" |
| | | v-model="editConfig.infomation.isReturnLocation" |
| | | > |
| | | </el-checkbox> |
| | | </el-form-item> |
| | | <el-form-item label="补充位置" prop="desc"> |
| | | <el-form-item label="补充位置" v-if="editConfig.infomation.type==3" prop="replenishLocation"> |
| | | <el-checkbox |
| | | :disabled="showEdit" |
| | | v-model="editConfig.value2" |
| | | :disabled="!showFooter" |
| | | v-model="editConfig.infomation.replenishLocation" |
| | | > |
| | | </el-checkbox> |
| | | </el-form-item> |
| | | </div> |
| | | <div class="left"> |
| | | <div class="left" v-if="editConfig.infomation.type==3||editConfig.infomation.type==7"> |
| | | <div class="second-label">循环计数</div> |
| | | <el-form-item label="盘点频率(天)" prop="desc"> |
| | | <el-form-item label="盘点频率(天)" prop="countFrequency"> |
| | | <el-input |
| | | :disabled="showEdit" |
| | | v-model="editConfig.infomation.inspectionScale" |
| | | :disabled="!showFooter" |
| | | v-model="editConfig.infomation.countFrequency" |
| | | placeholder="请输入" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="最近有效盘点" prop="desc"> |
| | | <el-input |
| | | :disabled="showEdit" |
| | | v-model="editConfig.infomation.inspectionScale" |
| | | placeholder="请输入" |
| | | ></el-input> |
| | | <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="desc"> |
| | | <el-input |
| | | :disabled="showEdit" |
| | | v-model="editConfig.infomation.inspectionScale" |
| | | placeholder="请输入" |
| | | ></el-input> |
| | | <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-form-item> |
| | | <div class="bottom"> |
| | | <div class="left"> |
| | | <div class="second-label">物流</div> |
| | | <el-form-item label="下载策略" prop="desc"> |
| | | <!-- <div class="left"> --> |
| | | <!-- <div class="second-label">物流</div> --> |
| | | <!-- <el-form-item label="下载策略" prop="desc"> |
| | | <el-select |
| | | v-model="editConfig.value1" |
| | | filterable |
| | | :disabled="showEdit" |
| | | :disabled="!showFooter" |
| | | clearable |
| | | placeholder="请选择" |
| | | style="width: 100%" |
| | |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="外部备注" prop="desc"> |
| | | <el-input |
| | | :disabled="showEdit" |
| | | type="textarea" |
| | | :autosize="{ minRows: 3, maxRows: 4 }" |
| | | maxlength="500" |
| | | clearable |
| | | v-model="editConfig.value1" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </div> |
| | | </el-form-item> --> |
| | | <!-- </div> --> |
| | | </div> |
| | | </div> |
| | | </el-form> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { addLocation,updateLocation,deleteLocation } from "@/api/warehouseManage/warehouse" |
| | | import { getDataByType } from "@/api/data"; |
| | | export default { |
| | | name: "AddScrapDialog", |
| | | props: { |
| | |
| | | infomation: {} |
| | | } |
| | | } |
| | | }, |
| | | positionList:{ |
| | | type:[Array] |
| | | } |
| | | }, |
| | | components: {}, |
| | |
| | | dialogWidth: "50%", |
| | | editConfig: this.editCommonConfig, |
| | | rules: { |
| | | |
| | | number: [{ required: true, message: "请输入退款单编号", trigger: "blur" }], |
| | | refundDate: [{ required: true, message: "请选择退款日期", trigger: "change" }], |
| | | memberId: [{ required: true, message: "请选择销售负责人", trigger: "change" }], |
| | | sale_return_nunber: [{ required: true, message: "请选择销售退货单", trigger: "change" }] |
| | | name: [{ required: true, message: "请输入", trigger: "change" }], |
| | | countFrequency: [{ |
| | | required: false, |
| | | message: "请填写不小于0的数字", |
| | | trigger: "change", |
| | | }, |
| | | { |
| | | validator: this.validatorNum, |
| | | trigger: "blur", |
| | | },], |
| | | }, |
| | | memberOptions: [], |
| | | paymentTypeListOptions: [], |
| | | showEdit: false, // 是否显示编辑按钮 |
| | | showFooter: false, // 是否显示取消保存 |
| | | currentState: "todo", // 当前状态 |
| | | wareList:[ |
| | | { |
| | | name:'直接接收产品(1步收货)', |
| | | id:1, |
| | | disabled:false, |
| | | }, |
| | | { |
| | | name:'接到产品到收料区,再入库(2步收货)', |
| | | id:2, |
| | | disabled:true, |
| | | }, |
| | | { |
| | | name:'接收产品到收料区,检验,然后入库(3步收货)', |
| | | id:3, |
| | | disabled:true, |
| | | } |
| | | ], |
| | | wareoutList:[ |
| | | { |
| | | name:'直接出库(1步)', |
| | | id:1, |
| | | disabled:false, |
| | | }, |
| | | { |
| | | name:'送到待出库区,再送货(2步发货)', |
| | | id:2, |
| | | disabled:true, |
| | | }, |
| | | { |
| | | name:'包装产品,发送到待出库区,再送货(3步发货)', |
| | | id:3, |
| | | disabled:true, |
| | | } |
| | | ], |
| | | positionTypeList: getDataByType("positionType"), |
| | | } |
| | | }, |
| | | created() { |
| | | this.setBottonView() |
| | | }, |
| | | methods: { |
| | | validatorNum(rule, value, callback) { |
| | | if (value) { |
| | | if (value == undefined || value == null) { |
| | | callback(new Error("请输入有效数字")); |
| | | } else { |
| | | var reg = /^\+?[0-9]\d*$/; |
| | | if (!reg.test(value)) { |
| | | callback(new Error("请填写不小于0的数字")); |
| | | } else { |
| | | callback(); |
| | | } |
| | | } |
| | | } else { |
| | | callback(); |
| | | } |
| | | }, |
| | | // 路线 |
| | | productClick() { |
| | | |
| | |
| | | handleClose() { |
| | | this.editConfig.visible = false |
| | | }, |
| | | // 刪除 |
| | | deleteClick() { |
| | | 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"); |
| | | } else { |
| | | this.$message.warning(res.msg?res.msg:"删除失败!") |
| | | } |
| | | }); |
| | | }, |
| | | // 编辑 |
| | | editClick() { |
| | | this.showEdit = false |
| | | this.showFooter = true |
| | | }, |
| | | saveParams() { |
| | | 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, |
| | | } |
| | | if(data.id){ |
| | | params.id=data.id |
| | | } |
| | | return params; |
| | | }, |
| | | // 保存 |
| | | saveClick() {} |
| | | 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; |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | </div> |
| | | </div> |
| | | <!-- 新建/编辑 --> |
| | | <AddDialog v-if="editConfig.visible" :edit-common-config="editConfig" /> |
| | | <AddDialog v-if="editConfig.visible" @refresh="refresh" :positionList="tableList.tableInfomation" :edit-common-config="editConfig" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import pageMixin from "@/components/makepager/pager/mixin/pageMixin" |
| | | import { getProductList } from "@/api/product/product" |
| | | // import DetailProduct from "@/views/productManage/product/DetailProduct" |
| | | import { getLocationList } from "@/api/warehouseManage/warehouse" |
| | | import AddDialog from "@/views/warehouseManage/position/AddDialog" |
| | | |
| | | import { getDataByType } from "@/api/data"; |
| | | export default { |
| | | name: "WarehouseView", |
| | | props: {}, |
| | |
| | | visible: false, |
| | | title: "新建", |
| | | infomation: {} |
| | | } |
| | | }, |
| | | positionTypeList: getDataByType("positionType"), |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | let tableColumn = [ |
| | | { |
| | | label: "位置", |
| | | prop: "id", |
| | | prop: "jointName", |
| | | isShowColumn: true, |
| | | default: true |
| | | }, |
| | | { |
| | | label: "位置类型", |
| | | prop: "deviceName", |
| | | prop: "type", |
| | | isShowColumn: true, |
| | | default: 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; |
| | | } |
| | | } |
| | | } |
| | | return string; |
| | | }, |
| | | selTableCol(val) { |
| | | this.showcol = val |
| | | this.tableList.tableColumn = this.setTableColumn(val) |
| | | }, |
| | | // 请求数据 |
| | | async getData(val, content) { |
| | | await getProductList({ |
| | | [val]: content, |
| | | async getData() { |
| | | await getLocationList({ |
| | | keyword: this.keyword, |
| | | page: this.pagerOptions.currPage, |
| | | pageSize: this.pagerOptions.pageSize |
| | | }).then((res) => { |
| | | if (res.data.code === 200) { |
| | | const list = res.data.data.list.map((item) => { |
| | | return { |
| | | ...item, |
| | | supplierNumber: item.supplier.number, |
| | | status: "草稿", |
| | | preTime: "2023-09-04 11:20:00" |
| | | } |
| | | }) |
| | | this.tableList.tableInfomation = list || [] |
| | | this.pagerOptions.totalCount = res.data.data.total |
| | | if (res.code === 200) { |
| | | const list = res.data?res.data:[] |
| | | this.tableList.tableInfomation = list |
| | | this.pagerOptions.totalCount = res.total |
| | | } |
| | | }) |
| | | }, |
| | | refresh(){ |
| | | this.pagerOptions.currPage=1 |
| | | this.getData() |
| | | }, |
| | | // 搜索 |
| | | getList(val) { |
| | | console.log(val) |
| | | this.keyword=val; |
| | | this.pagerOptions.currPage=1 |
| | | this.getData() |
| | | }, |
| | | // 行点击 |
| | | tableRowClick(row) { |
| | | console.log(row) |
| | | this.editConfig.visible = true |
| | | this.editConfig.title = "编辑" |
| | | this.editConfig.infomation = { ...row } |
| | | 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.visible = true |
| | | this.editConfig.title = "新建" |
| | | } |
| | |
| | | deleteWarehouse({ id: data.id }).then((res) => { |
| | | if (res.code === 200) { |
| | | this.editConfig.visible = false; |
| | | this.$message.success("刪除成功"); |
| | | this.$message.success("刪除成功!"); |
| | | this.$emit("refresh"); |
| | | } |
| | | }else { |
| | | this.$message.warning(res.msg?res.msg:"刪除失败!") |
| | | } |
| | | }); |
| | | }, |
| | | // 编辑 |
| | |
| | | addWarehouse(params).then((res) => { |
| | | if (res.code === 200) { |
| | | this.editConfig.visible = false; |
| | | this.$message.success("添加成功"); |
| | | this.$message.success("添加成功!"); |
| | | this.$emit('refresh') |
| | | }else { |
| | | this.$message.warning(res.msg?res.msg:"添加失败!") |
| | | } |
| | | }); |
| | | } else { |
| | | updateWarehouse(params).then((res) => { |
| | | if (res.code === 200) { |
| | | this.editConfig.visible = false; |
| | | this.$message.success("编辑成功"); |
| | | this.$message.success("编辑成功!"); |
| | | this.$emit('refresh') |
| | | }else { |
| | | this.$message.warning(res.msg?res.msg:"编辑失败!") |
| | | } |
| | | }); |
| | | } |
| | |
| | | }, |
| | | { |
| | | label: "库存位置", |
| | | prop: "deviceName", |
| | | prop: "warehouseLocation", |
| | | isShowColumn: true, |
| | | default: true |
| | | }, |
| | |
| | | }, |
| | | // 行点击 |
| | | tableRowClick(row) { |
| | | this.editConfig.visible = true |
| | | this.editConfig.title = "编辑" |
| | | this.editConfig.infomation = { ...row } |
| | | this.editConfig.visible = true |
| | | }, |
| | | // 新建 |
| | | addBtnClick() { |
| | | this.editConfig.visible = true |
| | | this.editConfig.infomation={ |
| | | address:'', |
| | | buyToResupply:'', |
| | | buyToResupply:null, |
| | | code:'', |
| | | name:'', |
| | | inboundTransportation:1, |
| | | outboundTransportation:1, |
| | | } |
| | | this.editConfig.visible = true |
| | | this.editConfig.title = "新建" |
| | | } |
| | | } |