|
@@ -419,6 +419,8 @@
|
|
|
:disabled="sonDisable"
|
|
|
:size="size"
|
|
|
v-model="scope.row.materialCode"
|
|
|
+ :source="scope.row"
|
|
|
+ @change="(val) => changeMaterialCode(val, scope.row)"
|
|
|
@paste.native="pasteMe($event, scope, scope.rowIndex)"
|
|
|
>
|
|
|
<el-button
|
|
@@ -2480,6 +2482,7 @@ export default {
|
|
|
line.transportationCondition =
|
|
|
rowList[i].transportationCondition;
|
|
|
line.storageCondition = rowList[i].storageCondition;
|
|
|
+ line.materialRemark = rowList[i].remark;
|
|
|
newLine.push(line);
|
|
|
console.log("临时数组", newLine);
|
|
|
}
|
|
@@ -3146,6 +3149,58 @@ export default {
|
|
|
// 返回一个二维数组的表尾合计(不要平均值,你就不要在数组中添加)
|
|
|
return [means];
|
|
|
},
|
|
|
+
|
|
|
+ // 物料编码
|
|
|
+ async changeMaterialCode(val, row) {
|
|
|
+ try {
|
|
|
+ let { code, rows } = await getRefer({
|
|
|
+ type: "MATERIAL_PARAM",
|
|
|
+ materialCodeList: [val],
|
|
|
+ });
|
|
|
+ if (rows && rows.length) {
|
|
|
+ let source = rows[0];
|
|
|
+ let fieldObject = {
|
|
|
+ puOrg: "purchasingOrganization",
|
|
|
+ purOrgName: "purchasingOrganizationName", // 默认采购组织
|
|
|
+ material: "id",
|
|
|
+ materialName: "name", // 物料名称
|
|
|
+ specification: "specification", // 规格
|
|
|
+ model: "model", // 型号
|
|
|
+ materialRemark: "remark", // 物料备注
|
|
|
+ unit: "unitId",
|
|
|
+ unitName: "unitIdName", // 单位
|
|
|
+ manufacturerName: "manufacturerIdName", // 生产厂家/代理人
|
|
|
+ minPackage: "minPackQty", // 最小包装量
|
|
|
+ materialClassifyOneName: "oneClass", // 物料一级分类
|
|
|
+ materialClassifyTwoName: "twoClass", // 物料二级分类
|
|
|
+ materialClassifyThreeName: "threeClass", // 物料三级分类
|
|
|
+ materialClassifyFourName: "fourClass", // 物料四级分类
|
|
|
+ minOrderQty: "minOrderQty", // 最小订货量
|
|
|
+ minBatch: "minBatchQty", // 最小批量
|
|
|
+ puPeriod: "deliveryPeriod", // 采购周期
|
|
|
+ expiry: "usefulLife", // 有效期
|
|
|
+ expiryUnit: "expiryUnitIdName", // 有效期单位
|
|
|
+ registrant: "registrant", // 注册人
|
|
|
+ transportationCondition: "transportationCondition", // 运输条件
|
|
|
+ storageCondition: "storageCondition", // 存储条件
|
|
|
+ storageCondition: "storageCondition", // 存储条件
|
|
|
+ classifyId: "classifyId",
|
|
|
+ };
|
|
|
+
|
|
|
+ let { billType } = this.basicForm;
|
|
|
+ row.isUrgency = billType == "JJXQ" ? "Y" : "N";
|
|
|
+ row.isReplenishment = billType == "BDXQ" ? "Y" : "N";
|
|
|
+
|
|
|
+ for (const key in fieldObject) {
|
|
|
+ row[key] = source[fieldObject[key]];
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ row.materialCode = null;
|
|
|
+ // 清空不弹窗
|
|
|
+ val && this.$notify.error("该物料编码不存在或已停用");
|
|
|
+ }
|
|
|
+ } catch (error) {}
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|