Explorar o código

成本价优化

lilei %!s(int64=3) %!d(string=hai) anos
pai
achega
df862cf83a

+ 25 - 2
src/views/allocationManagement/storeTransferOut/detail.vue

@@ -52,7 +52,21 @@
           :data="loadData"
           :defaultLoadData="false"
           bordered>
+          <div slot="costTitle">
+            <a-tooltip placement="top">
+              <template slot="title">
+                系统中不同批次的产品,成本价可能不同,此值是按照实际出库批次的成本计算得到。
+              </template>
+              <span style="margin-right: 5px;">实际总成本</span> <a-icon type="question-circle" />
+            </a-tooltip>
+          </div>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button size="small" type="link" class="button-info" @click="handleViewDetail(record)">出库明细</a-button>
+          </template>
         </s-table>
+        <!-- 出入库明细 -->
+        <outInDetialModal ref="outInDetialModal" :openModal="showOutInModal" @close="showOutInModal=false"></outInDetialModal>
       </a-card>
     </a-spin>
   </div>
@@ -64,10 +78,11 @@ import { STable, VSelect } from '@/components'
 import { getOperationalPrecision } from '@/libs/tools.js'
 import { storeCallOutDetailList, storeCallOutDetailCount, storeCallOutDetailSn, storeCallOutDetailPrint } from '@/api/storeCallOut'
 import Print from '@/views/common/print.vue'
