lilei 2 gadi atpakaļ
vecāks
revīzija
bd26492d1f

+ 1 - 1
src/views/common/supplier.js

@@ -56,8 +56,8 @@ const Employee = {
     handleChange(value) {
       this.defaultVal = value;
       const item = this.list.find(item => item.supplierSn == value)
-      this.$emit('change', value, item);
       this.$emit('input', value);
+      this.$emit('change', value, item);
     },
     getList () {
       supplierAllList().then(res => {

+ 13 - 4
src/views/supplierManagement/costSetting/addProductModal.vue

@@ -10,7 +10,17 @@
     :width="900">
     <a-spin :spinning="spinning" tip="Loading...">
       <div class="products-con">
-        <div>
+        <div style="display:flex;align-items: center;padding:10px 0;">
+          <div style="font-size:14px;"><span style="color:red;">*</span>供应商名称:</div>
+          <div style="flex-grow: 1;">
+            <supplier style="width:50%" v-model="queryParam.supplierSn" placeholder="请输入供应商名称搜索"></supplier>
+          </div>
+        </div>
+       <div style="padding:10px 0;border-bottom: 1px solid #eee;">
+         <span style="font-size:14px;">选择产品</span>
+         <span style="font-weight: bold;">(已选:{{ rowSelectionInfo&&rowSelectionInfo.selectedRowKeys.length }}个)</span>
+       </div>
+        <div style="padding:15px 0 0;">
           <!-- 搜索条件 -->
           <div class="table-page-search-wrapper">
             <a-form-model
@@ -63,7 +73,6 @@
               </a-row>
             </a-form-model></a-form>
           </div>
-          <p style="font-weight: bold;">当前已选:{{ rowSelectionInfo&&rowSelectionInfo.selectedRowKeys.length }}个</p>
           <!-- 列表 -->
           <s-table
             class="sTable"
@@ -102,14 +111,14 @@
 
 <script>
 import { STable } from '@/components'
-import tablePagination from '@/views/common/tablePagination.vue'
 import { productBrandQuery } from '@/api/productBrand'
 import { productTypeQuery, productTypeQueryAll } from '@/api/productType'
+import supplier from '@/views/common/supplier.js'
 import { dealerScopeValidProduct } from '@/api/dealerScope'
 import { productPricedList, productPricingList } from '@/api/product'
 export default {
   name: 'ChooseProductsModal',
-  components: { STable, tablePagination },
+  components: { STable, supplier },
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,

+ 36 - 9
src/views/supplierManagement/costSetting/list.vue

@@ -100,7 +100,9 @@
     </a-spin>
     
     <!-- 新增 -->
-    <addProductModal :openModal="newProduct" :chooseData="chooseProducts" @close="newProduct=false" @ok="handleProductsOk" />
+    <addProductModal :openModal="newProduct" @close="newProduct=false" @ok="handleProductsOk" />
+    <!-- 设置成本价 -->
+    <SettingCost ref="settingCost" :openModal="openSetModal" @ok="$refs.table.refresh()" @close="openSetModal=false"></SettingCost>
   </a-card>
 </template>
 
@@ -110,14 +112,16 @@ import { STable, VSelect } from '@/components'
 import ProductType from '@/views/common/productType.js'
 import ProductBrand from '@/views/common/productBrand.js'
 import addProductModal from './addProductModal.vue'
+import SettingCost from './settingCost.vue'
 import { supplierProductList } from '@/api/supplier'
 export default {
   name: 'AssociatedProductDetailsList',
   mixins: [commonMixin],
-  components: { STable, VSelect, ProductBrand, ProductType, addProductModal },
+  components: { STable, VSelect, ProductBrand, ProductType, addProductModal, SettingCost },
   data () {
     return {
       spinning: false,
+      exportLoading: false,
       advanced: true, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
@@ -152,7 +156,8 @@ export default {
         })
       },
       rowSelectionInfo: null,
-      newProduct: false
+      newProduct: false,
+      openSetModal: false
     }
   },
   computed: {
@@ -166,7 +171,7 @@ export default {
         { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: '12%', align: 'center' },
         { title: '供应商名称', dataIndex: 'supplierName', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '审核时间', dataIndex: 'creatDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '审核状态', dataIndex: 'supplierName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审核状态', dataIndex: 'state', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ]
       if (this.$hasPermissions('B_isShowCost')) { //  成本价权限
@@ -197,6 +202,10 @@ export default {
       this.queryParam.product.productTypeSn1 = val[0] ? val[0] : ''
       this.queryParam.product.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.product.productTypeSn3 = val[2] ? val[2] : ''
+    },
+    // 导出明细
+    handleExport(){
+      
     },
     // 新增成功
     handleProductsOk(){
@@ -210,13 +219,31 @@ export default {
     handleBatchAudit(){
       
     },
-    // 审核
-    handleAudit(){
-      
+    // 单个审核
+    handleAudit (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确认要审核通过吗?',
+        centered: true,
+        closable: true,
+        okText: '通过',
+        cancelText: '不通过',
+        onOk () {
+          // _this.auditOrder(row.allocateReturnSn, 'FINISH')
+        },
+        onCancel (e) {
+          if (!e.triggerCancel) {
+            // _this.auditOrder(row.allocateReturnSn, 'FINANCIAL_REJECT')
+          }
+          _this.$destroyAll()
+        }
+      })
     },
     // 成本设置
-    handleCostSet(){
-      
+    handleCostSet(row){
+      this.openSetModal = true
+      this.$refs.settingCost.setData(row)
     },
     pageInit () {
       const _this = this

+ 158 - 0
src/views/supplierManagement/costSetting/settingCost.vue

@@ -0,0 +1,158 @@
+<template>
+  <a-modal
+    centered
+    class="merchantInfoManagement-modal"
+    :footer="null"
+    :maskClosable="false"
+    :title="title"
+    v-model="isShow"
+    @cancel="cansel"
+    :width="600">
+    <div>
+      <a-spin :spinning="spinning" tip="Loading...">
+        <a-form-model
+          ref="ruleForm"
+          :model="form"
+          :rules="rules"
+          :label-col="labelCol"
+          :wrapper-col="wrapperCol"
+        >
+          <a-form-model-item label="产品名称">
+            {{ productName }}
+          </a-form-model-item>
+          <a-form-model-item label="产品编码">
+            {{ productCode }}
+          </a-form-model-item>
+          <a-form-model-item label="供应商名称">
+            {{ supplierName }}
+          </a-form-model-item>
+          <a-form-model-item label="成本价" prop="cost">
+            <a-input-number
+              id="setting-cost"
+              v-model="form.cost"
+              :precision="2"
+              :min="0"
+              :max="999999"
+              placeholder="请输入"
+              ref="cost"
+              @keyup.enter.native="onSubmit"
+              style="width: 100%;" />
+          </a-form-model-item>
+          <div style="display: flex;justify-content: center;padding: 30px 0;">
+            <a-button type="primary" @click="onSubmit">
+              确定
+            </a-button>
+            <a-button style="margin-left: 15px;" @click="cansel">
+              取消
+            </a-button>
+          </div>
+        </a-form-model></a-spin>
+      </a-form-model>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { VSelect } from '@/components'
+import { settingCost } from '@/api/supplier'
+export default {
+  name: 'SettingCost',
+  mixins: [commonMixin],
+  components: { VSelect },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      spinning: false,
+      title: '设置成本价',
+      labelCol: { span: 4 },
+      wrapperCol: { span: 18 },
+      productName: '',
+      productCode: '',
+      supplierName: '',
+      form: {
+        supplierSn: '',
+        supplierProductSn: '',
+        cost: ''
+      },
+      rules: {
+        cost: [
+          { required: true, message: '请输入成本价', trigger: 'change' }
+        ]
+      }
+    }
+  },
+  methods: {
+    setData (row) {
+      this.form.supplierSn = row.supplierSn
+      this.form.supplierProductSn = row.supplierProductSn
+      this.form.cost = row.cost
+      this.productName = row.product.name
+      this.productCode = row.product.code
+      this.supplierName = row.supplierName
+    },
+    onSubmit () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = JSON.parse(JSON.stringify(_this.form))
+          _this.spinning = true
+          settingCost(params).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$emit('ok')
+              _this.cansel()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    cansel () {
+      this.$emit('close')
+      this.productName = ''
+      this.productCode = ''
+      this.$refs.ruleForm.resetFields()
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+      if (newValue) {
+        // 默认首项获取焦点
+        const _this = this
+        setTimeout(() => {
+          if (_this.$refs['cost']) {
+            _this.$refs['cost'].focus()
+          }
+        }, 300)
+      }
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .merchantInfoManagement-modal{
+    .ant-modal-body {
+      padding: 40px 40px 24px;
+    }
+  }
+</style>