Bläddra i källkod

提交配件商城

caojunjie 2 år sedan
förälder
incheckning
4b9c20d88b

+ 6 - 9
src/api/basicData/salesOrder.js

@@ -19,6 +19,7 @@ export const getListTwo = (current, size, params) => {
       ...params,
       current,
       size,
+      source:'1'
     }
   })
 }
@@ -44,7 +45,7 @@ export function gainUser(query) {
 }
 export function save(data) {
   return request({
-    url: '/api/blade-purchase-sales/appParts/quickBilling',
+    url: '/api/blade-purchase-sales/partsMall/savePlaceOrder',
     method: 'post',
     data:data
   })
@@ -74,14 +75,10 @@ export const getDetails = (data) => {
   return request({
     url: '/api/blade-purchase-sales/appParts/detail',
     method: 'get',
-    params:data
-  })
-}
-export const getDetailsTwo = (data) => {
-  return request({
-    url: '/api/blade-purchase-sales/webpage/detail',
-    method: 'get',
-    params:data
+    params:{
+      ...data,
+      source:'1'
+    }
   })
 }
 export function remove(data) {

+ 13 - 0
src/router/views/index.js

@@ -2419,5 +2419,18 @@ export default [{
     },
     component: () => import( /* webpackChunkName: "views" */ '@/views/paymentManagement/paymentRecord/index')
   }]
+}, {
+  path: '/productLaunch/index',
+  component: Layout,
+  hidden: true,
+  children: [{
+    path: '/productLaunch/index',
+    name: '产品上架',
+    meta: {
+      i18n: '/productLaunch/index',
+      keepAlive: true,
+    },
+    component: () => import( /* webpackChunkName: "views" */ '@/views/productLaunch/index')
+  }]
 }
 ]

+ 10 - 3
src/views/basicData/customerInformation/detailsPageEdit.vue

@@ -131,9 +131,16 @@
         </basic-container>
         <containerTitle title="客户联系人"></containerTitle>
         <basic-container>
-          <avue-crud ref="crud" :option="customerContact" v-model="contactsForm" :data="contactsData"
-            @saveColumn="saveColumn" @resetColumn="resetColumn" @row-save="rowSave" @row-update="rowUpdate"
-            @row-del="rowDel">
+          <avue-crud
+              ref="crud"
+              :option="customerContact"
+              v-model="contactsForm"
+              :data="contactsData"
+              @saveColumn="saveColumn"
+              @resetColumn="resetColumn"
+              @row-save="rowSave"
+              @row-update="rowUpdate"
+              @row-del="rowDel">
             <template slot-scope="{ type, size, row }" slot="menu">
               <el-button icon="el-icon-check" :size="size" :type="type" @click="creatingUsers(row)">创建用户</el-button>
             </template>

+ 225 - 0
src/views/client/detailsPage.vue

@@ -76,6 +76,22 @@
         </el-tabs> -->
 
       </trade-card>
+      <trade-card title="客户联系人">
+        <avue-crud
+            ref="crudTwo"
+            :option="customerContact"
+            v-model="contactsForm"
+            :data="contactsData"
+            @saveColumn="saveColumnTwo"
+            @resetColumn="resetColumnTwo"
+            @row-save="rowSave"
+            @row-update="rowUpdate"
+            @row-del="rowDelTwo">
+          <template slot-scope="{ type, size, row }" slot="menu">
+            <el-button icon="el-icon-check" :size="size" :type="type" @click="creatingUsers(row)">创建用户</el-button>
+          </template>
+        </avue-crud>
+      </trade-card>
       <containerTitle title="上传附件"></containerTitle>
       <c-upload v-loading="loadingBtn" typeUpload="CD"
         deleteUrl="/api/blade-client/corpsfiles/remove" :data="corpsFiles" display
@@ -93,6 +109,15 @@
         </div>
       </el-dialog>
     </div>
+
+    <el-dialog title="创建用户" :visible.sync="dialogVisibleBt" append-to-body width="60%">
+      <avue-form v-if="dialogVisibleBt" ref="formDataTwo" v-model="formDataTwo" :option="optionData">
+      </avue-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisibleBt = false">取 消</el-button>
+        <el-button type="primary" @click="confirmSynchronizationTwo">确 定</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -100,6 +125,12 @@
 import { option2, option3 } from "./js/optionList";
 import { getDetails, addCorpType, getCorpType, submit, customerList, itemDel } from "@/api/basicData/client";
 import corpType from '@/components/corpType/index'
