Browse Source

面损表材料出库数量弹窗

jbb 2 years ago
parent
commit
b5ea38e477

+ 3 - 0
public/index.html

@@ -240,6 +240,9 @@
       content: '*';
       color: red;
     }
+    .ant-table-tbody .inputRowStyl {
+      background-color: #e6f7ff !important;
+    }
 
     </style>
     <!-- 全局配置 -->

+ 7 - 0
src/views/reportForms/fabric-loss-table.vue

@@ -778,6 +778,13 @@ export default {
       return {
         on: {
           click: event => {
+            record.fabricMoOrderCKList.map(item=>{
+              if(item.iprice == 0){
+                item.statue = 0
+              }else{
+                item.statue = 1
+            }
+            })
             this.$refs.materialsOutQuantityModal.materialsOutQuantityData = record.fabricMoOrderCKList;
             this.$refs.materialsOutQuantityModal.allDataList = record.fabricMoOrderCKList;
             this.$refs.materialsOutQuantityModal.queryParam = {};

+ 19 - 2
src/views/reportForms/fabric-loss-table/materialsOutQuantityModal.vue

@@ -68,8 +68,13 @@
           :data-source="materialsOutQuantityData"
           :pagination="false"
           :scroll="{ y: 500,x:1500 }"
+          :rowClassName="setRowClassName"
           :footer="showTotal"
         >
+        <template slot="iprice" slot-scope="text, record, index">
+              <a-input placeholder="请输入物料名称" v-model="record.iprice" v-if="record.statue == '0'" @blur="changePrice(record)" @pressEnter="changePrice(record)"></a-input>
+              <span v-if="record.statue == '1'">{{record.iprice}}</span>
+        </template>
         </a-table>
 
         <!-- 导出 打印 返回  -->
@@ -157,7 +162,8 @@ export default {
           dataIndex: 'iprice',
           width: 120,
           key: '',
-          className: 'replacecolor'
+          className: 'replacecolor',
+          scopedSlots: { customRender: 'iprice' },
         },
         {
           title: '数量',
@@ -301,7 +307,18 @@ export default {
     getExportDataList(){
       this.materialsOutQuantityData.forEach((record,index)=>record["ccode_ex"]="&nbsp;"+record["ccode"]);
       return this.materialsOutQuantityData;
-    }
+    },
+    //改变单价
+    changePrice(record){
+      if(record.iprice !== 0){
+        record.statue = 1
+      }
+      this.$forceUpdate()
+    },
+     // 行样式设置
+      setRowClassName(record) {
+        return record.statue === 0 ? "inputRowStyl" : "inputRowSty2";//赋予点击行样式
+      }
   }
 }
 </script>