Browse Source

货架启用禁用

lilei 1 year ago
parent
commit
23b930f2d6

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
 {
   "message": "发现有新版本发布,确定更新系统?",
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
   "vendorJsVersion": "",
-  "version": 1706000951648
+  "version": 1706162981586
 }
 }

+ 8 - 0
src/api/shelf.js

@@ -19,6 +19,14 @@ export const shelfDetail = (params) => {
     method: 'post'
     method: 'post'
   })
   })
 }
 }
+// 货架启用停用
+export const shelfModifState = (params) => {
+  return axios({
+    url: `/shelf/modifState`,
+    data: params,
+    method: 'post'
+  })
+}
 // 查询客户关联的货架
 // 查询客户关联的货架
 export const queryByCustomerSn = (params) => {
 export const queryByCustomerSn = (params) => {
   return axios({
   return axios({

+ 9 - 4
src/views/numsGoodsShelves/approveStore/list.vue

@@ -11,17 +11,17 @@
           <a-row :gutter="15">
           <a-row :gutter="15">
             <a-col :md="4" :sm="24">
             <a-col :md="4" :sm="24">
               <a-form-item label="联系人手机">
               <a-form-item label="联系人手机">
-                <a-input allowClear placeholder="请输入联系人手机" v-model.tirm="queryParam.contactPhone"/>
+                <a-input allowClear placeholder="请输入联系人手机" v-model.trim="queryParam.contactPhone"/>
               </a-form-item>
               </a-form-item>
             </a-col>
             </a-col>
             <a-col :md="4" :sm="24">
             <a-col :md="4" :sm="24">
               <a-form-item label="联系人姓名">
               <a-form-item label="联系人姓名">
-                <a-input allowClear placeholder="请输入联系人姓名" v-model.tirm="queryParam.contactName"/>
+                <a-input allowClear placeholder="请输入联系人姓名" v-model.trim="queryParam.contactName"/>
               </a-form-item>
               </a-form-item>
             </a-col>
             </a-col>
             <a-col :md="6" :sm="24">
             <a-col :md="6" :sm="24">
               <a-form-item label="门店名称">
               <a-form-item label="门店名称">
-                <a-input allowClear placeholder="请输入门店名称" v-model.tirm="queryParam.storeName"/>
+                <a-input allowClear placeholder="请输入门店名称" v-model.trim="queryParam.storeName"/>
               </a-form-item>
               </a-form-item>
             </a-col>
             </a-col>
             <a-col :md="4" :sm="24">
             <a-col :md="4" :sm="24">
@@ -56,6 +56,11 @@
         :scroll="{ y: tableHeight }"
         :scroll="{ y: tableHeight }"
         :defaultLoadData="false"
         :defaultLoadData="false"
         bordered>
         bordered>
+        <!-- 货架名称 -->
+        <template slot="storeName" slot-scope="text, record">
+           {{record.storeName}}
+           <a-badge count="已注销" :number-style="{ zoom:'80%',marginLeft:'5px', color: '#fff',background:'#999' }" v-if="record.state=='WRITE_OFF'"></a-badge>
+        </template>
         <!-- 图片 -->
         <!-- 图片 -->
         <template slot="imageUrl" slot-scope="text, record">
         <template slot="imageUrl" slot-scope="text, record">
           <div v-if="text&&text.length">
           <div v-if="text&&text.length">
@@ -108,7 +113,7 @@ export default {
         { title: '提交时间', dataIndex: 'applyTime', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '提交时间', dataIndex: 'applyTime', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '联系人手机', dataIndex: 'contactPhone', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '联系人手机', dataIndex: 'contactPhone', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '联系人姓名', dataIndex: 'contactName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '联系人姓名', dataIndex: 'contactName', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '门店名称', dataIndex: 'storeName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '门店名称', scopedSlots: { customRender: 'storeName' }, width: '15%', align: 'center' },
         { title: '门店地址', dataIndex: 'addrDetail', width: '20%', align: 'center', scopedSlots: { customRender: 'addr' } },
         { title: '门店地址', dataIndex: 'addrDetail', width: '20%', align: 'center', scopedSlots: { customRender: 'addr' } },
         { title: '门头照片', dataIndex: 'storeImage', width: '6%', align: 'center', scopedSlots: { customRender: 'imageUrl' } },
         { title: '门头照片', dataIndex: 'storeImage', width: '6%', align: 'center', scopedSlots: { customRender: 'imageUrl' } },
         { title: '营业执照', dataIndex: 'licenseImage', width: '6%', align: 'center', scopedSlots: { customRender: 'imageUrl' } },
         { title: '营业执照', dataIndex: 'licenseImage', width: '6%', align: 'center', scopedSlots: { customRender: 'imageUrl' } },

+ 63 - 5
src/views/numsGoodsShelves/shelfSet/list.vue

@@ -49,6 +49,11 @@
         :scroll="{ y: tableHeight }"
         :scroll="{ y: tableHeight }"
         :defaultLoadData="false"
         :defaultLoadData="false"
         bordered>
         bordered>
+        <!-- 货架名称 -->
+        <template slot="shelfName" slot-scope="text, record">
+           {{record.shelfName}}
+           <a-badge count="已注销" :number-style="{ zoom:'80%',marginLeft:'5px', color: '#fff',background:'#999' }" v-if="record.state=='WRITE_OFF'"></a-badge>
+        </template>
         <!-- 货位数量 -->
         <!-- 货位数量 -->
         <template slot="shelfPlaceNum" slot-scope="text, record">
         <template slot="shelfPlaceNum" slot-scope="text, record">
           <p style="margin: 0;">
           <p style="margin: 0;">
@@ -70,9 +75,23 @@
             {{ record.finishFlag == 1 ? '是' : (record.finishFlag!=undefined?'否':'--') }}
             {{ record.finishFlag == 1 ? '是' : (record.finishFlag!=undefined?'否':'--') }}
           </span>
           </span>
         </template>
         </template>
+        <!-- 启用禁用 -->
+        <template slot="enableFlag" slot-scope="text, record">
+          <a-switch
+            checkedChildren="启用"
+            unCheckedChildren="停用"
+            v-if="record.state!=undefined&&record.state!='WRITE_OFF'"
+            @change="enableShelf(record)"
+            :checked="record.state == 'ENABLE'"
+          />
+          <span v-else :style="{ color: record.state == 'ENABLE' ? '#00aa00' : '#999' }">
+            {{ record.state == 'ENABLE' ? '启用' : (record.state!=undefined&&record.state!='WRITE_OFF'?'停用':'--') }}
+          </span>
+        </template>
         <!-- 操作 -->
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
         <template slot="action" slot-scope="text, record">
-          <a-button size="small" type="link" class="button-primary" @click="handleSet(record)">设置</a-button>
+          <a-button size="small" type="link" class="button-primary" @click="handleSet(record)">{{record.state!='WRITE_OFF'?'设置':'查看'}}</a-button>
+          <a-button size="small" type="link" class="button-primary" v-if="record.state!='WRITE_OFF'" @click="handleCancel(record)">注销</a-button>
         </template>
         </template>
       </s-table>
       </s-table>
     </a-spin>
     </a-spin>
@@ -87,7 +106,7 @@ import { STable, VSelect } from '@/components'
 import custList from '@/views/common/custList.vue'
 import custList from '@/views/common/custList.vue'
 import shelfSList from '@/views/common/shelfList'
 import shelfSList from '@/views/common/shelfList'
 import basicInfoModal from './basicInfoModal.vue'
 import basicInfoModal from './basicInfoModal.vue'
-import { shelfList, modifFinishFlag } from '@/api/shelf'
+import { shelfList, modifFinishFlag, shelfModifState } from '@/api/shelf'
 export default {
 export default {
   components: { STable, VSelect, custList, shelfSList, basicInfoModal },
   components: { STable, VSelect, custList, shelfSList, basicInfoModal },
   mixins: [commonMixin],
   mixins: [commonMixin],
@@ -106,10 +125,11 @@ export default {
       },
       },
       columns: [
       columns: [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '货架名称', dataIndex: 'shelfName', width: '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '货架名称', scopedSlots: { customRender: 'shelfName' }, width: '25%', align: 'left', ellipsis: true },
         { title: '关联客户', dataIndex: 'customerEntity.customerName', width: '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '关联客户', dataIndex: 'customerEntity.customerName', width: '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '货位数量', scopedSlots: { customRender: 'shelfPlaceNum' }, width: '15%', align: 'center' },
         { title: '货位数量', scopedSlots: { customRender: 'shelfPlaceNum' }, width: '15%', align: 'center' },
-        { title: '是否设置完成', scopedSlots: { customRender: 'finishFlag' }, width: '20%', align: 'center' },
+        { title: '是否设置完成', scopedSlots: { customRender: 'finishFlag' }, width: '10%', align: 'center' },
+        { title: '启用状态', scopedSlots: { customRender: 'enableFlag' }, width: '10%', align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ],
       ],
       // 加载数据方法 必须为 Promise 对象
       // 加载数据方法 必须为 Promise 对象
@@ -160,7 +180,7 @@ export default {
         this.queryParam.customerSn = undefined
         this.queryParam.customerSn = undefined
       }
       }
     },
     },
-    // 启用 禁用
+    // 是否设置完成
     changeStatus (record) {
     changeStatus (record) {
       const params = {
       const params = {
         shelfSn: record.shelfSn,
         shelfSn: record.shelfSn,
@@ -177,6 +197,44 @@ export default {
         }
         }
       })
       })
     },
     },
+    // 启用禁用
+    enableShelf(record){
+      const params = {
+        shelfSn: record.shelfSn,
+        state: record.state == 'ENABLE' ? 'DISABLED' : 'ENABLE'
+      }
+      this.updateState(params)
+    },
+    // 注销
+    handleCancel(record){
+      const params = {
+        shelfSn: record.shelfSn,
+        state: 'WRITE_OFF'
+      }
+      const _this = this
+      _this.$confirm({
+        title: '',
+        content: <div style="text-align:center;"><div style="font-size:14px;">是否注销该数字货架,</div><div>点击确定,该数字货架就不可做任何操作,用户不可登陆</div><div style="font-size:12px;color:#999;margin-top:10px;">如需要迁移该数字货架的数据,可去货架设置中导出货架信息</div></div>,
+        centered: true,
+        closable: true,
+        class: 'confirm-center',
+        onOk () {
+           _this.updateState(params)
+        }
+      })
+    },
+    updateState(params){
+      this.spinning = true
+      shelfModifState(params).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+          this.$refs.table.refresh()
+          this.spinning = false
+        } else {
+          this.spinning = false
+        }
+      })
+    },
     // 重置
     // 重置
     resetSearchForm () {
     resetSearchForm () {
       this.queryParam.shelfSn = undefined
       this.queryParam.shelfSn = undefined

+ 25 - 15
src/views/numsGoodsShelves/shelfSet/set.vue

@@ -13,10 +13,13 @@
           <a-collapse-panel key="1">
           <a-collapse-panel key="1">
             <template slot="header">
             <template slot="header">
               <span>基础信息</span>
               <span>基础信息</span>
-              <a-button icon="edit" size="small" type="link" style="margin-left: 20px;color: #39f;" @click.stop="openInfoModal = true">编辑</a-button>
+              <a-button icon="edit" v-if="basicInfoData&&basicInfoData.state!='WRITE_OFF'" size="small" type="link" style="margin-left: 20px;color: #39f;" @click.stop="openInfoModal = true">编辑</a-button>
             </template>
             </template>
             <a-descriptions :column="2">
             <a-descriptions :column="2">
-              <a-descriptions-item label="货架名称">{{ basicInfoData&&basicInfoData.shelfName || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="货架名称">
+              {{ basicInfoData&&basicInfoData.shelfName || '--' }}
+              <a-badge count="已注销" :number-style="{ zoom:'80%',marginLeft:'5px', color: '#fff',background:'#999' }" v-if="basicInfoData&&basicInfoData.state=='WRITE_OFF'"></a-badge>
+              </a-descriptions-item>
               <a-descriptions-item>
               <a-descriptions-item>
                 <template slot="label">
                 <template slot="label">
                     货架产品 
                     货架产品 
@@ -69,7 +72,7 @@
           </a-form>
           </a-form>
         </div>
         </div>
         <!-- 操作按钮 -->
         <!-- 操作按钮 -->
-        <div class="table-operator">
+        <div class="table-operator" v-if="basicInfoData&&basicInfoData.state!='WRITE_OFF'">
           <a-button id="shelfSet-addHW" type="primary" class="button-error" @click="addHW(1)">新增货位</a-button>
           <a-button id="shelfSet-addHW" type="primary" class="button-error" @click="addHW(1)">新增货位</a-button>
           <a-button id="shelfSet-impoort" type="primary" class="button-info" @click="addHW(0)">批量导入货位</a-button>
           <a-button id="shelfSet-impoort" type="primary" class="button-info" @click="addHW(0)">批量导入货位</a-button>
           <a-button id="shelfSet-import" type="primary" class="button-error" @click="openGuideModal=true">导入绑定产品</a-button>
           <a-button id="shelfSet-import" type="primary" class="button-error" @click="openGuideModal=true">导入绑定产品</a-button>
@@ -179,7 +182,6 @@ export default {
   components: { STable, VSelect, commonModal, bindProductModal, addHwModal, ImportGuideModal, basicInfoModal, importHuoweiModal },
   components: { STable, VSelect, commonModal, bindProductModal, addHwModal, ImportGuideModal, basicInfoModal, importHuoweiModal },
   mixins: [commonMixin],
   mixins: [commonMixin],
   data () {
   data () {
-    const _this = this
     return {
     return {
       spinning: false,
       spinning: false,
       disabled: false, //  查询、重置按钮是否可操作
       disabled: false, //  查询、重置按钮是否可操作
@@ -190,17 +192,6 @@ export default {
           productName: ''
           productName: ''
         }
         }
       },
       },
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '货位号', dataIndex: 'shelfPlaceCode', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '绑定产品编码', dataIndex: 'shelfProductApiEntity.productCode', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '绑定产品名称', dataIndex: 'shelfProductApiEntity.productName', width: '23%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '车主价', dataIndex: 'shelfProductApiEntity.price', width: '9%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
-        { slots: { title: 'customTitle' }, dataIndex: 'shelfProductApiEntity.cost', width: '9%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
-        { title: '最大库容', dataIndex: 'shelfProductApiEntity.maxQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '当前库存', dataIndex: 'shelfProductApiEntity.qty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '15%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
       loadData: parameter => {
         this.disabled = true
         this.disabled = true
@@ -232,6 +223,25 @@ export default {
       showNoShelfPriceStr: []
       showNoShelfPriceStr: []
     }
     }
   },
   },
+  computed:{
+    columns(){
+      const _this = this
+      const ret = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '货位号', dataIndex: 'shelfPlaceCode', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '绑定产品编码', dataIndex: 'shelfProductApiEntity.productCode', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '绑定产品名称', dataIndex: 'shelfProductApiEntity.productName', width: '23%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '车主价', dataIndex: 'shelfProductApiEntity.price', width: '9%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
+        { slots: { title: 'customTitle' }, dataIndex: 'shelfProductApiEntity.cost', width: '9%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
+        { title: '最大库容', dataIndex: 'shelfProductApiEntity.maxQty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '当前库存', dataIndex: 'shelfProductApiEntity.qty', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+      ]
+      if(this.basicInfoData&&this.basicInfoData.state!='WRITE_OFF'){
+        ret.push({ title: '操作', scopedSlots: { customRender: 'action' }, width: '15%', align: 'center' })
+      }
+      return ret
+    }
+  },
   methods: {
   methods: {
     // 获取价格显示设置
     // 获取价格显示设置
     getShelfPriceShow () {
     getShelfPriceShow () {

+ 2 - 2
vue.config.js

@@ -209,8 +209,8 @@ const vueConfig = {
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     // If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
     proxy: {
     proxy: {
       '/api': {
       '/api': {
-        // target: 'http://192.168.2.103:8503/qpls-md',
-        target: 'https://p.iscm.360arrow.com/qpls-md',
+        target: 'http://192.168.2.117/qpls-md',
+        // target: 'https://p.iscm.360arrow.com/qpls-md',
         // ws: false,
         // ws: false,
         ws: true,
         ws: true,
         changeOrigin: true,
         changeOrigin: true,