+import customerContact from "@/views/basicData/customerInformation/configuration/customerContact.json";
+import {corpsattn, creatingUsers} from "@/api/basicData/customerInformation";
+import {getRoleTree} from "@/api/system/role";
+import {getDeptTree} from "@/api/system/dept";
+import {getPostList} from "@/api/system/post";
+import website from "@/config/website";
 export default {
   name: "index",
   data() {
@@ -108,6 +139,73 @@ export default {
         label: 'title',
         value: 'value'
       },
+      optionData: {
+        span: 8,
+        menuBtn: false,
+        column: [
+          {
+            label: "所属角色",
+            prop: "roleId",
+            multiple: true,
+            type: "tree",
+            dicData: [],
+            props: {
+              label: "title"
+            },
+            checkStrictly: true,
+            slot: true,
+            rules: [
+              {
+                required: true,
+                message: "请选择所属角色",
+                trigger: "click"
+              }
+            ]
+          },
+          {
+            label: "所属部门",
+            prop: "deptId",
+            type: "tree",
+            multiple: true,
+            dicData: [],
+            props: {
+              label: "title"
+            },
+            checkStrictly: true,
+            slot: true,
+            rules: [
+              {
+                required: true,
+                message: "请选择所属部门",
+                trigger: "click"
+              }
+            ]
+          },
+          {
+            label: "所属岗位",
+            prop: "postId",
+            type: "tree",
+            multiple: true,
+            dicData: [],
+            props: {
+              label: "postName",
+              value: "id"
+            },
+            rules: [
+              {
+                required: true,
+                message: "请选择所属岗位",
+                trigger: "click"
+              }
+            ]
+          }
+        ]
+      },
+      dialogVisibleBt:false,
+      formDataTwo:false,
+      customerContact: {},
+      contactsForm: {},
+      contactsData:[],
       corpTypeList: [],
       corpTypeVisible: false,
       activeName: 'first',
@@ -231,6 +329,10 @@ export default {
     }
   },
   async created() {
+    this.customerContact = await this.getColumnData(
+        this.getColumnName(143),
+        customerContact
+    );
     this.option2 = await this.getColumnData(this.getColumnName(208), option2);
     // this.option3 = await this.getColumnData(this.getColumnName(208.4), option3);
     if (this.detailData.id) {
@@ -239,10 +341,53 @@ export default {
     if (this.detailData.status == 1) {
       this.option.disabled = true;
     }
+    if (!website.tenantMode) {
+      this.initData(website.tenantId);
+    } else {
+      this.initData();
+    }
     this.getCorpType()
     this.getAllWorkDicts()
   },
   methods: {
+    initData(tenantId) {
+      getRoleTree(tenantId).then(res => {
+        const column = this.findObject(this.optionData.column, "roleId");
+        column.dicData = res.data.data;
+      });
+      getDeptTree(tenantId).then(res => {
+        const column = this.findObject(this.optionData.column, "deptId");
+        column.dicData = res.data.data;
+      });
+      getPostList(tenantId).then(res => {
+        const column = this.findObject(this.optionData.column, "postId");
+        column.dicData = res.data.data;
+      });
+    },
+    //确认创建用户
+    confirmSynchronizationTwo() {
+      this.$refs["formDataTwo"].validate((valid, done) => {
+        done();
+        if (valid) {
+          let data = JSON.parse(JSON.stringify(this.formDataTwo));
+          data.deptId = data.deptId.join(",");
+          data.roleId = data.roleId.join(",");
+          data.postId = data.postId.join(",");
+          creatingUsers({
+            ...data,
+            id: this.formRow.id
+          }).then(res => {
+            this.dialogVisibleBt = false;
+            this.formDataTwo = {}
+            this.$message.success(
+                "创建用户成功,默认帐号:手机号。默认密码:123456"
+            );
+          });
+        } else {
+          return false;
+        }
+      });
+    },
     getAllWorkDicts() {
       customerList({ corpType: "KH" }).then(res => {
         this.findObject(this.option4.column, "parentId").dicData = res.data.data.records
@@ -270,6 +415,7 @@ export default {
           this.form = res.data.data;
           this.data = res.data.data.corpsAddrList
           this.corpsFiles = res.data.data.corpsFiles
+          this.contactsData = res.data.data.corpsAttnList
         })
         .finally(() => {
           this.loadingBtn = false;
@@ -387,6 +533,7 @@ export default {
             corpType: "KH",
             corpsAddrList: this.data,
             corpsFiles: this.corpsFiles,
+            corpsAttnList:this.contactsData,
             billType:1
           }).then(res => {
               this.$message.success("保存成功");
@@ -431,6 +578,84 @@ export default {
         this.$refs.crud.$refs.dialogColumn.columnBox = false;
       }
     },
+
+
+    creatingUsers(row) {
+      if (row.id) {
+        if (row.tel) {
+          this.dialogVisibleBt = true;
+          this.formDataTwo = {};
+          this.formRow = row;
+        } else {
+          this.$message.error("请输入手机号");
+        }
+      } else {
+        this.$message.error("请保存数据后再点击");
+      }
+    },
+    //新增客户联系人保存触发
+    rowSave(row, done, loading) {
+      console.log(row, done, loading);
+      this.contactsData.push(row);
+      done();
+    },
+    //修改客户联系人触发
+    rowUpdate(row, index, done, loading) {
+      done(row);
+    },
+    //删除客户联系人触发
+    rowDelTwo(row, index, donerowDel) {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        // 数据回调进行刷新
+        if (row.id) {
+          corpsattn(row.id).then(res => {
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
+            this.contactsData.splice(index, 1);
+          });
+        } else {
+          this.$message({
+            type: "success",
+            message: "操作成功!"
+          });
+          this.contactsData.splice(index, 1);
+        }
+      });
+    },
+    async saveColumnTwo() {
+      const inSave = await this.saveColumnData(
+          this.getColumnName(143),
+          this.customerContact
+      );
+      if (inSave) {
+        this.$nextTick(() => {
+          this.$refs.crudTwo.doLayout();
+        });
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs.crudTwo.$refs.dialogColumn.columnBox = false;
+      }
+    },
+    async resetColumnTwo() {
+      this.customerContact = customerContact;
+      const inSave = await this.delColumnData(
+          this.getColumnName(143),
+          customerContact
+      );
+      if (inSave) {
+        this.$nextTick(() => {
+          this.$refs.crudTwo.doLayout();
+        });
+        this.$message.success("重置成功");
+        this.$refs.crudTwo.$refs.dialogColumn.columnBox = false;
+      }
+    },
     async saveColumn2() {
       const inSave = await this.saveColumnData(
         this.getColumnName(208.4),

+ 7 - 1
src/views/productLaunch/index.vue

@@ -166,7 +166,7 @@ export default {
           showColumn:false,
           type: 'select',
           span: 16,
-          dicUrl: "/api/blade-system/dict-biz/dictionary?code=lable",
+          dicUrl: "/api/blade-system/dict-biz/dictionary?code=label",
           props: {
             label: "dictValue",
             value: "dictKey"
@@ -224,6 +224,9 @@ export default {
       })
     },
     check(row) {
+      if (row.upperFrame == 0){
+        if (!Number(row.salesPrice)) return this.$message.error("上架失败,商城价格不能为0")
+      }
       submit({
         ...row,
         label: row.label.join(","),
@@ -240,6 +243,9 @@ export default {
         data.push(item.goodsId)
       }
       if (type === "up") {
+        for (let item of this.selectionList) {
+          if (!Number(item.salesPrice)) return this.$message.error("上架失败,商城价格不能为0")
+        }
         this.$confirm('是否确认全部上架?', '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',

+ 2 - 2
src/views/salesOrder/detailsPage.vue

@@ -141,7 +141,7 @@
 <script>
 import {optionList} from "./js/optionList";
 import {
-  getDetailsTwo,
+  getDetails,
   submit,
   getCorpDetails,
   remove,
@@ -526,7 +526,7 @@ export default {
     },
     getDetail(id) {
       this.loadingBtn = true
-      getDetailsTwo({ id: id })
+      getDetails({ id: id })
         .then(res => {
           this.form = res.data.data;
           this.data = res.data.data.orderItemsList;

+ 28 - 16
src/views/salesOrder/index.vue

@@ -1,20 +1,19 @@
 <template>
   <div>
     <basic-container v-show="show" class="page-crad">
-      <div style="display:flex;">
-        <el-badge v-for="item of badgeList" :value="item.count" :max="99" class="item" type="danger">
-          <el-button :type="search.status == item.status?'primary':''" size="mini" @click="query(item.status)">
-            {{ item.dictionaryStatus }}
-          </el-button>
-        </el-badge>
-      </div>
       <avue-crud :key="key" ref="crud" :option="option" :data="dataList" :page.sync="page" :search.sync="search"
                  @search-change="searchChange" @current-change="currentChange" @size-change="sizeChange"
                  @refresh-change="refreshChange" @on-load="onLoad" :table-loading="loading" @saveColumn="saveColumn"
                  @resetColumn="resetColumn" :cell-style="cellStyle" @search-criteria-switch="searchCriteriaSwitch">
         <template slot="menuLeft">
-          <el-button type="primary" size="mini" @click.stop="newAdd()">新建销售单
-          </el-button>
+          <div style="display:flex;padding-top: 10px">
+            <el-badge v-for="item of badgeList" :hidden="item.dictionaryStatus == '全部'?true:false" :value="item.count" :max="99" class="item" type="danger">
+              <el-button style="border-radius: 0" :type="search.status == item.status?'success':''" size="mini" @click="query(item.status)">
+                {{ item.dictionaryStatus }}
+              </el-button>
+            </el-badge>
+            <el-button type="primary" size="mini" @click.stop="newAdd()">新建销售单</el-button>
+          </div>
         </template>
         <template slot="corpIdSearch">
           <crop-select v-model="search.corpId" corpType="KH"></crop-select>
@@ -42,7 +41,7 @@
           <!--            <i class="tradingIcon icon-proceeds" />-->
           <!--          </el-tooltip>-->
           <el-tooltip class="item" effect="dark" content="发货" placement="top">
-            <i class="tradingIcon icon-deliver" v-if="row.status == 6" @click.stop="deliverGoods(row, index)"/>
+            <i class="tradingIcon icon-deliver" v-if="row.status == 3" @click.stop="deliverGoods(row, index)"/>
           </el-tooltip>
           <!--          <el-tooltip class="item" effect="dark" content="对账" placement="top">-->
           <!--            <i class="tradingIcon icon-reconciliation" />-->
@@ -109,7 +108,9 @@ export default {
       badgeList: [],
       show: true,
       loading: false,
-      search: {},
+      search: {
+        status:''
+      },
       detailData: {},
       dataList: [],
       selectionList: [],
@@ -278,7 +279,15 @@ export default {
     },
     onLoad(page, params = {}) {
       statusStatisticsApi().then(res => {
-        this.badgeList = res.data.data;
+        this.badgeList = [];
+        this.badgeList.push({
+          count:0,
+          dictionaryStatus:"全部",
+          status:''
+        });
+        for (let item of res.data.data){
+          this.badgeList.push(item)
+        }
       })
       let data = this.deepClone(Object.assign(params, this.search));
       data.billType = 'XS';
@@ -293,8 +302,7 @@ export default {
         page.currentPage,
         page.pageSize,
         data
-      )
-        .then(res => {
+      ).then(res => {
           this.dataList = res.data.data.records ? res.data.data.records : [];
           this.page.total = res.data.data.total;
         })
@@ -388,11 +396,12 @@ export default {
 
 ::v-deep .el-badge__content.is-fixed {
   z-index: 10;
+  right:25px
 }
 
 .item {
-  margin-right: 20px;
-  margin-bottom: 10px;
+  margin-right: -5px;
+  //margin-bottom: 10px;
 }
 
 .stat-td {
@@ -428,6 +437,9 @@ export default {
 ::v-deep .el-form-item__content{
   margin-left: 90px;
 }
+::v-deep .avue-crud__right{
+  padding-top: 5px;
+}
 ::v-deep .el-form-item__label {
   //text-align: right;
   //vertical-align: middle;

+ 14 - 0
src/views/salesOrder/js/optionList.js

@@ -87,6 +87,20 @@ export const option = {
       index: 7
     },
     {
+      label: "快递公司",
+      prop: "courierCorporation",
+      overHidden: true,
+      // search: true,
+      index: 7
+    },
+    {
+      label: "快递单号",
+      prop: "courierNumber",
+      overHidden: true,
+      // search: true,
+      index: 7
+    },
+    {
       label: "已收款",
       prop: "settlmentAmount",
       overHidden: true,

+ 2 - 3
vue.config.js

@@ -32,10 +32,9 @@ module.exports = {
       '/api': {
         //本地服务接口地址
         // target: 'http://192.168.3.64:1080',
-        // target: 'http://192.168.2.163:1080',
-        // target: 'http://192.168.0.106:1080',
+        target: 'http://192.168.0.103:1080',
         // 打包地址
-        target: 'http://121.37.83.47:10004',//服务器ip
+        // target: 'http://121.37.83.47:10004',//服务器ip
         // target: 'http://trade.tubaosoft.com:10004',//服务器域名
         ws: true,
         pathRewrite: {