Authored by htoooth

fix

@@ -972,7 +972,15 @@ export default { @@ -972,7 +972,15 @@ export default {
972 onChangeFactoryCode: function(index, code) { 972 onChangeFactoryCode: function(index, code) {
973 // 注意这里vue 没有办法监听到,手动添加监听 973 // 注意这里vue 没有办法监听到,手动添加监听
974 this.$set(this.product, `goods[${index}].factoryGoodsName`, code); 974 this.$set(this.product, `goods[${index}].factoryGoodsName`, code);
975 - this.product.goods[index].factoryGoodsName = code; 975 +
  976 + let goods = this.product.goods[index];
  977 +
  978 + goods.factoryGoodsName = code;
  979 +
  980 + // 同步图片中的factoryGoodsName 的值
  981 + goods.goodsImage.forEach((image) => {
  982 + image.factoryGoodsName = code || goods.goodsName;
  983 + });
976 }, 984 },
977 validate: function() { 985 validate: function() {
978 return Promise.all([this.validateProduct(), this.validateTable()]); 986 return Promise.all([this.validateProduct(), this.validateTable()]);
@@ -30,6 +30,7 @@ const handleGoods = (goods) => { @@ -30,6 +30,7 @@ const handleGoods = (goods) => {
30 orderBy: 0, 30 orderBy: 0,
31 productSkn: goods.productSkn, 31 productSkn: goods.productSkn,
32 productSkc: goods.productSkc, 32 productSkc: goods.productSkc,
  33 + factoryGoodsName: goods.factoryGoodsName || goods.goodsName,
33 status: 1 34 status: 1
34 }, { //1 35 }, { //1
35 angle: 0, 36 angle: 0,
@@ -39,6 +40,7 @@ const handleGoods = (goods) => { @@ -39,6 +40,7 @@ const handleGoods = (goods) => {
39 orderBy: 0, 40 orderBy: 0,
40 productSkn: goods.productSkn, 41 productSkn: goods.productSkn,
41 productSkc: goods.productSkc, 42 productSkc: goods.productSkc,
  43 + factoryGoodsName: goods.factoryGoodsName || goods.goodsName,
42 status: 1 44 status: 1
43 }, { //2 45 }, { //2
44 angle: 0, 46 angle: 0,
@@ -48,6 +50,7 @@ const handleGoods = (goods) => { @@ -48,6 +50,7 @@ const handleGoods = (goods) => {
48 orderBy: 0, 50 orderBy: 0,
49 productSkn: goods.productSkn, 51 productSkn: goods.productSkn,
50 productSkc: goods.productSkc, 52 productSkc: goods.productSkc,
  53 + factoryGoodsName: goods.factoryGoodsName || goods.goodsName,
51 status: 1 54 status: 1
52 }, { //3 55 }, { //3
53 angle: 0, 56 angle: 0,
@@ -57,6 +60,7 @@ const handleGoods = (goods) => { @@ -57,6 +60,7 @@ const handleGoods = (goods) => {
57 orderBy: 0, 60 orderBy: 0,
58 productSkn: goods.productSkn, 61 productSkn: goods.productSkn,
59 productSkc: goods.productSkc, 62 productSkc: goods.productSkc,
  63 + factoryGoodsName: goods.factoryGoodsName || goods.goodsName,
60 status: 1 64 status: 1
61 }, { //4 65 }, { //4
62 angle: 0, 66 angle: 0,
@@ -66,6 +70,7 @@ const handleGoods = (goods) => { @@ -66,6 +70,7 @@ const handleGoods = (goods) => {
66 orderBy: 0, 70 orderBy: 0,
67 productSkn: goods.productSkn, 71 productSkn: goods.productSkn,
68 productSkc: goods.productSkc, 72 productSkc: goods.productSkc,
  73 + factoryGoodsName: goods.factoryGoodsName || goods.goodsName,
69 status: 1 74 status: 1
70 }]; 75 }];
71 76