+import outInDetialModal from './outInDetialModal.vue'
 import { hdPrint } from '@/libs/JGPrint'
 export default {
   name: 'StoreCallOutDetail',
-  components: { STable, VSelect, Print },
+  components: { STable, VSelect, Print, outInDetialModal },
   mixins: [commonMixin],
   props: {
     outBizSn: { //  有值则为弹框,无值则为页面
@@ -78,6 +93,7 @@ export default {
   data () {
     return {
       spinning: false,
+      showOutInModal: false,
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
@@ -87,7 +103,9 @@ export default {
         { title: '成本价(¥)', dataIndex: 'outCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '调出仓库', dataIndex: 'warehouseName', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '调出数量', dataIndex: 'outQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '成本小计(¥)', dataIndex: 'costSubtotal', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        { slots: { title: 'costTitle' }, dataIndex: 'costSubtotal', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '成本小计(¥)', dataIndex: 'costSubtotal', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -135,6 +153,11 @@ export default {
         _this.spinning = false
       })
     },
+    // 出入库明细
+    handleViewDetail (row) {
+      this.showOutInModal = true
+      this.$refs.outInDetialModal.getData(row)
+    },
     // 基本信息
     getDetail () {
       storeCallOutDetailSn({ sn: this.outBizSn || this.$route.params.sn }).then(res => {

+ 32 - 5
src/views/allocationManagement/storeTransferOut/edit.vue

@@ -73,6 +73,14 @@
               :scroll="{ y: 300 }"
               :defaultLoadData="false"
               bordered>
+              <div slot="costTitle">
+                <a-tooltip placement="top">
+                  <template slot="title">
+                    参考成本价
+                  </template>
+                  <span style="margin-right: 5px;">参考成本价</span> <a-icon type="question-circle" />
+                </a-tooltip>
+              </div>
               <!-- 调出数量 -->
               <template slot="outQty" slot-scope="text, record">
                 <div @dblclick.stop>
@@ -154,6 +162,14 @@
               :defaultLoadData="false"
               :scroll="{ y: 300 }"
               bordered>
+              <div slot="costTitle">
+                <a-tooltip placement="top">
+                  <template slot="title">
+                    系统中不同批次的产品,成本价可能不同,此值是按照实际出库批次的成本计算得到。
+                  </template>
+                  <span style="margin-right: 5px;">实际总成本</span> <a-icon type="question-circle" />
+                </a-tooltip>
+              </div>
               <!-- 调出数量 -->
               <template slot="outQty" slot-scope="text, record">
                 <a-input-number
@@ -169,11 +185,14 @@
               </template>
               <!-- 操作 -->
               <template slot="action" slot-scope="text, record">
-                <a-button size="small" type="link" class="button-error" @click="handleDel(record)" id="storeTransferOutEdit-del-btn">删除</a-button>
+                <a-button size="small" type="link" class="button-info" @click="handleViewDetail(record)">出库明细</a-button>
+                <a-button size="small" type="link" class="button-error" @click="handleDel(record)">删除</a-button>
               </template>
             </s-table>
           </a-collapse-panel>
         </a-collapse>
+        <!-- 出入库明细 -->
+        <outInDetialModal ref="outInDetialModal" :openModal="showOutInModal" @close="showOutInModal=false"></outInDetialModal>
       </a-card>
     </a-spin>
     <div class="affix-cont">
@@ -199,14 +218,16 @@ import ProductBrand from '../../common/productBrand.js'
 import { warehouseAllList } from '@/api/warehouse'
 import { productQuery } from '@/api/allocWarehouse'
 import Print from '@/views/common/print.vue'
+import outInDetialModal from './outInDetialModal.vue'
 import { hdPrint } from '@/libs/JGPrint'
 export default {
   name: 'StoreCallOutEdit',
-  components: { STable, VSelect, Print, ProductType, ProductBrand },
+  components: { STable, VSelect, Print, ProductType, ProductBrand, outInDetialModal },
   mixins: [commonMixin],
   data () {
     return {
       spinning: false,
+      showOutInModal: false,
       queryParam: {
         productCode: '',
         productName: '',
@@ -237,7 +258,7 @@ export default {
         { title: '仓库', dataIndex: 'warehouseName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '仓位', dataIndex: 'warehouseLocationName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '库存数量', dataIndex: 'currentQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '成本价(¥)', dataIndex: 'putCost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { slots: { title: 'costTitle' }, dataIndex: 'putCost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '调出数量', scopedSlots: { customRender: 'outQty' }, width: '8%', align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ],
@@ -261,11 +282,12 @@ export default {
         { title: '产品编码', dataIndex: 'productCode', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', width: '18%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '单位', dataIndex: 'productUnit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本价(¥)', dataIndex: 'outCost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '成本价(¥)', dataIndex: 'outCost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '仓库', dataIndex: 'warehouseName', width: '12%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '仓位', dataIndex: 'warehouseLocationName', width: '12%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '调出数量', scopedSlots: { customRender: 'outQty' }, width: '8%', align: 'center' },
-        { title: '成本小计(¥)', dataIndex: 'costSubtotal', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '成本小计(¥)', dataIndex: 'costSubtotal', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { slots: { title: 'costTitle' }, dataIndex: 'costSubtotal', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
@@ -380,6 +402,11 @@ export default {
         }
       })
     },
+    // 出入库明细
+    handleViewDetail (row) {
+      this.showOutInModal = true
+      this.$refs.outInDetialModal.getData(row)
+    },
     //  删除
     handleDel (row) {
       const _this = this

+ 2 - 1
src/views/allocationManagement/storeTransferOut/list.vue

@@ -210,6 +210,7 @@ export default {
     },
     //  重置
     resetSearchForm () {
+      console.log('resetSearchForm')
       this.resetData()
       this.$refs.table.refresh(true)
     },
@@ -324,7 +325,7 @@ export default {
       const b = this.$store.state.app.updateList
       // 是否从首页点击进入
       const isHomeNav = this.getIsHomeNav()[this.$route.name]
-      console.log(a, b, this.getIsHomeNav(), isHomeNav, this.$route.name)
+      console.log(a, b, this.getIsHomeNav(), isHomeNav, this.$route.name, '店内调出')
 
       // 从首页进入,判断式新建还式待办查询
       if (isHomeNav) {

+ 136 - 0
src/views/allocationManagement/storeTransferOut/outInDetialModal.vue

@@ -0,0 +1,136 @@
+<template>
+  <a-modal
+    centered
+    class="outIndetail-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="出入库明细"
+    v-model="isShow"
+    @cancel="isShow = false"
+    :width="1024">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div class="baseInfo" v-if="baseData">
+        <div>
+          <span>产品编码:{{ baseData.productCode }}</span>
+        </div>
+        <div>
+          <span>产品名称:{{ baseData.productName }}</span>
+        </div>
+      </div>
+      <div class="outIndetail-modal-table">
+        <!-- 列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y: 450 }"
+          :defaultLoadData="false"
+          :showPagination="false"
+          bordered>
+        </s-table>
+      </div>
+      <div class="btn-cont">
+        <a-button id="storeTransferOut-basicInfo-modal-back" @click="isShow = false" style="margin-left: 15px;">关闭</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable } from '@/components'
+import { storeCallOutList } from '@/api/storeCallOut'
+export default {
+  name: 'OutinDetailModal',
+  components: { STable },
+  mixins: [commonMixin],
+  props: {
+    openModal: {
+      //  弹框显示状态
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      baseData: null,
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '库存批次', dataIndex: 'createDate', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库类型', dataIndex: 'callOutTypeName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓库', dataIndex: 'warehouseName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '总成本', dataIndex: 'productTotalCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '本次出库数量', dataIndex: 'productTotalCategory', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '成本小计', dataIndex: 'productTotalQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return storeCallOutList(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  methods: {
+    cansel () {
+      this.isShow = false
+      this.baseData = null
+    },
+    getData (row) {
+      this.baseData = row
+      this.$nextTick(() => {
+        this.$refs.table.refresh(true)
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+.outIndetail-modal {
+	.ant-modal-body {
+		padding: 20px;
+    .outIndetail-modal-table{
+      padding: 20px 0 0;
+    }
+    .baseInfo{
+      line-height: 24px;
+      font-size: 14px;
+    }
+	}
+	.btn-cont {
+		text-align: center;
+		margin: 35px 0 10px;
+	}
+}
+</style>

+ 33 - 13
src/views/productManagement/productInfo/list.vue

@@ -53,6 +53,14 @@
       <div class="table-operator">
         <a-button v-if="$hasPermissions('B_product_dealerProduct_add')" id="productInfoList-add" type="primary" class="button-error" @click="handleEdit()">新增</a-button>
         <!-- <a-button id="productInfoList-import" @click="handleImport" style="margin: 0 15px;">批量导入产品</a-button> -->
+        <a-dropdown>
+          <a-menu slot="overlay" @click="handleMenuClick">
+            <a-menu-item key="1"> 批量启用</a-menu-item>
+            <a-menu-item key="2"> 批量禁用</a-menu-item>
+          </a-menu>
+          <a-button type="danger" ghost style="margin-left: 5px"> 批量操作 <a-icon type="down" /> </a-button>
+        </a-dropdown>
+        <span v-if="rowSelectionInfo&&rowSelectionInfo.selectedRowKeys">已选 {{ rowSelectionInfo.selectedRowKeys.length }} 项</span>
       </div>
       <!-- 列表 -->
       <s-table
@@ -60,6 +68,8 @@
         ref="table"
         :style="{ height: tableHeight + 84.5 + 'px' }"
         size="small"
+        :row-selection="{}"
+        @rowSelection="rowSelectionFun"
         :rowKey="record => record.id"
         :columns="columns"
         :data="loadData"
@@ -253,10 +263,24 @@ export default {
       openModal: false, //  查看客户详情  弹框
       itemId: '', //  当前产品id
       productBrandList: [], //  品牌下拉数据
-      productTypeList: [] //  分类下拉数据
+      productTypeList: [], //  分类下拉数据
+      rowSelectionInfo: null
     }
   },
   methods: {
+    // 表格选中项
+    rowSelectionFun (obj) {
+      this.rowSelectionInfo = obj || null
+    },
+    // 批量操作
+    handleOutbounds (type) {
+      if (!this.rowSelectionInfo || (this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length < 1)) {
+        this.$message.warning('请在列表勾选后再进行批量操作!')
+      }
+    },
+    handleMenuClick (e) {
+      this.handleOutbounds(e.key)
+    },
     //  重置
     resetSearchForm () {
       this.queryParam.code = ''
@@ -303,18 +327,14 @@ export default {
     },
     // 启用 禁用
     changeStatus (record) {
-      if (record.enabledFlag == '1') {
-        this.$confirm({
-          title: '提示',
-          content: '产品被禁用后,不能再销售,确定禁用吗?',
-          centered: true,
-          onOk: () => {
-            this.setEnable(record)
-          }
-        })
-      } else {
-        this.setEnable(record)
-      }
+      this.$confirm({
+        title: '提示',
+        content: record.enabledFlag == '1' ? '产品被禁用后,不能再销售,确定禁用吗?' : '确定启用吗?',
+        centered: true,
+        onOk: () => {
+          this.setEnable(record)
+        }
+      })
     },
     // 启用 禁用
     setEnable (record) {

+ 74 - 24
src/views/productManagement/productInfoJg/list.vue

@@ -31,22 +31,15 @@
               <ProductType id="productInfoList-productType" placeholder="请选择产品分类" :isDealer="true" @change="changeProductType" v-model="productType"></ProductType>
               </a-form-item>
             </a-col> -->
-            <!-- <a-col :md="6" :sm="24">
+            <a-col :md="6" :sm="24">
               <a-form-item label="状态">
-                <v-select code="ONLINE_FLAG" id="productInfoList-onlineFalg" v-model="queryParam.onlineFalg" allowClear placeholder="请选择状态"></v-select>
+                <v-select code="ENABLE_FLAG" id="productInfoList-enabledFlag" v-model="queryParam.enabledFlag" allowClear placeholder="请选择状态"></v-select>
               </a-form-item>
-            </a-col> -->
+            </a-col>
           </template>
           <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
             <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productInfoList-refresh">查询</a-button>
             <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="productInfoList-reset">重置</a-button>
-            <!-- <a-button
-              style="margin: 0 0 18px 8px"
-              type="danger"
-              @click="handleExport"
-              :disabled="disabled"
-              :loading="exportLoading"
-              id="inventoryQueryList-export">导出</a-button> -->
             <a @click="advanced=!advanced" style="margin-left: 5px">
               {{ advanced ? '收起' : '展开' }}
               <a-icon :type="advanced ? 'up' : 'down'"/>
@@ -55,12 +48,25 @@
         </a-row>
       </a-form>
     </div>
+    <!-- 操作按钮 -->
+    <div class="table-operator">
+      <a-dropdown>
+        <a-menu slot="overlay" @click="handleMenuClick">
+          <a-menu-item key="1"> 批量启用</a-menu-item>
+          <a-menu-item key="2"> 批量禁用</a-menu-item>
+        </a-menu>
+        <a-button ghost type="danger"> 批量操作 <a-icon type="down" /> </a-button>
+      </a-dropdown>
+      <span v-if="rowSelectionInfo&&rowSelectionInfo.selectedRowKeys">已选 {{ rowSelectionInfo.selectedRowKeys.length }} 项</span>
+    </div>
     <!-- 列表 -->
     <s-table
       class="sTable fixPagination"
       ref="table"
       :style="{ height: tableHeight+84.5+'px' }"
       size="small"
+      :row-selection="{}"
+      @rowSelection="rowSelectionFun"
       :rowKey="(record) => record.id"
       :columns="columns"
       :data="loadData"
@@ -79,6 +85,18 @@
         <span v-if="record.productTypeName2 || record.productTypeName3">{{ record.productTypeName2 }} {{ record.productTypeName3 ? '>' : '' }} {{ record.productTypeName3 }}</span>
         <span v-else>--</span>
       </template>
+      <!-- 状态 -->
+      <template slot="enabledFlag" slot-scope="text, record">
+        <a-switch
+          checkedChildren="启用"
+          unCheckedChildren="禁用"
+          v-if="$hasPermissions('B_JgProduct_enable')"
+          @change="changeStatus(record)"
+          :checked="record.enabledFlag == 1 ? true : false"
+        />
+        <span v-else :style="{ color: record.enabledFlag == 1 ? '#00aa00' : '#999' }">{{ record.enabledFlag == 1 ? '已启用' : '已禁用' }}</span>
+      </template>
+      <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
         <a-button
           size="small"
@@ -93,7 +111,7 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import { productList, getCurrentDealer } from '@/api/product'
+import { productList, getCurrentDealer, dealerProductUpdate } from '@/api/product'
 import ProductType from '../../common/productType.js'
 import ProductBrand from '../../common/productBrand.js'
 import { STable, VSelect } from '@/components'
@@ -142,10 +160,24 @@ export default {
       },
       openModal: false, //  查看客户详情  弹框
       itemId: '', //  当前产品id
-      productTypeList: [] //  分类下拉数据
+      productTypeList: [], //  分类下拉数据
+      rowSelectionInfo: null
     }
   },
   methods: {
+    // 表格选中项
+    rowSelectionFun (obj) {
+      this.rowSelectionInfo = obj || null
+    },
+    // 批量操作
+    handleOutbounds (type) {
+      if (!this.rowSelectionInfo || (this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length < 1)) {
+        this.$message.warning('请在列表勾选后再进行批量操作!')
+      }
+    },
+    handleMenuClick (e) {
+      this.handleOutbounds(e.key)
+    },
     inited (viewer) {
       if (viewer) {
         const imageUrl = []
@@ -181,15 +213,12 @@ export default {
         { title: '产品编码', dataIndex: 'code', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'name', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '原厂编码', dataIndex: 'origCode', width: '17%', align: 'center', customRender: function (text) { return (!text || text == ' ') ? '--' : text } }
-        // { title: '产品品牌', dataIndex: 'productBrandName', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-        // { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: 120, align: 'center' }
       ]
       const cArr = [
         { title: '终端价', dataIndex: 'terminalPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '车主价', dataIndex: 'carOwnersPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '状态', scopedSlots: { customRender: 'enabledFlag' }, width: '7%', align: 'center' },
         { title: '产品图片', scopedSlots: { customRender: 'imageUrl' }, width: '6%', align: 'center' },
-        // { title: '创建时间', dataIndex: 'createDate', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
-        // { title: '状态', dataIndex: 'onlineFalgDictValue', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
       ]
       getCurrentDealer().then(res => {
@@ -222,13 +251,34 @@ export default {
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
     },
-    //  导出
-    handleExport () {
-      this.exportLoading = true
-      // dealerProductExport(this.queryParam).then(res => {
-      //   this.exportLoading = false
-	  // downloadExcel(res, '箭冠产品列表')
-      // })
+    // 启用 禁用
+    changeStatus (record) {
+      this.$confirm({
+        title: '提示',
+        content: record.enabledFlag == '1' ? '产品被禁用后,不能再销售,确定禁用吗?' : '确定启用吗?',
+        centered: true,
+        onOk: () => {
+          this.setEnable(record)
+        }
+      })
+    },
+    // 启用 禁用
+    setEnable (record) {
+      const params = {
+        id: record.id,
+        enabledFlag: record.enabledFlag == 1 ? '0' : '1'
+      }
+      this.spinning = true
+      dealerProductUpdate(params).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+          this.$refs.table.refresh()
+          this.spinning = false
+        } else {
+          this.$refs.table.refresh()
+          this.spinning = false
+        }
+      })
     },
     pageInit () {
       const _this = this
@@ -239,7 +289,7 @@ export default {
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 195
+      this.tableHeight = window.innerHeight - tableSearchH - 235
     }
   },
   watch: {

+ 26 - 4
src/views/salesManagement/salesQuery/detail.vue

@@ -66,7 +66,7 @@
               折扣金额:<strong>{{ detailData&&(detailData.discountAmount || detailData.discountAmount==0) ? detailData.discountAmount : '--' }}</strong>;
             </div>
             <div>
-              <a-checkbox v-model="showCost" id="salesQuery-cost">成本价</a-checkbox>
+              <a-checkbox v-model="showCost" v-if="$hasPermissions('M_ShowAllCost')" id="salesQuery-cost">成本价</a-checkbox>
             </div>
           </div>
         </a-alert>
@@ -80,7 +80,21 @@
           :data="loadData"
           :defaultLoadData="false"
           bordered>
+          <div slot="costTitle">
+            <a-tooltip placement="top">
+              <template slot="title">
+                系统中不同批次的产品,成本价可能不同,此值是按照实际出库批次的成本计算得到。
+              </template>
+              <span style="margin-right: 5px;">实际总成本</span> <a-icon type="question-circle" />
+            </a-tooltip>
+          </div>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button size="small" type="link" class="button-info" @click="handleViewDetail(record)">出库明细</a-button>
+          </template>
         </s-table>
+        <!-- 出入库明细 -->
+        <outInDetialModal ref="outInDetialModal" :openModal="showOutInModal" @close="showOutInModal=false"></outInDetialModal>
       </a-card>
     </a-spin>
   </div>
@@ -92,11 +106,12 @@ import { getOperationalPrecision } from '@/libs/tools.js'
 import { STable, VSelect } from '@/components'
 import { salesDetailBySn, salesDetailPrint, salesDetailExport } from '@/api/sales'
 import { salesDetailList } from '@/api/salesDetail'
+import outInDetialModal from './outInDetialModal.vue'
 import Print from '@/views/common/print.vue'
 import { hdPrint } from '@/libs/JGPrint'
 export default {
   name: 'SalesDetail',
-  components: { STable, VSelect, Print },
+  components: { STable, VSelect, Print, outInDetialModal },
   mixins: [commonMixin],
   props: {
     outBizSn: { //  有值则为弹框,无值则为页面
@@ -111,6 +126,7 @@ export default {
       disabled: false,
       showCost: false,
       printOrgCode: false, // 打印原创编码
+      showOutInModal: false,
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
@@ -126,7 +142,8 @@ export default {
         { title: '折扣金额', dataIndex: 'discountAmount', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '仓库', dataIndex: 'warehouseName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '仓位', dataIndex: 'warehouseLocationName', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '是否急件', dataIndex: 'oosFlagDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '是否急件', dataIndex: 'oosFlagDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -195,6 +212,11 @@ export default {
         }
       })
     },
+    // 出入库明细
+    handleViewDetail (row) {
+      this.showOutInModal = true
+      this.$refs.outInDetialModal.getData(row)
+    },
     pageInit () {
       const vm = this
       vm.$nextTick(() => {
@@ -210,7 +232,7 @@ export default {
   watch: {
     showCost (newValue, oldValue) {
       if (newValue) {
-        this.columns.splice(4, 0, { title: '成本价', dataIndex: 'cost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        this.columns.splice(4, 0, { slots: { title: 'costTitle' }, dataIndex: 'cost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       } else {
         this.columns.splice(4, 1)
       }

+ 20 - 2
src/views/salesManagement/salesQuery/edit.vue

@@ -125,6 +125,14 @@
           :pageSize="5"
           :rowClassName="(record, index) => record.cost > record.price ? 'redBg-row':''"
           bordered>
+          <div slot="costTitle">
+            <a-tooltip placement="top">
+              <template slot="title">
+                系统中不同批次的产品,成本价可能不同,此值是按照实际出库批次的成本计算得到。
+              </template>
+              <span style="margin-right: 5px;">实际总成本</span> <a-icon type="question-circle" />
+            </a-tooltip>
+          </div>
           <!-- 产品编码 -->
           <template slot="productCode" slot-scope="text, record">
             <a-badge count="急" v-if="record.oosFlag == 1">
@@ -160,6 +168,7 @@
           </template>
           <!-- 操作 -->
           <template slot="action" slot-scope="text, record">
+            <a-button size="small" type="link" class="button-info" @click="handleViewDetail(record)">出库明细</a-button>
             <a-button
               size="small"
               type="link"
@@ -178,6 +187,8 @@
     <importGuideModal :openModal="openGuideModal" :params="{salesBillSn: $route.params.sn, salesBillNo:detailData?detailData.salesBillNo:''}" @close="openGuideModal=false" @ok="hanldeImprotOk" />
     <!-- 收付款弹框 -->
     <settleModal ref="settleModal" @ok="settleAcountPay" :openModal="openSettleModal" @close="openSettleModal=false"></settleModal>
+    <!-- 出入库明细 -->
+    <outInDetialModal ref="outInDetialModal" :openModal="showOutInModal" @close="showOutInModal=false"></outInDetialModal>
   </div>
 </template>
 
@@ -192,14 +203,16 @@ import settleModal from '@/views/financialManagement/settleModal/settleModal.vue
 import { stockByProductSn } from '@/api/stock'
 import { salesDetail, salesWriteSubmit, salesWriteDiscount, salesDetailPrint, salesDetailExport, salesDel } from '@/api/sales'
 import { salesDetailList, salesDetailInsert, salesDetailUpdatePrice, salesDetailUpdateQty, salesDetailDel, salesDetailDelAll, salesDetailInsertImport } from '@/api/salesDetail'
+import outInDetialModal from './outInDetialModal.vue'
 import Print from '@/views/common/print.vue'
 import { hdPrint } from '@/libs/JGPrint'
 export default {
   name: 'SalesEdit',
-  components: { STable, VSelect, queryPart, chooseCustomModal, Print, importGuideModal, settleModal },
+  components: { STable, VSelect, queryPart, chooseCustomModal, Print, importGuideModal, settleModal, outInDetialModal },
   mixins: [commonMixin],
   data () {
     return {
+      showOutInModal: false, // 出入库明细
       showPage: false,
       spinning: false,
       orderId: null, // 销售单id
@@ -262,7 +275,7 @@ export default {
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '7%', align: 'center' }
       ]
       if (this.isCosts) {
-        arr.splice(7, 0, { title: '成本价', dataIndex: 'cost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(7, 0, { slots: { title: 'costTitle' }, dataIndex: 'cost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       }
       return arr
     }
@@ -473,6 +486,11 @@ export default {
         }
       })
     },
+    // 出入库明细
+    handleViewDetail (row) {
+      this.showOutInModal = true
+      this.$refs.outInDetialModal.getData(row)
+    },
     // 删除产品
     handleDel (row) {
       const _this = this

+ 136 - 0
src/views/salesManagement/salesQuery/outInDetialModal.vue

@@ -0,0 +1,136 @@
+<template>
+  <a-modal
+    centered
+    class="outIndetail-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="出入库明细"
+    v-model="isShow"
+    @cancel="isShow = false"
+    :width="1024">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div class="baseInfo" v-if="baseData">
+        <div>
+          <span>产品编码:{{ baseData.dealerProductEntity.code }}</span>
+        </div>
+        <div>
+          <span>产品名称:{{ baseData.dealerProductEntity.name }}</span>
+        </div>
+      </div>
+      <div class="outIndetail-modal-table">
+        <!-- 列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y: 450 }"
+          :defaultLoadData="false"
+          :showPagination="false"
+          bordered>
+        </s-table>
+      </div>
+      <div class="btn-cont">
+        <a-button id="storeTransferOut-basicInfo-modal-back" @click="isShow = false" style="margin-left: 15px;">关闭</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable } from '@/components'
+import { storeCallOutList } from '@/api/storeCallOut'
+export default {
+  name: 'OutinDetailModal',
+  components: { STable },
+  mixins: [commonMixin],
+  props: {
+    openModal: {
+      //  弹框显示状态
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      baseData: null,
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '库存批次', dataIndex: 'createDate', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '入库类型', dataIndex: 'callOutTypeName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '仓库', dataIndex: 'warehouseName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '仓位', dataIndex: 'warehouseLocationName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '成本价', dataIndex: 'productTotalCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '本次出库数量', dataIndex: 'productTotalCategory', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '成本小计', dataIndex: 'productTotalQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return storeCallOutList(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  methods: {
+    cansel () {
+      this.isShow = false
+      this.baseData = null
+    },
+    getData (row) {
+      this.baseData = row
+      this.$nextTick(() => {
+        this.$refs.table.refresh(true)
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+.outIndetail-modal {
+	.ant-modal-body {
+		padding: 20px;
+    .outIndetail-modal-table{
+      padding: 20px 0 0;
+    }
+    .baseInfo{
+      line-height: 24px;
+      font-size: 14px;
+    }
+	}
+	.btn-cont {
+		text-align: center;
+		margin: 35px 0 10px;
+	}
+}
+</style>

+ 24 - 4
src/views/salesManagement/salesQuery/queryPart.vue

@@ -66,8 +66,9 @@
               {{ advanced ? '收起' : '展开' }}
               <a-icon :type="advanced ? 'up' : 'down'"/>
             </a>
-            <a-checkbox v-model="cost" id="salesQuery-cost">成本价</a-checkbox>
+            <a-checkbox v-model="cost" v-if="$hasPermissions('M_ShowAllCost')" id="salesQuery-cost">成本价</a-checkbox>
             <a-checkbox v-model="cityPrice" id="salesQuery-cityPrice">市级价</a-checkbox>
+            <a-checkbox v-model="tyuePrice" id="salesQuery-tyuePrice">特约价</a-checkbox>
           </a-col>
         </a-row>
       </a-form-model>
@@ -101,6 +102,14 @@
       :pageSize="10"
       :scroll="{ y: 149 }"
       bordered>
+      <div slot="costTitle">
+        <a-tooltip placement="top">
+          <template slot="title">
+            参考成本价
+          </template>
+          <span style="margin-right: 5px;">参考成本价</span> <a-icon type="question-circle" />
+        </a-tooltip>
+      </div>
       <!-- 售价 -->
       <template slot="salePrice" slot-scope="text, record">
         <div style="display: flex;align-items: center;" @dblclick.stop>
@@ -245,8 +254,9 @@ export default {
         }
       },
       openModal: false, //  查看客户详情  弹框
-      cost: false,
-      cityPrice: false,
+      cost: false, // 成本价
+      cityPrice: false, // 城市价
+      tyuePrice: false, // 特约价
       openCarInfoModal: false,
       onlyList: false
     }
@@ -267,11 +277,21 @@ export default {
         { title: '操作', dataIndex: 'action', scopedSlots: { customRender: 'action' }, width: '13%', align: 'center' }
       ]
       if (this.cost) {
-        arr.splice(6, 0, { title: '成本价', dataIndex: 'putCost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(6, 0, { slots: { title: 'costTitle' }, dataIndex: 'putCost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       }
       if (this.cityPrice) {
         arr.splice(this.cost ? 7 : 6, 0, { title: '市级价', dataIndex: 'dealerProduct.cityPrice', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
       }
+      if (this.tyuePrice) {
+        let s = 6
+        if (this.cost && this.cityPrice) {
+          s = 8
+        }
+        if (!this.cost || !this.cityPrice) {
+          s = 7
+        }
+        arr.splice(s, 0, { title: '特约价', dataIndex: 'dealerProduct.cityPrice', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
       return arr
     }
   },