谢杰标 il y a 2 ans
Parent
commit
81db8c960b

+ 1 - 7
src/components/Comon/pictureList.vue

@@ -5,7 +5,7 @@
       <div class="right">
         <h4>{{ item.label }}:</h4>
         <p>
-          {{ formatPrice(item.value || info[item.prop]) }}{{ item.ch || "元" }}
+          {{ item.value || info[item.prop] | formatPrice }}{{ item.ch || "元" }}
         </p>
       </div>
     </div>
@@ -45,12 +45,6 @@ export default {
     backFullSrc(name) {
       return require(`@/assets/images/${name}@2x.png`);
     },
-    formatPrice(price) {
-      return price?.toLocaleString(
-        "zh-CN",
-        (undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })
-      );
-    },
   },
 };
 </script>

+ 12 - 4
src/components/tableList.vue

@@ -123,7 +123,9 @@
         width="55"
         header-align="center"
         fixed="left"
-        :selectable="navText.selectableStatus?navText.selectableFunc:selectFuncTrue"
+        :selectable="
+          navText.selectableStatus ? navText.selectableFunc : selectFuncTrue
+        "
       >
       </el-table-column>
       <el-table-column
@@ -593,7 +595,7 @@
             }}</span
           >
           <span v-else-if="item.scope === 'aTimeList'">{{
-            scope.row[item.prop] === null
+            scope.row[item.prop] === null || scope.row[item.prop] === 0
               ? "--"
               : $methodsTools.onlyForma(scope.row[item.prop], !item.isDiszing)
           }}</span>
@@ -968,6 +970,12 @@
           <div v-else-if="item.scope === 'solt'">
             <slot :name="item.soltName" :scope="scope"></slot>
           </div>
