Преглед на файлове

Merge branch 'dev_v2' of https://gogs.zfire.top/zfire-front/supply-front into dev_v2

zh преди 2 години
родител
ревизия
69ac629c7d

+ 4 - 5
src/views/sales_control/adjust_warehouse.vue

@@ -10,9 +10,9 @@
       :optionsEvensGroup="optionsEvensGroup"
     >
     </template-page>
-    <warehouse-form v-if="pageType == 1" :pageType="pageType" @close="handleClose"/>
-    <warehouse-examine v-else-if="pageType == 2" :detailsId="detailsId" :pageType="pageType" @close="handleClose"/>
-    <warehouse-details v-else :detailsId="detailsId" :pageType="pageType" @close="handleClose"/>
+    <warehouse-form v-if="pageType == 1" :pageType="pageType" @close="handleClose" />
+    <warehouse-examine v-else-if="pageType == 2" :detailsId="detailsId" :pageType="pageType" @close="handleClose" />
+    <warehouse-details v-else-if="pageType" :detailsId="detailsId" :pageType="pageType" @close="handleClose" />
   </div>
 </template>
 
@@ -76,10 +76,9 @@ export default {
       this.pageType = 1
       console.log(this.pageType, '333')
     },
-    handleClose(){
+    handleClose() {
       this.pageType = 0
       this.$refs.pageRef.refreshList()
-
     },
     operation() {
       return (h, { row, index, column }) => {

+ 1 - 1
src/views/sales_control/components/WarehouseExamine.vue

@@ -49,7 +49,7 @@ import { approvalCustomerStockOrder, getFrontDetail } from '@/api/stock'
 
 export default {
   name: 'WarehouseExamine',
-  props: ['detailsId','pageType'],
+  props: ['detailsId', 'pageType'],
   components: {
     WarehousingHeader,
     SalesTable

+ 30 - 30
src/views/sales_control/sales_management/components/customer_sales_details.vue

@@ -3,11 +3,12 @@
     <el-page-header @back="handleBack" content="详情" style=" padding: 20px 20px 0 20px;"></el-page-header>
     <sales-header ref="header" />
     <sales-table :dataList="dataList" :column="column" @handleSelection="handleSelection">
-
       <template #events>
-        <el-button v-if="details.status==1 && isFront!==false" type="primary" size="mini" @click="handleInform(2)">通知发货</el-button>
-        <el-button v-if="details.status==2 && isFront!==false" size="mini">撤销发货</el-button>
-        <el-button v-if="isFront===false && details.status==1" type="primary" size="mini" @click="handleSignIn(4)">
+        <el-button v-if="details.status == 1 && isFront !== false" type="primary" size="mini" @click="handleInform(2)"
+          >通知发货</el-button
+        >
+        <el-button v-if="details.status == 2 && isFront !== false" size="mini">撤销发货</el-button>
+        <el-button v-if="isFront === false && details.status == 1" type="primary" size="mini" @click="handleSignIn(4)">
           签收
         </el-button>
       </template>
@@ -59,8 +60,11 @@
       <!--        </el-timeline>-->
       <!--      </div>-->
     </sales-table>
-    <sales-dialog :dialogVisible="dialogVisible" :customerNumber="customerNumber" :func="getDialogList"
-                  @confirm="confirm"
+    <sales-dialog
+      :dialogVisible="dialogVisible"
+      :customerNumber="customerNumber"
+      :func="getDialogList"
+      @confirm="confirm"
     />
   </div>
 </template>
@@ -79,7 +83,7 @@ export default {
     SalesTable,
     SalesDialog
   },
-  props: ['detailsId','pageType'],
+  props: ['detailsId', 'pageType'],
   data() {
     return {
       dialogVisible: false,
@@ -127,22 +131,24 @@ export default {
         {
           prop: 'notes',
           label: '备注'
-
         }
       ],
-      activities: [{
-        content: '活动按期开始',
-        color: '#0bbd87',
-        timestamp: '2018-04-15'
-      }, {
-        content: '通过审核',
-        timestamp: '2018-04-13'
-      }, {
-        content: '创建成功',
-        timestamp: '2018-04-11'
-      }],
+      activities: [
+        {
+          content: '活动按期开始',
+          color: '#0bbd87',
+          timestamp: '2018-04-15'
+        },
+        {
+          content: '通过审核',
+          timestamp: '2018-04-13'
+        },
+        {
+          content: '创建成功',
+          timestamp: '2018-04-11'
+        }
+      ],
       isFront: null
-
     }
   },
   created() {
@@ -160,7 +166,6 @@ export default {
         this.$refs.header.screenForm.areaId = res.data.area
         this.$refs.header.screenForm.streetId = res.data.street
         this.$refs.header.screenForm.stockType = res.data.stockType == 1 ? '前置仓' : '商家仓'
-
       })
     }
   },
@@ -175,7 +180,6 @@ export default {
       this.$refs.header.screenForm.customerNumber = this.dataList[0].customerNumber
       this.customerNumber = this.dataList[0].customerNumber
       this.dialogVisible = false
-
     },
     handleDel(item, index) {
       this.dataList.splice(index, 1)
@@ -208,13 +212,11 @@ export default {
         this.$forceUpdate()
       })
     },
-    handelSigning() {
-
-    },
+    handelSigning() {},
     handleInform(status = 2) {
       sbumitFrontOrder({ id: this.$refs.header.screenForm.id, status }).then(res => {
         this.$successMsg('发货通知')
-        this.handleBack()
+        this.$emit('close')
 
       })
     },
@@ -226,7 +228,7 @@ export default {
       }).then(res => {
         signIn({ id: this.$refs.header.screenForm.id, status }).then(res => {
           this.$successMsg('签收')
-          this.handleBack()
+          this.$emit('close')
 
         })
       }).catch(err => {
@@ -242,6 +244,4 @@ export default {
 }
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>

+ 74 - 88
src/views/sales_control/sales_management/components/customer_sales_form.vue

@@ -3,28 +3,24 @@
     <el-page-header @back="handleBack" :content="detailsId?'编辑':'新增'" style=" padding: 20px 20px 0 20px;"
     ></el-page-header>
     <sales-header ref="header" />
-    <sales-table :dataList="dataList" :column="column" :isOperation="detailsId ?false:true" isSelection
-                 @handleSelection="handleSelection"
+    <sales-table
+      :dataList="dataList"
+      :column="column"
+      :isOperation="detailsId ? false : true"
+      isSelection
+      @handleSelection="handleSelection"
     >
       <template #bts>
-        <div v-if="!detailsId ">
-          <el-button type="primary" v-if="dis"
-                     size="mini" @click="dialogVisible=true"
-          >添加
-          </el-button>
-          <el-button type="danger" v-if="dis"
-                     size="mini" @click="delChange"
-          >删除
-          </el-button>
+        <div v-if="!detailsId">
+          <el-button type="primary" v-if="dis" size="mini" @click="dialogVisible = true">添加 </el-button>
+          <el-button type="danger" v-if="dis" size="mini" @click="delChange">删除 </el-button>
         </div>
       </template>
       <template #events>
         <div v-if="!detailsId">
           <el-button type="primary" :disabled="!dis" size="mini" @click="handelSubmit(1)">提交</el-button>
-          <el-button size="mini" @click="onReset" v-if="dis"
-          >重置
-          </el-button>
-          <el-button size="mini" v-if="isFront!==false"  :disabled="dis" @click="handleInform(2)">通知发货</el-button>
+          <el-button size="mini" @click="onReset" v-if="dis">重置 </el-button>
+          <el-button size="mini" v-if="isFront !== false" :disabled="dis" @click="handleInform(2)">通知发货</el-button>
         </div>
         <div v-else>
           <el-button type="primary" size="mini" @click="handelSubmit(2)">保存</el-button>
@@ -32,19 +28,18 @@
         </div>
       </template>
 
-      <template v-slot:operation="{item:{row,$index}}">
-        <el-popconfirm
-          v-if="dis"
-          style="margin-left: 10px"
-          title="删除?"
-          @onConfirm="handleDel(row,$index)"
-        >
+      <template v-slot:operation="{ item: { row, $index } }">
+        <el-popconfirm v-if="dis" style="margin-left: 10px" title="删除?" @onConfirm="handleDel(row, $index)">
           <el-button slot="reference" type="text" size="mini">删除</el-button>
         </el-popconfirm>
       </template>
     </sales-table>
-    <sales-dialog ref="dia" :dialogVisible="dialogVisible" :customerNumber="customerNumber" :func="getDialogList"
-                  @confirm="confirm"
+    <sales-dialog
+      ref="dia"
+      :dialogVisible="dialogVisible"
+      :customerNumber="customerNumber"
+      :func="getDialogList"
+      @confirm="confirm"
     />
   </div>
 </template>
@@ -63,7 +58,7 @@ export default {
     SalesTable,
     SalesDialog
   },
-  props: ['detailsId','pageType'],
+  props: ['detailsId', 'pageType'],
   data() {
     return {
       dialogVisible: false,
@@ -73,7 +68,7 @@ export default {
       disabled: false,
       flag: 1,
       dis: true,
-      column:  [
+      column: [
         {
           prop: 'materialName',
           label: '产品名称',
@@ -106,7 +101,6 @@ export default {
           width: '180',
           isInput: true,
           type: 'text'
-
         }
       ],
       isFront: JSON.parse(localStorage.getItem('supply_user')).isFront,
@@ -115,7 +109,6 @@ export default {
   },
   created() {
     if (this.detailsId) {
-
       getFrontOrderDetail({ id: this.detailsId }).then(res => {
         this.dataList = res.data.orders
         this.customerNumber = res.data.customerNumber
@@ -129,46 +122,44 @@ export default {
       })
     } else {
       Object.assign(this.$data, this.$options.data())
-        this.column = [
-          {
-            prop: 'materialName',
-            label: '产品名称',
-            width: '180'
-          },
-          {
-            prop: 'materialCode',
-            label: '物料编码',
-            width: '180'
-          },
-          {
-            prop: 'specification',
-            label: '规格型号',
-            width: '300'
-          },
-          {
-            prop: 'stockQty',
-            label: '库存数量',
-            width: '180'
-          },
-          {
-            prop: 'qty',
-            label: '数量',
-            width: '180',
-            isInput: true
-          },
-          {
-            prop: 'notes',
-            label: '备注',
-            width: '180',
-            isInput: true,
-            type: 'text'
-
-          }
-        ]
+      this.column = [
+        {
+          prop: 'materialName',
+          label: '产品名称',
+          width: '180'
+        },
+        {
+          prop: 'materialCode',
+          label: '物料编码',
+          width: '180'
+        },
+        {
+          prop: 'specification',
+          label: '规格型号',
+          width: '300'
+        },
+        {
+          prop: 'stockQty',
+          label: '库存数量',
+          width: '180'
+        },
+        {
+          prop: 'qty',
+          label: '数量',
+          width: '180',
+          isInput: true
+        },
+        {
+          prop: 'notes',
+          label: '备注',
+          width: '180',
+          isInput: true,
+          type: 'text'
+        }
+      ]
     }
   },
   methods: {
-
     getDialogList(p) {
       let func = getcustomerFrontList
       if (this.isFront === true) {
@@ -181,12 +172,15 @@ export default {
     },
     confirm(selected) {
       this.dataList = [...this.dataList, ...selected]
-      for (let i = 0; i <this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData.length ; i++) {
+      for (let i = 0; i < this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData.length; i++) {
         for (let j = 0; j < this.dataList.length; j++) {
-          if ( this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i].id == this.dataList[j].id || this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i].disabled ===false){
-            this.$set(this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i],'disabled',false)
-          }else{
-            this.$set(this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i],'disabled',true)
+          if (
+            this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i].id == this.dataList[j].id ||
+            this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i].disabled === false
+          ) {
+            this.$set(this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i], 'disabled', false)
+          } else {
+            this.$set(this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i], 'disabled', true)
           }
         }
       }
@@ -225,13 +219,15 @@ export default {
     },
     delChange() {
       if (this.dataList.length) {
-        for (let i = 0; i <this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData.length ; i++) {
+        for (let i = 0; i < this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData.length; i++) {
           for (let j = 0; j < this.selection.length; j++) {
-            if ( this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i].id == this.selection[j].id|| this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i].disabled ===true){
+            if (
+              this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i].id == this.selection[j].id ||
+              this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i].disabled === true
+            ) {
               // k.disabled = true
-              this.$set(this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i],'disabled',true)
+              this.$set(this.$refs.dia.$refs.pageRef.$refs.zjpage.$refs.tableEl.tableData[i], 'disabled', true)
             }
-
           }
         }
         this.dataList = this.resArr(this.dataList, this.selection)
@@ -240,7 +236,6 @@ export default {
           this.customerNumber = ''
         }
       }
-
     },
     handleSelection(data) {
       this.selection = data
@@ -253,7 +248,6 @@ export default {
       })
     },
     handelSubmit(type, status = 1) {
-
       if (!this.dataList.length) {
         this.$errorMsg('请添加产品')
         return
@@ -261,8 +255,6 @@ export default {
       for (let i = 0; i < this.dataList.length; i++) {
         this.dataList[i].id = ''
         this.dataList[i].directFlag = this.dataList[i].flag
-        console.log(Number(this.dataList[i].qty))
-
         if (Number(this.dataList[i].qty) < 0 || !this.dataList[i].qty) {
           this.$errorMsg(`第${i + 1}产品数量有误`)
           return
@@ -274,7 +266,7 @@ export default {
         orders: this.dataList,
         status: status
       }
-      this.$refs.header.$refs.form.validate((valid) => {
+      this.$refs.header.$refs.form.validate(valid => {
         if (valid) {
           if (type == 1) {
             params.id = ''
@@ -282,7 +274,7 @@ export default {
               this.$successMsg('新增成功')
               this.dis = false
               this.disabled = true
-              this.$set(this.$refs.header.screenForm,'disabled',true)
+              this.$set(this.$refs.header.screenForm, 'disabled', true)
               this.column = [
                 {
                   prop: 'materialName',
@@ -307,8 +299,7 @@ export default {
                 {
                   prop: 'qty',
                   label: '数量',
-                  width: '180',
-
+                  width: '180'
                 },
                 {
                   prop: 'notes',
@@ -316,7 +307,6 @@ export default {
                   width: '180',
 
                   type: 'text'
-
                 }
               ]
               if (this.isFront ===false){
@@ -325,14 +315,12 @@ export default {
               this.$set(this.$refs.header.screenForm,'id',res.data)
               this.$forceUpdate()
             })
-
           } else {
             updateFrontOrder(params).then(res => {
               this.$successMsg('编辑成功')
               this.handleBack()
               this.$forceUpdate()
             })
-
           }
         } else {
           console.log('error submit!!')
@@ -353,6 +341,4 @@ export default {
 }
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>

+ 1 - 1
src/views/sales_control/sales_management/components/return_sales_details.vue

@@ -41,7 +41,7 @@ export default {
     SalesTable,
     SalesDialog
   },
-  props: ['detailsId','pageType'],
+  props: ['detailsId', 'pageType'],
   data() {
     return {
       dialogVisible: false,

+ 1 - 1
src/views/sales_control/sales_management/components/return_sales_form.vue

@@ -78,7 +78,7 @@ export default {
     SalesTable,
     SalesDialog
   },
-  props: ['detailsId','pageType'],
+  props: ['detailsId', 'pageType'],
   data() {
     return {
       dialogVisible: false,

+ 10 - 5
src/views/sales_control/sales_management/customer_sales_list.vue

@@ -10,8 +10,13 @@
       :optionsEvensGroup="optionsEvensGroup"
     >
     </template-page>
-    <customer_sales_form :detailsId="detailsId" v-if="pageType === 1 || pageType === 2" :pageType="pageType" @close="handleClose"/>
-    <customer_sales_details :detailsId="detailsId" v-else :pageType="pageType" @close="handleClose"/>
+    <customer_sales_form
+      :detailsId="detailsId"
+      v-if="pageType === 1 || pageType === 2"
+      :pageType="pageType"
+      @close="handleClose"
+    />
+    <customer_sales_details :detailsId="detailsId" v-else :pageType="pageType" @close="handleClose" />
   </div>
 </template>
 
@@ -90,10 +95,10 @@ export default {
     // 监听勾选变化
     selectionChange(data) {
       this.recordSelected = data
-    },   handleClose(){
-      this.pageType =0
+    },
+    handleClose() {
+      this.pageType = 0
       this.$refs.pageRef.refreshList()
-
     },
     operation() {
       return (h, { row, index, column }) => {

+ 3 - 3
src/views/sales_control/sales_management/return_sales_list.vue

@@ -70,10 +70,10 @@ export default {
     // 监听勾选变化
     selectionChange(data) {
       this.recordSelected = data
-    },   handleClose(){
-      this.pageType =0
+    },
+    handleClose() {
+      this.pageType = 0
       this.$refs.pageRef.refreshList()
-
     },
     operation() {
       return (h, { row, index, column }) => {