| | |
| | | <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> |
| | |
| | | ref="form" |
| | | :model="editConfig.infomation" |
| | | :rules="rules" |
| | | label-position="left" |
| | | label-position="right" |
| | | label-width="100px" |
| | | size="mini" |
| | | style="height: 60vh; overflow-x: hidden" |
| | | > |
| | | <div> |
| | | <!-- <div>aaa</div> --> |
| | | <div class="content-number-bg"> |
| | | <FormBtnsView :showWarehouse="true" @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="name"> |
| | | <el-input :disabled="showEdit" v-model="editConfig.infomation.name" placeholder="请输入"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="缩写" prop="code"> |
| | | <el-input :disabled="showEdit" v-model="editConfig.infomation.code" placeholder="请输入"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="地址" prop="address"> |
| | | <el-input |
| | | :disabled="showEdit" |
| | | v-model="editConfig.infomation.inspectionScale" |
| | | :disabled="showEdit" |
| | | v-model="editConfig.infomation.address" |
| | | placeholder="请输入" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11"> |
| | | <el-form-item label="缩写" prop="client_name"> |
| | | <el-input |
| | | :disabled="showEdit" |
| | | v-model="editConfig.infomation.inspectionScale" |
| | | placeholder="请输入" |
| | | ></el-input> |
| | | <el-col :span="24"> |
| | | <el-form-item label="入向运输" prop="inboundTransportation"> |
| | | <el-radio-group :disabled="showEdit" v-model="editConfig.infomation.inboundTransportation"> |
| | | <el-radio |
| | | style="width: 90%" |
| | | class="line_height_30px" |
| | | v-for="item in inboundTransportationList" |
| | | :key="item.id" |
| | | :disabled="item.disabled" |
| | | :label="item.id" |
| | | >{{ item.name }}</el-radio |
| | | > |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="2"> </el-col> |
| | | <el-col :span="11"> |
| | | <el-form-item label="地址" prop="client_name"> |
| | | <el-input |
| | | :disabled="showEdit" |
| | | v-model="editConfig.infomation.inspectionScale" |
| | | placeholder="请输入" |
| | | ></el-input> |
| | | <el-col :span="24"> |
| | | <el-form-item label="出库运输" prop="outboundTransportation"> |
| | | <el-radio-group :disabled="showEdit" v-model="editConfig.infomation.outboundTransportation"> |
| | | <el-radio |
| | | style="width: 90%" |
| | | class="line_height_30px" |
| | | v-for="item in outboundTransportationList" |
| | | :key="item.id" |
| | | :disabled="item.disabled" |
| | | :label="item.id" |
| | | >{{ item.name }}</el-radio |
| | | > |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <div class="bottom"> |
| | | <!-- <div class="bottom"> |
| | | <el-tabs v-model="activeName" type="card"> |
| | | <el-tab-pane label="仓库配置" name="first"> |
| | | <div class="second-label">运输</div> |
| | | <el-form-item label="入向运输" prop="desc"> |
| | | <el-radio-group |
| | | :disabled="showEdit" |
| | | v-model="editConfig.value1" |
| | | > |
| | | <el-radio style="width:100%;" class="line_height_30px" |
| | | v-for="(item,index) in wareList" |
| | | :key='index' |
| | | :disabled="item.disabled" |
| | | :label="item.id" |
| | | >{{item.name}}</el-radio> |
| | | <el-form-item label="入向运输" prop="inboundTransportation"> |
| | | <el-radio-group :disabled="showEdit" v-model="editConfig.infomation.inboundTransportation"> |
| | | <el-radio |
| | | style="width: 100%" |
| | | class="line_height_30px" |
| | | v-for="item in inboundTransportationList" |
| | | :key="item.id" |
| | | :disabled="item.disabled" |
| | | :label="item.id" |
| | | >{{ item.name }}</el-radio |
| | | > |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="出库运输" prop="desc"> |
| | | <el-radio-group |
| | | :disabled="showEdit" |
| | | v-model="editConfig.value2" |
| | | > |
| | | <el-radio style="width:100%;" class="line_height_30px" |
| | | v-for="(item,index) in wareoutList" |
| | | :key='index' |
| | | :disabled="item.disabled" |
| | | :label="item.id" |
| | | >{{item.name}}</el-radio> |
| | | <el-form-item label="出库运输" prop="outboundTransportation"> |
| | | <el-radio-group :disabled="showEdit" v-model="editConfig.infomation.outboundTransportation"> |
| | | <el-radio |
| | | style="width: 100%" |
| | | class="line_height_30px" |
| | | v-for="item in outboundTransportationList" |
| | | :key="item.id" |
| | | :disabled="item.disabled" |
| | | :label="item.id" |
| | | >{{ item.name }}</el-radio |
| | | > |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </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 { addWarehouse, updateWarehouse, deleteWarehouse } from "@/api/warehouseManage/warehouse" |
| | | import { getDataByType } from "@/api/data" |
| | | export default { |
| | | name: "AddScrapDialog", |
| | | props: { |
| | |
| | | computed: {}, |
| | | data() { |
| | | return { |
| | | activeName:'first', |
| | | activeName: "first", |
| | | 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" }], |
| | | code: [ |
| | | { required: true, message: "请输入", trigger: "change" }, |
| | | { required: true,max:5, message: "长度不能超过5位", trigger: "change" }, |
| | | ] |
| | | }, |
| | | 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, |
| | | } |
| | | ], |
| | | inboundTransportationList: getDataByType("inboundTransportation"), |
| | | outboundTransportationList: getDataByType("outboundTransportation") |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | }, |
| | | methods: { |
| | | // 路线 |
| | | productClick() { |
| | | |
| | | }, |
| | | 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)) |
| | | deleteWarehouse({ 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 = { |
| | | address: data.address, |
| | | buyToResupply: data.buyToResupply, |
| | | code: data.code, |
| | | name: data.name, |
| | | inboundTransportation: data.inboundTransportation, |
| | | outboundTransportation: data.outboundTransportation |
| | | } |
| | | 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 === "新建") { |
| | | addWarehouse(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 { |
| | | updateWarehouse(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; |
| | | // 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{ |
| | | .bottom { |
| | | .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; |
| | |
| | | color: #333; |
| | | } |
| | | } |
| | | .el-tabs--card > .el-tabs__header .el-tabs__nav { |
| | | margin-left: 20px; |
| | | .el-tabs--card > .el-tabs__header { |
| | | border-bottom: none; |
| | | } |
| | | .el-tabs__item.is-active { |
| | | color: #fff; |
| | | background: #2a78fb; |
| | | } |
| | | .el-tabs__item { |
| | | height: 30px; |
| | | line-height: 30px; |
| | | font-size: 13px; |
| | | background: #f3f3f3; |
| | | } |
| | | .el-tabs__item { |
| | | height: 30px; |