Browse Source

Merge remote-tracking branch 'origin/xq' into master_liushuang

ms-blue 1 month ago
parent
commit
1f10f29de4

+ 1 - 0
jshERP-web/src/components/jeecg/JEditableTable.vue

@@ -3306,6 +3306,7 @@ export default {
         overflow: hidden;
         white-space: nowrap;
         text-overflow: ellipsis;
+        max-width: 150px;
       }
     }
   }

+ 3 - 1
jshERP-web/src/components/jeecg/JUpload.vue

@@ -231,7 +231,9 @@ export default {
       let fileList = []
       let arr = paths.split(',')
       for (var a = 0; a < arr.length; a++) {
-        let url = getFileAccessHttpUrl('systemConfig/static/' + arr[a])
+        // let url = getFileAccessHttpUrl('systemConfig/static/' + arr[a])
+        let url = getFileAccessHttpUrl(arr[a])
+
         fileList.push({
           uid: uidGenerator(),
           name: getFileName(arr[a]),

+ 2 - 2
jshERP-web/src/components/jeecgbiz/modal/JSelectMaterialModal.vue

@@ -93,14 +93,14 @@
                     </a-select>
                   </a-form-item>
                 </a-col>
-                <a-col :md="6" :sm="24">
+                <!-- <a-col :md="6" :sm="24">
                   <a-form-item label="批号" :labelCol="{ span: 5 }" :wrapperCol="{ span: 18, offset: 1 }">
                     <a-select placeholder="有无批号" v-model="queryParam.enableBatchNumber">
                       <a-select-option value="1">有</a-select-option>
                       <a-select-option value="0">无</a-select-option>
                     </a-select>
                   </a-form-item>
-                </a-col>
+                </a-col> -->
               </template>
             </a-row>
           </a-form>

+ 3 - 3
jshERP-web/src/mixins/newTableMixin.js

@@ -5,8 +5,8 @@ export const newTableMixin = {
     return {
       ipagination: {
         current: 1,
-        pageSize: 2,
-        pageSizeOptions: ['2', '20', '30', '50', '100'],
+        pageSize: 10,
+        pageSizeOptions: ['10', '20', '30', '50', '100'],
         showTotal: (total, range) => {
           return range[0] + '-' + range[1] + ' 共' + total + '条'
         },
@@ -61,7 +61,7 @@ export const newTableMixin = {
     getTaskkboxProps(record) {
       return {
         props: {
-          disabled: record.taskStatus !== 1 || record.taskStatus !== 4,
+          disabled: record.taskStatus !== 1 && record.taskStatus !== 4,
         },
       }
     },

+ 1 - 0
jshERP-web/src/views/bill/PurchaseOrderList.vue

@@ -189,6 +189,7 @@
               <a-tag v-if="status == '1'" color="green">已审核</a-tag>
               <a-tag v-if="status == '2'" color="cyan">完成采购</a-tag>
               <a-tag v-if="status == '3'" color="blue">部分采购</a-tag>
+              <a-tag v-if="status == '4'" color="purple">进行中</a-tag>
               <a-tag v-if="status == '9'" color="orange">审核中</a-tag>
             </template>
           </a-table>

+ 5 - 0
jshERP-web/src/views/bill/dialog/BillDetail.vue

@@ -558,6 +558,11 @@
                 {{ model.debt }}
               </a-form-item>
             </a-col>
+            <a-col :lg="6" :md="12" :sm="24">
+              <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="二维码">
+                <vue-qr :text="model.number" :size="200" />
+              </a-form-item>
+            </a-col>
             <a-col v-if="model.hasBackFlag" :span="6">
               <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="退货单号">
                 <template v-for="(item, index) in linkNumberList">

+ 4 - 2
jshERP-web/src/views/bill/mixins/BillModalMixin.js

@@ -484,6 +484,7 @@ export const BillModalMixin = {
           getMaterialByBatchNumber(param).then((res) => {
             if (res && res.code === 200) {
               let mList = res.data
+
               if (value.indexOf(',') > -1) {
                 //多个条码
                 this.$refs.materialDataTable.getValues((error, values) => {
@@ -541,6 +542,7 @@ export const BillModalMixin = {
                       values: mInfoEx,
                     }
                     mArr.push(mObj)
+
                     target.setValues(mArr)
                     target.recalcAllStatisticsColumns()
                     that.autoChangePrice(target)
@@ -698,7 +700,7 @@ export const BillModalMixin = {
             }
             for (let i of arr) {
               if (i.name === value) {
-                target.setValues([{ rowKey: row.id, values: { actualQuantityInStorage: i.ratio, unitName: i.name } }])
+                target.setValues([{ rowKey: row.id, values: { unitName: i.name } }])
               }
             }
           }
@@ -709,7 +711,7 @@ export const BillModalMixin = {
     //转为商品对象
     parseInfoToObj(mInfo) {
       return {
-        barCode: mInfo.mBarCode,
+        barCode: mInfo.barCode,
         batchNumber: mInfo.batchNumber,
         name: mInfo.name,
         standard: mInfo.standard,

+ 4 - 1
jshERP-web/src/views/bill/modules/OtherInModal.vue

@@ -28,7 +28,7 @@
             <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="供应商">
               <a-select
                 placeholder="请选择供应商"
-                v-decorator="['organId']"
+                v-decorator="['organId', validatorRules.organId]"
                 :disabled="!rowCanEdit"
                 :dropdownMatchSelectWidth="false"
                 showSearch
@@ -342,6 +342,9 @@ export default {
       },
       confirmLoading: false,
       validatorRules: {
+        organId: {
+          rules: [{ required: true, message: '请选择供应商!' }],
+        },
         operTime: {
           rules: [{ required: true, message: '请输入单据日期!' }],
         },

+ 4 - 1
jshERP-web/src/views/bill/modules/OtherOutModal.vue

@@ -28,7 +28,7 @@
             <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="客户">
               <a-select
                 placeholder="请选择客户"
-                v-decorator="['organId']"
+                v-decorator="['organId', validatorRules.organId]"
                 :disabled="!rowCanEdit"
                 :dropdownMatchSelectWidth="false"
                 showSearch
@@ -342,6 +342,9 @@ export default {
       },
       confirmLoading: false,
       validatorRules: {
+        organId: {
+          rules: [{ required: true, message: '请选择客户!' }],
+        },
         operTime: {
           rules: [{ required: true, message: '请输入单据日期!' }],
         },

+ 2 - 1
jshERP-web/src/views/bill/modules/PurchaseInModal.vue

@@ -294,8 +294,9 @@
             </a-form-item>
           </a-col>
           <a-col :lg="6" :md="12" :sm="24">
-            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="本次付款">
+            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="本次实际付款">
               <a-input
+                disabled
                 placeholder="请输入本次付款"
                 v-decorator.trim="['changeAmount', validatorRules.changeAmount]"
                 @change="onChangeChangeAmount"

+ 26 - 1
jshERP-web/src/views/bill/modules/PurchaseOrderModal.vue

@@ -319,6 +319,20 @@
             </a-form-item>
           </a-col>
         </a-row>
+        <a-row class="form-row" :gutter="24">
+          <a-col :lg="6" :md="12" :sm="24">
+            <a-form-item
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              label="凭证图片"
+              data-step="11"
+              data-title="附件"
+              data-intro="可以上传与单据相关的图片、文档,支持多个文件"
+            >
+              <j-image-upload v-model="imageList" bizPath="material" text="上传图片" isMultiple></j-image-upload>
+            </a-form-item>
+          </a-col>
+        </a-row>
       </a-form>
     </a-spin>
     <many-account-modal ref="manyAccountModalForm" @ok="manyAccountModalFormOk"></many-account-modal>
@@ -347,6 +361,7 @@ import { BillModalMixin } from '../mixins/BillModalMixin'
 import { findBillDetailByNumber, getCurrentSystemConfig } from '@/api/api'
 import { getMpListShort, changeListFmtMinus, handleIntroJs } from '@/utils/util'
 import JUpload from '@/components/jeecg/JUpload'
+import JImageUpload from '@/components/jeecg/JImageUpload.vue'
 import JDate from '@/components/jeecg/JDate'
 import Vue from 'vue'
 // import QrcodeVue from 'qrcode.vue'
@@ -363,6 +378,7 @@ export default {
     WorkflowIframe,
     BillPrintIframe,
     JUpload,
+    JImageUpload,
     JDate,
     // QrcodeVue,
     VNodes: {
@@ -383,6 +399,7 @@ export default {
       operTimeStr: '',
       prefixNo: 'CGDD',
       fileList: [],
+      imageList: [],
       rowCanEdit: true,
       //以销定购的场景开关
       purchaseBySaleFlag: false,
@@ -420,7 +437,7 @@ export default {
           { title: '商品条码', key: 'barCode', width: '6%', type: FormTypes.normal },
           { title: '仓库名', key: 'depotName', width: '6%', type: FormTypes.normal },
           { title: '仓库货架', key: 'position', width: '6%', type: FormTypes.normal },
-          { title: '包装规格', key: 'unitName', width: '6%', type: FormTypes.input },
+          { title: '包装规格', key: 'unitName', width: '6%', type: FormTypes.normal },
 
           { title: '型号', key: 'model', width: '9%', type: FormTypes.normal },
           { title: '颜色', key: 'color', width: '5%', type: FormTypes.normal },
@@ -517,6 +534,7 @@ export default {
       if (this.action === 'add') {
         this.addInit(this.prefixNo)
         this.fileList = []
+        this.imageList = []
         this.$nextTick(() => {
           handleIntroJs(this.prefixNo, 1)
         })
@@ -535,6 +553,8 @@ export default {
           this.manyAccountBtnStatus = false
         }
         this.fileList = this.model.fileName
+        this.imageList = this.model.voucherPicture
+
         this.$nextTick(() => {
           this.form.setFieldsValue(
             pick(
@@ -598,6 +618,11 @@ export default {
       } else {
         billMain.fileName = ''
       }
+      if (this.imageList && this.imageList.length > 0) {
+        billMain.voucherPicture = this.imageList
+      } else {
+        billMain.voucherPicture = ''
+      }
       if (this.model.id) {
         billMain.id = this.model.id
       }

+ 26 - 5
jshERP-web/src/views/bill/modules/SaleOrderModal.vue

@@ -282,8 +282,26 @@
               />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24"> </a-col>
-          <a-col :lg="6" :md="12" :sm="24"> </a-col>
+          <a-col :lg="6" :md="12" :sm="24">
+            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="收货人" data-step="10">
+              <a-input placeholder="请输入收货人" v-decorator.trim="['receiverName']" :readOnly="true" />
+            </a-form-item>
+          </a-col>
+          <a-col :lg="6" :md="12" :sm="24">
+            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="收货人电话" data-step="10">
+              <a-input placeholder="请输入收货人电话" v-decorator.trim="['receiverPhone']" :readOnly="true" />
+            </a-form-item>
+          </a-col>
+          <a-col :lg="6" :md="12" :sm="24">
+            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="收货地址" data-step="8">
+              <a-input
+                style="width: 80%"
+                placeholder="请输入收货地址"
+                v-decorator.trim="['receiverAddress']"
+                :readOnly="true"
+              />
+            </a-form-item>
+          </a-col>
         </a-row>
         <a-row class="form-row" :gutter="24">
           <a-col :lg="6" :md="12" :sm="24">
@@ -382,10 +400,10 @@ export default {
             multi: true,
             validateRules: [{ required: true, message: '${title}不能为空' }],
           },
-          { title: '名称', key: 'name', width: '10%', type: FormTypes.normal },
+          { title: '名称', key: 'name', width: '9%', type: FormTypes.normal },
           { title: '规格', key: 'standard', width: '9%', type: FormTypes.normal },
 
-          { title: '生产日期', key: 'productionDate', width: '9%', type: FormTypes.normal },
+          { title: '生产日期', key: 'productionDate', width: '6%', type: FormTypes.normal },
           { title: '保质期', key: 'expiryNum', width: '6%', type: FormTypes.normal },
           { title: '商品条码', key: 'barCode', width: '6%', type: FormTypes.normal },
           { title: '仓库名', key: 'depotName', width: '6%', type: FormTypes.normal },
@@ -513,7 +531,10 @@ export default {
               'discountLastMoney',
               'accountId',
               'changeAmount',
-              'salesMan'
+              'salesMan',
+              'receiverName',
+              'receiverPhone',
+              'receiverAddress'
             )
           )
         })

+ 27 - 6
jshERP-web/src/views/bill/modules/SaleOutModal.vue

@@ -339,9 +339,21 @@
               />
             </a-form-item>
           </a-col>
-          <a-col :lg="6" :md="12" :sm="24"> </a-col>
-          <a-col :lg="6" :md="12" :sm="24"> </a-col>
-          <a-col :lg="6" :md="12" :sm="24"> </a-col>
+          <a-col :lg="6" :md="12" :sm="24">
+            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="收货人" data-step="10">
+              <a-input placeholder="请输入收货人" v-decorator="['receiverName']" :readOnly="true" />
+            </a-form-item>
+          </a-col>
+          <a-col :lg="6" :md="12" :sm="24">
+            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="收货人电话" data-step="10">
+              <a-input placeholder="请输入收货人电话" v-decorator="['receiverPhone']" :readOnly="true" />
+            </a-form-item>
+          </a-col>
+          <a-col :lg="6" :md="12" :sm="24">
+            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="收货地址" data-step="10">
+              <a-input placeholder="请输入收货地址" v-decorator="['receiverAddress']" :readOnly="true" />
+            </a-form-item>
+          </a-col>
         </a-row>
         <a-row class="form-row" :gutter="24">
           <a-col :lg="6" :md="12" :sm="24">
@@ -474,7 +486,7 @@ export default {
           { title: '生产日期', key: 'productionDate', width: '9%', type: FormTypes.normal },
           { title: '保质期', key: 'expiryNum', width: '6%', type: FormTypes.normal },
           { title: '商品条码', key: 'barCode', width: '6%', type: FormTypes.normal },
-          { title: '仓库名', key: 'depotName', width: '6%', type: FormTypes.normal },
+          { title: '仓库名', key: 'depotId', width: '6%', type: FormTypes.select, disabled: true },
           { title: '仓库货架', key: 'position', width: '6%', type: FormTypes.normal },
           { title: '包装规格', key: 'unitName', width: '6%', type: FormTypes.normal },
 
@@ -640,7 +652,10 @@ export default {
               'deposit',
               'changeAmount',
               'debt',
-              'salesMan'
+              'salesMan',
+              'receiverName',
+              'receiverPhone',
+              'receiverAddress'
             )
           )
         })
@@ -721,7 +736,10 @@ export default {
       remark,
       depotId,
       accountId,
-      salesMan
+      salesMan,
+      receiverName,
+      receiverPhone,
+      receiverAddress
     ) {
       let that = this
       this.rowCanEdit = false
@@ -769,6 +787,9 @@ export default {
             changeAmount: changeAmount,
             accountId: accountId,
             remark: remark,
+            receiverName,
+            receiverPhone,
+            receiverAddress,
           })
           this.personList.value = salesMan
         })

+ 4 - 4
jshERP-web/src/views/stock/CheckList.vue

@@ -11,9 +11,7 @@
           :deoptData="deoptData"
         ></filter-form>
         <div style="margin-bottom: 6px">
-          <a-button :disabled="!selectedRowKeys.length" type="primary" icon="plus" @click="onStartTask"
-            >开始盘点</a-button
-          >
+          <a-button :disabled="!selectedRowKeys.length" type="primary" @click="onStartTask">开始盘点</a-button>
 
           <!-- <a-popconfirm style="margin: 0 6px" title="确定取消选中的盘点任务吗?" @confirm="() => cancelTask()">
             <a-button :disabled="!selectedRowKeys.length">取消盘点</a-button>
@@ -220,11 +218,13 @@ export default {
     onStartTask() {
       const ids = this.selectedRowKeys
       const url = this.url.startTask + ids
+      // this.$refs.table.clearSelection()
+
       getAction(url)
         .then((res) => {
           this.$message.success('盘点成功')
           this.getList()
-          this.$refs.table.clearSelection()
+          this.selectedRowKeys = []
         })
         .catch((err) => {
           this.$message.error('盘点失败')

+ 3 - 2
jshERP-web/src/views/stock/TaskList.vue

@@ -4,7 +4,8 @@
       <a-card :bordered="false">
         <!-- 查询区域 -->
         <filter-form
-          @search="getList"
+          @search="onSearch"
+          @reset="onReset"
           :queryParam="queryParam"
           :spinnerList="spinnerList"
           :deoptData="deoptData"
@@ -58,7 +59,7 @@
             <a :disabled="record.taskStatus !== 1" @click="addTask('edit', record)">编辑</a>
             <a-divider type="vertical" />
             <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
-              <a :disabled="record.taskStatus !== 1 || record.taskStatus !== 4">删除</a>
+              <a :disabled="record.taskStatus !== 1 && record.taskStatus !== 4">删除</a>
             </a-popconfirm>
           </span>
         </a-table>

+ 4 - 4
jshERP-web/src/views/stock/components/FilterForm.vue

@@ -3,24 +3,24 @@
     <!-- 搜索区域 -->
     <a-form layout="inline" :form="queryParam" ref="form" @keyup.enter.native="searchQuery">
       <a-row :gutter="24">
-        <a-col :md="6" :sm="24">
+        <a-col :md="5" :sm="24">
           <a-form-item label="盘点状态" :labelCol="labelCol" :wrapperCol="wrapperCol">
             <a-select placeholder="请选择供应商" showSearch :options="taskStatusList" v-model="queryParam.taskStatus">
             </a-select>
           </a-form-item>
         </a-col>
-        <a-col :md="6" :sm="24">
+        <a-col :md="5" :sm="24">
           <a-form-item label="盘点单号" :labelCol="labelCol" :wrapperCol="wrapperCol">
             <a-input placeholder="请输入条码、名称、助记码、规格、型号等信息" v-model="queryParam.number"></a-input>
           </a-form-item>
         </a-col>
-        <a-col :md="6" :sm="24">
+        <a-col :md="5" :sm="24">
           <a-form-item label="盘点仓库" :labelCol="labelCol" :wrapperCol="wrapperCol">
             <a-select placeholder="请选择盘点仓库" showSearch :options="deoptData" v-model="queryParam.depotId">
             </a-select>
           </a-form-item>
         </a-col>
-        <a-col :md="6" :sm="24">
+        <a-col :md="5" :sm="24">
           <a-form-item label="创建人" :labelCol="labelCol" :wrapperCol="wrapperCol">
             <a-select placeholder="请选择创建人" showSearch :options="spinnerList" v-model="queryParam.createBy">
             </a-select>

+ 7 - 1
jshERP-web/src/views/stock/components/checkModal.vue

@@ -250,7 +250,12 @@ export default {
   },
   computed: {
     isShowBtn() {
-      return this.openType !== 'detail' && this.form.taskStatus !== 1
+      console.log('==================', this.form.taskStatus)
+
+      if (this.openType === 'detail') return false
+      if (this.form.taskStatus !== 1) return false
+
+      return true
     },
   },
   methods: {
@@ -354,6 +359,7 @@ export default {
     },
     getList(id) {
       const url2 = '/stocktaking/detailByItemList'
+      const form = this.$refs['editForm'].form
 
       const params = { ...this.queryParams, taskStocktakingId: id }
       const url = url2 + '?pageNum=' + this.ipagination.current + '&pageSize=' + this.ipagination.pageSize

+ 9 - 5
jshERP-web/src/views/stock/components/stockModal.vue

@@ -27,9 +27,9 @@
             rowKey="id"
             :columns="columns"
             :dataSource="dataSource"
-            :components="handleDrag(columns)"
-            :pagination="ipagination"
             :loading="loading"
+            :scroll="{ y: 500 }"
+            :pagination="false"
             @change="handleTableChange"
           >
             <span v-if="form.taskType === 2" slot="action" slot-scope="text, record">
@@ -129,7 +129,7 @@ export default {
       if (val) {
         if (this.taskId) {
           this.$nextTick(() => {
-            this.getDetailList(this.taskId)
+            this.getList(this.taskId)
           })
 
           return
@@ -143,7 +143,11 @@ export default {
   },
   computed: {
     isShowBtn() {
-      return this.openType !== 'detail' && this.form.taskStatus !== 1
+      if (this.openType === 'add') return true
+
+      if (this.openType === 'detail') return false
+      if (this.form.taskStatus !== 1) return false
+      return true
     },
   },
   methods: {
@@ -169,7 +173,7 @@ export default {
       this.$refs.selectModal.queryParam.depotId = this.form.depotId
       this.$refs.selectModal.showModal()
     },
-    getDetailList(id) {
+    getList(id) {
       const url = '/stocktaking/detail/' + id
       const url2 = '/stocktaking/detailByItemList'
       const form = this.$refs['editForm'].form

+ 13 - 1
jshERP-web/src/views/system/UserList.vue

@@ -53,6 +53,10 @@
               <a v-if="btnEnableList.indexOf(1) > -1 && customerFlag === '1'" @click="btnSetCustomer(record)"
                 >分配客户</a
               >
+              <a-divider v-if="btnEnableList.indexOf(1) > -1 && depotFlag === '1'" type="vertical" />
+              <a v-if="btnEnableList.indexOf(1) > -1 && customerFlag === '1'" @click="btnSetSupplier(record)"
+                >分配供应商</a
+              >
               <a-divider v-if="btnEnableList.indexOf(1) > -1 && customerFlag === '1'" type="vertical" />
               <a @click="handleEdit(record)">编辑</a>
               <a-divider v-if="btnEnableList.indexOf(1) > -1" type="vertical" />
@@ -79,6 +83,7 @@
         <user-modal ref="modalForm" @ok="modalFormOk"></user-modal>
         <user-depot-modal ref="userDepotModal" @ok="modalFormOk"></user-depot-modal>
         <user-customer-modal ref="userCustomerModal" @ok="modalFormOk"></user-customer-modal>
+        <user-supplier-modal ref="userSupplierModal" @ok="modalFormOk"></user-supplier-modal>
       </a-card>
     </a-col>
   </a-row>
@@ -92,6 +97,7 @@ import { postAction } from '@/api/manage'
 import { getCurrentSystemConfig } from '@/api/api'
 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import JInput from '@/components/jeecg/JInput'
+import UserSupplierModal from './modules/userSupplierModal.vue'
 export default {
   name: 'UserList',
   mixins: [JeecgListMixin],
@@ -100,6 +106,7 @@ export default {
     UserDepotModal,
     UserCustomerModal,
     JInput,
+    UserSupplierModal,
   },
   data() {
     return {
@@ -129,7 +136,7 @@ export default {
           dataIndex: 'action',
           scopedSlots: { customRender: 'action' },
           align: 'center',
-          width: 200,
+          width: 260,
         },
         { title: '登录名称', dataIndex: 'loginName', width: 100, align: 'left' },
         { title: '用户姓名', dataIndex: 'username', width: 100, align: 'left' },
@@ -206,6 +213,11 @@ export default {
       this.$refs.userCustomerModal.title = '分配客户给:' + record.username
       this.$refs.userCustomerModal.disableSubmit = false
     },
+    btnSetSupplier(record) {
+      this.$refs.userSupplierModal.edit(record)
+      this.$refs.userSupplierModal.title = '分配供应商给:' + record.username
+      this.$refs.userSupplierModal.disableSubmit = false
+    },
   },
 }
 </script>

+ 4 - 1
jshERP-web/src/views/system/modules/CustomerModal.vue

@@ -36,7 +36,7 @@
           <a-row class="form-row" :gutter="24">
             <a-col :span="24 / 2">
               <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="手机号码">
-                <a-input placeholder="请输入手机号码" v-decorator.trim="['telephone']" />
+                <a-input placeholder="请输入手机号码" v-decorator.trim="['telephone', validatorRules.telephone]" />
               </a-form-item>
             </a-col>
             <a-col :span="24 / 2">
@@ -130,6 +130,9 @@ export default {
       confirmLoading: false,
       form: this.$form.createForm(this),
       validatorRules: {
+        telephone: {
+          rules: [{ required: true, message: '请输入手机号!' }],
+        },
         supplier: {
           rules: [
             { required: true, message: '请输入名称!' },

+ 217 - 0
jshERP-web/src/views/system/modules/userSupplierModal.vue

@@ -0,0 +1,217 @@
+<template>
+  <div ref="container">
+    <a-modal
+      :title="title"
+      :width="800"
+      :visible="visible"
+      :confirmLoading="confirmLoading"
+      :getContainer="() => $refs.container"
+      :maskStyle="{ top: '93px', left: '154px' }"
+      :wrapClassName="wrapClassNameInfo()"
+      :mask="isDesktop()"
+      :maskClosable="false"
+      @ok="handleOk"
+      @cancel="handleCancel"
+      cancelText="取消"
+      okText="保存"
+      style="top: 5%; height: 95%"
+    >
+      <a-spin :spinning="confirmLoading">
+        <div class="drawer-bootom-button">
+          <a-dropdown :trigger="['click']" placement="topCenter">
+            <a-menu slot="overlay">
+              <a-menu-item key="1" @click="switchCheckStrictly(1)">父子关联</a-menu-item>
+              <a-menu-item key="2" @click="switchCheckStrictly(2)">取消关联</a-menu-item>
+              <a-menu-item key="3" @click="checkALL">全部勾选</a-menu-item>
+              <a-menu-item key="4" @click="cancelCheckALL">取消全选</a-menu-item>
+              <a-menu-item key="5" @click="expandAll">展开所有</a-menu-item>
+              <a-menu-item key="6" @click="closeAll">合并所有</a-menu-item>
+            </a-menu>
+            <a-button> 树操作 <a-icon type="up" /> </a-button>
+          </a-dropdown>
+        </div>
+        <a-col :md="10" :sm="24">
+          <template>
+            <a-tree
+              checkable
+              multiple
+              @check="onCheck"
+              :selectedKeys="selectedKeys"
+              :checkedKeys="checkedKeys"
+              :treeData="roleFunctionTree"
+              :checkStrictly="checkStrictly"
+              :expandedKeys="iExpandedKeys"
+              :autoExpandParent="true"
+              @expand="onExpand"
+            />
+          </template>
+        </a-col>
+      </a-spin>
+    </a-modal>
+  </div>
+</template>
+<script>
+import pick from 'lodash.pick'
+import { mixinDevice } from '@/utils/mixin'
+import { addUserBusiness, editUserBusiness, checkUserBusiness } from '@/api/api'
+import { getAction } from '../../../api/manage'
+export default {
+  name: 'UserSupplierModal',
+  mixins: [mixinDevice],
+  data() {
+    return {
+      title: '操作',
+      visible: false,
+      model: {},
+      roleId: 0,
+      iExpandedKeys: [],
+      roleFunctionTree: [],
+      checkedKeys: [],
+      selectedKeys: [],
+      checkStrictly: false,
+      hiding: true,
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 5 },
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 16 },
+      },
+      confirmLoading: false,
+      form: this.$form.createForm(this),
+    }
+  },
+  created() {},
+  methods: {
+    edit(record) {
+      this.form.resetFields()
+      this.model = Object.assign({}, {})
+      this.visible = true
+      this.$nextTick(() => {
+        this.form.setFieldsValue(pick(this.model, 'name', 'type', 'description'))
+      })
+      this.roleId = record.id
+      this.checkedKeys = []
+      this.loadTree(record.id)
+    },
+    close() {
+      this.$emit('close')
+      this.visible = false
+    },
+    handleOk() {
+      const that = this
+      // 触发表单验证
+      this.form.validateFields((err, values) => {
+        if (!err) {
+          that.confirmLoading = true
+          let formData = Object.assign(this.model, values)
+          formData.type = 'UserSupplier'
+          formData.keyId = this.roleId
+          formData.value = this.checkedKeys
+          let obj
+          checkUserBusiness({ type: 'UserSupplier', keyId: this.roleId }).then((res) => {
+            if (res.data && res.data.id) {
+              formData.id = res.data.id
+              obj = editUserBusiness(formData)
+            } else {
+              obj = addUserBusiness(formData)
+            }
+            obj
+              .then((res) => {
+                if (res.code === 200) {
+                  that.$emit('ok')
+                } else {
+                  that.$message.warning(res.data.message)
+                }
+              })
+              .finally(() => {
+                that.confirmLoading = false
+                that.close()
+              })
+          })
+        }
+      })
+    },
+    handleCancel() {
+      this.close()
+    },
+    loadTree(id) {
+      let that = this
+      that.treeData = []
+      that.roleFunctionTree = []
+      let params = {}
+      params.id = ''
+      getAction('/supplier/findUserSupplier?UBType=UserSupplier&UBKeyId=' + id).then((res) => {
+        if (res) {
+          //机构全选后,再添加机构,选中数量增多
+          this.allTreeKeys = []
+          for (let i = 0; i < res.length; i++) {
+            let temp = res[i]
+            that.treeData.push(temp)
+            that.roleFunctionTree.push(temp)
+            that.setThisExpandedKeys(temp)
+            that.getAllKeys(temp)
+          }
+          console.log(JSON.stringify(this.checkedKeys))
+          this.loading = false
+        }
+      })
+    },
+    onCheck(checkedKeys, info) {
+      console.log('onCheck', checkedKeys, info)
+      this.hiding = false
+      if (this.checkStrictly) {
+        this.checkedKeys = checkedKeys.checked
+      } else {
+        this.checkedKeys = checkedKeys
+      }
+    },
+    setThisExpandedKeys(node) {
+      if (node.checked == true) {
+        this.checkedKeys.push(node.key)
+      }
+      if (node.children && node.children.length > 0) {
+        this.iExpandedKeys.push(node.key)
+        for (let a = 0; a < node.children.length; a++) {
+          this.setThisExpandedKeys(node.children[a])
+        }
+      }
+    },
+    getAllKeys(node) {
+      // console.log('node',node);
+      this.allTreeKeys.push(node.key)
+      if (node.children && node.children.length > 0) {
+        for (let a = 0; a < node.children.length; a++) {
+          this.getAllKeys(node.children[a])
+        }
+      }
+    },
+    expandAll() {
+      this.iExpandedKeys = this.allTreeKeys
+    },
+    closeAll() {
+      this.iExpandedKeys = []
+    },
+    checkALL() {
+      this.checkStriccheckStrictlytly = false
+      this.checkedKeys = this.allTreeKeys
+    },
+    cancelCheckALL() {
+      this.checkedKeys = []
+    },
+    switchCheckStrictly(v) {
+      if (v == 1) {
+        this.checkStrictly = false
+      } else if (v == 2) {
+        this.checkStrictly = true
+      }
+    },
+    onExpand(expandedKeys) {
+      console.log('onExpand', expandedKeys)
+      this.iExpandedKeys = expandedKeys
+    },
+  },
+}
+</script>
+<style scoped></style>