瀏覽代碼

EHSD产品库 价格显示问题

lxf 1 年之前
父節點
當前提交
cbd69ea4df

+ 13 - 8
src/views/EHSD/productLibrary/companyProduct/index.vue

@@ -51,6 +51,16 @@
             <span>{{ item.productHigh }}cm</span>
             <span>{{ item.productHigh }}cm</span>
           </div>
           </div>
         </template>
         </template>
+        <template #price="{ item }">
+          <div>
+            <span v-if="item.price">${{ item.price }}</span>
+          </div>
+        </template>
+        <template #costPrice="{ item }">
+          <div>
+            <span v-if="item.costPrice">¥{{ item.costPrice }}</span>
+          </div>
+        </template>
       </byTable>
       </byTable>
     </div>
     </div>
 
 
@@ -190,20 +200,15 @@ const config = computed(() => {
     {
     {
       attrs: {
       attrs: {
         label: "销售指导价",
         label: "销售指导价",
-        prop: "price",
+        slot: "price",
         width: 150,
         width: 150,
       },
       },
-      render(price) {
-        return "$" + proxy.moneyFormat(price, 2);
-      },
     },
     },
     {
     {
       attrs: {
       attrs: {
         label: "成本价",
         label: "成本价",
-        prop: "costPrice",
-      },
-      render(costPrice) {
-        return "¥" + proxy.moneyFormat(costPrice, 2);
+        slot: "costPrice",
+        width: 150,
       },
       },
     },
     },
     {
     {

+ 18 - 9
src/views/EHSD/productLibrary/customerProduct/index.vue

@@ -51,6 +51,16 @@
             <span>{{ item.productHigh }}cm</span>
             <span>{{ item.productHigh }}cm</span>
           </div>
           </div>
         </template>
         </template>
+        <template #price="{ item }">
+          <div>
+            <span v-if="item.price">${{ item.price }}</span>
+          </div>
+        </template>
+        <template #costPrice="{ item }">
+          <div>
+            <span v-if="item.costPrice">¥{{ item.costPrice }}</span>
+          </div>
+        </template>
       </byTable>
       </byTable>
     </div>
     </div>
     <el-dialog :title="modalType == 'add' ? '添加产品' : '编辑产品'" v-model="dialogVisible" width="600" v-loading="submitLoading" destroy-on-close>
     <el-dialog :title="modalType == 'add' ? '添加产品' : '编辑产品'" v-model="dialogVisible" width="600" v-loading="submitLoading" destroy-on-close>
@@ -190,20 +200,15 @@ const config = computed(() => {
     {
     {
       attrs: {
       attrs: {
         label: "销售指导价",
         label: "销售指导价",
-        prop: "price",
+        slot: "price",
         width: 150,
         width: 150,
       },
       },
-      render(price) {
-        return "$" + proxy.moneyFormat(price, 2);
-      },
     },
     },
     {
     {
       attrs: {
       attrs: {
         label: "成本价",
         label: "成本价",
-        prop: "costPrice",
-      },
-      render(costPrice) {
-        return "¥" + proxy.moneyFormat(costPrice, 2);
+        slot: "costPrice",
+        width: 150,
       },
       },
     },
     },
     {
     {
@@ -481,11 +486,13 @@ const getList = async (req) => {
   loading.value = true;
   loading.value = true;
   proxy.post("/productInfo/getCustomerProductList", sourceList.value.pagination).then(
   proxy.post("/productInfo/getCustomerProductList", sourceList.value.pagination).then(
     (message) => {
     (message) => {
-      sourceList.value.data = message.rows.map((x) => ({
+      message.rows = message.rows.map((x) => ({
         ...x,
         ...x,
         fileList: [],
         fileList: [],
         ...JSON.parse(x.ehsdJson),
         ...JSON.parse(x.ehsdJson),
       }));
       }));
+      console.log(message.rows);
+      sourceList.value.data = message.rows;
       sourceList.value.pagination.total = message.total;
       sourceList.value.pagination.total = message.total;
       setTimeout(() => {
       setTimeout(() => {
         loading.value = false;
         loading.value = false;
@@ -521,6 +528,7 @@ const treeChange = (e) => {
 };
 };
 
 
 const openModal = () => {
 const openModal = () => {
+  fileList.value = [];
   dialogVisible.value = true;
   dialogVisible.value = true;
   modalType.value = "add";
   modalType.value = "add";
   formData.data = {
   formData.data = {
@@ -595,6 +603,7 @@ const getTreeList = () => {
 };
 };
 
 
 const getDtl = (row) => {
 const getDtl = (row) => {
+  fileList.value = [];
   modalType.value = "edit";
   modalType.value = "edit";
   proxy.post("/productInfo/detailByEhsd", { id: row.id }).then((res) => {
   proxy.post("/productInfo/detailByEhsd", { id: row.id }).then((res) => {
     res.definition = "1"; //产品
     res.definition = "1"; //产品