lilei 11 ماه پیش
والد
کامیت
9ad750b751

+ 1 - 1
public/version.json

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

+ 11 - 5
src/views/purchasingManagement/purchaseOrder/basicInfoModal.vue

@@ -55,6 +55,7 @@
 import { commonMixin } from '@/utils/mixin'
 import { VSelect } from '@/components'
 import chooseAddressModal from '@/views/common/receivingAddress/chooseAddressModal.vue'
+// 接口
 import { shippingAddressQuery } from '@/api/shippingAddress'
 import { purchaseSave, purchaseTargetList } from '@/api/purchase'
 export default {
@@ -70,7 +71,7 @@ export default {
   data () {
     return {
       spinning: false,
-      confirmLoading: false,
+      confirmLoading: false, // 保存按钮loading
       isShow: this.openModal, //  是否打开弹框
       formItemLayout: {
         labelCol: { span: 4 },
@@ -85,8 +86,8 @@ export default {
         consigneeTel: '', // 联系电话
         consigneeName: '', // 联系人名称
         settleStyleSn: undefined, //  支付方式
-        purchaseTargetSn: undefined,
-        purchaseTargetName: ''
+        purchaseTargetSn: undefined, // 供应商
+        purchaseTargetName: '' // 供应商名称
       },
       rules: {
         purchaseTargetSn: [
@@ -99,14 +100,15 @@ export default {
           { required: true, message: '请选择收货地址(联系电话不能为空)', trigger: 'change' }
         ]
       },
-      purchaseTragetType: [],
+      purchaseTragetType: [], // 采购方类型
       addressVal: '选择地址', //  选择地址/更换地址
       chooseAddr: '', //  当前已选地址信息
-      addressId: undefined,
+      addressId: undefined, // 地址id
       openAddrModal: false // 选择地址弹框是否显示
     }
   },
   methods: {
+    // 重置表单
     resetForm () {
       this.$refs.ruleForm.resetFields()
       this.chooseAddr = ''
@@ -178,6 +180,7 @@ export default {
       this.chooseAddr = data.consigneeName + '(' + (data.consigneeTel || '--') + ')' + ' ' + data.shippingAddressProvinceName + '-' + data.shippingAddressCityName + '-' + data.shippingAddressCountyName + ' ' + data.shippingAddress
       this.addressVal = '更换地址'
     },
+    // 获取上级经销商列表
     getParentDealer () {
       const zb = this.$hasPermissions('B_SUPPLIER_ZB')
       const sj = this.$hasPermissions('B_SUPPLIER_SJ')
@@ -233,6 +236,7 @@ export default {
         }
       })
     },
+    // 重置地址
     verifyFun (id) {
       if (id == this.addressId) {
         this.chooseAddr = ''
@@ -257,7 +261,9 @@ export default {
         this.$emit('close')
         this.resetForm()
       } else {
+        // 获取上级列表
         this.getParentDealer()
+        // 获取默认地址
         this.getDefaultAddress()
       }
     }

+ 5 - 2
src/views/purchasingManagement/purchaseOrder/chooseImportModal.vue

@@ -82,7 +82,7 @@ export default {
       type: Boolean,
       default: false
     },
-    paramsData: {
+    paramsData: { // 参数
       type: Object,
       default: () => {
         return {}
@@ -114,17 +114,20 @@ export default {
     }
   },
   methods: {
+    // 获取列表数据
     getData () {
       const _this = this
       this.loading = true
       purchaseDetailParseProducts(this.paramsData).then(res => {
         this.loading = false
         if (res.status == 200) {
+          // 正确数据
           if (res.data.okList && res.data.okList.length > 0) {
             res.data.okList.map((item, index) => {
               item.no = index + 1
             })
           }
+          // 错误数据
           if (res.data.failList && res.data.failList.length > 0) {
             res.data.failList.map((item, index) => {
               item.no = index + 1
@@ -150,7 +153,7 @@ export default {
         })
       }
     },
-    // 导出
+    // 导出错误项
     handleError () {
       const _this = this
       if (_this.unLoadData.length < 1) {

+ 8 - 6
src/views/purchasingManagement/purchaseOrder/detail.vue

@@ -147,7 +147,7 @@ export default {
   data () {
     return {
       spinning: false,
-      isShowSalesFlag: false,
+      isShowSalesFlag: false, // 是否显示优惠金额
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -167,16 +167,17 @@ export default {
         })
       },
       detail: null, //  详情数据
-      localDataSource: [],
+      localDataSource: [], // 原始数据
       printerType: 'NEEDLE' //  打印机类型
     }
   },
   computed: {
-    showConvertPromoGIftQty(){
+    // 是否显示转标志
+    showConvertPromoGIftQty () {
       const c = this.detail ? this.detail.totalConvertPromoGiftsQty : 0
       const a = this.detail ? (this.detail.totalPutQty + this.detail.totalWaitPutQty + this.detail.totalCancelQty + c) : 0
       const b = this.detail ? this.detail.totalQty : 0
-         return this.detail && c>0 && a == b
+      return this.detail && c > 0 && a == b
     },
     columns () {
       const _this = this
@@ -193,12 +194,14 @@ export default {
         { title: '审核订单数量', dataIndex: 'pushedQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '已取消数量', dataIndex: 'cancelQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ]
+      // 成本权限
       if (this.$hasPermissions('M_ShowAllCost')) {
         arr.splice(5, 0, { title: '采购单价', dataIndex: 'price', width: '7%', align: 'right', scopedSlots: { customRender: 'unitPrice' } })
         arr.splice(6, 0, { title: '采购金额', dataIndex: 'discountedAmount', width: '7%', align: 'right', scopedSlots: { customRender: 'amount' } })
         arr.splice(8, 0, { title: '审核订单金额', dataIndex: 'pushedAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
       }
-      if(this.showConvertPromoGIftQty){
+      // 是否转促销品
+      if (this.showConvertPromoGIftQty) {
         arr.push({ slots: { title: 'customTitle1' }, dataIndex: 'convertPromoGiftsQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
         arr.push({ slots: { title: 'customTitle2' }, dataIndex: 'convertPromoGiftsAmount', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
       }
@@ -274,7 +277,6 @@ export default {
     }
   },
   activated () {
-    console.log(this.$store.state.app.isNewTab, !this.$store.state.app.isNewSubTab)
     // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
     if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
       this.$refs.table.refresh(true)

+ 52 - 42
src/views/purchasingManagement/purchaseOrder/edit.vue

@@ -6,7 +6,7 @@
         <template slot="subTitle">
           <a id="purchaseOrderEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
           <p class="billno">单号:{{ detail&&detail.purchaseBillNo }}</p>
-          <a-button type="primary" ghost @click="isShowBisiceInfo=!isShowBisiceInfo" style="margin-left:30px;vertical-align:middle;">
+          <a-button id="purchaseOrderEdit-editInfo-btn" type="primary" ghost @click="isShowBisiceInfo=!isShowBisiceInfo" style="margin-left:30px;vertical-align:middle;">
             基础信息
             <a-icon :type="isShowBisiceInfo ? 'up' : 'down'"/>
           </a-button>
@@ -40,9 +40,9 @@
                   {{ detail&&detail.shippingAddressCityName || '' }}
                   {{ detail&&detail.shippingAddressCountyName || '' }}
                   {{ detail&&detail.shippingAddress || '' }}
-                  <a-button type="link" @click="openAddrModal=true">更换地址 >></a-button>
+                  <a-button type="link" id="purchaseOrderEdit-upAddr-btn" @click="openAddrModal=true">更换地址 >></a-button>
                 </div>
-                <div v-else><a-button type="link" @click="openAddrModal=true">选择地址 >></a-button></div>
+                <div v-else><a-button type="link" id="purchaseOrderEdit-chooseAddr-btn" @click="openAddrModal=true">选择地址 >></a-button></div>
               </a-col>
             </a-row>
           </a-collapse-panel>
@@ -94,7 +94,7 @@
                     <a-col flex="auto" style="margin-bottom: 10px;">
                       <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="purchaseOrderEdit-refresh">查询</a-button>
                       <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="purchaseOrderEdit-reset">重置</a-button>
-                      <a @click="advanced=!advanced" style="margin:0 30px 0 10px">
+                      <a @click="advanced=!advanced" style="margin:0 30px 0 10px" id="purchaseOrderEdit-advanced-btn">
                         {{ advanced ? '收起' : '展开' }}
                         <a-icon :type="advanced ? 'up' : 'down'"/>
                       </a>
@@ -121,6 +121,7 @@
                     width="30"
                     height="30"
                     style="cursor: pointer;"
+                    :id="'purchaseOrderEdit-viewImg-'+record.id"
                     @click="handlePicDetail(record)" />
                 </template>
                 <!-- 包装数 -->
@@ -141,6 +142,7 @@
                 <template slot="storageQuantity" slot-scope="text, record">
                   <a-input-number
                     size="small"
+                    :id="'purchaseOrderEdit-qty-'+record.id"
                     v-model="record.qty"
                     :precision="0"
                     :min="0"
@@ -153,6 +155,7 @@
                   <a-button
                     size="small"
                     type="link"
+                    :id="'purchaseOrderEdit-add-'+record.id"
                     class="button-primary"
                     :loading="addLoading"
                     @click="handleAdd(record,0)"
@@ -184,18 +187,18 @@
                       <a-row :gutter="15">
                         <a-col :md="8" :sm="24">
                           <a-form-model-item label="产品编码">
-                            <a-input v-model.trim="productForm.productCode" allowClear placeholder="输入产品编码" />
+                            <a-input id="purchaseOrderEdit-cp-productCode" v-model.trim="productForm.productCode" allowClear placeholder="输入产品编码" />
                           </a-form-model-item>
                         </a-col>
                         <a-col :md="8" :sm="24">
                           <a-form-model-item label="产品名称">
-                            <a-input v-model.trim="productForm.productName" allowClear placeholder="输入产品名称" />
+                            <a-input id="purchaseOrderEdit-cp-productName" v-model.trim="productForm.productName" allowClear placeholder="输入产品名称" />
                           </a-form-model-item>
                         </a-col>
                         <a-col :md="8" :sm="24">
                           <a-form-model-item style="margin-bottom: 10px;">
-                            <a-button type="primary" @click="$refs.purchaseTable.refresh(true)" :disabled="purchaseDisabled" id="purchaseOrderEdit-refresh">查询</a-button>
-                            <a-button style="margin-left: 5px" @click="resetPurchaseForm" id="purchaseOrderEdit-reset">重置</a-button>
+                            <a-button type="primary" @click="$refs.purchaseTable.refresh(true)" :disabled="purchaseDisabled" id="purchaseOrderEdit-cp-refresh">查询</a-button>
+                            <a-button style="margin-left: 5px" @click="resetPurchaseForm" id="purchaseOrderEdit-cp-reset">重置</a-button>
                           </a-form-model-item>
                         </a-col>
                       </a-row>
@@ -203,8 +206,8 @@
                   </a-col>
                   <a-col :span="6">
                     <div style="float:right;overflow: hidden;">
-                      <a-button v-if="!isDealerUp" type="primary" class="button-primary" id="purchaseOrderEdit-import-btn" @click="handleOutStock">导入缺货</a-button>
-                      <a-button id="purchaseOrderEdit-import-btn" @click="openGuideModal=true">导入产品</a-button>
+                      <a-button v-if="!isDealerUp" type="primary" class="button-primary" id="purchaseOrderEdit-cp-importQh-btn" @click="handleOutStock">导入缺货</a-button>
+                      <a-button id="purchaseOrderEdit-cp-importCp-btn" @click="openGuideModal=true">导入产品</a-button>
                     </div>
                   </a-col>
                 </a-row>
@@ -224,7 +227,7 @@
                 <template slot="storageQuantity" slot-scope="text, record">
                   <a-input-number
                     size="small"
-                    id="purchaseOrderEdit-qty"
+                    :id="'purchaseOrderEdit-cp-qty-'+record.id"
                     v-model="record.qty"
                     :precision="0"
                     :min="1"
@@ -241,7 +244,7 @@
                     class="button-error"
                     :loading="delLoading"
                     @click="handleDel(record)"
-                    id="purchaseOrderEdit-del-btn">删除</a-button>
+                    :id="'purchaseOrderEdit-cp-del-btn-'+record.id">删除</a-button>
                 </template>
               </s-table>
             </div>
@@ -280,6 +283,10 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import defImg from '@/assets/def_img@2x.png'
+import Print from '@/views/common/print.vue'
+import { hdPrint } from '@/libs/JGPrint'
+// 组件
 import { STable, VSelect } from '@/components'
 import ImportGuideModal from './importGuideModal.vue'
 import outStockModal from './outStockModal.vue'
@@ -287,29 +294,28 @@ import outStockListModal from './outStockListModal.vue'
 import chooseAddressModal from '@/views/common/receivingAddress/chooseAddressModal.vue'
 import ProductType from '../../common/productType.js'
 import ProductBrand from '../../common/productBrand.js'
+// 接口
 import { purchaseDetailBySn, purchaseWriteSubmit, purchaseDetailPrint, purchaseDetailExport, purchaseDetailAddress } from '@/api/purchase'
 import { purchaseDetailList, purchaseDetailSave, purchaseDetailDel } from '@/api/purchaseDetail'
 import { productListPurchase } from '@/api/product'
-import defImg from '@/assets/def_img@2x.png'
-import Print from '@/views/common/print.vue'
-import { hdPrint } from '@/libs/JGPrint'
+
 export default {
   name: 'PurchaseEdit',
   components: { STable, VSelect, ProductType, ProductBrand, ImportGuideModal, outStockModal, Print, chooseAddressModal, outStockListModal },
   mixins: [commonMixin],
   data () {
     return {
-      isShowBisiceInfo: false,
-      showPage: false,
+      isShowBisiceInfo: false, // 详细信息显示
+      showPage: false, // 是否显示页面
       spinning: false,
       detail: null, // 详细信息
-      subLoading: false,
-      defImg,
+      subLoading: false, // 按钮loading
+      defImg, // 默认图片
       // 选择产品
-      addLoading: false,
-      productType: [],
+      addLoading: false, // 按钮loading
+      productType: [], //
       queryParam: {
-        productBrandSn: undefined,
+        productBrandSn: undefined, // 品牌
         code: '', //  产品编码
         name: '', //  产品名称
         origCode: '', //  原厂编码
@@ -337,8 +343,8 @@ export default {
       // -------已选产品-------------
       delLoading: false,
       productForm: {
-        productName: '',
-        productCode: '',
+        productName: '', // 产品名称
+        productCode: '', // 产品编码
         orderBy: 'purchase_bill_detail.CREATE_DATE desc'
       },
       purchaseDisabled: false, //  查询、重置按钮是否可操作
@@ -359,19 +365,20 @@ export default {
           return data
         })
       },
-      localDataSource: [],
-      chooseData: [],
+      localDataSource: [], // 原始列表数据
+      chooseData: [], // 已选列表数据
       openGuideModal: false, //  导入产品引导
-      openOutStockModal: false,
-      paramsData: null,
+      openOutStockModal: false, // 上次缺货弹框
       openAddrModal: false, // 选择地址弹框是否显示
-      openOutStockListModal: false
+      openOutStockListModal: false // 导入缺货弹框
     }
   },
   computed: {
+    // 是否上级
     isDealerUp () {
       return this.detail && (this.detail.purchaseTargetType == 'DEALER_UP' || this.detail.purchaseTargetType == 'DEALER_SUPPLIER')
     },
+    // 列定义
     columns () {
       const _this = this
       const arr = [
@@ -387,19 +394,22 @@ export default {
         { title: '产品图片', scopedSlots: { customRender: 'imageUrl' }, width: '6%', align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ]
-      // 产品来源
+      // 产品来源,如果是上级经销商
       if (this.isDealerUp) {
         arr.splice(1, 0, { title: '产品编码', scopedSlots: { customRender: 'code' }, width: '15%', align: 'center', sorter: true })
         arr.splice(6, 0, { title: '产品来源', dataIndex: 'sysFlagDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } })
       } else {
+        // 不是上级
         arr.splice(1, 0, { title: '产品编码', dataIndex: 'code', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, sorter: true })
       }
+      // 成本价权限
       if (this.$hasPermissions('M_ShowAllCost')) {
         arr.splice(this.isDealerUp ? 7 : 6, 0, { title: '成本价', dataIndex: 'purchasePrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
       }
 
       return arr
     },
+    // 已添加列表列
     chooseColumns () {
       const _this = this
       const arr = [
@@ -409,9 +419,9 @@ export default {
         { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '采购数量', scopedSlots: { customRender: 'storageQuantity' }, width: '8%', align: 'center' },
         { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
-        // { title: '采购金额', dataIndex: 'discountedAmount', width: '9%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
       ]
+      // 成本价权限
       if (this.$hasPermissions('M_ShowAllCost')) {
         arr.splice(4, 0, { title: '采购单价', dataIndex: 'discountedPrice', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
         arr.splice(7, 0, { title: '采购金额', dataIndex: 'discountedAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
@@ -465,11 +475,6 @@ export default {
         this.handleAdd(record, 1)
       }
     },
-    filterOption (input, option) {
-      return (
-        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-      )
-    },
     //  产品分类  change
     changeProductType (val, opt) {
       this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
@@ -490,6 +495,7 @@ export default {
       this.productType = []
       this.$refs.table.refresh(true)
     },
+    // 已选产品列表重置
     resetPurchaseForm () {
       this.productForm.productName = ''
       this.productForm.productCode = ''
@@ -502,9 +508,11 @@ export default {
         this.$message.warning('请输入数量后再添加!')
         return
       }
-      // 添加
+      // 添加操作
       if (type == 0) {
+        // 如果是上级
         if (this.isDealerUp) {
+          // 如果有价格
           if (row.purchasePrice) {
             params.productSn = row.productSn
             params.purchaseBillSn = this.detail.purchaseBillSn
@@ -517,6 +525,7 @@ export default {
             return
           }
         } else {
+          // 不是上级,且有成本价、终端会员价、车主零售价
           if (row.purchasePrice && row.terminalPrice && row.carOwnersPrice) {
             params.productSn = row.productSn
             params.purchaseBillSn = this.detail.purchaseBillSn
@@ -529,7 +538,8 @@ export default {
             return
           }
         }
-      } else { //  编辑
+      } else {
+        //  编辑操作
         // 清空成本价或数量时,值应保持未清空前的值,因成本价和数量都不可为空
         if (!row.qty) {
           row.qty = row.qtyBackups
@@ -539,6 +549,7 @@ export default {
       }
       this.addLoading = true
       this.spinning = true
+      // 保存数据
       purchaseDetailSave(params).then(res => {
         if (res.status == 200) {
           this.resetPurchaseDetail()
@@ -550,7 +561,7 @@ export default {
         this.addLoading = false
       })
     },
-    //  提交
+    //  提交单据
     handleSubmit () {
       const _this = this
       this.subLoading = true
@@ -581,6 +592,7 @@ export default {
         _this.$refs.outStockList.resetSearchForm()
       })
     },
+    // 导入缺货成功
     hanldeOkOutStockList (con) {
       const _this = this
       _this.openOutStockModal = true
@@ -637,6 +649,7 @@ export default {
     handleBack () {
       this.$router.push({ path: '/purchasingManagement/purchaseOrder/list' })
     },
+    // 页面初始化
     pageInit () {
       this.$nextTick(() => {
         this.getOrderDetail()
@@ -659,9 +672,6 @@ export default {
       this.pageInit()
     }
   },
-  deactivated () {
-    // this.showPage = false
-  },
   beforeRouteEnter (to, from, next) {
     next(vm => {})
   }

+ 4 - 4
src/views/purchasingManagement/purchaseOrder/importGuideModal.vue

@@ -19,7 +19,7 @@
             <li>2) 除了“产品编码”、“数量”两列,其他列可自定义,不影响数据导入</li>
             <li>3) 如果导入的产品已经存在,则不会导入该行</li>
             <li>
-              <a :href="filePath" style="margin: 5px 0 0;display: block;">
+              <a :href="filePath" style="margin: 5px 0 0;display: block;" id="import-download-tpl">
                 <a-icon type="download" style="padding-right: 5px;" />下载导入模板
               </a>
             </li>
@@ -88,12 +88,12 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       openImportModal: false, //  导入
-      attachAction: process.env.VUE_APP_API_BASE_URL + '/upload',
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/upload', // 上传接口
       paramsData: null,
       uploadParams: {
         savePathType: 'local'
       },
-      filePath: location.protocol + '//' +location.host + '/templ/采购单产品导入模板.xlsx'
+      filePath: location.protocol + '//' + location.host + '/templ/采购单产品导入模板.xlsx' // 模板地址
     }
   },
   methods: {
@@ -122,7 +122,7 @@ export default {
     handleClose () {
       this.openImportModal = false
       this.isShow = false
-    },
+    }
   },
   watch: {
     //  父页面传过来的弹框状态

+ 39 - 31
src/views/purchasingManagement/purchaseOrder/list.vue

@@ -7,7 +7,7 @@
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="创建时间">
-                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+                <rangeDate id="purchaseOrderList-time" ref="rangeDate" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -26,23 +26,25 @@
                   option-filter-prop="children"
                   :filter-option="filterOption"
                   @change="tragetTypeChange">
-                  <a-select-option v-for="item in supplierList" :pyCode="item.pyCode" :key="item.purchaseTargetSn" :value="item.purchaseTargetSn">{{ item.purchaseTargetName }}</a-select-option>
+                  <a-select-option v-for="item in supplierList" :pyCode="item.pyCode" :id="'purchaseOrderList-purchaseTargetSn-'+item.purchaseTargetSn" :key="item.purchaseTargetSn" :value="item.purchaseTargetSn">
+                    {{ item.purchaseTargetName }}
+                  </a-select-option>
                 </a-select>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24" v-show="advanced">
               <a-form-item label="业务状态">
                 <a-select id="purchaseOrderList-billStatus" allowClear v-model="queryParam.billStatus" placeholder="请选择业务状态">
-                  <a-select-option value="">全部</a-select-option>
-                  <a-select-option value="WAIT_SUBMIT">待提交</a-select-option>
-                  <a-select-option value="SUBMIT">已提交</a-select-option>
+                  <a-select-option id="purchaseOrderList-billStatus-all" value="">全部</a-select-option>
+                  <a-select-option id="purchaseOrderList-billStatus-wait" value="WAIT_SUBMIT">待提交</a-select-option>
+                  <a-select-option id="purchaseOrderList-billStatus-submit" value="SUBMIT">已提交</a-select-option>
                 </a-select>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24" v-show="advanced">
               <a-form-item label="财务状态">
                 <v-select
-                style="width: 100%;"
+                  style="width: 100%;"
                   v-model="queryParam.financialStatus"
                   ref="financialStatus"
                   id="purchaseOrderList-financialStatus"
@@ -54,7 +56,7 @@
             <a-col :md="6" :sm="24" v-show="advanced">
               <a-form-item label="单据来源">
                 <v-select
-                style="width: 100%;"
+                  style="width: 100%;"
                   v-model="queryParam.purchaseBillSource"
                   ref="purchaseBillSource"
                   id="purchaseOrderList-purchaseBillSource"
@@ -78,7 +80,7 @@
               <span class="table-page-search-submitButtons">
                 <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="purchaseOrderList-refresh">查询</a-button>
                 <a-button style="margin-left: 8px" @click="resetSearchForm()" :disabled="disabled" id="purchaseOrderList-reset">重置</a-button>
-                <a @click="advanced=!advanced" style="margin-left: 8px">
+                <a @click="advanced=!advanced" style="margin-left: 8px" id="purchaseOrderList-advanced">
                   {{ advanced ? '收起' : '展开' }}
                   <a-icon :type="advanced ? 'up' : 'down'"/>
                 </a>
@@ -114,21 +116,21 @@
         bordered>
         <!-- 采购单号 -->
         <template slot="purchaseBillNo" slot-scope="text, record">
-          <span class="table-td-link" v-if="$hasPermissions('B_purchaseDetail')" @click="handleDetail(record)">{{ record.purchaseBillNo }}</span>
+          <span class="table-td-link" :id="'purchaseOrderList-detail-'+record.id" v-if="$hasPermissions('B_purchaseDetail')" @click="handleDetail(record)">{{ record.purchaseBillNo }}</span>
           <span v-else>{{ record.purchaseBillNo }}</span>
           <a-badge v-if="record.promotionFlag && record.promotionFlag==1" count="促" :number-style="{ backgroundColor: '#52c41a', zoom:'80%',marginLeft:'5px' }"></a-badge>
           <a-badge count="改" v-if="record.billStatus=='HQ_CHANGE'||record.billStatus=='SUPERIOR_CHANGE'" :number-style="{ zoom:'80%',marginLeft:'5px' }"></a-badge>
         </template>
-        <!-- 审核 -->
+        <!-- 审核icon -->
         <template slot="audit" slot-scope="text, record">
           <stateIcon :title="record.billStatusDictValue" v-if="record.billStatus!='AUDIT_REJECT'" :state="record.billStatus == 'WAIT_PUT_WAREHOUSE'||record.billStatus=='AUDIT_PASS'||record.billStatus == 'FINISH'?'1':'2'"></stateIcon>
           <stateIcon :title="record.billStatusDictValue" v-else :state="0"></stateIcon>
         </template>
-        <!-- 付款 -->
+        <!-- 付款icon -->
         <template slot="financial" slot-scope="text, record">
           <stateIcon :title="record.financialStatusDictValue" :state="record.financialStatus == 'FINISH'?'1':'2'"></stateIcon>
         </template>
-        <!-- 入库 -->
+        <!-- 入库icon -->
         <template slot="waitOut" slot-scope="text, record">
           <stateIcon :state="record.billStatus == 'FINISH'?'1':'2'"></stateIcon>
         </template>
@@ -138,6 +140,7 @@
             size="small"
             type="link"
             class="button-primary"
+            :id="'purchaseOrderList-edit-'+record.id"
             v-if="(record.billStatus == 'WAIT_SUBMIT'||record.billStatus == 'AUDIT_REJECT') && $hasPermissions('B_purchaseEdit')"
             @click="handleEdit(record)"
           >编辑</a-button>
@@ -145,6 +148,7 @@
             size="small"
             type="link"
             class="button-error"
+            :id="'purchaseOrderList-del-'+record.id"
             v-if="(record.billStatus == 'WAIT_SUBMIT'||record.billStatus == 'AUDIT_REJECT') &&$hasPermissions('B_purchaseDel')"
             @click="handleDel(record)"
           >删除</a-button>
@@ -159,11 +163,12 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import basicInfoModal from './basicInfoModal.vue'
 import stateIcon from '@/views/common/stateIcon'
-import getDate from '@/libs/getDate.js'
+// 接口
 import { purchaseList, purchaseDel, purchaseCount } from '@/api/purchase'
 import { queryReturnSupplierList } from '@/api/purchaseReturn'
 export default {
@@ -177,29 +182,29 @@ export default {
       advanced: true, //  高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
       openModal: false, // 基本信息弹框是否显示
-      supplierList: [],
-      tableHeight: 0,
-      time: [
+      supplierList: [], // 供应商列表
+      tableHeight: 0, // 表格高度
+      time: [ // 时间
         getDate.getCurrMonthDays().starttime,
         getDate.getCurrMonthDays().endtime
       ],
       // 查询参数
       queryParam: {
-        purchaseBillNo: '',
-        purchaseTargetSn: undefined,
-        purchaseTargetType: undefined,
-        billStatus: undefined,
-        financialStatus: undefined,
-        purchaseBillSource: undefined,
-        promotionFlag: undefined,
-        beginDate: getDate.getCurrMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime
+        purchaseBillNo: '', // 采购单号
+        purchaseTargetSn: undefined, // 供应商sn
+        purchaseTargetType: undefined, // 采购方类型
+        billStatus: undefined, // 单据状态
+        financialStatus: undefined, // 财务状态
+        purchaseBillSource: undefined, // 单据来源
+        promotionFlag: undefined, // 是否促销商品
+        beginDate: getDate.getCurrMonthDays().starttime, // 开始时间
+        endDate: getDate.getCurrMonthDays().endtime// 结束时间
       },
-      totalData: {
-        totalRecord: 0,
-        totalCategory: 0,
-        totalQty: 0,
-        totalAmount: 0
+      totalData: { // 统计数据
+        totalRecord: 0, // 总条数
+        totalCategory: 0, // 总款数
+        totalQty: 0, // 总数量
+        totalAmount: 0// 总金额
       },
       // 表头
       columns: [
@@ -217,7 +222,6 @@ export default {
         { title: '审核', scopedSlots: { customRender: 'audit' }, width: '3%', align: 'center' },
         { title: '入库', scopedSlots: { customRender: 'waitOut' }, width: '3%', align: 'center' },
         { title: '付款', scopedSlots: { customRender: 'financial' }, width: '3%', align: 'center' },
-        // { title: '财务状态', dataIndex: 'financialStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '9%', align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
@@ -247,6 +251,7 @@ export default {
     }
   },
   methods: {
+    // 统计信息
     getTotalData (params) {
       purchaseCount(params).then(res => {
         this.totalData = res.data || null
@@ -324,6 +329,7 @@ export default {
         this.setIsHomeNav(this.$route.name, null)
       }
     },
+    // 供应商筛选
     filterOption (input, option) {
       return (
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
@@ -339,6 +345,7 @@ export default {
         }
       })
     },
+    // 页面初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -379,6 +386,7 @@ export default {
         }
       }
     },
+    // 表格高度计算
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 275

+ 15 - 14
src/views/purchasingManagement/purchaseOrder/outStockListModal.vue

@@ -16,22 +16,21 @@
               <a-row type="flex" :gutter="12" justify="start">
                 <a-col :md="10" :sm="24">
                   <a-form-model-item label="创建时间" prop="time">
-                    <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+                    <rangeDate id="outStock-modal-time" ref="rangeDate" :value="time" @change="dateChange" />
                   </a-form-model-item>
                 </a-col>
                 <a-col :md="8" :sm="24">
                   <a-form-item label="采购单号">
-                    <a-input id="outStockList-purchaseBillNo" v-model.trim="queryParam.purchaseBillNo" allowClear placeholder="请输入采购单号"/>
+                    <a-input id="outStock-modal-purchaseBillNo" v-model.trim="queryParam.purchaseBillNo" allowClear placeholder="请输入采购单号"/>
                   </a-form-item>
                 </a-col>
                 <a-col flex="auto">
-                  <a-button type="primary" @click="searchForm" :disabled="disabled" id="productInfoList-refresh">查询</a-button>
-                  <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="productInfoList-reset">重置</a-button>
+                  <a-button type="primary" @click="searchForm" :disabled="disabled" id="outStock-modal-refresh">查询</a-button>
+                  <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="outStock-modal-reset">重置</a-button>
                 </a-col>
               </a-row>
             </a-form>
           </div>
-          <!-- <p style="font-weight: bold;">当前已选:{{ rowSelectionInfo&&rowSelectionInfo.selectedRowKeys?rowSelectionInfo.selectedRowKeys.length:0 }}个</p> -->
           <!-- 列表 -->
           <s-table
             class="sTable"
@@ -50,14 +49,14 @@
         <!-- 按钮 -->
         <div class="btn-con">
           <a-button
-            id="outStock-cancel"
+            id="outStock-modal-cancel"
             size="large"
             class="button-cancel"
             @click="isShow=false"
             style="padding: 0 30px;margin-right: 30px;">取消</a-button>
           <a-button
             type="primary"
-            id="outStock-save"
+            id="outStock-modal-save"
             size="large"
             class="button-primary"
             @click="handleSave"
@@ -85,13 +84,13 @@ export default {
       type: Boolean,
       default: false
     },
-    chooseData: {
+    chooseData: { // 已选数据
       type: Array,
       default: () => {
         return []
       }
     },
-    paramsData: {
+    paramsData: { // 详情信息
       type: Object,
       default: () => {
         return {}
@@ -134,15 +133,15 @@ export default {
         })
       },
       spinning: false,
-      rowSelectionInfo: null,
-      time: [
+      rowSelectionInfo: null, // 已选数据
+      time: [ // 默认时间
         getDate.getCurrMonthDays().starttime,
         getDate.getCurrMonthDays().endtime
       ],
       queryParam: { //  查询条件
-        purchaseBillNo: '',
-        beginDate: getDate.getCurrMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime
+        purchaseBillNo: '', // 采购单号
+        beginDate: getDate.getCurrMonthDays().starttime, // 开始时间
+        endDate: getDate.getCurrMonthDays().endtime // 结束时间
       }
     }
   },
@@ -165,9 +164,11 @@ export default {
       }
       _this.$emit('ok', this.rowSelectionInfo.selectedRowKeys)
     },
+    // 查询
     searchForm () {
       this.$refs.table.refresh(true)
     },
+    // 重置
     resetSearchForm () {
       this.$refs.rangeDate.resetDate(this.time)
       this.queryParam.beginDate = getDate.getCurrMonthDays().starttime

+ 13 - 10
src/views/purchasingManagement/purchaseOrder/outStockModal.vue

@@ -110,17 +110,17 @@ export default {
       type: Boolean,
       default: false
     },
-    paramsSn: {
+    paramsSn: { // sn
       type: String,
       default: ''
     },
-    chooseData: {
+    chooseData: { // 已选数据
       type: Array,
       default: () => {
         return []
       }
     },
-    purchaseTargetType: {
+    purchaseTargetType: { // 采购类型
       type: String,
       default: null
     }
@@ -163,11 +163,11 @@ export default {
         })
       },
       spinning: false,
-      rowSelectionInfo: null,
-      productType: [],
+      rowSelectionInfo: null, // 已勾选数据
+      productType: [], // 产品分类
       queryParam: { //  查询条件
-        purchaseBillSnList: undefined,
-        purchaseBillNo: '',
+        purchaseBillSnList: undefined, // 已选sn列表
+        purchaseBillNo: '', // 采购单号
         dealerProduct: {
           code: '', //  产品编码
           name: '', //  产品名称
@@ -198,6 +198,7 @@ export default {
         this.$message.warning('请在列表勾选后再进行操作!')
         return
       }
+      // 格式化数据
       const arr = []
       _this.rowSelectionInfo.selectedRows.forEach(item => {
         const obj = {
@@ -213,20 +214,22 @@ export default {
         }
       })
     },
+    // 查询
     searchForm () {
       this.$refs.table.refresh(true)
     },
+    // 重置
     resetSearchForm () {
-      this.queryParam.purchaseBillNo = ''
+      this.queryParam.purchaseBillNo = '' // 采购单号
       const info = {
-        productBrandSn: undefined,
+        productBrandSn: undefined, // 采购sn
         code: '', //  产品编码
         name: '', //  产品名称
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '' //  产品三级分类
       }
-      this.productType = []
+      this.productType = [] // 产品分类
       Object.assign(this.queryParam.dealerProduct, info)
       this.$refs.table.refresh(true)
     }

+ 11 - 13
src/views/purchasingManagement/purchaseOrder/warehousing.vue

@@ -42,7 +42,7 @@
               expand-trigger="hover"
               :options="warehouseCascadeData"
               :fieldNames="{ label: 'name', value: 'sn', children: 'warehouseLocationList' }"
-              id="purchaseOrderWarehousing-warehouseCascade"
+              :id="'purchaseOrderWarehousing-warehouseCascade-'+record.id"
               placeholder="请选择仓库仓位"
               :allowClear="false"
               style="width: 100%;" />
@@ -79,11 +79,11 @@ export default {
     return {
       spinning: false,
       detail: null, //  详情数据
-      productType: [],
+      productType: [], // 产品分类默认值
       queryParam: {
-        productBrandSn: undefined,
-        queryWord: '',
-        brand: '',
+        productBrandSn: undefined, // 产品品牌
+        queryWord: '', // 关键词查询
+        brand: '', // 品牌
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '' //  产品三级分类
@@ -189,11 +189,6 @@ export default {
     handleBack () {
       this.$router.push({ path: '/purchasingManagement/purchaseOrder/list' })
     },
-    filterOption (input, option) {
-      return (
-        option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
-      )
-    },
     //  详情
     getDetail () {
       this.spinning = true
@@ -212,8 +207,8 @@ export default {
       warehouseCascadeList({}).then(res => {
         if (res.status == 200) {
           res.data.filter(item => {
-            // 过滤默认仓库
-            if (item.defaultFlag == 1 && item.wasteFlag == 0) { //  defaultFlag为1,且不是废品仓
+            // 过滤默认仓库,defaultFlag为1,且不是废品仓
+            if (item.defaultFlag == 1 && item.wasteFlag == 0) {
               _this.defaultWarehouseCascade[0] = item.warehouseSn
               // 过滤默认仓位
               item.warehouseLocationList.filter(subItem => {
@@ -228,6 +223,7 @@ export default {
               })
             }
           })
+          // 格式化数据
           res.data.map(item => {
             item.sn = item.warehouseSn
             if (item.warehouseLocationList) {
@@ -245,6 +241,7 @@ export default {
     // 修改仓库仓位
     changeWarehouseCascade (val, opt, ind, bindex) {
       let loadData = this.chooseLoadData[bindex][ind]
+      // 当前仓库无仓位
       if (val.length == 1) {
         this.$message.warning('当前仓库无仓位,请选择其他仓库')
         const warehouseSnBackups = loadData.warehouseSnBackups || undefined
@@ -257,6 +254,7 @@ export default {
           loadData.warehouseCascade = undefined
         }
       } else {
+        // 有仓库仓位
         loadData.warehouseSn = val[0] ? val[0] : ''
         loadData.warehouseLocationSn = val[1] ? val[1] : ''
         loadData.warehouseSnBackups = val[0] ? val[0] : ''
@@ -275,7 +273,6 @@ export default {
       }).then(res => {
         if (res.status == 200) {
           this.$message.success(res.message)
-          console.log(bindex, this.$refs)
           this.$refs['table-' + bindex][0].refresh()
           this.spinning = false
         } else {
@@ -283,6 +280,7 @@ export default {
         }
       })
     },
+    // 初始化页面
     pageInit () {
       this.getDetail()
       this.getWarehouseCascade()