| | |
| | | <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> |
| | | <el-button |
| | | v-if="showEdit && editConfig.infomation.type == 3" |
| | | plain |
| | | size="mini" |
| | | style="margin-left: 15px" |
| | | @click="editClick" |
| | | >编辑</el-button |
| | | > |
| | | </div> |
| | | </div> |
| | | <!-- 内容 --> |
| | |
| | | ref="form" |
| | | :model="editConfig.infomation" |
| | | :rules="rules" |
| | | label-position="left" |
| | | label-width="110px" |
| | | label-position="right" |
| | | label-width="130px" |
| | | size="mini" |
| | | style="height: 60vh; overflow-x: hidden" |
| | | > |
| | | <div> |
| | | <!-- <div>aaa</div> --> |
| | | <FormBtnsView :showPosition="true" :showWarehouse=false @productClick="productClick" /> |
| | | <div class="content-number-bg"> |
| | | <FormBtnsView :showPosition="true" :showPositionCursor="this.editConfig.title != '新建'?true:false" @positionReport="positionReport" :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="client_name"> |
| | | <el-col :span="12" class="line_height_30px"> |
| | | <el-form-item |
| | | label="仓库" |
| | | prop="warehouseId"> |
| | | <el-select |
| | | @change="selWarehouse" |
| | | v-model="editConfig.infomation.warehouseId" |
| | | placeholder="请选择" |
| | | size="mini" |
| | | style="width:90%" |
| | | :disabled="!showFooter" |
| | | > |
| | | <el-option v-for="warehouse in warehouseList" :key="warehouse.id" :label="warehouse.name" :value="warehouse.id"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12" class="line_height_30px"> |
| | | <el-form-item label="位置名称" prop="name"> |
| | | <el-input |
| | | :disabled="showEdit" |
| | | v-model="editConfig.infomation.inspectionScale" |
| | | :disabled="!showFooter" |
| | | v-model="editConfig.infomation.name" |
| | | placeholder="请输入" |
| | | style="width: 90%" |
| | | ></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-col :span="12"> |
| | | <el-form-item label="上级位置" prop="parentId"> |
| | | <el-select |
| | | v-model="editConfig.infomation.parentId" |
| | | placeholder="请选择" |
| | | size="mini" |
| | | :disabled="editCommonConfig.title != '新建'" |
| | | style="width: 90%" |
| | | > |
| | | <el-option v-for="item in positionList" :key="item.id" :label="item.jointName" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <div class="bottom"> |
| | | <div class="purchase-view"> |
| | | <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.infomation.type" |
| | | filterable |
| | | :disabled="editCommonConfig.title != '新建'" |
| | | placeholder="请选择" |
| | | style="width: 90%" |
| | | 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="right" 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="请输入" |
| | | style="width: 90%" |
| | | ></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" |
| | | style="width: 90%" |
| | | > |
| | | </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" |
| | | style="width: 90%" |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </div> |
| | | </div> |
| | | <el-form-item label="备注" prop="notes"> |
| | | <el-input |
| | | :disabled="!showFooter" |
| | | type="textarea" |
| | | placeholder="外部备注" |
| | | :autosize="{ minRows: 3, maxRows: 4 }" |
| | | maxlength="500" |
| | | clearable |
| | | v-model="editConfig.infomation.notes" |
| | | style="width: 96%" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </div> |
| | | |
| | | <div class="bottom"> |
| | | <!-- <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-checkbox |
| | | :disabled="showEdit" |
| | | v-model="editConfig.value2" |
| | | > |
| | | </el-checkbox> |
| | | </el-form-item> |
| | | <el-form-item label="是一个退回位置" prop="desc"> |
| | | <el-checkbox |
| | | :disabled="showEdit" |
| | | v-model="editConfig.value2" |
| | | > |
| | | </el-checkbox> |
| | | </el-form-item> |
| | | <el-form-item label="补充位置" prop="desc"> |
| | | <el-checkbox |
| | | :disabled="showEdit" |
| | | v-model="editConfig.value2" |
| | | > |
| | | </el-checkbox> |
| | | </el-form-item> |
| | | </div> |
| | | <div class="left"> |
| | | <div class="second-label">循环计数</div> |
| | | <el-form-item label="盘点频率(天)" prop="desc"> |
| | | <el-input |
| | | :disabled="showEdit" |
| | | v-model="editConfig.infomation.inspectionScale" |
| | | 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> |
| | | <el-form-item label="预计下一次盘点" prop="desc"> |
| | | <el-input |
| | | :disabled="showEdit" |
| | | v-model="editConfig.infomation.inspectionScale" |
| | | placeholder="请输入" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </div> |
| | | </div> |
| | | <div class="bottom"> |
| | | <div class="left"> |
| | | <div class="second-label">物流</div> |
| | | <el-form-item label="下载策略" prop="desc"> |
| | | <el-select |
| | | v-model="editConfig.value1" |
| | | filterable |
| | | :disabled="showEdit" |
| | | clearable |
| | | placeholder="请选择" |
| | | style="width: 100%" |
| | | no-data-text="暂无数据" |
| | | > |
| | | <el-option |
| | | v-for="item in wareList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | > |
| | | </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> |
| | | <!-- 尾 --> |
| | | <div v-if="showFooter" slot="footer" class="dialog-footer"> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" size="small" @click="saveClick('form')" :disabled="!showFooter">保存</el-button> |
| | | <el-button size="small" @click="editConfig.visible = false">取消</el-button> |
| | | <el-button type="primary" size="small" @click="saveClick('form')">保存</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { addLocation, updateLocation, deleteLocation } from "@/api/warehouseManage/warehouse" |
| | | import { getDataByType } from "@/api/data" |
| | | import {getWarehouseList} from '@/api/warehouseManage/warehouse.js' |
| | | import {getLocationList} from "@/api/overview/overview"; |
| | | export default { |
| | | name: "AddScrapDialog", |
| | | props: { |
| | |
| | | infomation: {} |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | /* positionList: { |
| | | type: [Array] |
| | | }*/ |
| | | }, |
| | | components: {}, |
| | | computed: {}, |
| | | data() { |
| | | return { |
| | | positionList:[], |
| | | warehouseList:[], |
| | | 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" }] |
| | | warehouseId:[{ required: true, message: "请输选择仓库", trigger: "change" }], |
| | | name: [{ required: true, message: "请输入", trigger: "change" }], |
| | | // parentId: [{ required: true, message: "请选择位置类型", trigger: "change" }], |
| | | type: [{ 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() |
| | | this.queryWareHouse(); |
| | | this.queryLocationList(); |
| | | }, |
| | | methods: { |
| | | // 路线 |
| | | productClick() { |
| | | |
| | | async queryWareHouse(){ |
| | | const {code,data}=await getWarehouseList({page:0,pageSize:0,keyword: ""}); |
| | | if(code===200){ |
| | | this.warehouseList=data; |
| | | } |
| | | }, |
| | | queryLocationList(val){ |
| | | getLocationList({ |
| | | warehouseId:val, |
| | | type:3, |
| | | keyWord: "", |
| | | page: 0, |
| | | pageSize: 0, |
| | | }).then((res) => { |
| | | if (res.code == 200) { |
| | | this.positionList=res.data; |
| | | } |
| | | }); |
| | | }, |
| | | selWarehouse(val){ |
| | | this.queryLocationList(val); |
| | | }, |
| | | 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() |
| | | } |
| | | }, |
| | | // 当前库存 |
| | | positionReport(){ |
| | | if(this.editConfig.title != '新建'){ |
| | | this.$router.push({ |
| | | name: "locationReport", |
| | | params: { |
| | | locationId: this.editConfig.infomation.id |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | // 路线 |
| | | productClick() {}, |
| | | // 设置删除/打印/编辑是否显示 |
| | | setBottonView() { |
| | | if (this.editConfig.title === "新建") { |
| | | if (this.editConfig.title === "新建" || this.editConfig.title === "编辑") { |
| | | this.showEdit = false |
| | | this.showFooter = true |
| | | } else if (this.editConfig.infomation.status === "完成") { |
| | |
| | | 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, |
| | | warehouseId:data.warehouseId |
| | | }; |
| | | if (data.id) { |
| | | params.id = data.id |
| | | params.jointName = data.jointName |
| | | } |
| | | 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> |
| | |
| | | .content-status { |
| | | display: flex; |
| | | } |
| | | .content-number-bg { |
| | | margin-top: 10px; |
| | | } |
| | | .basic-info { |
| | | height: calc(100% - 80px); |
| | | overflow: auto; |
| | | margin: 20px; |
| | | border: 1px solid #dcdfe6; |
| | | box-shadow: inset 0 0 2px #dee2e6; |
| | | -moz-box-shadow: inset 0 0 2px #dee2e6; |
| | | -webkit-box-shadow: inset 0 0 2px #dee2e6; |
| | | .basic-info-view { |
| | | margin-top: 20px; |
| | | padding:0 20px; |
| | | |
| | | } |
| | | .bottom{ |
| | | // border: 1px solid #dcdfe6; |
| | | // box-shadow: inset 0 0 2px #dee2e6; |
| | | // -moz-box-shadow: inset 0 0 2px #dee2e6; |
| | | // -webkit-box-shadow: inset 0 0 2px #dee2e6; |
| | | // .basic-info-view { |
| | | // margin-top: 20px; |
| | | // padding: 0 20px; |
| | | // } |
| | | .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; |