| | |
| | | id: 3, |
| | | }, |
| | | ]; |
| | | // 物料 毛重,净重的单位 |
| | | const grossUnit=[ |
| | | { |
| | | name: "g", |
| | | id: 1, |
| | | }, |
| | | { |
| | | name: "kg", |
| | | id: 2, |
| | | }, |
| | | { |
| | | name: "吨", |
| | | id: 3, |
| | | }, |
| | | { |
| | | name: "斤", |
| | | id: 4, |
| | | }, |
| | | ] |
| | | export const getDataByType = (type) => { |
| | | if (type == "purchaseStatus") { |
| | | return purchaseStatus |
| | |
| | | return baseOperationTypeTwo |
| | | }else if(type=='purchaseType'){ |
| | | return purchaseType; |
| | | }else if(type=='grossUnit'){ |
| | | return grossUnit; |
| | | } |
| | | } |
| | |
| | | { label: "产品型号", prop: "model" }, |
| | | { label: "数量", prop: "amount" }, |
| | | { label: "计量单位", prop: "unit" }, |
| | | { label: "辅助数量", prop: "unit" }, |
| | | { label: "辅助单位", prop: "amount" } |
| | | { label: "辅助数量", prop: "adjunctAmount" }, |
| | | { label: "辅助单位", prop: "adjunctUnit" } |
| | | ], |
| | | allotProductColumn: [ |
| | | { label: "产品编号", prop: "id", default: true }, |
| | |
| | | { label: "调出位置", prop: "location" }, |
| | | { label: "调入位置", prop: "toLocation" }, |
| | | { label: "数量", prop: "amount" }, |
| | | { label: "辅助数量", prop: "unit" }, |
| | | { label: "辅助单位", prop: "amount" } |
| | | { label: "辅助数量", prop: "adjunctAmount" }, |
| | | { label: "辅助单位", prop: "adjunctUnit" } |
| | | ] |
| | | } |
| | | }, |
| | |
| | | // bottom产品信息数据处理 |
| | | bottomProductData(arr) { |
| | | const list = arr.details.map((item) => { |
| | | let adjunctUnit='' |
| | | let adjunctAmount='' |
| | | if(item.product.moreUnit&&item.product.moreUnitList){ |
| | | let moreUnitList=item.product.moreUnitList |
| | | if(moreUnitList.length>0){ |
| | | for(let j in moreUnitList){ |
| | | if(moreUnitList[j].floating){ |
| | | adjunctUnit=moreUnitList[j].unit |
| | | adjunctAmount=moreUnitList[j].amount |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return { |
| | | ...item, |
| | | productName: item.product.name, |
| | | unit: item.product.unit, |
| | | location: arr.location.name, |
| | | toLocation: arr.toLocation.name |
| | | toLocation: arr.toLocation.name, |
| | | adjunctUnit:adjunctUnit, |
| | | adjunctAmount:adjunctAmount |
| | | } |
| | | }) |
| | | this.productTableList.tableInfomation = list |
| | |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="重量" prop="weight" label-width="80px"> |
| | | <!-- <el-form-item label="重量" prop="weight" label-width="80px"> |
| | | <el-input-number |
| | | v-model="editConfig.infomation.weight" |
| | | placeholder="请输入" |
| | |
| | | :disabled="!showFooter" |
| | | ></el-input-number> |
| | | <span> kg</span> |
| | | </el-form-item> |
| | | </el-form-item> --> |
| | | <el-form-item label="毛重" prop="grossWeight"> |
| | | <el-col :span="15" |
| | | > |
| | | <el-input |
| | | v-model="editConfig.infomation.grossWeight" |
| | | placeholder="请输入" |
| | | :disabled="!showFooter" |
| | | ></el-input> |
| | | </el-col> |
| | | <el-col :span="1"> </el-col> |
| | | <el-col :span="4"> |
| | | <el-select |
| | | v-model="editConfig.infomation.grossUnit" |
| | | placeholder="单位" |
| | | filterable |
| | | :disabled="!showFooter" |
| | | style="width: 100%; float: right" |
| | | :popper-append-to-body="false" |
| | | > |
| | | <el-option |
| | | v-for="ele in grossUnitList" |
| | | :key="ele.id" |
| | | :label="ele.name" |
| | | :value="ele.name" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-col> |
| | | </el-form-item> |
| | | <el-form-item label="净重" prop="netWeight"> |
| | | <el-col :span="15" |
| | | > |
| | | <el-input |
| | | v-model="editConfig.infomation.netWeight" |
| | | :disabled="!showFooter" |
| | | placeholder="请输入" |
| | | ></el-input> |
| | | </el-col> |
| | | <el-col :span="1"> </el-col> |
| | | <el-col :span="4"> |
| | | <el-select |
| | | v-model="editConfig.infomation.netUnit" |
| | | placeholder="单位" |
| | | filterable |
| | | :disabled="!showFooter" |
| | | style="width: 100%; float: right" |
| | | :popper-append-to-body="false" |
| | | > |
| | | <el-option |
| | | v-for="ele in grossUnitList" |
| | | :key="ele.id" |
| | | :label="ele.name" |
| | | :value="ele.name" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-col> |
| | | </el-form-item> |
| | | <el-form-item label="体积" prop="volume" label-width="80px"> |
| | | <el-input-number |
| | | v-model="editConfig.infomation.volume" |
| | |
| | | // salePrice: [{ required: true, message: "请输入销售价格", trigger: "blur" }], |
| | | unit: [{ required: true, message: "请输入单位", trigger: ["blur"] }], |
| | | // 采购类型 |
| | | purchaseTypeList: [{ required: true, message: "请选择", trigger: "blur" }] |
| | | purchaseTypeList: [{ required: true, message: "请选择", trigger: "blur" }], |
| | | netWeight: [ |
| | | { |
| | | required: false, |
| | | message: "请填写", |
| | | trigger: "change", |
| | | }, |
| | | { |
| | | validator: this.validatorNumFour, |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | grossWeight: [ |
| | | { |
| | | required: false, |
| | | message: "请填写", |
| | | trigger: "change", |
| | | }, |
| | | { |
| | | validator: this.validatorNumFour, |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | memberOptions: [], |
| | | productCategoryOptions: [], // 产品类别 |
| | |
| | | isView: false, |
| | | fileFormdata: null, // 上传图片入参 |
| | | bomPurchaseTypeList: getDataByType("purchaseType"), |
| | | grossUnitList:getDataByType("grossUnit"), |
| | | unitList: [], |
| | | editRow:{ |
| | | editDialogVisible:false, |
| | |
| | | this.getUnitInfo() |
| | | }, |
| | | methods: { |
| | | validatorNumFour(rule, value, callback) { |
| | | if (value != "") { |
| | | if (value == undefined || value == null) { |
| | | callback(new Error("请输入有效数字")); |
| | | } else { |
| | | let reg2 = |
| | | /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/; |
| | | if (!reg2.test(value) || value == 0) { |
| | | callback(new Error("请填写大于零的2位小数的数字")); |
| | | } else { |
| | | callback(); |
| | | } |
| | | } |
| | | } else { |
| | | callback(); |
| | | } |
| | | }, |
| | | // 单位 |
| | | handleUnitShow() { |
| | | this.editRow.editDialogVisible = true; |