+          <div v-else-if="item.scope === 'fill'">
+            {{ scope.row[item.prop] || "--" }}
+          </div>
+          <div v-else-if="item.scope === 'formatPrice'">
+            {{ scope.row[item.prop] | formatPrice }}
+          </div>
           <span v-else>
             {{ scope.row[item.prop] }}
             {{
@@ -1258,8 +1266,8 @@ export default {
     this.initTR();
   },
   methods: {
-    selectFuncTrue(){
-      return true
+    selectFuncTrue() {
+      return true;
     },
     radioChange(val) {},
     /**

+ 7 - 0
src/directive/filter/index.js

@@ -0,0 +1,7 @@
+// 金额格式化
+export function formatPrice(price) {
+  return price?.toLocaleString(
+    "zh-CN",
+    (undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })
+  );
+}

+ 3 - 1
src/directive/index.js

@@ -5,7 +5,8 @@ import dialogDragWidth from "./dialog/dragWidth";
 import dialogDragHeight from "./dialog/dragHeight";
 import throttle from "./common/throttle";
 import int from "./common/int";
-
+import { formatPrice } from "./filter/index";
+console.log(formatPrice, "formatPrice");
 const install = function (Vue) {
   Vue.directive("hasRole", hasRole);
   Vue.directive("hasPermi", hasPermi);
@@ -14,6 +15,7 @@ const install = function (Vue) {
   Vue.directive("dialogDragHeight", dialogDragHeight);
   Vue.directive("throttle", throttle);
   Vue.directive("int", int);
+  Vue.filter("formatPrice", formatPrice);
 };
 
 if (window.Vue) {

+ 68 - 61
src/main.js

@@ -1,81 +1,88 @@
-import Vue from 'vue'
+import Vue from "vue";
 
-import Cookies from 'js-cookie'
+import Cookies from "js-cookie";
 
-import Element from 'element-ui'
-import AFTableColumn from 'af-table-column'
-import './assets/fonts/iconfont.css'
-import './assets/styles/element-variables.scss'
+import Element from "element-ui";
+import AFTableColumn from "af-table-column";
+import "./assets/fonts/iconfont.css";
+import "./assets/styles/element-variables.scss";
 
-import '@/assets/styles/index.scss' // global css
-import '@/assets/styles/ruoyi.scss' // ruoyi css
-import App from './App'
-import store from './store'
-import api from '@/api/api'
-import gsap from 'gsap'
-import upload from '@/utils/uploadFile'
-import router from './router'
-import directive from './directive' //directive
-import plugins from './plugins' // plugins
-import './assets/icons' // icon
-import './permission' // permission control
+import "@/assets/styles/index.scss"; // global css
+import "@/assets/styles/ruoyi.scss"; // ruoyi css
+import App from "./App";
+import store from "./store";
+import api from "@/api/api";
+import gsap from "gsap";
+import upload from "@/utils/uploadFile";
+import router from "./router";
+import directive from "./directive"; //directive
+import plugins from "./plugins"; // plugins
+import "./assets/icons"; // icon
+import "./permission"; // permission control
 import { getDicts } from "@/api/system/dict/data";
 import { getConfigKey } from "@/api/system/config";
-import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/ruoyi";
+import {
+  parseTime,
+  resetForm,
+  addDateRange,
+  selectDictLabel,
+  selectDictLabels,
+  handleTree,
+} from "@/utils/ruoyi";
 // 通用弹窗
 import BaseDialog from "@/components/BaseDialog";
 // 分页组件
 import Pagination from "@/components/Paginations";
 // 自定义表格工具组件
-import RightToolbar from "@/components/RightToolbar"
+import RightToolbar from "@/components/RightToolbar";
 // 富文本组件
-import Editor from "@/components/Editor"
+import Editor from "@/components/Editor";
 // 文件上传组件
-import FileUpload from "@/components/FileUpload"
+import FileUpload from "@/components/FileUpload";
 // 字典标签组件
-import DictTag from '@/components/DictTag'
+import DictTag from "@/components/DictTag";
 // 头部标签组件
-import VueMeta from 'vue-meta'
+import VueMeta from "vue-meta";
 // 字典数据组件
-import DictData from '@/components/DictData'
-import methodsTools from '@/utils/methodsTool'
-import bus from '@/utils/eventBus'
+import DictData from "@/components/DictData";
+import methodsTools from "@/utils/methodsTool";
+import bus from "@/utils/eventBus";
 // 全局方法挂载
 
-Vue.prototype.$store = store
-Vue.prototype.getDicts = getDicts
-Vue.prototype.getConfigKey = getConfigKey
-Vue.prototype.parseTime = parseTime
-Vue.prototype.resetForm = resetForm
-Vue.prototype.addDateRange = addDateRange
-Vue.prototype.selectDictLabel = selectDictLabel
-Vue.prototype.selectDictLabels = selectDictLabels
-Vue.prototype.handleTree = handleTree
-Vue.prototype.$api = api
-Vue.prototype.$upload = upload
-Vue.prototype.$methodsTools = methodsTools
-Vue.prototype.$bus = bus
-Vue.prototype.gsap = gsap
+Vue.prototype.$store = store;
+Vue.prototype.getDicts = getDicts;
+Vue.prototype.getConfigKey = getConfigKey;
+Vue.prototype.parseTime = parseTime;
+Vue.prototype.resetForm = resetForm;
+Vue.prototype.addDateRange = addDateRange;
+Vue.prototype.selectDictLabel = selectDictLabel;
+Vue.prototype.selectDictLabels = selectDictLabels;
+Vue.prototype.handleTree = handleTree;
+Vue.prototype.$api = api;
+Vue.prototype.$upload = upload;
+Vue.prototype.$methodsTools = methodsTools;
+Vue.prototype.$bus = bus;
+Vue.prototype.gsap = gsap;
 
 // 全局组件挂载
-Vue.component('DictTag', DictTag)
-Vue.component('Pagination', Pagination)
-Vue.component('BaseDialog', BaseDialog)
-Vue.component('RightToolbar', RightToolbar)
-Vue.component('Editor', Editor)
-Vue.component('FileUpload', FileUpload)
+Vue.component("DictTag", DictTag);
+Vue.component("Pagination", Pagination);
+Vue.component("BaseDialog", BaseDialog);
+Vue.component("RightToolbar", RightToolbar);
+Vue.component("Editor", Editor);
+Vue.component("FileUpload", FileUpload);
 const fontRate = {
   CHAR_RATE: 1.1, // 汉字比率
   NUM_RATE: 0.65, // 数字
-  OTHER_RATE: 0.8 // 除汉字和数字以外的字符的比率
-}
-const fontSize = 16
+  OTHER_RATE: 0.8, // 除汉字和数字以外的字符的比率
+};
+const fontSize = 16;
 // 注册组件
-Vue.use(AFTableColumn, { fontRate, fontSize })
-Vue.use(directive)
-Vue.use(plugins)
-Vue.use(VueMeta)
-DictData.install()
+Vue.use(AFTableColumn, { fontRate, fontSize });
+Vue.use(directive);
+Vue.use(plugins);
+Vue.use(VueMeta);
+DictData.install();
 
 /**
  * If you don't want to use mock-server
@@ -87,14 +94,14 @@ DictData.install()
  */
 
 Vue.use(Element, {
-  size: Cookies.get('size') || 'medium' // set element-ui default size
-})
+  size: Cookies.get("size") || "medium", // set element-ui default size
+});
 
-Vue.config.productionTip = false
+Vue.config.productionTip = false;
 
 new Vue({
-  el: '#app',
+  el: "#app",
   router,
   store,
-  render: h => h(App)
-})
+  render: (h) => h(App),
+});

