lilei 4 gadi atpakaļ
vecāks
revīzija
ff7962e6a3

+ 9 - 7
src/views/salesManagement/salesQuery/edit.vue

@@ -27,10 +27,10 @@
         <a-col :span="18">
           <a-form-model layout="inline" :model="productForm">
             <a-form-model-item label="产品编码">
-              <a-input v-model="productForm.code" placeholder="输入产品编码" />
+              <a-input v-model="productForm.dealerProductEntity.code" allowClear placeholder="输入产品编码" />
             </a-form-model-item>
             <a-form-model-item label="产品名称">
-              <a-input v-model="productForm.name" placeholder="输入产品名称" />
+              <a-input v-model="productForm.dealerProductEntity.name" allowClear placeholder="输入产品名称" />
             </a-form-model-item>
             <a-form-model-item>
               <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="salesEdit-refresh">查询</a-button>
@@ -53,7 +53,7 @@
         :rowKey="(record) => record.id"
         :columns="columns"
         :data="loadData"
-        :scroll="{ x: 1560, y: 150 }"
+        :scroll="{ x: 1560, y: 300 }"
         bordered>
         <!-- 售价 -->
         <template slot="price" slot-scope="text, record">
@@ -118,12 +118,14 @@ export default {
       detailData: null, // 订单基础数据
       dataSource: [],
       productForm: {
-        code: '',
-        name: ''
+        dealerProductEntity: {
+          code: '',
+          name: ''
+        }
       },
       // 表头
       columns: [
-        { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
+        { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: 140, align: 'center', sorter: true },
         { title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'center' },
         { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: 140, align: 'center' },
@@ -228,7 +230,7 @@ export default {
       if (this.isInster) {
         return
       }
-      this.$message.loading('正在添加产品...')
+      this.$message.loading('正在添加产品...', 1)
       this.isInster = true
       salesDetailInsert({
         productSn: row.productSn,

+ 21 - 3
src/views/salesManagement/salesQuery/list.vue

@@ -131,11 +131,29 @@
       </template>
       <!-- 操作 -->
       <template slot="action" slot-scope="text, record">
-        <a-button size="small" type="primary" class="button-warning" @click="handleEexamine(record)" id="salesManagementList-eexamine-btn">审核</a-button>
+        <a-button
+          size="small"
+          type="primary"
+          class="button-warning"
+          v-if="record.billStatus == 'WAIT_AUDIT'"
+          @click="handleEexamine(record)"
+          id="salesManagementList-eexamine-btn">审核</a-button>
         <a-button size="small" type="primary" class="button-primary" @click="handleSend(record)" id="salesManagementList-send-btn">出库</a-button>
         <a-button size="small" type="primary" class="button-success" @click="handleDetail(record)" id="salesManagementList-detail-btn">详情</a-button>
-        <a-button size="small" type="primary" class="button-info" @click="handleEdit(record)" id="salesManagementList-edit-btn">编辑</a-button>
-        <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="salesManagementList-del-btn">删除</a-button>
+        <a-button
+          size="small"
+          type="primary"
+          class="button-info"
+          v-if="record.billStatus !== 'CANCEL' && record.billStatus !== 'FINISH'"
+          @click="handleEdit(record)"
+          id="salesManagementList-edit-btn">编辑</a-button>
+        <a-button
+          size="small"
+          type="primary"
+          class="button-error"
+          v-if="record.billStatus == 'WAIT_AUDIT' || record.billStatus == 'WAIT'"
+          @click="handleDel(record)"
+          id="salesManagementList-del-btn">删除</a-button>
       </template>
     </s-table>
     <!-- 选择客户弹框 -->

+ 63 - 10
src/views/salesManagement/salesQuery/queryPart.vue

@@ -83,7 +83,10 @@
               <template slot="content">双击列表配件可快速选中添加</template>
               <a-icon type="question-circle" theme="twoTone" />
             </a-popover>
-            <a-icon style="margin:0 15px" type="setting" theme="twoTone" />
+            <a-popover>
+              <template slot="content">点击设置列的显示</template>
+              <a-icon style="margin:0 15px;cursor: pointer;" @click="showSetting = true" type="setting" theme="twoTone" />
+            </a-popover>
           </a-col>
         </a-row>
       </a-form>
@@ -97,7 +100,7 @@
       :columns="columns"
       :data="loadData"
       :customRow="handleClickRow"
-      :scroll="{ x: 1530, y: 150 }"
+      :scroll="{ x: 1530, y: 300 }"
       :pageSize="30"
       bordered>
       <!-- 售价 -->
@@ -137,12 +140,29 @@
     </s-table>
     <!-- 销售记录 -->
     <product-salesRecord-modal ref="salseRecord" :openModal="openModal" @close="closeModal" />
+    <!-- 设置列 -->
+    <a-modal
+      v-model="showSetting"
+      title="设置要显示的列"
+      centered
+      @ok="() => (showSetting = false)"
+    >
+      <a-checkbox-group v-model="settingColVal" @change="onSettingChange">
+        <a-row>
+          <a-col :span="8" v-for="item in settingColList" :key="item.value">
+            <a-checkbox :value="item.value">
+              {{ item.label }}
+            </a-checkbox>
+          </a-col>
+        </a-row>
+      </a-checkbox-group>
+    </a-modal>
   </div>
 </template>
 
 <script>
-import { productBrandQuery } from '@/api/productBrand'
-import { productTypeQuery } from '@/api/productType'
+import { dealerProductBrandQuery } from '@/api/dealerProductBrand'
+import { dealerProductTypeList } from '@/api/dealerProductType'
 import { querySumByProductLocation } from '@/api/stock'
 import { warehouseAllList } from '@/api/warehouse'
 import productSalesRecordModal from './productSalesRecordModal.vue'
@@ -159,6 +179,18 @@ export default {
   data () {
     return {
       advanced: false, // 高级搜索 展开/关闭
+      showSetting: false, // 设置弹框
+      settingColVal: ['productOrigCode', 'brandName', 'warehouseName', 'warehouseLocationName', 'currentQty', 'unit'],
+      settingColList: [
+        { label: '原厂编码', value: 'productOrigCode' },
+        { label: '品牌', value: 'brandName' },
+        { label: '仓库', value: 'warehouseName' },
+        { label: '仓位', value: 'warehouseLocationName' },
+        { label: '库存数量', value: 'currentQty' },
+        { label: '单位', value: 'unit' },
+        { label: '成本价', value: 'putCost' },
+        { label: '市级价', value: 'cityPrice' }
+      ],
       productType: [],
       queryParam: { //  查询条件
         productCode: '', //  产品编码
@@ -175,7 +207,7 @@ export default {
       productBrandList: [], //  下拉数据
       productTypeList: [], //  产品类别  下拉数据
       warehouseList: [], // 仓库列表
-      columns: [
+      columnsBak: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: 140, align: 'center', sorter: true },
         { title: '产品名称', dataIndex: 'productName', align: 'center' },
@@ -183,11 +215,13 @@ export default {
         { title: '品牌', dataIndex: 'brandName', width: 100, align: 'center', sorter: true },
         { title: '仓库', dataIndex: 'warehouseName', width: 100, align: 'center', sorter: true },
         { title: '仓位', dataIndex: 'warehouseLocationName', width: 100, align: 'center' },
-        { title: '售价', scopedSlots: { customRender: 'price' }, width: 150, align: 'center' },
-        { title: '销售数量', scopedSlots: { customRender: 'nums' }, width: 150, align: 'center' },
+        { title: '库存数量', dataIndex: 'currentQty', width: 100, align: 'center' },
         { title: '单位', dataIndex: 'unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: 200, align: 'center', fixed: 'right' }
+        { title: '售价', dataIndex: 'price', scopedSlots: { customRender: 'price' }, width: 150, align: 'center' },
+        { title: '销售数量', dataIndex: 'salesNums', scopedSlots: { customRender: 'nums' }, width: 150, align: 'center' },
+        { title: '操作', dataIndex: 'action', scopedSlots: { customRender: 'action' }, width: 200, align: 'center', fixed: 'right' }
       ],
+      columns: [],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -217,7 +251,26 @@ export default {
       openModal: false //  查看客户详情  弹框
     }
   },
+  created () {
+    this.columns = this.columnsBak
+  },
   methods: {
+    // 设置列
+    onSettingChange (v) {
+      const a = ['no', 'productCode', 'productName']
+      const b = ['price', 'salesNums', 'action']
+      const c = this.settingColVal
+      const r = a.concat(c).concat(b)
+      const d = []
+      for (let i = 0; i < r.length; i++) {
+        const row = this.columnsBak.find(item => item.dataIndex == r[i])
+        if (row) {
+          d.push(row)
+        }
+      }
+      this.columns = d
+      console.log(d)
+    },
     // 双击列表
     handleClickRow (record) {
       const _this = this
@@ -272,7 +325,7 @@ export default {
     },
     //  产品品牌  列表
     getProductBrand () {
-      productBrandQuery({}).then(res => {
+      dealerProductBrandQuery({ sysFlag: 0 }).then(res => {
         if (res.status == 200) {
           this.productBrandList = res.data
         } else {
@@ -282,7 +335,7 @@ export default {
     },
     //  产品分类  列表
     getProductType () {
-      productTypeQuery({}).then(res => {
+      dealerProductTypeList({}).then(res => {
         if (res.status == 200) {
           this.productTypeList = res.data
         } else {