浏览代码

采购单 产品列表添加产品图片字段

chenrui 3 年之前
父节点
当前提交
a2e60328ae
共有 1 个文件被更改,包括 15 次插入1 次删除
  1. 15 1
      src/views/purchasingManagement/purchaseOrder/edit.vue

+ 15 - 1
src/views/purchasingManagement/purchaseOrder/edit.vue

@@ -92,8 +92,19 @@
                 :rowKey="(record) => record.id"
                 :rowKey="(record) => record.id"
                 :columns="columns"
                 :columns="columns"
                 :data="loadData"
                 :data="loadData"
-                :scroll="{ x: 950, y:300 }"
+                :scroll="{ x: 1030, y:300 }"
                 bordered>
                 bordered>
+                <!-- 产品图片 -->
+                <template slot="imageUrl" slot-scope="text, record">
+                  <img
+                    v-if="record.productMainPic && record.productMainPic.imageUrl"
+                    :src="record.productMainPic.imageUrl+'?x-oss-process=image/resize,h_30,m_lfit' || ''"
+                    width="30"
+                    height="30"
+                    class="imageUrl"
+                    @click="handlePicDetail(record)" />
+                  <span v-else>--</span>
+                </template>
                 <!-- 产品编码 -->
                 <!-- 产品编码 -->
                 <template slot="code" slot-scope="text, record">
                 <template slot="code" slot-scope="text, record">
                   <a-tooltip placement="top" v-if="record.stockState=='NOT_ENOUGH'">
                   <a-tooltip placement="top" v-if="record.stockState=='NOT_ENOUGH'">
@@ -273,6 +284,7 @@ export default {
         { title: '箱/单位', dataIndex: 'unit', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '箱/单位', dataIndex: 'unit', width: 80, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '采购单价', dataIndex: 'purchasePrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') }, fixed: 'right' },
         { title: '采购单价', dataIndex: 'purchasePrice', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') }, fixed: 'right' },
         { title: '采购数量', dataIndex: 'qty', scopedSlots: { customRender: 'storageQuantity' }, width: 100, align: 'center', fixed: 'right' },
         { title: '采购数量', dataIndex: 'qty', scopedSlots: { customRender: 'storageQuantity' }, width: 100, align: 'center', fixed: 'right' },
+        { title: '产品图片', scopedSlots: { customRender: 'imageUrl' }, width: 80, align: 'center', fixed: 'right' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 80, align: 'center', fixed: 'right' }
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 80, align: 'center', fixed: 'right' }
       ],
       ],
       // 加载数据方法 必须为 Promise 对象
       // 加载数据方法 必须为 Promise 对象
@@ -487,6 +499,8 @@ export default {
         }
         }
       })
       })
     },
     },
+    // 查看产品
+    handlePicDetail (row) {},
     // 上次缺货 导入成功
     // 上次缺货 导入成功
     hanldeOkOutStock () {
     hanldeOkOutStock () {
       this.$refs.purchaseTable.refresh(true)
       this.$refs.purchaseTable.refresh(true)