+ 16 - 1
src/views/financed/arap/index.vue

@@ -76,7 +76,7 @@
         </div>
       </template>
       <template slot="status" slot-scope="props">
-        {{ backStatus(props.scope) }}
+        {{ backStatus(props.scope) | formatPrice }}
       </template>
       <template slot="btn" slot-scope="props">
         <el-button
@@ -356,21 +356,25 @@ export default {
           label: "合同金额(元)",
           prop: "orderPrice",
           hidden: true,
+          scope: "formatPrice",
         },
         {
           label: "已收账款(元)",
           prop: "orderReceived",
           hidden: true,
+          scope: "formatPrice",
         },
         {
           label: "已退金额(元)",
           prop: "orderRefunded",
           hidden: true,
+          scope: "formatPrice",
         },
         {
           label: "未收账款(元)",
           prop: "orderUncollected",
           hidden: true,
+          scope: "formatPrice",
         },
         {
           label: "预收时间",
@@ -382,6 +386,7 @@ export default {
           label: "剩余天数",
           prop: "predictReceiveDay",
           hidden: true,
+          scope: "fill",
         },
         {
           label: "提醒设置",
@@ -408,6 +413,8 @@ export default {
           label: "订单单号",
           prop: "orderSn",
           hidden: true,
+          scope: "fill",
+          width: 200,
         },
         {
           label: "类型",
@@ -432,6 +439,7 @@ export default {
           label: "角色名称",
           prop: "roleName",
           hidden: true,
+          scope: "fill",
         },
         {
           label: "已付分成(元)",
@@ -472,6 +480,7 @@ export default {
           label: "剩余天数",
           prop: "predictPayDay",
           hidden: true,
+          scope: "fill",
         },
         {
           label: "审核状态",
@@ -502,7 +511,9 @@ export default {
         {
           label: "订单单号",
           prop: "orderSn",
+          scope: "fill",
           hidden: true,
+          width: 200,
         },
         {
           label: "类型",
@@ -527,6 +538,7 @@ export default {
           label: "角色名称",
           prop: "roleName",
           hidden: true,
+          scope: "fill",
         },
         {
           label: "业务员",
@@ -595,7 +607,9 @@ export default {
         {
           label: "订单单号",
           prop: "orderSn",
+          scope: "fill",
           hidden: true,
+          width: 200,
         },
         {
           label: "机构名称",
@@ -606,6 +620,7 @@ export default {
           label: "角色名称",
           prop: "roleName",
           hidden: true,
+          scope: "fill",
         },
         {
           label: "已付佣金(元)",