浏览代码

Merge branch 'master' of http://git.dongkesoft.com:9001/iBOSS-2.0-Mini/iboss-mini-web

changhaoning 2 年之前
父节点
当前提交
d0c9412e76

+ 4 - 0
src/api/pages/common/common.js

@@ -227,6 +227,10 @@ export default {
     getCustomerByPage: 'get_customer_by_page',
     // 获取渠道
     getChannel: 'get_channel',
+    // 获取客户
+    getInventory: 'get_inventory',
+    // 获取客户(分页)
+    getInventoryByPage: 'get_inventory_by_page',
   },
 }
 

+ 4 - 0
src/api/pages/sale/saleOut.js

@@ -6,6 +6,10 @@
 export default {
   saleOutService: {
     prefix: '/sale-server/sale/saleOut/',
+    getOutForEdit: 'get_out_for_edit',
+    insertSaleOut: 'insert_sale_out',
+    editSaleOut: 'edit_sale_out',
+
   }
 }
 

+ 41 - 0
src/components/business/table-select/table-select.vue

@@ -1248,6 +1248,47 @@ export default {
           {field: 'skuSpec', minWidth: '40'},
         ]
       }
+      //库存
+      else if (this.dataType === this.$config.tableSelectType.inventory) {
+        this.service = this.$service.commonService
+        this.methodsName = 'getInventory'
+        this.methodsNameDetail = 'getInventoryByPage'
+        // 查询条件
+        this.searchContent = [
+          {
+            valueFormat: {code: 'skuCode'},
+          },
+          {
+            valueFormat: {code: 'skuName'},
+          },
+        ]
+        this.modalWidth = 550
+        this.colCount = 2
+        this.selectKey = 'skuId'
+        this.selectLabel = 'skuName'
+        this.columns = [
+          {field: 'skuCode', minWidth: '40'},
+          {field: 'skuName', minWidth: '40'},
+          {field: 'skuModel', minWidth: '40'},
+          {field: 'nonStdCode', minWidth: '40'},
+          {field: 'invQty', minWidth: '40'},
+          {field: 'outingQty', minWidth: '40'},
+          {field: 'usableQty', minWidth: '40'},
+          {field: 'whName', minWidth: '40'},
+          {field: 'skuSpec', minWidth: '40'},
+        ]
+        this.columnsDetail = [
+          {field: 'skuCode', minWidth: '40'},
+          {field: 'skuName', minWidth: '40'},
+          {field: 'skuModel', minWidth: '40'},
+          {field: 'nonStdCode', minWidth: '40'},
+          {field: 'invQty', minWidth: '40'},
+          {field: 'outingQty', minWidth: '40'},
+          {field: 'usableQty', minWidth: '40'},
+          {field: 'whName', minWidth: '40'},
+          {field: 'skuSpec', minWidth: '40'},
+        ]
+      }
       //成型模具
       else if (this.dataType === this.$config.tableSelectType.mould) {
         this.service = this.$service.commonService

+ 2 - 0
src/config/index.js

@@ -1235,6 +1235,8 @@ export default {
     warehousePlace: 'warehousePlace',
     //工位
     workStation: 'workStation',
+    //库存
+    inventory: 'inventory',
   },
   /**
    * @desc   : 选择类型

+ 4 - 1
src/store/module/user.js

@@ -272,7 +272,10 @@ export default {
       commit('setCpCode', data.company.cpCode)
       commit('setCpName', data.company.cpName)
       commit('setSvcCode', data.company.svcCode)
-      commit('setBaseUrl', data.company.svcIp + ':' + data.company.svcPort )
+
+      if(data.company.svcIp && data.company.svcPort){
+        commit('setBaseUrl', data.company.svcIp + ':' + data.company.svcPort )
+      }
 
       // commit('setStaffId', data.user.staffId)
       // commit('setStaffName', data.user.staffName)

+ 58 - 31
src/view/sale/order-out/form.vue

@@ -10,76 +10,80 @@
             <InputPop ref="orderNo" v-model="formData.orderNo" :readonly="true"/>
           </DkFormItem>
           <!--客户电话-->
-          <DkFormItem prop="cusPhone" :required="true">
-            <SelectMagnifier v-model="formData.cusPhone" :multiple="false"
-                             :input-read-only="true"
-                             ref="cusPhone" :select-flag=false
-                             :type="this.$config.MagnifierType.staff"
-                             :disabled="true">
+          <DkFormItem prop="cusPhone">
+            <SelectMagnifier v-model="formData.cusPhone"
+                             :telephone="true"
+                             :other-condition="{flgOrderForm: true}"
+                             primary-key="cusId"
+                             ref="cusPhone"
+                             :type="this.$config.MagnifierType.customer"
+                             :disabled="true"
+            >
             </SelectMagnifier>
           </DkFormItem>
           <!--客户名称-->
-          <DkFormItem prop="cusName" :required="true">
-            <InputPop ref="cusName" :readonly="checkColumnIsEdit('cusName')"
-                      v-model="formData.cusName"/>
+          <DkFormItem prop="cusName">
+            <InputPop ref="cusName" :disabled="true" v-model="formData.cusName"/>
           </DkFormItem>
           <!--客户区域-->
-          <DkFormItem prop="addressArea" :required="true">
+          <DkFormItem prop="addressArea">
             <RegionsChoose v-model="regionData" :options="cityData" :default-value="formData.addressArea"
-                           :readonly="true" ref="customerDistrict"></RegionsChoose>
+                           :readonly="true" ref="customerDistrict" :disabled="true"></RegionsChoose>
           </DkFormItem>
           <!--门牌号-->
-          <DkFormItem prop="addressNo" :required="true">
-            <InputPop ref="addressNo" :readonly="checkColumnIsEdit('addressNo')" v-model="formData.addressNo"/>
+          <DkFormItem prop="addressNo">
+            <InputPop ref="addressNo" v-model="formData.addressNo" :disabled="true"/>
           </DkFormItem>
           <!--联系人-->
           <DkFormItem prop="contactName">
-            <InputPop ref="contactName" :readonly="checkColumnIsEdit('contactName')"
+            <InputPop ref="contactName" :disabled="true"
                       v-model="formData.contactName"/>
           </DkFormItem>
           <!--详细地址-->
-          <DkFormItem prop="addressFull" :required="true">
-            <InputPop ref="addressFull" v-model="formData.addressFull"/>
+          <DkFormItem prop="addressFull">
+            <InputPop ref="addressFull" v-model="formData.addressFull" :disabled="true"/>
           </DkFormItem>
           <!--业务部门-->
-          <DkFormItem prop="orgId" :label="$t('orgId')" :required="true">
+          <DkFormItem prop="orgId" :label="$t('orgId')">
             <SelectMagnifier v-model="formData.orgId" :display-text="formData.orgName"
                              :type="this.$config.MagnifierType.org"
                              @ok="orgOk"
                              :initSearchFlag="true"
-                             :readonly="checkColumnIsEdit('orgId')"
-                             :multiple="false"/>
+                             :multiple="false" :disabled="true"/>
           </DkFormItem>
           <!--业务员-->
-          <DkFormItem prop="staffId" :label="$t('staffId')" :required="true">
+          <DkFormItem prop="staffId" :label="$t('staffId')">
             <SelectMagnifier v-model="formData.staffId" :display-text="formData.staffName"
                              :type="this.$config.MagnifierType.staff"
                              @ok="staffOk"
                              :initSearchFlag="true"
-                             :readonly="checkColumnIsEdit('staffId')"
-                             :multiple="false"/>
+                             :multiple="false" :disabled="true"/>
           </DkFormItem>
           <!--客户来源-->
-          <DkFormItem prop="cusFrom" :required="true">
+          <DkFormItem prop="cusFrom">
             <SelectPop v-model="formData.cusFrom" ref="cusFrom" :multiple="false"
                        :options="cusFromList"
-                       :disabled="checkColumnIsEdit('cusFrom')"
                        labelKey="fromName"
-                       valueKey=fromId>
+                       valueKey=fromId :disabled="true">
             </SelectPop>
           </DkFormItem>
           <!--销售渠道-->
-          <DkFormItem prop="channelId" :required="true">
+          <DkFormItem prop="channelId">
             <SelectPop v-model="formData.channelId" ref="channelId"
                        :options="channelList"
                        :multiple="false"
                        labelKey="channelName"
-                       valueKey="channelId">
+                       valueKey="channelId" :disabled="true">
             </SelectPop>
           </DkFormItem>
+          <!--送货时间-->
+          <DkFormItem prop="outDate" :data-type="$config.dataType.date">
+            <DatePickerPop v-model="formData.outDate"
+                           :short-cut-flag="true"/>
+          </DkFormItem>
           <!--单据备注-->
           <DkFormItem prop="remarks">
-            <InputPop ref="remarks" v-model="formData.remarks" :readonly="checkColumnIsEdit('remarks')"
+            <InputPop ref="remarks" v-model="formData.remarks"
                       maxlength=500 textareaFlag/>
           </DkFormItem>
         </DkForm>
@@ -472,7 +476,23 @@ export default {
      * @date   : 2022/03/04 13:17
      */
     detail(id) {
-
+      //如果是新建用订单ID,编辑、办理用出库单ID
+      if (this.type === this.$config.formMode.add) {
+        return this.excuteNoParam(this.$service.orderService, this.$service.orderService.getOrderForUpdate, [id]);
+      } else if (this.type === this.$config.formMode.handle) {
+        return this.excuteNoParam(this.$service.saleOutService, this.$service.saleOutService.getOutForEdit, [id]);
+      }
+    },
+    /**
+     * @desc   : 编辑页面赋值
+     * @author : 付斌
+     * @date   : 2024-03-03 9:33
+     */
+    setValuesByEdit(data) {
+      if (data) {
+        this.formData = data["order"];
+        this.formData.orderItemList = data["orderItem"];
+      }
     },
     /**
      * @desc   : 判断列是否可以编辑
@@ -606,8 +626,15 @@ export default {
    * @date   : 2022/3/3 10:32
    */
   created() {
-    this.focusItem = 'saleOutId';    // 给第一个组件赋值,可以在混入中自动去聚焦
-    this.primaryKey = 'saleOutId'  // 设置主键Id
+    this.focusItem = 'outId';    // 给第一个组件赋值,可以在混入中自动去聚焦
+    this.primaryKey = 'outId'  // 设置主键Id
+
+    //如果是新建用订单ID,编辑、办理用出库单ID
+    if (this.type === this.$config.formMode.add) {
+      this.detail(this.$route.query.orderId);
+    } else if (this.type === this.$config.formMode.handle) {
+      this.detail(this.$route.query.outId);
+    }
   },
 }
 </script>

