15102826049 1 ヶ月 前
コミット
58df1a7ee2

+ 24 - 3
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">
@@ -513,7 +531,10 @@ export default {
               'discountLastMoney',
               'accountId',
               'changeAmount',
-              'salesMan'
+              'salesMan',
+              'receiverName',
+              'receiverPhone',
+              'receiverAddress'
             )
           )
         })

+ 26 - 5
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">
@@ -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
         })

+ 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>