Kaynağa Gözat

Merge branch 'develop_yh12' of http://git.chelingzhu.com/jianguan-web/jg-ocs-html into develop_yh12

chenrui 2 yıl önce
ebeveyn
işleme
923178cde3

+ 41 - 4
src/views/allocationManagement/transferOut/basicInfoModal.vue

@@ -70,10 +70,26 @@
             </a-form-model-item>
           </a-col>
           <a-col :md="24" :sm="24">
-            <a-form-model-item label="备注" prop="remark" :wrapperCol="{ span: 20 }" :labelCol="{ span: 4 }">
+            <a-form-model-item style="margin-bottom:10px;" label="备注" prop="remark" :wrapperCol="{ span: 20 }" :labelCol="{ span: 4 }">
               <a-textarea id="allocateBill-basicInfo-remark" :maxLength="120" v-model="form.remark" placeholder="请输入备注(最多120个字符)" allowClear />
             </a-form-model-item>
           </a-col>
+          <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+            <a-form-model-item label="附件" help="(支持图片、word、excel、PDF等格式,最多10个附件)" :label-col="{span:4}" :wrapper-col="{span:18}">
+              <Upload
+                style="height: 100%;"
+                id="allocateBill-attachList"
+                v-model="form.allocateFilesList"
+                ref="attachList"
+                :fileSize="10"
+                :maxNums="10"
+                fileType="*"
+                uploadType="attach"
+                :action="attachAction"
+                @change="changeAttach"
+                upText="上传附件"></Upload>
+            </a-form-model-item>
+          </a-col>
         </a-row>
       </a-form-model>
       <div class="btn-cont">
@@ -87,7 +103,7 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import debounce from 'lodash/debounce'
-import { VSelect } from '@/components'
+import { VSelect, Upload } from '@/components'
 import { allocateBillSave } from '@/api/allocateBill'
 import { dealerSubareaScopeList } from '@/api/dealer'
 import { getLookUpData } from '@/api/data'
