| | |
| | | <div slot="title" class="dialog-header"> |
| | | <span>{{ editCommonConfig.title === "查看" ? editCommonConfig.title : editCommonConfig.title + addName }}</span> |
| | | <div class="header_btns"> |
| | | <span class="btn" @click="btnPrint"> |
| | | <span class="btn" :style="{cursor:thatCursor,color:thatColor}" @click="btnPrint" :disabled="true"> |
| | | <i class="el-icon-printer"></i> |
| | | <span>打印</span> |
| | | </span> |
| | |
| | | </div> |
| | | <!-- 物流信息 --> |
| | | <div v-if="activeName === 'two' && this.workType === 2"> |
| | | <el-form :rules="rules" ref="shipmentsInfo" label-position="right" :model="shipmentsInfo" label-width="120px" size="mini" |
| | | <el-form :rules="rules2" ref="shipmentsInfo" label-position="right" :model="editConfig.infomation" label-width="120px" size="mini" |
| | | style="margin-top: 20px;"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="承运商"> |
| | | <el-select size="mini" :disabled="!showFooter" v-model="editConfig.infomation.logisticCompanyId" |
| | | placeholder="请选择" style="width: 90%;"> |
| | | <el-option v-for="item in shipmentsInfo.carrier" :key="item.id" :label="item.name" :value="item.id"> |
| | | <el-option v-for="item in editConfig.infomation.carrier" :key="item.id" :label="item.name" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | <!-- 尾 --> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <!-- <el-button type="primary" size="small" @click="editConfig.visible = false">保并提交审批</el-button> --> |
| | | <el-button type="primary" size="small" @click="saveClick('form','shipmentsInfo')" :disabled="!showFooter">保存</el-button> |
| | | <el-button type="primary" size="small" @click="saveClick" :disabled="!showFooter">保存</el-button> |
| | | <el-button size="small" @click="editConfig.visible = false">取消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | |
| | | toLocationId: [{ required: true, message: "请选择仓库位置", trigger: "change" }], |
| | | fromLocationId: [{ required: true, message: "请选择源位置", trigger: "change" }], |
| | | operationTypeId: [{ required: true, message: "请选择入库类型", trigger: "change" }], |
| | | }, |
| | | rules2:{ |
| | | receiverPhone: [ |
| | | {required: true, message: "请输入手机号", trigger: "change" }, |
| | | // {required: true, message: "请输入手机号", trigger: "change" }, |
| | | { |
| | | pattern: |
| | | /^1(3\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\d|9[0-35-9])\d{8}$/, |
| | |
| | | trigger: ["blur",'change' ], |
| | | }, |
| | | ] |
| | | |
| | | }, |
| | | companyOptions: [], // 公司 |
| | | supplierOptions: [],//供应商 |
| | |
| | | waybillNumber: '', |
| | | weight: 0, |
| | | logisticWeight: 0, |
| | | receiverPhone:'' |
| | | }, |
| | | showCancel: false, // 取消是否可以显示 |
| | | list: [], |
| | | pdfParams:{} |
| | | pdfParams:{}, |
| | | thatCursor:this.workType===3?"no-drop":'pointer', |
| | | thatColor:this.workType===3?'#ccc':'#000' |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | async getLogisticCompanyList() { |
| | | await getLogisticCompanyList().then((res) => { |
| | | if (res.code === 200) { |
| | | this.shipmentsInfo.carrier = res.data |
| | | this.editConfig.infomation.carrier = res.data |
| | | } |
| | | }) |
| | | }, |
| | | // 保存 |
| | | saveClick(formName,shipmentsInfo) { |
| | | this.$refs[formName,shipmentsInfo].validate((valid) => { |
| | | if (valid) { |
| | | saveClick() { |
| | | let validArr=[] |
| | | if(this.workType === 2){ |
| | | console.log("出库") |
| | | validArr=[this.$refs.form.validate(),this.$refs.shipmentsInfo.validate()] |
| | | }else{ |
| | | console.log("入库") |
| | | validArr=[this.$refs.form.validate()] |
| | | } |
| | | console.log(validArr,"xxx") |
| | | Promise.all(validArr) |
| | | .then((results) => { |
| | | console.log(results,"执行成功") |
| | | for (let i = 0; i < this.tableData.length; i++) { |
| | | if (this.tableData[i].productName.length === 0) { |
| | | this.isNoProduct = true |
| | |
| | | console.log(res) |
| | | this.editConfig.visible = false |
| | | if (res.code === 200) { |
| | | if(this.editConfig.title === "新建"){ |
| | | this.$message.success("添加成功") |
| | | }else { |
| | | this.$message.success("编辑成功") |
| | | } |
| | | this.$parent.getData() |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | console.error('表单校验未通过:', error); |
| | | }); |
| | | }, |
| | | saveParams() { |
| | | let data = this.editConfig.infomation |
| | |
| | | }, |
| | | //打印 |
| | | async btnPrint() { |
| | | if(this.workType!==3){ |
| | | localStorage.removeItem('pdfParams'); |
| | | try { |
| | | let res = await printReceipts(this.editCommonConfig.infomation.id); |
| | |
| | | console.error(error); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | |
| | | .btn:nth-of-type(2) { |
| | | cursor: no-drop; |
| | | color:#ccc; |
| | | } |
| | | } |
| | | } |