+ 1 - 49
src/view/sale/order/form.vue

@@ -93,11 +93,6 @@
                        valueKey="channelId">
             </SelectPop>
           </DkFormItem>
-          <!--制单时间-->
-          <DkFormItem prop="makeTime" :data-type="$config.dataType.date" :required="true">
-            <DatePickerPop v-model="formData.makeTime"
-                           :short-cut-flag="true"/>
-          </DkFormItem>
           <!--送货时间-->
           <DkFormItem prop="deliveryDate" :data-type="$config.dataType.date">
             <DatePickerPop v-model="formData.deliveryDate"
@@ -190,50 +185,17 @@ export default {
   data() {
     let self = this
     return {
-      ruleFlag: false,
-      // 装修风格
-      orderFitupStyleFlg: null,
-      // 年龄构成
-      orderAgeCompositionFlg: null,
-      // 决策者
-      orderDecisionMakerFlg: null,
-      // 房屋类型
-      orderHouseTypeFlg: null,
-      // 合同号
-      orderContractNoFlg: null,
       //新增省市区
       addressArea: [],
-      //画面模式选项
-      tabsOptions: [
-        {label: self.$t('order-message'), name: 'name1'},
-        {label: self.$t('goods-message'), name: 'name2'},
-        {label: self.$t('customer-account'), name: 'name3'},
-        {label: self.$t('file'), name: 'name5'},
-      ],
-      //画面模式选项角标
-      bottomList: ['1', '2', '3', '5'],
       setCustomerFlag: false,  // 是否是选择客户设置以及编辑时设置
       loading: false,
       //控制客户是否可以输入
       readonlyFlag: true,
-      changeOrgFlag: false,
-      //费用的列
-      feeItemColumns: [
-        {field: 'itemName', type: 'disabled', title: self.$t('costItemName'), width: 'auto'},
-        {field: 'itemAmt', type: 'number', digits: 2, sum: true},
-      ],
-      // //一直可以编辑的列(客户名称(暂时不让改)、客户来源、装修户型数、装修类型、房屋类型、装修风格、年龄构成、决策者 客户送货信息:客户地址、合同号、联系人、联系电话、小区档案 送货时间、备注、附件)
-      // alwaysEditColumns: ['remarks', 'designRemarks', 'cusFrom', 'toiletCount', 'fitupType', 'houseType', 'fitupStyle', 'ageComposition',
-      //   'decisionMaker', 'addressName', 'addressNo', 'contractNo', 'deliveryDate', 'estateId', 'contactName', 'contactPhone'],
-      // customerColumns: ['cusName', 'addressNo', 'addressGcj02', 'contactName', 'contactPhone', 'addressName'],
-      // allCanEdit: true,  //是否可以进行大编辑
       allCanNoEdit: false, //是否所有的都不允许编辑
       customerPhoneReadOnly: false,//电话是否可以只读
-      // fristCustomerId: null,//记录第一次选的客户
       // 画面表单数据
       formData: {
         cpId: self.$store.state.user.cpId,
-        editTime: null,//编辑的时间戳
         orderId: null, //订单Id
         orderNo: null,
         orderStatus: this.$config.orderStatus.done,//订单状态
@@ -257,7 +219,6 @@ export default {
         salesChannel: null, //销售渠道
         cusFrom: null,//客户来源
         deliveryDate: new Date().addDays(1),//送货时间
-        makeTime: new Date().format(),//制单日期
         remarks: null,
         orderItemList: [],
         deleteItemList: [],
@@ -298,7 +259,7 @@ export default {
           field: 'skuName',
           controlId: 'skuId',
           type: 'tableSelect',
-          width: 300,
+          width: 200,
           dataType: self.$config.tableSelectType.goods,
           fieldUpdate: self.$updateColumns.orderChooseGoods,
           searchDetailFlag: true
@@ -443,9 +404,6 @@ export default {
         },
       ],
       receiptList: [],//定金
-      warehouseList: [],//仓库
-      defWhId: null,//默认仓库id
-      warehouseName: null,//默认仓库名称
     }
   },
 
@@ -673,9 +631,6 @@ export default {
         this.formData = data["order"];
         this.formData.orderItemList = data["orderItem"];
 
-        // this.formData.makeTime = new Date(this.formData.makeTime).toDateStr();
-        // this.formData.deliveryDate = new Date(this.formData.deliveryDate).toDateStr();
-
         this.goodsFootFormData.sumQuantity = this.formData.sumQuantity;
         this.goodsFootFormData.sumAmount = this.formData.sumAmount;
         this.goodsFootFormData.sumStandard = this.formData.sumStandard;
@@ -710,7 +665,6 @@ export default {
       }
       Object.assign(this.params, this.formData, this.goodsFootFormData)
       this.params.deliveryDate = new Date(this.formData.deliveryDate).toDateStr();
-      this.params.makeTime = new Date(this.formData.makeTime).format();
       // console.log('this.params',this.params)
     },
     /**
@@ -735,7 +689,6 @@ export default {
       this.setCustomerFlag = true;
       this.formData = {
         cpId: null,//公司ID
-        editTime: null,//编辑的时间戳
         orderId: null, //订单Id
         orderNo: null,
         orderStatus: null,//订单状态
@@ -759,7 +712,6 @@ export default {
         salesChannel: null, //销售渠道
         cusFrom: null,//客户来源
         deliveryDate: new Date().addDays(1),//送货时间
-        makeTime: new Date().format(),//制单日期
         remarks: null,
         orderItemList: [],
         receiptFormData: {},