@@ -97,7 +113,7 @@ import AllocateType from '@/views/common/allocateType.js'
 export default {
   name: 'TransferOutBasicInfoModal',
   mixins: [commonMixin],
-  components: { VSelect, ProductBrand, productTypeAll, AllocateType },
+  components: { VSelect, Upload, ProductBrand, productTypeAll, AllocateType },
   props: {
     openModal: {
       //  弹框显示状态
@@ -116,6 +132,8 @@ export default {
         wrapperCol: { span: 16 }
       },
       productType: [],
+      attachList: [],
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/uploadGetFileInfo',
       form: {
         targetType: 'DEALER',
         targetSn: undefined,
@@ -130,7 +148,8 @@ export default {
         time: [],
         promoStartDate: '',
         promoEndDate: '',
-        remark: ''
+        remark: '',
+        allocateFilesList: ''
       },
       rules: {
         targetType: [{ required: true, message: '请选择调往对象', trigger: 'change' }],
@@ -160,6 +179,13 @@ export default {
       this.form.promoStartDate = date.length ? dateStrings[0] : ''
       this.form.promoEndDate = date.length ? dateStrings[1] : ''
     },
+    //  附件上传
+    changeAttach (file) {
+      this.attachList = JSON.parse(file)
+      this.attachList.map(item => {
+        item.fileType = item.extName
+      })
+    },
     // 调拨类别 change
     allocateTypeChange (val, opt) {
       console.log(val, opt, '------------')
@@ -216,6 +242,7 @@ export default {
           if (!form.productBrandName) {
             form.productBrandSn = ''
           }
+          form.allocateFilesList = this.attachList
           _this.spinning = true
           allocateBillSave(form).then(res => {
             if (res.status == 200) {
@@ -267,6 +294,9 @@ export default {
         this.$refs.ruleForm.resetFields()
         this.allocateTypeVal = []
         this.productType = []
+        this.attachList = []
+        this.form.allocateFilesList = ''
+        this.$refs.attachList.setFileList('')
         this.form = {
           targetType: 'DEALER',
           targetSn: undefined,
@@ -289,6 +319,13 @@ export default {
         if (this.detailData) {
           this.isEdit = true
           this.form = Object.assign(this.form, this.detailData)
+          // 获取附件列表
+          this.form.allocateFilesList = ''
+          this.attachList = this.detailData.allocateFilesList
+          this.$nextTick(() => {
+            this.$refs.attachList.setFileList(this.attachList)
+          })
+
           this.allocateTypeVal = [this.detailData.costTypeSn, this.detailData.allocateSortSn, this.detailData.allocateTypeSn]
           if (this.detailData.productTypeSn1) {
             this.productType = [this.detailData.productTypeSn1, this.detailData.productTypeSn2, this.detailData.productTypeSn3]

+ 13 - 0
src/views/allocationManagement/transferOut/detail.vue

@@ -85,6 +85,19 @@
                 <span v-else>--</span>
               </a-descriptions-item>
               <a-descriptions-item label="备注">{{ (basicInfoData&&basicInfoData.remark) || '--' }}</a-descriptions-item>
+              <a-descriptions-item label="附件" :span="4">
+                <div v-if="basicInfoData&&basicInfoData.allocateFilesList">
+                  <a
+                    target="_blank"
+                    style="color: #00aaff;text-decoration: underline;margin-right: 15px;"
+                    :href="item.filePath"
+                    v-for="item in basicInfoData.allocateFilesList"
+                    :key="item.id">
+                    {{ item.fileName }}
+                  </a>
+                </div>
+                <span v-else>--</span>
+              </a-descriptions-item>
             </a-descriptions>
           </a-collapse-panel>
         </a-collapse>

+ 34 - 3
src/views/allocationManagement/transferOut/edit.vue

@@ -83,6 +83,19 @@
               <a-descriptions-item label="备注">
                 {{ (basicInfoData&&basicInfoData.remark||'--') }}
               </a-descriptions-item>
+              <a-descriptions-item label="附件" :span="4">
+                <div v-if="basicInfoData&&basicInfoData.allocateFilesList">
+                  <a
+                    target="_blank"
+                    style="color: #00aaff;text-decoration: underline;margin-right: 15px;"
+                    :href="item.filePath"
+                    v-for="item in basicInfoData.allocateFilesList"
+                    :key="item.id">
+                    {{ item.fileName }}
+                  </a>
+                </div>
+                <span v-else>--</span>
+              </a-descriptions-item>
             </a-descriptions>
           </a-collapse-panel>
         </a-collapse>
@@ -130,6 +143,17 @@
               :data="loadData"
               :scroll="{ y: 300 }"
               bordered>
+              <!-- 调出数量 -->
+              <template slot="qty" slot-scope="text, record">
+                <a-input-number
+                  size="small"
+                  v-model="record.qty"
+                  :precision="0"
+                  :min="1"
+                  :max="record.currentStockQty"
+                  placeholder="请输入"
+                  style="width: 100%;" />
+              </template>
               <!-- 操作 -->
               <template slot="action1" slot-scope="text, record">
                 <a-button
@@ -367,6 +391,7 @@ export default {
           const no = (data.pageNo - 1) * data.pageSize
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = no + i + 1
+            data.list[i].qty = 1
           }
           this.loadDataSource = data.list || []
           this.disabled = false
@@ -411,12 +436,13 @@ export default {
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', align: 'center', width: '29%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', width: '26%', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'productOrigCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
         // { title: '成本价', dataIndex: 'lastStockCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         // { title: '售价', dataIndex: 'productPrice', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '库存数量', dataIndex: 'currentStockQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'productUnit', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调出数量', scopedSlots: { customRender: 'qty' }, width: '8%', align: 'center' },
+        { title: '单位', dataIndex: 'productUnit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action1' }, width: '10%', align: 'center' }
       ]
       if (this.$hasPermissions('B_isShowCost')) { //  成本价权限
@@ -551,7 +577,7 @@ export default {
         allocateSn: this.$route.params.sn,
         cost: isEdit ? row.cost : row.lastStockCost,
         price: isEdit ? row.price : row.productPrice,
-        qty: isEdit ? row.qty : 1, //  添加时调出数量默认为1
+        qty: row.qty, //  添加时调出数量默认为1
         productSn: row.productSn,
         departmentSn: row.departmentSn,
         departmentName: row.departmentName
@@ -566,6 +592,11 @@ export default {
           row.price = row.priceBackups
           return
         }
+      } else {
+        if (!row.qty) {
+          this.$message.info('请输入调出数量')
+          return
+        }
       }
       this.spinning = true
       allocateBillDetailSave(params).then(res => {

+ 6 - 28
src/views/expenseManagement/expenseReimbursement/add.vue

@@ -95,13 +95,12 @@
           </template>
           <!-- 产品信息 -->
           <template slot="cpxx" slot-scope="text,record">
-            <div style="display:flex;align-items: center;" v-if="record.detailProductsList">
-              <a-icon style="color:red;font-size:16px;" v-if="record.ptaFlag" type="exclamation-circle" />
-              <div style="padding-left: 6px;">
+            <div v-if="record.detailProductsList">
+              <div>
                 <div v-for="item in record.detailProductsList" :key="item.id">
-                  <div v-if="item.productCode">{{ item.productCode }}: <span :style="{color:record.ptaFlag?'red':''}">¥{{ item.expense }}</span></div>
-                  <div v-else-if="item.productBrandName">{{ item.productBrandName }}<span v-if="item.productTypeShowName">/</span>{{ item.productTypeShowName }}: <span :style="{color:record.ptaFlag?'red':''}">¥{{ item.expense }}</span></div>
-                  <div v-else>{{ item.productTypeShowName }}: <span :style="{color:record.ptaFlag?'red':''}">¥{{ item.expense }}</span></div>
+                  <div v-if="item.productCode">{{ item.productCode }}</div>
+                  <div v-else-if="item.productBrandName">{{ item.productBrandName }}<span v-if="item.productTypeShowName">/</span>{{ item.productTypeShowName }}</div>
+                  <div v-else>{{ item.productTypeShowName }}</div>
                 </div>
               </div>
             </div>
@@ -170,7 +169,6 @@ export default {
       expenseAccountDetailSn: '',
       openProductInfoModal: false, // 产品信息弹框
       total: 0,
-      hasPtaFlag: [],
       loadData: parameter => {
         const params = Object.assign(parameter, { expenseAccountSn: this.$route.params.sn })
         return expenseAcctDetailFindList(params).then(res => {
@@ -178,7 +176,6 @@ export default {
           if (res.status == 200) {
             data = res.data
             const no = 0
-            this.hasPtaFlag = []
             for (var i = 0; i < data.length; i++) {
               data[i].no = no + i + 1
               // 产品信息合计
@@ -187,10 +184,6 @@ export default {
                 data[i].detailProductsList.map(item => {
                   data[i].productTotalAmount += item.expense
                 })
-                data[i].ptaFlag = data[i].productTotalAmount !== Math.abs(data[i].expense)
-                if (data[i].ptaFlag) {
-                  this.hasPtaFlag.push('第 ' + (i + 1) + ' 行')
-                }
               }
             }
             this.total = data.length
@@ -305,22 +298,7 @@ export default {
     },
     beforeSubmit () {
       if (this.total) {
-        // 判断是否存在产品信息合计不等于记账费用
-        if (this.hasPtaFlag.length) {
-          const h = this.$createElement
-          this.$warning({
-            title: '操作提示',
-            content: h('div', {}, [
-              h('p', '提交失败,以下费用明细的产品信息金额之和,不等于记账费用,请修改后再提交!'),
-              h('p', '需要修改的行数:'),
-              h('p', { style: { color: '#00aaff' } }, this.hasPtaFlag.join(','))
-            ]),
-            centered: true,
-            onOk () {}
-          })
-        } else {
-          this.openDepartUserModal = true
-        }
+        this.openDepartUserModal = true
       } else {
         this.$message.info('请新增费用明细')
       }

+ 7 - 6
src/views/expenseManagement/expenseReimbursement/productInfoModal.vue

@@ -26,7 +26,7 @@
           <a-table
             class="sTable fixPagination"
             ref="table"
-            :scroll="{ y: 500 }"
+            :scroll="{ y: 200 }"
             size="small"
             :rowKey="(record) => record.id"
             :columns="columns"
@@ -75,6 +75,7 @@
               <a-button
                 type="link"
                 class="button-info"
+                v-if="dataList.length==0"
                 block
                 @click="handleAddRow()"
               >+ 新增产品信息</a-button>
@@ -127,7 +128,7 @@ export default {
         { title: '产品品牌', scopedSlots: { customRender: 'productBrand' }, align: 'center', width: '20%' },
         { title: '产品分类', scopedSlots: { customRender: 'productType' }, align: 'center', width: '30%' },
         { title: '产品编码', scopedSlots: { customRender: 'productCode' }, align: 'center', width: '20%' },
-        { slots: { title: 'customTitle' }, scopedSlots: { customRender: 'expense' }, align: 'center', width: '20%' },
+        // { slots: { title: 'customTitle' }, scopedSlots: { customRender: 'expense' }, align: 'center', width: '20%' }
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
     }
@@ -237,10 +238,10 @@ export default {
         delete item.productType
         delete item.no
       })
-      if (hasError == 1) {
-        this.$message.info('请输入费用金额')
-        return
-      }
+      // if (hasError == 1) {
+      //   this.$message.info('请输入费用金额')
+      //   return
+      // }
       if (hasError == 2) {
         this.$message.info('产品品牌、产品分类、产品编码,三个至少填一个')
         return