suixueyan 1 周之前
父節點
當前提交
b90ceffb7f

+ 0 - 1
dist/assets/CourseOrder-0018eef6.css

@@ -1 +0,0 @@
-@charset "UTF-8";.el-menu[data-v-6f5f191c]{border-right:none}.el-menu .el-menu-item[data-v-6f5f191c]{height:auto;line-height:40px!important}.el-menu .el-sub-menu[data-v-6f5f191c]{display:grid}.el-table__header-wrapper tr th[data-v-6f5f191c]{background-color:#f5f5f7!important}.el-dialog__header[data-v-6f5f191c]{background-color:#f5f5f7;margin-right:0}.el-dialog__footer[data-v-6f5f191c]{border-top:1px solid #f5f5f7;padding-bottom:10px}.el-drawer__header[data-v-6f5f191c]{margin-bottom:0!important}html[data-v-6f5f191c],body[data-v-6f5f191c]{margin:0;padding:0;background:#f5f7fb;min-width:1200px}.box-shadow[data-v-6f5f191c]{box-shadow:0 0 13px #3030324b}.pagination-box[data-v-6f5f191c]{display:flex;justify-content:center;margin-top:10px}[data-v-6f5f191c]::-webkit-scrollbar{height:7px;width:5px}[data-v-6f5f191c]::-webkit-scrollbar-thumb{background:#d8d8d8;border-radius:10px}[data-v-6f5f191c]::-webkit-scrollbar-track-piece{background:transparent}.drawer-content[data-v-6f5f191c]{width:100%;height:calc(100% - 5px);overflow:hidden;overflow-y:auto}.drawer-foot[data-v-6f5f191c]{margin-top:10px}.manage-order[data-v-6f5f191c]{border-bottom:none!important}.manage-order[data-v-6f5f191c] .el-tabs__content{padding:0}.manage-order-content[data-v-6f5f191c]{width:100%;padding:10px;height:calc(100% - 40px);overflow:hidden;border:1px solid #dcdfe6;border-top:none;box-sizing:border-box}.manage-order-content .pagination-div[data-v-6f5f191c]{display:flex;justify-content:space-between;margin-top:10px}.manage-order-content .manage-info[data-v-6f5f191c]{display:flex}.manage-order-content .manage-info .img-box[data-v-6f5f191c]{align-self:center}.manage-order-content .manage-info .right[data-v-6f5f191c]{margin-left:10px;align-self:center}.manage-order-content .manage-info .right span[data-v-6f5f191c]{color:#409eff}

+ 0 - 1
dist/assets/DialogShare-d5fb026a.css

@@ -1 +0,0 @@
-@charset "UTF-8";.el-menu[data-v-e122ab5b]{border-right:none}.el-menu .el-menu-item[data-v-e122ab5b]{height:auto;line-height:40px!important}.el-menu .el-sub-menu[data-v-e122ab5b]{display:grid}.el-table__header-wrapper tr th[data-v-e122ab5b]{background-color:#f5f5f7!important}.el-dialog__header[data-v-e122ab5b]{background-color:#f5f5f7;margin-right:0}.el-dialog__footer[data-v-e122ab5b]{border-top:1px solid #f5f5f7;padding-bottom:10px}.el-drawer__header[data-v-e122ab5b]{margin-bottom:0!important}html[data-v-e122ab5b],body[data-v-e122ab5b]{margin:0;padding:0;background:#f5f7fb;min-width:1200px}.box-shadow[data-v-e122ab5b]{box-shadow:0 0 13px #3030324b}.pagination-box[data-v-e122ab5b]{display:flex;justify-content:center;margin-top:10px}[data-v-e122ab5b]::-webkit-scrollbar{height:7px;width:5px}[data-v-e122ab5b]::-webkit-scrollbar-thumb{background:#d8d8d8;border-radius:10px}[data-v-e122ab5b]::-webkit-scrollbar-track-piece{background:transparent}.drawer-content[data-v-e122ab5b]{width:100%;height:calc(100% - 5px);overflow:hidden;overflow-y:auto}.drawer-foot[data-v-e122ab5b]{margin-top:10px}.share-dialog .form-item-style[data-v-e122ab5b]{width:100%;margin-right:0}.share-dialog .form-item-style[data-v-e122ab5b] .el-input{width:100%}

File diff suppressed because it is too large
+ 0 - 0
dist/assets/Index-ce10a986.css


File diff suppressed because it is too large
+ 0 - 0
dist/assets/Index-f8744588.css


File diff suppressed because it is too large
+ 0 - 0
dist/assets/Shopping-d07bb14f.css


File diff suppressed because it is too large
+ 0 - 0
dist/assets/Tab4-dialog-6a76dba7.css


+ 1 - 1
dist/index.html

@@ -9,7 +9,7 @@
       type="text/javascript"
     ></script>
     <title></title>
-    <script type="module" crossorigin src="./assets/index-b6c64bef.js"></script>
+    <script type="module" crossorigin src="./assets/index-2a78364a.js"></script>
     <link rel="stylesheet" href="./assets/index-dbad0f5d.css">
   </head>
   <body>

+ 30 - 3
src/App.vue

@@ -1,44 +1,71 @@
 <template>
+  <!-- 设置 Element Plus 的语言环境为简体中文 -->
   <el-config-provider :locale="zhCn">
+    <!-- 路由视图,用于渲染匹配的组件 -->
     <RouterView/>
   </el-config-provider>
 </template>
 
 <script setup>
+// 导入 Element Plus 的简体中文语言包
 import zhCn from "element-plus/dist/locale/zh-cn.mjs";
+// 导入 Vuex 的 store
 import {useCounterStore} from "@/stores/counter.js";
+// 导入水印插件(已注释)
 // import Watermark from "@/plugins/wartermark"; // 引入水印
+// 初始化 Vuex 的 store
 const store = useCounterStore();
 
+/**
+ * 获取窗口客户端尺寸
+ * 此函数用于获取当前窗口的实时宽度和高度,并根据宽度动态调整菜单的折叠状态和宽度
+ */
 function getWindowClient() {
-  let windowWidth = document.documentElement.clientWidth; //实时屏幕宽度
-  let windowHeight = document.documentElement.clientHeight; //实时屏幕高度
+  // 获取实时屏幕宽度
+  let windowWidth = document.documentElement.clientWidth;
+  // 获取实时屏幕高度
+  let windowHeight = document.documentElement.clientHeight;
 
+  // 将获取到的尺寸信息存储到 Vuex store 中
   store.windowWidth = windowWidth;
   store.windowHeight = windowHeight;
+  // 当屏幕宽度小于 900px 时,折叠菜单并设置菜单宽度为 65px
   if (windowWidth < 900) {
     store.isCollapse = true;
     store.menuWidth = "65px";
   }
 }
 
-// 获取用户信息//公司信息
+/**
+ * 获取用户信息和公司信息
+ * 此函数从本地存储中获取用户信息和公司信息,并将其存储到 Vuex store 中
+ */
 function getUser() {
+  // 从本地存储中获取用户信息
   let userInfo = localStorage.getItem("manpu_userInfo");
   if (userInfo) {
+    // 将用户信息解析并存储到 Vuex store 中
     store.userInfo = JSON.parse(userInfo);
   }
+  // 从本地存储中获取公司信息
   let config = localStorage.getItem("manpu_config");
   if (config) {
+    // 将公司信息解析并存储到 Vuex store 中
     store.configInfo = JSON.parse(config);
   }
+  // 设置文档标题为公司信息中的站点名称
   document.title = store.configInfo.site_name;
 }
 
+// 组件挂载时执行以下操作
 onMounted(() => {
+  // 设置水印(已注释)
   // Watermark.set("水印"); // 水印内容
+  // 获取用户信息和公司信息
   getUser();
+  // 获取窗口客户端尺寸
   getWindowClient();
+  // 监听窗口大小变化事件,实时更新窗口客户端尺寸
   window.addEventListener("resize", () => {
     getWindowClient();
   });

+ 9 - 0
src/plugins/api/shopping/order.js

@@ -72,6 +72,15 @@ export function exportApi(data) {
     responseType: "blob",
   });
 }
+//订单导出
+export function exportApi2(data) {
+  return request({
+    url: "/shop/export/expense",
+    method: "post",
+    data,
+    responseType: "blob",
+  });
+}
 //商城订单发货列表
 export function orderListApi(data) {
   return request({

+ 4 - 4
src/views/activity/Index.vue

@@ -85,12 +85,12 @@
               </template>
             </el-table-column>
 
-            <el-table-column prop="entry_max" label="人数限制" align="center">
+            <el-table-column prop="entry_max" label="人数限制" width="170"  align="center">
               <template #default="scope">
                 {{ scope.row.entry_max === 0 ? '无限制' : scope.row.entry_max }}
               </template>
             </el-table-column>
-            <el-table-column prop="entry_num" label="报名人数" align="center"/>
+            <el-table-column prop="entry_num" label="报名人数" width="170"  align="center"/>
             <el-table-column prop="address" label="地点" align="center"/>
             <el-table-column prop="entry_end" label="报名截止时间" width="170" align="center"/>
             <el-table-column prop="start_time" label="活动开始时间" width="170" align="center"/>
@@ -161,7 +161,7 @@ function getDictionary(dict_id) {
   });
 }
 getDictionary(36).then((res) => {
-  activityTypeList.value = res;
+  activityTypeList.value = res||[];
 });
 const handleSizeChange = (val) => {
   pageSize.value = val;
@@ -187,7 +187,7 @@ function imgSrc(path) {
 }
 
 function getActivityTypeName(code) {
-  const activityType = this.activityTypeList.find(type => type.code === code);
+  const activityType = activityTypeList.value.find(type => type.code === code);
   return activityType ? activityType.name : '未知';
 }
 const router = useRouter();

+ 1 - 0
src/views/customer/manage/components/DialogPool.vue

@@ -74,6 +74,7 @@ function getCustomer(type) {
   return new Promise((resolve, reject) => {
     customerApi({
       is_base: type,
+      in_form:1,
     }).then((data) => {
       if (type == 1) {
         topTable.value = data;

+ 17 - 1
src/views/customer/manage/components/DialogShare.vue

@@ -152,9 +152,25 @@ function findNodeById(tree, id) {
 let treeData = ref([]);
 function getUsers() {
   listApi().then((res) => {
-    treeData.value = res;
+    treeData.value = addDisabledFlag(res||[]) ;
   });
 }
+function addDisabledFlag(data) {
+  return data.map(item => {
+    // 如果当前对象没有 username,则添加 disabled: true
+    if (!item.username) {
+      item.disabled = true;
+    }
+
+    // 如果存在 children 数组,递归处理子节点
+    if (item.children && Array.isArray(item.children)) {
+      item.children = addDisabledFlag(item.children);
+    }
+
+    return item;
+  });
+}
+
 onMounted(() => {
   getUsers();
 });

+ 135 - 75
src/views/customer/manage/components/tabDialog/Tab4-dialog.vue

@@ -5,18 +5,18 @@
         <div class="title-box">
           <h3>合同信息</h3>
           <el-icon class="icon" v-if="inputType && showBtn" @click="openUpdate1">
-            <IEpEdit />
+            <IEpEdit/>
           </el-icon>
         </div>
 
         <el-form-item prop="customer_name" label="客户名称">
-          <el-input disabled readonly placeholder="客户名称" v-model="dataInfo.customer_name" :disabled="inputType" />
+          <el-input disabled readonly placeholder="客户名称" v-model="dataInfo.customer_name" :disabled="inputType"/>
         </el-form-item>
         <el-form-item prop="order_name" label="合同名称">
-          <el-input placeholder="合同名称" v-model="ruleForm.order_name" :disabled="inputType" />
+          <el-input placeholder="合同名称" v-model="ruleForm.order_name" :disabled="inputType"/>
         </el-form-item>
-        <el-form-item prop="" label="合同编号">
-          <el-input placeholder="合同编号" v-model="ruleForm.order_no" :disabled="inputType" />
+        <el-form-item prop="order_no" label="合同编号">
+          <el-input placeholder="合同编号" v-model="ruleForm.order_no" :disabled="inputType"/>
           <!-- <el-checkbox
             @change="heTongChange"
             style="margin-left: 20px"
@@ -26,7 +26,7 @@
         </el-form-item>
         <el-form-item prop="order_uid" label="签署人">
           <el-tree-select default-expand-all node-key="id" filterable v-model="ruleForm.order_uid" :data="userOptions"
-            check-strictly :render-after-expand="false" :props="{
+                          check-strictly :render-after-expand="false" :props="{
               label: 'name',
             }" style="width: 100%" placeholder="签署人" clearable :disabled="inputType">
           </el-tree-select>
@@ -34,7 +34,7 @@
 
         <el-form-item label="签署日期" prop="order_date">
           <el-date-picker :disabled="inputType" style="width: 100%" v-model="ruleForm.order_date" type="date"
-            placeholder="签署日期" value-format="YYYY-MM-DD" />
+                          placeholder="签署日期" value-format="YYYY-MM-DD"/>
         </el-form-item>
         <el-form-item prop="is_virtual" label="虚拟合同">
           <el-radio-group v-model="ruleForm.is_virtual" :disabled="inputType">
@@ -44,8 +44,8 @@
         </el-form-item>
         <el-form-item prop="contact_id" label="客户签署人">
           <el-select :disabled="inputType" style="width: 100%" v-model="ruleForm.contact_id" placeholder="客户签署人"
-            filterable clearable>
-            <el-option v-for="item in userData" :key="item.id" :label="item.name" :value="item.id" />
+                     filterable clearable>
+            <el-option v-for="item in userData" :key="item.id" :label="item.name" :value="item.id"/>
           </el-select>
         </el-form-item>
         <!-- <el-form-item prop="h" label="联系方式">
@@ -53,14 +53,14 @@
         </el-form-item> -->
         <el-form-item prop="" label="开始/结束日期">
           <el-date-picker :disabled="inputType" v-model="ruleForm.datetimerange" type="daterange" range-separator="至"
-            start-placeholder="开始时间" end-placeholder="结束时间" value-format="YYYY-MM-DD" />
+                          start-placeholder="开始时间" end-placeholder="结束时间" value-format="YYYY-MM-DD"/>
         </el-form-item>
         <el-form-item prop="amount_real" label="合同金额(元)">
-          <el-input :disabled="inputType" placeholder="合同金额(元)" v-model="ruleForm.amount_real" />
+          <el-input :disabled="inputType" placeholder="合同金额(元)" v-model="ruleForm.amount_real"/>
         </el-form-item>
         <el-form-item prop="owner_by" label="销售">
-          <el-tree-select :disabled="inputType" default-expand-all node-key="id" filterable v-model="ruleForm.owner_by"
-            :data="userOptions" check-strictly :render-after-expand="false" :props="{
+          <el-tree-select :disabled="inputType" default-expand-all node-key="id" filterable v-model="ruleForm.owner_by "
+                          :data="userOptions" check-strictly :render-after-expand="false" :props="{
               label: 'name',
             }" style="width: 100%" placeholder="选择销售" clearable>
           </el-tree-select>
@@ -80,7 +80,7 @@
         </el-form-item>
         <el-form-item prop="truck_price" label="运费(元)">
           <div style="white-space: nowrap">
-            <el-input :disabled="inputType" placeholder="运费" v-model="ruleForm.truck_price" />
+            <el-input :disabled="inputType" placeholder="运费" v-model="ruleForm.truck_price"/>
             <span style="color: #8c8d8f; font-size: 12px">
               *运费包含在合同金额里
             </span>
@@ -89,9 +89,9 @@
 
         <el-form-item prop="" label="合同附件" style="width: 100%">
           <el-upload class="upload-demo" action="#" :auto-upload="false" :on-change="fileOnChange"
-            :show-file-list="false" v-if="!inputType">
+                     :show-file-list="false" v-if="!inputType">
             <div class="file-btn">
-              <el-button type="primary" size="small"> 文件上传 </el-button>
+              <el-button type="primary" size="small"> 文件上传</el-button>
             </div>
           </el-upload>
 
@@ -101,7 +101,7 @@
                 {{ item.file_name || item.name }}
               </a>
               <el-icon v-if="!inputType" class="close" @click="fileRemove(i)">
-                <IEpClose />
+                <IEpClose/>
               </el-icon>
             </div>
           </div>
@@ -110,24 +110,25 @@
           </div>
         </el-form-item>
         <el-form-item prop="contract" label="相关合同">
-          <el-select v-model="ruleForm.contract" placeholder="相关合同" style="width: 100%" multiple :disabled="inputType">
-            <el-option v-for="item in contractOptions" :key="item.id" :label="item.order_name" :value="item.id" />
+          <el-select v-model="ruleForm.contract" placeholder="相关合同" style="width: 100%" multiple
+                     :disabled="inputType">
+            <el-option v-for="item in contractOptions" :key="item.id" :label="item.order_name" :value="item.id"/>
           </el-select>
         </el-form-item>
         <el-form-item prop="remark" label="备注" style="width: 100%">
-          <el-input :disabled="inputType" placeholder="备注" type="textarea" :rows="2" v-model="ruleForm.remark" />
+          <el-input :disabled="inputType" placeholder="备注" type="textarea" :rows="2" v-model="ruleForm.remark"/>
         </el-form-item>
         <!-- 回款信息 -->
         <div class="title-box">
           <h3>回款计划</h3>
           <el-icon class="icon" @click="openUpdate2" v-if="inputType && showBtn">
-            <IEpPlus />
+            <IEpPlus/>
           </el-icon>
         </div>
         <el-table :data="collectionTable" border>
-          <el-table-column prop="num" label="期次" />
-          <el-table-column prop="plan_money" label="金额" />
-          <el-table-column prop="plan_date" label="日期" />
+          <el-table-column prop="num" label="期次"/>
+          <el-table-column prop="plan_money" label="金额"/>
+          <el-table-column prop="plan_date" label="日期"/>
           <el-table-column label="操作" width="80" v-if="showBtn">
             <template #default="scoped">
               <el-button v-if="inputType" type="primary" @click="openEdit2(scoped)" link>
@@ -140,10 +141,10 @@
           </el-table-column>
         </el-table>
         <div style="margin: 10px 0" v-if="!inputType">
-          <el-input style="width: 220px" placeholder="期次" v-model="collectionForm.num" />
-          <el-input style="width: 220px; margin: 0 10px" placeholder="金额(元)" v-model="collectionForm.plan_money" />
+          <el-input style="width: 220px" placeholder="期次" v-model="collectionForm.num"/>
+          <el-input style="width: 220px; margin: 0 10px" placeholder="金额(元)" v-model="collectionForm.plan_money"/>
           <el-date-picker style="width: 220px; margin-right: 10px" v-model="collectionForm.plan_date" type="date"
-            placeholder="日期" value-format="YYYY-MM-DD" />
+                          placeholder="日期" value-format="YYYY-MM-DD"/>
           <el-button type="primary" @click="addCollection">
             + 新增期次
           </el-button>
@@ -154,20 +155,21 @@
           <div class="title-box">
             <h3>回款记录</h3>
             <el-icon class="icon" v-if="showBtn" @click="openUpdate3">
-              <IEpPlus />
+              <IEpPlus/>
             </el-icon>
           </div>
           <el-table :data="collectionLogs" border>
-            <el-table-column prop="return_money" label="回款金额" />
-            <el-table-column prop="return_date" label="回款日期" />
-            <el-table-column prop="remark" label="备注" />
+            <el-table-column prop="return_money" label="回款金额"/>
+            <el-table-column prop="return_date" label="回款日期"/>
+            <el-table-column prop="remark" label="备注"/>
             <el-table-column label="附件">
               <template #default="{ row }">
                 <div v-if="row.files">
                   <div v-for="item in JSON.parse(row.files)">
                     <span v-if="isImageUrl(item.url)" style="color: var(--el-color-primary); cursor: pointer;"
-                      @click="lookImg(item.url)"> {{
-                        item.name }}</span>
+                          @click="lookImg(item.url)"> {{
+                        item.name
+                      }}</span>
                     <a v-else :href="item.url" target="_blank" :download="item.name">
                       {{ item.name }}
                     </a>
@@ -205,17 +207,17 @@
           <div class="title-box" style="margin-top: 20px">
             <h3>配送信息</h3>
             <el-icon class="icon" v-if="inputType && showBtn" @click="openUpdate4">
-              <IEpEdit />
+              <IEpEdit/>
             </el-icon>
           </div>
           <el-form-item label="收货人">
-            <el-input style="width: 100%" placeholder="收货人" v-model="ruleForm.addr_name" :disabled="true" />
+            <el-input style="width: 100%" placeholder="收货人" v-model="ruleForm.addr_name" :disabled="true"/>
           </el-form-item>
           <el-form-item label="收货人电话">
-            <el-input placeholder="收货人电话" v-model="ruleForm.addr_phone" :disabled="true" />
+            <el-input placeholder="收货人电话" v-model="ruleForm.addr_phone" :disabled="true"/>
           </el-form-item>
           <el-form-item label="收货人地址" style="width: 100%">
-            <el-input :disabled="true" placeholder="收货人地址" type="textarea" :rows="2" v-model="ruleForm.address" />
+            <el-input :disabled="true" placeholder="收货人地址" type="textarea" :rows="2" v-model="ruleForm.address"/>
           </el-form-item>
         </div>
 
@@ -241,9 +243,9 @@
           </el-button>
         </div>
         <el-table :data="goodsTable" border>
-          <el-table-column prop="id" label="ID" width="60" />
-          <el-table-column prop="goods_name" label="商品名称" />
-          <el-table-column prop="goods_kind" label="商品类型" />
+          <el-table-column prop="id" label="ID" width="60"/>
+          <el-table-column prop="goods_name" label="商品名称"/>
+          <el-table-column prop="goods_kind" label="商品类型"/>
           <el-table-column prop="" label="规格/售价">
             <template #default="{ row }">
               <div>
@@ -256,13 +258,13 @@
           </el-table-column>
           <el-table-column label="合同价">
             <template #default="{ row }">
-              <el-input v-if="!inputType" placeholder="合同价" v-model="row.discount_amount" />
+              <el-input v-if="!inputType" placeholder="合同价" v-model="row.discount_amount"/>
               <span v-else>{{ row.discount_amount }}</span>
             </template>
           </el-table-column>
           <el-table-column label="数量">
             <template #default="{ row }">
-              <el-input placeholder="数量" v-if="!inputType" v-model="row.count" />
+              <el-input placeholder="数量" v-if="!inputType" v-model="row.count"/>
               <span v-else>{{ row.count }}</span>
             </template>
           </el-table-column>
@@ -279,9 +281,9 @@
         <div style="margin-top: 20px" v-if="ruleForm.sends && ruleForm.sends.length > 0">
           <h3>物流信息</h3>
           <el-table :data="ruleForm.sends" border>
-            <el-table-column prop="company_name" label="快递名称" />
-            <el-table-column prop="send_number" label="快递单号" />
-            <el-table-column prop="send_remark" label="备注" />
+            <el-table-column prop="company_name" label="快递名称"/>
+            <el-table-column prop="send_number" label="快递单号"/>
+            <el-table-column prop="send_remark" label="备注"/>
           </el-table>
         </div>
 
@@ -316,21 +318,21 @@
     </template>
   </el-dialog>
   <!-- 添加关联商品 -->
-  <goodsPage ref="goodsPageRef" @selectGoodsFun="selectGoodsFun" />
+  <goodsPage ref="goodsPageRef" @selectGoodsFun="selectGoodsFun"/>
   <!-- 编辑组件 -->
   <!-- 基本信息 -->
   <update1 ref="update1Ref" :contractOptions="contractOptions" :dataInfo="dataInfo" :userOptions="userOptions"
-    :userData="userData" @refreshFun="refreshFun" />
-  <update2 ref="update2Ref" :dataInfo="dataInfo" @refreshList="refreshFun" />
-  <update3 ref="update3Ref" :dataInfo="dataInfo" @refreshList="refreshFun" @addRefreshList="addRefreshList" />
-  <update4 ref="update4Ref" :dataInfo="dataInfo" @refreshList="refreshFun" />
-  <update5 ref="update5Ref" :dataInfo="dataInfo" @refreshList="refreshFun" />
-  <imgDialog ref="imgDialogRef" />
+           :userData="userData" @refreshFun="refreshFun"/>
+  <update2 ref="update2Ref" :dataInfo="dataInfo" @refreshList="refreshFun"/>
+  <update3 ref="update3Ref" :dataInfo="dataInfo" @refreshList="refreshFun" @addRefreshList="addRefreshList"/>
+  <update4 ref="update4Ref" :dataInfo="dataInfo" @refreshList="refreshFun"/>
+  <update5 ref="update5Ref" :dataInfo="dataInfo" @refreshList="refreshFun"/>
+  <imgDialog ref="imgDialogRef"/>
 </template>
 <script setup>
-import { treePersonApi } from "@/plugins/api/system/user";
-import { fileApi } from "@/plugins/api/upload";
-import { optionsApi } from "@/plugins/api/customer/manage/contacts";
+import {treePersonApi} from "@/plugins/api/system/user";
+import {fileApi} from "@/plugins/api/upload";
+import {optionsApi} from "@/plugins/api/customer/manage/contacts";
 import {
   addApi,
   detailApi,
@@ -359,12 +361,13 @@ const props = defineProps({
 });
 
 
-
 // 查看图片
 let imgDialogRef = ref(null);
+
 function lookImg(src) {
   imgDialogRef.value.initFun(src, '70%');
 }
+
 function isImageUrl(url) {
   // 首先,检查URL是否包含至少一个'.'  
   if (!url.includes('.')) {
@@ -386,38 +389,51 @@ function isImageUrl(url) {
 // let dataInfo = ref({})
 // 基本信息--1
 let update1Ref = ref(null);
+
 function openUpdate1() {
   update1Ref.value.initFun(ruleForm.value);
 }
+
 // 回款计划--2
 let update2Ref = ref(null);
+
 function openUpdate2() {
   update2Ref.value.initFun(ruleForm.value);
 }
+
 function openEdit2(scoped) {
   update2Ref.value.initFun(scoped.row, "edit");
 }
+
 // 回款记录--3
 let update3Ref = ref(null);
+
 function openUpdate3() {
   update3Ref.value.initFun(ruleForm.value);
 }
+
 function openEdit3(row) {
   update3Ref.value.initFun(row, "edit");
 }
+
 // 配送信息--4
 let update4Ref = ref(null);
+
 function openUpdate4() {
   update4Ref.value.initFun(ruleForm.value);
 }
+
 // 配送信息--5
 let update5Ref = ref(null);
+
 function openUpdate5() {
   update5Ref.value.initFun(ruleForm.value);
 }
+
 //
 //联系人(客户)
 let userData = ref([]);
+
 function getCustomer() {
   optionsApi({
     customer_id: props.dataInfo.customer_id,
@@ -425,6 +441,7 @@ function getCustomer() {
     userData.value = res;
   });
 }
+
 let ruleForm = ref({});
 let rules = {
   order_name: [
@@ -476,6 +493,14 @@ let rules = {
       trigger: "change",
     },
   ],
+  truck_price:
+      [
+        {
+          required: true,
+          message: "运费(元)",
+          trigger: "blur",
+        },
+      ],
   owner_by: [
     {
       required: true,
@@ -506,13 +531,16 @@ let rules = {
   ],
 };
 let dialogVisible = ref(false);
+
 function handleClose(done) {
   ElMessageBox.confirm("是否确定关闭此对话框?")
-    .then(() => {
-      done();
-    })
-    .catch(() => { });
+      .then(() => {
+        done();
+      })
+      .catch(() => {
+      });
 }
+
 let title = ref("");
 let submitType = ref("");
 let inputType = computed(() => {
@@ -544,7 +572,7 @@ function initFun(type, row) {
   goodsTable.value = []; //商品
   activities.value = []; //变更记录
   if (!props.showBtn) {
-    ruleForm.value = { ...row };
+    ruleForm.value = {...row};
   }
   // 配送信息
   ruleForm.value.addr_name = props.dataInfo.shouhuoren;
@@ -557,10 +585,11 @@ function initFun(type, row) {
   getUsers();
   getContract();
 }
+
 function detailFun(id) {
   return new Promise((resolve, reject) => {
     detailApi(id).then((res) => {
-      ruleForm.value = { ...res };
+      ruleForm.value = {...res};
       resolve(res);
       if (res.files_arr) {
         fileList.value = res.files_arr.slice();
@@ -598,15 +627,19 @@ function detailFun(id) {
     });
   });
 }
+
 function refreshFun() {
   detailFun(ruleForm.value.id);
   emit("refreshList");
 }
+
 //
 function addRefreshList(row) {
   collectionLogs.value.push(row);
 }
+
 const emit = defineEmits(["refreshList"]);
+
 function submit() {
   if (!ruleFormRef.value) return;
   ruleFormRef.value.validate((valid, fields) => {
@@ -614,8 +647,8 @@ function submit() {
       let obj = Object.assign({}, ruleForm.value);
       obj.customer_id = props.dataInfo.id;
       if (
-        ruleForm.value.datetimerange &&
-        ruleForm.value.datetimerange.length == 2
+          ruleForm.value.datetimerange &&
+          ruleForm.value.datetimerange.length == 2
       ) {
         obj.start_date = ruleForm.value.datetimerange[0];
         obj.end_date = ruleForm.value.datetimerange[1];
@@ -626,15 +659,21 @@ function submit() {
       //
       obj.plans = [...collectionTable.value];
       if (
-        collectionForm.value.num &&
-        collectionForm.value.plan_money &&
-        collectionForm.value.plan_date
+          collectionForm.value.num &&
+          collectionForm.value.plan_money &&
+          collectionForm.value.plan_date
       ) {
         obj.plans.push(collectionForm.value);
       }
       //
       obj.goods = goodsTable.value.map((ele) => {
         ele.sku_id = ele.id;
+        if (!ele.count || ele.count ==="") {
+          ele.count=1
+        }
+        if (!ele.discount_amount || ele.discount_amount ===""){
+          ele.discount_amount= ele.price_selling
+        }
         return ele;
       });
       if (ruleForm.value.contract) {
@@ -655,15 +694,19 @@ function heTongChange(type) {
     ruleForm.value.c = new Date();
   }
 }
+
 // 销售
 let userOptions = ref([]);
+
 function getUsers() {
   treePersonApi().then((res) => {
     userOptions.value = res;
   });
 }
+
 // 文件上传
 let fileList = ref([]);
+
 function fileOnChange(file) {
   let formData = new FormData();
   formData.append("file", file.raw);
@@ -678,11 +721,14 @@ function fileOnChange(file) {
     }
   });
 }
+
 function fileRemove(i) {
   fileList.value.splice(i, 1);
 }
+
 // 相关合同
 let contractOptions = ref([]);
+
 function getContract() {
   contractApi({
     customer_id: props.dataInfo.customer_id,
@@ -690,9 +736,11 @@ function getContract() {
     contractOptions.value = data;
   });
 }
+
 // 回款信息
 let collectionTable = ref([]);
 let collectionForm = ref({});
+
 function collectionDel(row) {
   collectionTable.value.splice(row.$index, 1);
 }
@@ -710,29 +758,39 @@ function addCollection() {
   collectionTable.value.push(collectionForm.value);
   collectionForm.value = {};
 }
+
 // 回款记录
 let collectionLogs = ref([]);
 
 // 商品明细
 let goodsTable = ref([]);
 let goodsPageRef = ref(null);
+
 function addGoodsFun() {
   goodsPageRef.value.initFun();
 }
+
 function selectGoodsFun(arr) {
   if (arr && arr.length > 0) {
     arr.forEach((item) => {
+      console.log( item,"==============price_selling=======")
       // 不再判断是否有相同的商品,直接添加
-      // if (
-      //   !goodsTable.value.some((ele) => {
-      //     return ele.id == item.id;
-      //   })
-      // ) {
-      goodsTable.value.push(item);
-      // }
+      const existingItem = goodsTable.value.find((ele) => ele.id === item.id);
+      if (existingItem) {
+        // 如果商品已存在,数量 +1
+        existingItem.count = (parseInt(existingItem.count) || 0) + 1;
+      } else {
+        item.count=parseInt(item.count|| 1)
+        if (!item.discount_amount){
+          item.discount_amount= item.price_selling
+        }
+        // 否则新增商品
+        goodsTable.value.push(item);
+      }
     });
   }
 }
+
 function goodsDel(scoped) {
   if (!inputType.value) {
     goodsTable.value.splice(scoped.$index, 1);
@@ -744,6 +802,7 @@ function goodsDel(scoped) {
     });
   }
 }
+
 let allData = computed(() => {
   let num = 0;
   let price = 0;
@@ -763,7 +822,8 @@ let allData = computed(() => {
 // 合同变更记录
 let activities = ref([]);
 
-onMounted(() => { });
+onMounted(() => {
+});
 defineExpose({
   initFun,
 });

+ 3 - 2
src/views/finance/Index.vue

@@ -162,7 +162,7 @@ function getEchartsLine(dom, dataX, seriesList) {
         xAxisIndex: [0],
         start: 0, //初始化时,滑动条宽度开始标度
         bottom: "1%",
-        end: dataX.length > 15 ? 50 : 100,
+        // end: dataX.length > 15 ? 50 : 100,
         height: 10,
         fillerColor: "#3E86FF",
         borderColor: "transparent",
@@ -197,10 +197,11 @@ function getEchartsLine(dom, dataX, seriesList) {
       data: dataX,
       axisLabel: {
         interval: 0,
-        // rotate: 45, //X轴文字倾斜
+        rotate: 45, //X轴文字倾斜
 
         // color: "#cadbe3", //X轴文字颜色
         fontSize: "10", //文字大小
+        hideOverlap: false
       },
       axisLine: {
         lineStyle: {

+ 2 - 2
src/views/finance/Shopping.vue

@@ -98,7 +98,7 @@ function getEchartsLine(dom, dataX, seriesList) {
         xAxisIndex: [0],
         start: 0, //初始化时,滑动条宽度开始标度
         bottom: "1%",
-        end: dataX.length > 15 ? 50 : 100,
+        // end: dataX.length > 15 ? 50 : 100,
         height: 10,
         fillerColor: "#3E86FF",
         borderColor: "transparent",
@@ -133,7 +133,7 @@ function getEchartsLine(dom, dataX, seriesList) {
       data: dataX,
       axisLabel: {
         interval: 0,
-        // rotate: 45, //X轴文字倾斜
+        rotate: 45, //X轴文字倾斜
 
         // color: "#cadbe3", //X轴文字颜色
         fontSize: "10", //文字大小

+ 2 - 1
src/views/home/Index.vue

@@ -41,7 +41,8 @@
             </div>
             <img src="../../assets/imgs/icon/icon8.png" alt="" />
           </div>
-          <div class="item item-4">
+          <div class="item item-4 cursor-style"
+          @click="toPage('/shopping/order')">
             <div class="item-left">
               <div>今日新增订单</div>
               <h5>{{ analysis_data.order_new || 0 }}</h5>

+ 19 - 2
src/views/orders/Offline.vue

@@ -58,6 +58,9 @@
             <el-form-item style="width: 240px">
               <el-button type="primary" @click="searchFun">查询</el-button>
               <el-button @click="resetFun">重置</el-button>
+              <el-button type="success" @click="exportFun"
+              ><el-icon> <IEpDownload /> </el-icon>导出</el-button
+              >
             </el-form-item>
           </el-form>
         </div>
@@ -183,7 +186,7 @@
 </template>
 <script setup>
 import {
-  orderExpenseListApi, orderExpenseDelApi, orderExpenseTrashListApi
+  orderExpenseListApi, orderExpenseDelApi, orderExpenseTrashListApi, exportApi, exportApi2
 } from "@/plugins/api/shopping/order";
 import { useCounterStore } from "@/stores/counter.js";
 import AddDialog from "@/views/orders/components/AddOffline.vue";
@@ -324,7 +327,21 @@ function tabChange(name) {
 function imgSrc(path) {
   return import.meta.env.VITE_APP_BASE_API + path;
 }
-
+function exportFun() {
+  let obj = Object.assign({}, searchForm.value);
+  obj.order_date_start = obj.timeArr ? obj.timeArr[0] : "";
+  obj.order_date_end = obj.timeArr ? obj.timeArr[1] : "";
+  delete obj.timeArr;
+  if (obj.status == "all") obj.status = "";
+  exportApi2(obj).then((res) => {
+    const url = window.URL.createObjectURL(new Blob([res]));
+    const link = document.createElement("a");
+    link.href = url;
+    link.setAttribute("download", "data.xlsx");
+    document.body.appendChild(link);
+    link.click();
+  });
+}
 
 // 发货
 let sendPageRef = ref(null);

+ 13 - 4
src/views/orders/components/AddOffline.vue

@@ -186,7 +186,7 @@
                     <el-button @click="save" style="width: 100%;"  :disabled="pageType==='init'"  type="primary">保存</el-button>
                   </el-col>
                   <el-col :span="4" :offset="4">
-                    <el-button @click="markAsPaid" style="width: 100%;" :disabled="pageType==='init'" type="primary">已收款</el-button>
+                    <el-button @click="markAsPaid" style="width: 100%;" :disabled="pageType==='init'||orderItem.status===1" type="primary">已收款</el-button>
                   </el-col>
                   <el-col :span="4" :offset="4">
                     <el-button @click="refund" style="width: 100%;" :disabled="pageType==='init'"  type="danger">退款</el-button>
@@ -213,6 +213,7 @@ import {ElMessageBox, ElMessage} from 'element-plus';
 import {addApi, saveApi} from "@/plugins/api/shopping/manage";
 import {listApi as dictApi} from "@/plugins/api/system/dict";
 import {listApi} from "@/plugins/api/customer/manage/pool";
+import {listApi as listPrivateApi} from "@/plugins/api//customer/manage/my.js";
 import ProductList from "@/views/orders/components/ProductList.vue";
 import {useCounterStore} from "@/stores/counter";
 import {
@@ -239,7 +240,7 @@ function handleSelectionChange(val) {
 
 let ruleForm = ref({});
 
-let poolList = ref({});
+let poolList = ref([]);
 
 let orderObj = ref({id: 0, status: 0});
 let rules = {
@@ -376,6 +377,7 @@ function orderExpenseDel() {
   orderExpenseDelApi({order_no:orderItem.value.order_no})
       .then((res) => {
         ElMessage.success("退款成功");
+        dialogVisible.value = false;
         emit('refreshTable');
       });
 }
@@ -438,13 +440,15 @@ function save() {
 }
 
 function markAsPaid() {
-  if (!(orderItem.value.payment_type==='balance'  && ruleForm.value.paymentMethod==='1')){
+
+  if (!(orderItem.value.payment_type==='cash'  && ruleForm.value.paymentMethod==='2')){
      ElMessage.error('请先点击修改订单');
     return
   }
   // 标记为已收款逻辑
   orderExpensePayApi({order_no:orderItem.value.order_no,payment_type:orderItem.value.payment_type}).then((data) => {
     ElMessage.success("确认成功");
+    orderItem.value=data
     emit('refreshTable');
   })
 }
@@ -486,7 +490,12 @@ function initFun(type, row) {
   orderItem.value={}
   listApi().then((data) => {
     if (data != null && data.list != null) {
-      poolList.value = data.list;
+      poolList.value = poolList.value.concat(data.list || []);
+    }
+  });
+  listPrivateApi().then((data) => {
+    if (data != null && data.list != null) {
+      poolList.value = poolList.value.concat(data.list || []);
     }
   });
   handleClick(activeName.value)

+ 1 - 0
src/views/shopping/CourseOrder.vue

@@ -292,6 +292,7 @@ function getData() {
   obj.order_date_end = obj.timeArr ? obj.timeArr[1] : "";
   delete obj.timeArr;
   if (obj.status == "all") obj.status = "";
+  obj.goods_kind="课程商品";
   listApi(obj)
     .then((data) => {
       tableData.value = data.list;

+ 0 - 1
src/views/shopping/components/DialogSales.vue

@@ -235,7 +235,6 @@ function initFun(row) {
   }
   ruleForm.value.order_no = row.order_no;
   ruleForm2.value.order_no = row.order_no;
-  console.log(ruleForm.value,"ruleForm.value=>>>>>>>>>>>.")
   ruleForm2.value.refund_price = showForm.value.amount_total||"";
   dialogVisible.value = true;
 

+ 45 - 2
src/views/system/config/page/Shop.vue

@@ -189,7 +189,25 @@
           </el-icon>
         </el-upload>
       </el-form-item>
+      <el-form-item label="海报logo" :rules="[
+        { required: true, message: '上传海报logo', trigger: 'change' },
+      ]">
+        <div class="img-box" v-for="(item, i) in posterLogoList" :key="i">
+          <img :src="item.url" alt="" />
 
+          <div class="occlusion">
+            <el-icon class="del" @click="handleRemove(8, i)">
+              <IEpDelete />
+            </el-icon>
+          </div>
+        </div>
+        <el-upload action="#" list-type="picture-card" :auto-upload="false" :show-file-list="false"
+                   :file-list="posterLogoList" :on-change="onChange(11)">
+          <el-icon>
+            <IEpPlus />
+          </el-icon>
+        </el-upload>
+      </el-form-item>
       <el-form-item label="分享海报" :rules="[
         { required: true, message: '上传分享海报', trigger: 'change' },
       ]">
@@ -197,7 +215,7 @@
           <img :src="item.url" alt="" />
 
           <div class="occlusion">
-            <el-icon class="del" @click="handleRemove(7, i)">
+            <el-icon class="del" @click="handleRemove(11, i)">
               <IEpDelete />
             </el-icon>
           </div>
@@ -261,7 +279,8 @@ let fxshBgList = ref([]);
 // 加入会员广告图
 let joinVipAdList = ref([]);
 
-
+// 分享海报图
+let posterLogoList = ref([]);
 // 分享海报图
 let sharePosterList = ref([]);
 
@@ -380,6 +399,15 @@ const onChange = (type) => {
               fxshBgList.value.push(obj);
             }
             break;
+          case 11:
+            // 分享海报
+            if (posterLogoList.value.length > 0) {
+              posterLogoList.value = [];
+              posterLogoList.value.push(obj);
+            } else {
+              posterLogoList.value.push(obj);
+            }
+            break;
         }
         loading.value = false;
         //
@@ -426,6 +454,9 @@ const handleRemove = (type, index) => {
     case 10:
       fxshBgList.value.splice(index, 1);
       break;
+    case 11:
+      posterLogoList.value.splice(index, 1);
+      break;
     default:
       break;
   }
@@ -442,6 +473,7 @@ const submit = () => {
     const user_grade_bg = levelBgList.value && levelBgList.value.length ? levelBgList.value[0].url.replace(import.meta.env.VITE_APP_BASE_API, '') : null
     const user_in_bg = joinVipAdList.value && joinVipAdList.value.length ? joinVipAdList.value[0].url.replace(import.meta.env.VITE_APP_BASE_API, '') : null
     const shop_adimg = sharePosterList.value && sharePosterList.value.length ? sharePosterList.value[0].url.replace(import.meta.env.VITE_APP_BASE_API, '') : null
+    const shop_poster_logoimg = posterLogoList.value && posterLogoList.value.length ? posterLogoList.value[0].url.replace(import.meta.env.VITE_APP_BASE_API, '') : null
     if (valid) {
       let arr = [
         {
@@ -492,6 +524,10 @@ const submit = () => {
           conf_name: "wechat.shop_adimg",
           conf_value: shop_adimg,
         },
+        {
+          conf_name: "wechat.shop_poster_logoimg",
+          conf_value: shop_poster_logoimg,
+        },
         {
           conf_name: "wechat.btn_color",
           conf_value: formData.value.btn_color,
@@ -595,6 +631,13 @@ const getConfigApi = () => {
         url: import.meta.env.VITE_APP_BASE_API + data.wechat.shop_adimg,
       });
     }
+    // 海报logo
+    if (data?.wechat?.shop_poster_logoimg) {
+      posterLogoList.value = [];
+      posterLogoList.value.push({
+        url: import.meta.env.VITE_APP_BASE_API + data.wechat.shop_poster_logoimg,
+      });
+    }
 
   });
 }

Some files were not shown because too many files changed in this diff