瀏覽代碼

Merge branch 'deploy_0804' of http://git.chelingzhu.com/jianguan-web/qpls-md-html into deploy_0804

lilei 3 年之前
父節點
當前提交
5e6829b9d5
共有 2 個文件被更改,包括 60 次插入52 次删除
  1. 24 21
      src/views/salesManagement/salesman/editModal.vue
  2. 36 31
      src/views/salesManagement/salesman/list.vue

+ 24 - 21
src/views/salesManagement/salesman/editModal.vue

@@ -79,24 +79,12 @@
       </div>
       <!-- 详情 -->
       <a-descriptions size="small" :column="2" v-if="!isEdit">
-        <a-descriptions-item label="客户名称">{{ detailData&&detailData.buyerName || '--' }}</a-descriptions-item>
-        <a-descriptions-item label="客户地址">
-          <div v-if="detailData&&(detailData.shippingAddressProvinceName || detailData.shippingAddressCityName || detailData.shippingAddressCountyName || detailData.shippingAddress)">
-            {{ detailData&&detailData.shippingAddressProvinceName || '' }}
-            {{ detailData&&detailData.shippingAddressCityName || '' }}
-            {{ detailData&&detailData.shippingAddressCountyName || '' }}
-            {{ detailData&&detailData.shippingAddress || '' }}
-          </div>
-          <span v-else>--</span>
-        </a-descriptions-item>
-        <a-descriptions-item label="收款方式">{{ detailData&&detailData.settleStyleEntity&&detailData.settleStyleEntity.name || '--' }}</a-descriptions-item>
-        <a-descriptions-item label="联系电话">{{ detailData&&detailData.consigneeTel || '--' }}</a-descriptions-item>
-        <a-descriptions-item label="备注">{{ detailData&&detailData.remarks || '--' }}</a-descriptions-item>
-        <a-descriptions-item label="销售单号">{{ detailData&&detailData.salesBillNo || '--' }}</a-descriptions-item>
-        <a-descriptions-item label="制单人">{{ detailData&&detailData.operatorName || '--' }}</a-descriptions-item>
-        <a-descriptions-item label="业务员">{{ detailData&&detailData.salesManName || '--' }}</a-descriptions-item>
-        <a-descriptions-item label="业务状态">{{ detailData&&detailData.billStatusDictValue || '--' }}</a-descriptions-item>
-        <a-descriptions-item label="财务状态">{{ detailData&&detailData.financialStatusDictValue || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="姓名">{{ this.form.name || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="身份证号">{{ this.form.idCard || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="联系电话">{{ this.form.mobile || '--' || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="入职时间">{{ this.form.entryDate || '--' || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="性别">{{ this.form.sexDictValue || '--' || '--' }}</a-descriptions-item>
+        <a-descriptions-item label="状态">{{ this.form.enableFlagDictValue || '--' || '--' }}</a-descriptions-item>
       </a-descriptions>
     </a-spin>
   </a-modal>
@@ -187,12 +175,13 @@ export default {
       str = str.replace(/[\r\n]/g, '')
       this.form.supplierName = str
     },
-    //  获取供应商信息
+    // 详情
     getDetail () {
       employeeDetail({ id: this.itemId }).then(res => {
         if (res.status == 200) {
           this.form = Object.assign(this.form, res.data)
-          this.form.enabledFlag = Number(this.form.enabledFlag)
+          this.form.sex = Number(this.form.sex)
+          this.form.enableFlag = Number(this.form.enableFlag)
         }
       })
     },
@@ -203,7 +192,7 @@ export default {
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
           const form = _this.form
-          form.entryDate = moment(form.entryDate).format('YYYY-MM-DD 00:00:00')
+          form.entryDate = moment(form.entryDate).format('YYYY-MM-DD')
           form.id = this.itemId ? this.itemId : null
           _this.spinning = true
           employeeSave(form).then(res => {
@@ -221,12 +210,23 @@ export default {
           return false
         }
       })
+    },
+    cancel () {
+      this.form = {
+        name: '', // 姓名
+        mobile: '', //  联系电话
+        enableFlag: 1, //  启禁用
+        sex: 1, // 性别
+        idCard: '', // 身份证号
+        entryDate: undefined // 入职时间
+      }
     }
   },
   watch: {
     //  父页面传过来的弹框状态
     openModal (newValue, oldValue) {
       this.isShow = newValue
+      this.cancel()
     },
     //  重定义的弹框状态
     isShow (newValue, oldValue) {
@@ -241,6 +241,9 @@ export default {
       if (this.isShow && newValue) {
         console.log(this.isShow)
         this.getDetail()
+      } else {
+        this.isEdit = true
+        this.$refs.ruleForm.resetFields()
       }
     },
     modalTitle (newValue, oldValue) {

+ 36 - 31
src/views/salesManagement/salesman/list.vue

@@ -6,12 +6,12 @@
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="姓名">
-              <a-input id="salesmanList-supplierName" v-model.trim="queryParam.name" allowClear placeholder="请输入供应商名称"/>
+              <a-input id="salesmanList-supplierName" v-model.trim="queryParam.name" allowClear placeholder="请输入姓名"/>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="状态">
-              <v-select code="FLAG" id="salesmanList-enableFlag" v-model="queryParam.enableFlag" allowClear placeholder="请选择状态"></v-select>
+              <v-select code="ENABLE_FLAG" id="salesmanList-enableFlag" v-model="queryParam.enableFlag" allowClear placeholder="请选择状态"></v-select>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -87,7 +87,7 @@
 
 <script>
 import { STable, VSelect } from '@/components'
-import { employeeList, employeeAudit } from '@/api/salesman'
+import { employeeList } from '@/api/salesman'
 import salesmanEditModal from './editModal.vue'
 import rangeDate from '@/views/common/rangeDate.vue'
 export default {
@@ -107,11 +107,11 @@ export default {
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '姓名', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '性别', dataIndex: 'sex', width: 200, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '性别', dataIndex: 'sexDictValue', width: 200, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
         { title: '联系电话', dataIndex: 'mobile', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '入职日期', dataIndex: 'entryDate', width: 200, align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '状态', dataIndex: 'enabledFlagDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '状态', dataIndex: 'enableFlagDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
       ],
       // 加载数据方法 必须为 Promise 对象
@@ -141,8 +141,13 @@ export default {
     },
     //  重置
     resetSearchForm () {
-      this.queryParam.supplierName = ''
-      this.queryParam.enabledFlag = undefined
+      this.$refs.rangeDate.resetDate()
+      this.queryParam = { //  查询条件
+        beginDate: '',
+        endDate: '',
+        name: '', //  姓名
+        enableFlag: undefined //  状态
+      }
       this.$refs.table.refresh(true)
     },
     //  新增/编辑
@@ -159,30 +164,30 @@ export default {
       }
       this.openModal = true
     },
-    //  通过
-    handleSend (row) {
-      const _this = this
-      this.$confirm({
-        title: '提示',
-        content: '审核通过后该类型名称不能更改,确定审核通过该类型名称?',
-        centered: true,
-        closable: true,
-        onOk () {
-          _this.spinning = true
-          employeeAudit({
-            salesBillSn: row.id
-          }).then(res => {
-            if (res.status == 200) {
-              _this.$message.success(res.message)
-              _this.$refs.table.refresh()
-              _this.spinning = false
-            } else {
-              _this.spinning = false
-            }
-          })
-        }
-      })
-    },
+    // //  通过
+    // handleSend (row) {
+    //   const _this = this
+    //   this.$confirm({
+    //     title: '提示',
+    //     content: '审核通过后该类型名称不能更改,确定审核通过该类型名称?',
+    //     centered: true,
+    //     closable: true,
+    //     onOk () {
+    //       _this.spinning = true
+    //       employeeAudit({
+    //         salesBillSn: row.id
+    //       }).then(res => {
+    //         if (res.status == 200) {
+    //           _this.$message.success(res.message)
+    //           _this.$refs.table.refresh()
+    //           _this.spinning = false
+    //         } else {
+    //           _this.spinning = false
+    //         }
+    //       })
+    //     }
+    //   })
+    // },
     // 关闭弹框
     closeModal () {
       this.itemId = ''