Преглед изворни кода

采购单完善id和注释

lilei пре 1 година
родитељ
комит
0147f67a71

+ 1 - 1
public/version.json

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

+ 1 - 1
src/views/purchasingManagement/purchaseOrder/warehousing.vue

@@ -105,7 +105,7 @@ export default {
         { title: '本次入库数量', dataIndex: 'putQty', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '仓库仓位', scopedSlots: { customRender: 'warehousePosition' }, width: '13%', align: 'center' }
       ],
-      chooseLoadData: [],
+      chooseLoadData: [], // 已选数据
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true

+ 9 - 6
src/views/purchasingManagement/purchaseOrderNew/basicInfoModal.vue

@@ -70,7 +70,7 @@ export default {
   data () {
     return {
       spinning: false,
-      confirmLoading: false,
+      confirmLoading: false, // 按钮loading
       isShow: this.openModal, //  是否打开弹框
       formItemLayout: {
         labelCol: { span: 4 },
@@ -85,8 +85,8 @@ export default {
         consigneeTel: '', // 联系电话
         consigneeName: '', // 联系人名称
         settleStyleSn: undefined, //  支付方式
-        purchaseTargetSn: undefined,
-        purchaseTargetName: ''
+        purchaseTargetSn: undefined, // 供应商sn
+        purchaseTargetName: '' // 供应商名称
       },
       rules: {
         purchaseTargetSn: [
@@ -99,14 +99,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 = ''
@@ -121,7 +122,7 @@ export default {
       this.form.purchaseTargetSn = undefined
       this.form.purchaseTargetName = ''
     },
-    // 供应商change
+    // 选择供应商change
     tragetTypeChange (e) {
       const val = e.target.value
       const ind = this.purchaseTragetType.findIndex(item => item.purchaseTargetSn == val)
@@ -178,6 +179,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 +235,7 @@ export default {
         }
       })
     },
+    // 重置地址信息
     verifyFun (id) {
       if (id == this.addressId) {
         this.chooseAddr = ''

+ 7 - 4
src/views/purchasingManagement/purchaseOrderNew/chooseImportModal.vue

@@ -82,7 +82,7 @@ export default {
       type: Boolean,
       default: false
     },
-    paramsData: {
+    paramsData: { // 参数
       type: Object,
       default: () => {
         return {}
@@ -108,23 +108,26 @@ export default {
         { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '备注', dataIndex: 'errorDesc', width: '30%', align: 'center', customRender: function (text) { return text || '--' } }
       ],
-      loadData: [],
-      unLoadData: [],
+      loadData: [], // 可导入数据
+      unLoadData: [], // 错误数据
       loading: false
     }
   },
   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) {

+ 27 - 16
src/views/purchasingManagement/purchaseOrderNew/chooseProductModal.vue

@@ -66,6 +66,7 @@
               :src="record.productMainPic && record.productMainPic.imageUrl?(record.productMainPic.imageUrl+'?x-oss-process=image/resize,h_30,m_lfit'):defImg"
               width="30"
               height="30"
+              :id="'purchaseOrderEdit-imgview-'+record.id"
               style="cursor: pointer;"
               @click="handlePicDetail(record)" />
           </template>
@@ -88,6 +89,7 @@
             <div @dblclick.stop>
               <a-input-number
                 size="small"
+                :id="'purchaseOrderEdit-cQty-'+record.id"
                 v-model="record.qty"
                 :precision="0"
                 :min="0"
@@ -101,6 +103,7 @@
             <a-button
               size="small"
               type="link"
+              :id="'purchaseOrderEdit-cadd-'+record.id"
               class="button-primary"
               :loading="addLoading"
               @click="handleAdd(record)"
@@ -136,22 +139,22 @@ export default {
     STable, VSelect, ProductType, ProductBrand
   },
   props: {
-    showModal: {
+    showModal: { // 显示隐藏弹框
       type: Boolean,
       default: false
     },
-    width: {
+    width: { // 弹框宽度
       type: [String, Number],
       default: '80%'
     },
-    zIndex: {
+    zIndex: { // 弹框层级
       type: Number,
       default: 100
     },
-    isDealerUp: {
+    isDealerUp: { // 是否上级经销商
       type: Boolean
     },
-    purchaseBillSn: {
+    purchaseBillSn: { // 采购单sn
       type: String
     }
   },
@@ -159,6 +162,7 @@ export default {
     showModal (newValue, oldValue) {
       this.visible = newValue
       if (newValue) {
+        // 初始化页面
         this.resetSearchForm()
         this.$refs.searchProductCode.focus()
         this.setTableH()
@@ -170,16 +174,16 @@ export default {
   },
   data () {
     return {
-      visible: this.showModal,
-      title: '添加产品',
-      tableHeight: 0,
-      simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
+      visible: this.showModal, // 显示弹框
+      title: '添加产品', // 标题
+      tableHeight: 0, // 表格高度
+      simpleImage: Empty.PRESENTED_IMAGE_SIMPLE, // 默认图片
       // 选择产品
-      addLoading: false,
+      addLoading: false, // 添加按钮loading
       spinning: false,
-      productType: [],
+      productType: [], // 产品分类默认值
       queryParam: {
-        productBrandSn: undefined,
+        productBrandSn: undefined, // 产品品牌
         code: '', //  产品编码
         name: '', //  产品名称
         origCode: '', //  原厂编码
@@ -189,7 +193,7 @@ export default {
       },
       advanced: false, //  高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
-      showTable: false,
+      showTable: false, // 是否显示表格
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -206,13 +210,15 @@ export default {
           return data
         })
       },
-      defImg
+      defImg // 默认图片
     }
   },
   computed: {
+    // 是否有筛选条件,至少一个
     hasVaild () {
       return this.queryParam.code || this.queryParam.name || this.queryParam.productBrandSn || this.queryParam.productTypeSn1
     },
+    // 动态计算表格宽度
     tableWidth () {
       let w = 1410
       if (this.isDealerUp) {
@@ -223,6 +229,7 @@ export default {
       }
       return w
     },
+    // 列定义
     columns () {
       const _this = this
       const arr = [
@@ -239,13 +246,14 @@ export default {
         { title: '采购数量', dataIndex: 'qty', scopedSlots: { customRender: 'storageQuantity' }, width: '100px', align: 'center', fixed: 'right' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '100px', align: 'center', fixed: 'right' }
       ]
-      // 产品来源
+      // 产品来源,如果时上级
       if (this.isDealerUp) {
         arr.splice(0, 0, { title: '产品编码', scopedSlots: { customRender: 'code' }, width: '150px', align: 'center', fixed: 'left' })
         arr.splice(2, 0, { title: '产品来源', dataIndex: 'sysFlagDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' } })
       } else {
         arr.splice(0, 0, { title: '产品编码', dataIndex: 'code', width: '150px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left', sorter: true })
       }
+      // 成本价权限
       if (this.$hasPermissions('M_ShowAllCost')) {
         arr.splice(this.isDealerUp ? 4 : 3, 0, { title: '成本价', dataIndex: 'purchasePrice', width: '100px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
       }
@@ -263,7 +271,7 @@ export default {
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
     },
-    // 查询
+    // 查询列表
     searchForm () {
       if (this.hasVaild) {
         this.showTable = true
@@ -288,13 +296,16 @@ export default {
       this.productType = []
       this.showTable = false
     },
+    // 关闭弹框
     onClose () {
       this.$emit('close')
     },
+    // 添加产品
     handleAdd (record) {
       this.spinning = true
       this.$emit('add', record, 0)
     },
+    // 计算表格高度
     setTableH () {
       this.$nextTick(() => {
         const searchBoxH = this.$refs.searchBox.offsetHeight

+ 11 - 9
src/views/purchasingManagement/purchaseOrderNew/detail.vue

@@ -8,7 +8,7 @@
           <a-tag color="blue" v-if="detail&&detail.billStatusDictValue">{{ detail&&detail.billStatusDictValue }}</a-tag>
           <a-tag color="orange" v-if="detail&&detail.financialStatusDictValue">{{ detail&&detail.financialStatusDictValue }}</a-tag>
           <span v-if="detail&&detail.purchaseBillNoSource" style="font-size: 14px;margin: 0 10px;">(原:{{ detail&&detail.purchaseBillNoSource }})</span>
-          <a-button type="link" class="button-default" @click="isShowBisiceInfo=!isShowBisiceInfo" style="margin-left:10px;vertical-align:middle;">
+          <a-button id="purchaseNewOrderEdit-showDesc-btn" type="link" class="button-default" @click="isShowBisiceInfo=!isShowBisiceInfo" style="margin-left:10px;vertical-align:middle;">
             <a-icon :type="isShowBisiceInfo ? 'eye-invisible' : 'eye'"/>
             {{ isShowBisiceInfo?'隐藏':'查看' }}信息
           </a-button>
@@ -54,7 +54,6 @@
       </a-card>
       <!-- 产品详情 -->
       <a-card size="small" :bordered="false" class="purchaseOrderDetail-cont">
-        <!-- <div slot="title" style="font-size:14px;"><strong>产品详情</strong></div> -->
         <!-- 总计 -->
         <div class="alert-message">
           产品款数:<strong>{{ detail && (detail.totalCategory || detail.totalCategory==0) ? detail.totalCategory : '--' }}</strong>,
@@ -148,8 +147,8 @@ export default {
   data () {
     return {
       spinning: false,
-      isShowBisiceInfo: false,
-      isShowSalesFlag: false,
+      isShowBisiceInfo: false, // 是否显示详情信息
+      isShowSalesFlag: false, // 是否显示优惠金额
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -169,17 +168,19 @@ 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
       const arr = [
@@ -195,12 +196,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: '11%', align: 'right', scopedSlots: { customRender: 'unitPrice' } })
         arr.splice(6, 0, { title: '采购金额', dataIndex: 'discountedAmount', width: '11%', 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) : '--') } })
       }
@@ -276,7 +279,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)

+ 50 - 27
src/views/purchasingManagement/purchaseOrderNew/edit.vue

@@ -4,7 +4,7 @@
       <!-- 自定义的二级文字标题 -->
       <template slot="subTitle">
         <p class="billno">单号:{{ detail&&detail.purchaseBillNo }}</p>
-        <a-button type="link" class="button-default" @click="isShowBisiceInfo=!isShowBisiceInfo" style="margin-left:10px;vertical-align:middle;">
+        <a-button id="purchaseNewOrderEdit-showDesc-btn" type="link" class="button-default" @click="isShowBisiceInfo=!isShowBisiceInfo" style="margin-left:10px;vertical-align:middle;">
           <a-icon :type="isShowBisiceInfo ? 'eye-invisible' : 'eye'"/>
           {{ isShowBisiceInfo?'隐藏':'查看' }}信息
         </a-button>
@@ -21,17 +21,17 @@
           <a-divider type="vertical" />
           <a-dropdown>
             <a-menu slot="overlay" @click="handleActions">
-              <a-menu-item key="3" v-if="$hasPermissions('M_shoppingCart')">
+              <a-menu-item key="3" v-if="$hasPermissions('M_shoppingCart')" id="purchaseNewOrderEdit-more-3">
                 <a-icon type="shopping" /> 购物车
               </a-menu-item>
-              <a-menu-item key="2" v-if="!isDealerUp">
+              <a-menu-item key="2" v-if="!isDealerUp" id="purchaseNewOrderEdit-more-2">
                 <a-icon type="funnel-plot" />导入缺货
               </a-menu-item>
-              <a-menu-item key="1">
+              <a-menu-item key="1" id="purchaseNewOrderEdit-more-1">
                 <a-icon type="import" />导入产品
               </a-menu-item>
             </a-menu>
-            <a-button type="link" class="button-default"> <a-icon type="unordered-list" />  更多</a-button>
+            <a-button id="purchaseNewOrderEdit-more-btn" type="link" class="button-default"> <a-icon type="unordered-list" />  更多</a-button>
           </a-dropdown>
         </div>
       </template>
@@ -58,9 +58,9 @@
               {{ detail&&detail.shippingAddressCityName || '' }}
               {{ detail&&detail.shippingAddressCountyName || '' }}
               {{ detail&&detail.shippingAddress || '' }}
-              <a-button type="link" @click="openAddrModal=true">更换地址 >></a-button>
+              <a-button id="purchaseNewOrderEdit-upaddr" type="link" @click="openAddrModal=true">更换地址 >></a-button>
             </div>
-            <div v-else><a-button type="link" @click="openAddrModal=true">选择地址 >></a-button></div>
+            <div v-else><a-button id="purchaseNewOrderEdit-chooseAddr" type="link" @click="openAddrModal=true">选择地址 >></a-button></div>
           </a-descriptions-item>
         </a-descriptions>
       </div>
@@ -75,12 +75,12 @@
                   <a-row :gutter="15">
                     <a-col :md="5" :sm="24">
                       <a-form-model-item label="产品编码">
-                        <a-input v-model.trim="productForm.productCode" allowClear placeholder="输入产品编码" />
+                        <a-input id="purchaseNewOrderEdit-productCode" v-model.trim="productForm.productCode" allowClear placeholder="输入产品编码" />
                       </a-form-model-item>
                     </a-col>
                     <a-col :md="5" :sm="24">
                       <a-form-model-item label="产品名称">
-                        <a-input v-model.trim="productForm.productName" allowClear placeholder="输入产品名称" />
+                        <a-input id="purchaseNewOrderEdit-productName" v-model.trim="productForm.productName" allowClear placeholder="输入产品名称" />
                       </a-form-model-item>
                     </a-col>
                     <a-col :md="8" :sm="24">
@@ -118,7 +118,7 @@
               }"
             >
               <span slot="description">暂无产品</span>
-              <a-button type="primary" class="button-error" @click="openChooseProduct=true"><a-icon type="plus" />立即添加产品</a-button>
+              <a-button id="purchaseNewOrderEdit-go-add" type="primary" class="button-error" @click="openChooseProduct=true"><a-icon type="plus" />立即添加产品</a-button>
             </a-empty>
           </div>
           <div style="text-align: center;padding: 30px 50px;" v-if="spinning">
@@ -187,6 +187,7 @@ import ImportGuideModal from './importGuideModal.vue'
 import outStockModal from './outStockModal.vue'
 import outStockListModal from './outStockListModal.vue'
 import chooseAddressModal from '@/views/common/receivingAddress/chooseAddressModal.vue'
+// 接口
 import { purchaseDetailBySn, purchaseWriteSubmit, purchaseDetailPrint, purchaseDetailExport, purchaseDetailAddress } from '@/api/purchase'
 import { purchaseDetailList, purchaseDetailSave, purchaseDetailDel } from '@/api/purchaseDetail'
 // 选择产品
@@ -194,13 +195,17 @@ import chooseProductModal from './chooseProductModal.vue'
 // 打印
 import PrintPanel from '@/views/common/printPanel.vue'
 import { hdPrint } from '@/libs/JGPrint'
+// 异步加载购物车弹框
 const shopingCatModal = () => import(/* webpackChunkName: "shopingCatModal" */ '@/views/common/shopingCatModal.vue')
+
+// 自定义数量组件
 const qtyComp = {
   name: 'qtyComp',
   template: `
         <a-input-number
               size="small"
               v-model="row.qty"
+              :id="'purchaseNewOrderEdit-editQty-'+row.id"
               :precision="0"
               :min="1"
               :max="999999"
@@ -215,12 +220,14 @@ const qtyComp = {
     that: Object
   }
 }
+// 自定义操作组件
 const actionComp = {
   name: 'actionComp',
   template: `
         <a-button
           size="small"
           type="link"
+          :id="'purchaseNewOrderEdit-del-'+row.id"
           class="button-error"
           :loading="row.delLoading"
           @click="that.handleDel(row)"
@@ -240,38 +247,40 @@ export default {
   mixins: [commonMixin],
   data () {
     return {
-      isShowBisiceInfo: false,
-      showPage: false,
+      isShowBisiceInfo: false, // 是否显示详情信息
+      showPage: false, // 是否显示页面
       spinning: false,
       detail: null, // 详细信息
-      openChooseProduct: false,
-      openShopCatModal: false,
-      tableHeight: 0,
-      simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
+      openChooseProduct: false, // 打开添加产品弹框
+      openShopCatModal: false, // 打开购物车弹框
+      tableHeight: 0, // 表格高度
+      simpleImage: Empty.PRESENTED_IMAGE_SIMPLE, // 默认图片
       // -------已选产品-------------
-      subLoading: false,
-      orderCountData: null,
-      delLoading: false,
-      showSearch: false,
+      subLoading: false, // loading加载
+      orderCountData: null, // 统计信息
+      delLoading: false, // 操作按钮loading加载
+      showSearch: false, // 是否查询
       productForm: {
-        productName: '',
-        productCode: '',
-        orderBy: 'purchase_bill_detail.CREATE_DATE desc'
+        productName: '', // 产品名称
+        productCode: '', // 产品编码
+        orderBy: 'purchase_bill_detail.CREATE_DATE desc' // 默认排序
       },
       purchaseDisabled: false, //  查询、重置按钮是否可操作
-      localDataSource: [],
-      chooseData: [],
+      localDataSource: [], // 原始列表数据
+      chooseData: [], // 已选列表数据
       openGuideModal: false, //  导入产品引导
-      openOutStockModal: false,
-      paramsData: null,
+      openOutStockModal: false, // 上次缺货弹框
+      paramsData: null, // 传递购物车的参数
       openAddrModal: false, // 选择地址弹框是否显示
       openOutStockListModal: false // 导入缺货
     }
   },
   computed: {
+    // 是否上级经销商
     isDealerUp () {
       return this.detail && (this.detail.purchaseTargetType == 'DEALER_UP' || this.detail.purchaseTargetType == 'DEALER_SUPPLIER')
     },
+    // 已选列表列
     chooseColumns () {
       const _this = this
       const arr = [
@@ -298,6 +307,7 @@ export default {
             return <actionComp row={row} column={column} rowIndex={rowIndex} that={_this} />
           } }
       ]
+      // 是否有成本价权限
       if (this.$hasPermissions('M_ShowAllCost')) {
         arr.splice(4, 0, { title: '采购单价', key: 'h', field: 'discountedPriceText', width: '10%', align: 'right', operationColumn: false })
         arr.splice(6, 0, { title: '采购金额', key: 'i', field: 'discountedAmountText', width: '10%', align: 'right', operationColumn: false })
@@ -306,17 +316,22 @@ export default {
     }
   },
   methods: {
+    // 更多操作
     handleActions (e) {
+      // 导入
       if (e.key == 1) {
         this.openGuideModal = true
       }
+      // 缺货
       if (e.key == 2) {
         this.handleOutStock()
       }
+      // 购物车
       if (e.key == 3) {
         this.hanldCart()
       }
     },
+    // 获取列表数据
     getTableData () {
       this.disabled = true
       this.spinning = true
@@ -349,6 +364,7 @@ export default {
         if (res.status == 200) {
           this.detail = res.data
           if (!noRefashTable) {
+            // 如果有列表数据
             if (this.detail.totalCategory) {
               if (isReset) {
                 this.resetPurchaseForm()
@@ -414,7 +430,9 @@ export default {
       }
       // 添加
       if (type == 0) {
+        // 是上级
         if (this.isDealerUp) {
+          // 如果有成本价
           if (row.purchasePrice) {
             params.productSn = row.productSn
             params.purchaseBillSn = this.detail.purchaseBillSn
@@ -428,6 +446,7 @@ export default {
             return
           }
         } else {
+          // 如果有成本价、终端会员价、车主零售价
           if (row.purchasePrice && row.terminalPrice && row.carOwnersPrice) {
             params.productSn = row.productSn
             params.purchaseBillSn = this.detail.purchaseBillSn
@@ -560,9 +579,11 @@ export default {
     handleBack () {
       this.$router.push({ name: 'purchaseOrderNewList' })
     },
+    // 计算表格高度
     setTableH () {
       this.tableHeight = window.innerHeight - (this.isShowBisiceInfo ? 127 : 0) - (this.showSearch ? 42 : 0) - 210
     },
+    // 页面初始化
     pageInit () {
       this.$nextTick(() => {
         this.setTableH()
@@ -571,9 +592,11 @@ export default {
     }
   },
   watch: {
+    // 显示详情信息
     isShowBisiceInfo (newValue, oldValue) {
       this.setTableH()
     },
+    // 显示页面
     showSearch (newValue, oldValue) {
       if (this.isShowBisiceInfo) {
         this.isShowBisiceInfo = false

+ 4 - 4
src/views/purchasingManagement/purchaseOrderNew/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="importGuide-tpl">
                 <a-icon type="download" style="padding-right: 5px;" />下载导入模板
               </a>
             </li>
@@ -79,7 +79,7 @@ export default {
       type: Boolean,
       default: false
     },
-    params: {
+    params: { // 参数
       type: Object,
       default: null
     }
@@ -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: {

+ 35 - 29
src/views/purchasingManagement/purchaseOrderNew/list.vue

@@ -7,7 +7,7 @@
           <a-row type="flex" justify="start" :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="创建时间">
-                <rangeDate style="width:100%" ref="rangeDate" :value="time" @change="dateChange" />
+                <rangeDate id="purchaseOrderList-time" style="width:100%" ref="rangeDate" :value="time" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -26,16 +26,16 @@
                   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" :id="'purchase-'+item.purchaseTargetSn" :pyCode="item.pyCode" :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 value="" id="purchaseOrderList-billStatus-0">全部</a-select-option>
+                  <a-select-option value="WAIT_SUBMIT" id="purchaseOrderList-billStatus-1">待提交</a-select-option>
+                  <a-select-option value="SUBMIT" id="purchaseOrderList-billStatus-2">已提交</a-select-option>
                 </a-select>
               </a-form-item>
             </a-col>
@@ -75,7 +75,7 @@
             <a-col :md="6" :sm="24">
               <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>
@@ -113,33 +113,35 @@
           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 :id="'purchaseOrderList-detail-'+record.id" class="table-td-link" 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>
           <!-- 操作 -->
           <template slot="action" slot-scope="text, record">
             <a-button
+              :id="'purchaseOrderList-edit-'+record.id"
               size="small"
               type="link"
               class="button-primary"
               v-if="(record.billStatus == 'WAIT_SUBMIT'||record.billStatus == 'AUDIT_REJECT') && $hasPermissions('B_purchaseEdit')"
               @click="handleEdit(record)">编辑</a-button>
             <a-button
+              :id="'purchaseOrderList-del-'+record.id"
               size="small"
               type="link"
               class="button-error"
@@ -157,11 +159,11 @@
 
 <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 {
@@ -175,29 +177,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
+        totalRecord: 0, // 总记录条数
+        totalCategory: 0, // 总款数
+        totalQty: 0, // 总数量
+        totalAmount: 0 // 总金额
       },
       // 表头
       columns: [
@@ -244,6 +246,7 @@ export default {
     }
   },
   methods: {
+    // 统计信息
     getTotalData (params) {
       purchaseCount(params).then(res => {
         this.totalData = res.data || null
@@ -259,12 +262,12 @@ export default {
         this.queryParam.purchaseTargetType = undefined
       }
     },
-    //  时间  change
+    //  选择时间  change
     dateChange (date) {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
-    //  新增
+    //  打开新增弹框
     handleAdd () {
       this.openModal = true
     },
@@ -321,6 +324,7 @@ export default {
         this.setIsHomeNav(this.$route.name, null)
       }
     },
+    // 按名称筛选供应商
     filterOption (input, option) {
       return (
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
@@ -336,6 +340,7 @@ export default {
         }
       })
     },
+    // 页面初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -377,6 +382,7 @@ export default {
         }
       }
     },
+    // 计算表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 255

+ 18 - 16
src/views/purchasingManagement/purchaseOrderNew/outStockListModal.vue

@@ -18,7 +18,7 @@
               <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="outStockList-time" ref="rangeDate" :value="time" @change="dateChange" />
                   </a-form-model-item>
                 </a-col>
                 <a-col :md="8" :sm="24">
@@ -27,13 +27,12 @@
                   </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="outStockList-refresh">查询</a-button>
+                  <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="outStockList-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"
@@ -53,14 +52,14 @@
         <!-- 按钮 -->
         <div class="btn-con" ref="btnBox">
           <a-button
-            id="outStock-cancel"
+            id="outStockList-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="outStockList-save"
             size="large"
             class="button-primary"
             @click="handleSave"
@@ -88,13 +87,13 @@ export default {
       type: Boolean,
       default: false
     },
-    chooseData: {
+    chooseData: { // 已选数据
       type: Array,
       default: () => {
         return []
       }
     },
-    paramsData: {
+    paramsData: { // 详情信息
       type: Object,
       default: () => {
         return {}
@@ -105,9 +104,9 @@ export default {
     const _this = this
     return {
       isShow: this.openModal, //  是否打开弹框
-      zIndex: 90,
-      width: '70%',
-      tableHeight: 0,
+      zIndex: 90, // 弹框层级
+      width: '70%', // 弹框宽度
+      tableHeight: 0, // 表格高度
       formItemLayout: {
         labelCol: { span: 4 },
         wrapperCol: { span: 20 }
@@ -140,15 +139,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 // 结束时间
       }
     }
   },
@@ -171,9 +170,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
@@ -181,6 +182,7 @@ export default {
       this.queryParam.purchaseBillNo = ''
       this.$refs.table.refresh(true)
     },
+    // 计算表格高度
     setTableH () {
       this.$nextTick(() => {
         const searchBoxH = this.$refs.tableSearch.offsetHeight

+ 19 - 15
src/views/purchasingManagement/purchaseOrderNew/outStockModal.vue

@@ -22,32 +22,32 @@
               <a-row type="flex" :gutter="12" justify="start">
                 <a-col flex="auto">
                   <a-form-item label="采购单号">
-                    <a-input id="productInfoList-purchaseBillNo" v-model.trim="purchaseBillNo" placeholder="请输入采购单号" allowClear />
+                    <a-input id="outStock-modal-purchaseBillNo" v-model.trim="purchaseBillNo" placeholder="请输入采购单号" allowClear />
                   </a-form-item>
                 </a-col>
                 <a-col flex="auto">
                   <a-form-item label="产品编码">
-                    <a-input id="productInfoList-code" v-model.trim="queryParam.code" allowClear placeholder="请输入产品编码"/>
+                    <a-input id="outStock-modal-code" v-model.trim="queryParam.code" allowClear placeholder="请输入产品编码"/>
                   </a-form-item>
                 </a-col>
                 <a-col flex="auto">
                   <a-form-item label="产品名称">
-                    <a-input id="productInfoList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
+                    <a-input id="outStock-modal-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
                   </a-form-item>
                 </a-col>
                 <a-col flex="250px">
                   <a-form-item label="产品分类">
-                    <ProductType id="productInfoList-productType" placeholder="请选择产品分类" :isDealer="true" @change="changeProductType" v-model="productType"></ProductType>
+                    <ProductType id="outStock-modal-productType" placeholder="请选择产品分类" :isDealer="true" @change="changeProductType" v-model="productType"></ProductType>
                   </a-form-item>
                 </a-col>
                 <a-col flex="250px">
                   <a-form-item label="产品品牌">
-                    <ProductBrand id="productInfoList-productBrandSn" placeholder="请选择产品品牌" v-model="queryParam.productBrandSn"></ProductBrand>
+                    <ProductBrand id="outStock-modal-productBrandSn" placeholder="请选择产品品牌" v-model="queryParam.productBrandSn"></ProductBrand>
                   </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>
@@ -56,7 +56,7 @@
             <a-button
               type="primary"
               ghost
-              id="outStock-save"
+              id="outStock-modal-add"
               @click="handleSave"
               style="padding: 0 20px;">批量添加</a-button>
             <span style="font-weight: bold;margin-left:15px;" v-if="rowSelectionInfo&&rowSelectionInfo.selectedRowKeys.length">已选:{{ rowSelectionInfo&&rowSelectionInfo.selectedRowKeys.length }}个</span>
@@ -104,21 +104,21 @@ export default {
       type: Boolean,
       default: false
     },
-    paramsSn: {
+    paramsSn: { // 采购单sn
       type: String,
       default: ''
     },
-    chooseData: {
+    chooseData: { // 已选数据
       type: Array,
       default: () => {
         return []
       }
     },
-    width: {
+    width: { // 弹框宽度
       type: [String, Number],
       default: '70%'
     },
-    zIndex: {
+    zIndex: { // 弹框层级
       type: Number,
       default: 100
     },
@@ -167,8 +167,8 @@ export default {
         })
       },
       spinning: false,
-      rowSelectionInfo: null,
-      productType: [],
+      rowSelectionInfo: null, // 已选行
+      productType: [], // 产品分类默认值
       queryParam: { //  查询条件
         code: '', //  产品编码
         name: '', //  产品名称
@@ -177,10 +177,11 @@ export default {
         productTypeSn2: '', //  产品二级分类
         productTypeSn3: '' //  产品三级分类
       },
-      purchaseBillNo: ''
+      purchaseBillNo: '' // 采购单号
     }
   },
   methods: {
+    // 计算表格高度
     setTableH () {
       this.$nextTick(() => {
         const searchBoxH = this.$refs.searchBox.offsetHeight
@@ -219,13 +220,16 @@ export default {
         }
       })
     },
+    // 取消关闭弹框
     onCancel () {
       this.$emit('close')
       this.$refs.table.clearSelected() // 清空表格选中项
     },
+    // 查询列表
     searchForm () {
       this.$refs.table.refresh(true)
     },
+    // 重置列表
     resetSearchForm () {
       this.queryParam = {
         productBrandSn: undefined,