Parcourir la source

按重量手动输入

yusheng il y a 1 an
Parent
commit
f4fca7667e

+ 14 - 3
src/BIZComponents/inventoryTable.vue

@@ -14,7 +14,6 @@
       <template v-slot:toolbar>
         <div class="headbox">
           <div>
-        
             <el-button
               size="small"
               type="primary"
@@ -517,7 +516,15 @@
       </template>
       <template v-slot:pricingWay="scope">
         <el-form-item :prop="'datasource.' + scope.$index + '.pricingWay'">
-          <el-select v-model="scope.row.pricingWay" placeholder="请选择">
+          <el-select
+            v-model="scope.row.pricingWay"
+            placeholder="请选择"
+            :rules="{
+              required: true,
+              message: '请选择计价方式',
+              trigger: 'change'
+            }"
+          >
             <el-option
               v-for="item in pricingWayList"
               :key="item.id"
@@ -529,6 +536,9 @@
           </el-select>
         </el-form-item>
       </template>
+      <template v-slot:headerPricingWay="{ column }">
+        <span class="is-required">{{ column.label }}</span>
+      </template>
 
       <!-- 操作列 -->
       <template v-slot:action="scope">
@@ -767,6 +777,7 @@
             width: 160,
             prop: 'pricingWay',
             label: '计价方式',
+            headerSlot: 'headerPricingWay',
             slot: 'pricingWay',
             align: 'center'
           },
@@ -1035,7 +1046,7 @@
               categoryIds,
               isQueryEE: 1
             });
-          }else{
+          } else {
             return Promise.resolve({});
           }
         } catch (e) {

+ 15 - 7
src/api/wms/index.js

@@ -4,6 +4,9 @@ import request from '@/utils/request';
  * 获取产品所有库存
  */
 export async function getInventoryTotalAPI(data) {
+  if (data.length == 0) {
+    return[]
+  }
   const res = await request.post(`wms/stocktwo/getInventoryTotal`, data);
   if (res.data.code == 0) {
     return res.data.data;
@@ -88,7 +91,7 @@ export async function getInfoById(id) {
 // 批次明细
 
 export async function getBatchDetails(data) {
-  const res = await request.get(`/wms/outin/getBatchDetails`, {params: data});
+  const res = await request.get(`/wms/outin/getBatchDetails`, { params: data });
   if (res.data.code == 0) {
     return res.data.data;
   }
@@ -107,14 +110,13 @@ export async function getDetailById(data) {
  * 产品列表
  */
 export async function getProductList(params) {
-  const res = await request.get(`/main/category/getList`, {params});
+  const res = await request.get(`/main/category/getList`, { params });
   if (res.data.code == 0) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
 }
 
-
 //库存台账-库存明细-物料维度
 
 export async function getMaterielDetails(params) {
@@ -151,7 +153,10 @@ export async function getWarehouseList() {
 // 查询出入库详情
 //sourceBizNo
 export async function getInfoBySourceBizNoAPI(sourceBizNo) {
-  const res = await request.get(`/wms/outintwo/getInfoBySourceBizNo/${sourceBizNo}`, {});
+  const res = await request.get(
+    `/wms/outintwo/getInfoBySourceBizNo/${sourceBizNo}`,
+    {}
+  );
   if (res.data.code == 0) {
     return res.data.data;
   }
@@ -160,7 +165,10 @@ export async function getInfoBySourceBizNoAPI(sourceBizNo) {
 // 查询出入库详情
 //sourceBizNo
 export async function getInfoBySourceBizNoAll(sourceBizNo) {
-  const res = await request.get(`/wms/outintwo/getInfoBySourceBizNoAll/${sourceBizNo}`, {});
+  const res = await request.get(
+    `/wms/outintwo/getInfoBySourceBizNoAll/${sourceBizNo}`,
+    {}
+  );
   if (res.data.code == 0) {
     return res.data.data;
   }
@@ -187,7 +195,7 @@ export async function getOutindetailtwoList(params) {
   return Promise.reject(new Error(res.data.message));
 }
 // 批次维度台账列表
-export async function getBatchList (params){
+export async function getBatchList(params) {
   const res = await request.get(`/wms/outindetailtwo/batchPage`, {
     params
   });
@@ -197,7 +205,7 @@ export async function getBatchList (params){
   return Promise.reject(new Error(res.data.message));
 }
 // 获取物料维度台账列表
-export async function  getMaterialList (params){
+export async function getMaterialList(params) {
   const res = await request.get(`/wms/materialDetail/page`, {
     params
   });

+ 1 - 1
src/views/purchasingManage/purchaseOrder/components/inquiryList.vue

@@ -37,7 +37,7 @@
 
 <script>
 import {generateContract, getTableList, isHasGeneratedContractPI} from '@/api/purchasingManage/inquiryManage';
-import searchProduct from '@/views/purchasingManage/inquiryManage/components/searchQuotation.vue';
+import searchProduct from '@/views/purchasingManage/inquiryManage/components/searchIndex.vue';
 import generateOrderDialog from "@/views/purchasingManage/purchaseOrder/components/generateOrderDialog.vue";
 
 export default {

+ 26 - 14
src/views/purchasingManage/purchaseOrder/components/inventoryTable.vue

@@ -447,19 +447,30 @@
           </el-popconfirm>
         </template>
         <template v-slot:pricingWay="scope">
-          <el-form-item :prop="'datasource.' + scope.$index + '.pricingWay'">
-            <el-select v-model="scope.row.pricingWay" placeholder="请选择">
-              <el-option
-                v-for="item in pricingWayList"
-                :key="item.id"
-                :label="item.name"
-                :value="item.id"
-                @click.native="changeCount(scope.row, scope.$index)"
-              >
-              </el-option>
-            </el-select>
-          </el-form-item>
-        </template>
+        <el-form-item :prop="'datasource.' + scope.$index + '.pricingWay'">
+          <el-select
+            v-model="scope.row.pricingWay"
+            placeholder="请选择"
+            :rules="{
+              required: true,
+              message: '请选择计价方式',
+              trigger: 'change'
+            }"
+          >
+            <el-option
+              v-for="item in pricingWayList"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id"
+              @click.native="changeCount(scope.row, scope.$index)"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+      </template>
+      <template v-slot:headerPricingWay="{ column }">
+        <span class="is-required">{{ column.label }}</span>
+      </template>
       </ele-pro-table>
     </template>
     <product-list
@@ -646,6 +657,7 @@
             width: 160,
             prop: 'pricingWay',
             label: '计价方式',
+            headerSlot: 'headerPricingWay',
             slot: 'pricingWay',
             align: 'center'
           },
@@ -1149,7 +1161,7 @@
           this.$set(parasm, 'produceType', item.produceType);
           this.$set(parasm, 'approvalNumber', item.extField?.approvalNumber);
           this.$set(parasm, 'singleWeight', item.roughWeight);
-          this.$set(parasm, 'pricingWay',1);
+          this.$set(parasm, 'pricingWay',item.pricingWay||1);
           
           this.$set(
             parasm,

+ 3 - 10
src/views/purchasingManage/purchaseOrder/invoice/components/addInvoiceDialog.vue

@@ -124,16 +124,9 @@
             </el-date-picker>
           </el-form-item>
         </el-col>
-        <!-- <el-col :span="12">
-          <el-form-item
-            label="计价方式"
-            >
-            <el-select v-model="form.pricingWay" disabled style="width: 100%">
-              <el-option label="按数量计费" :value="1"></el-option>
-              <el-option label="按重量计费" :value="2"></el-option>
-            </el-select>
-          </el-form-item>
-        </el-col> -->
+
+      </el-row>
+      <el-row :gutter="20">
         <el-col :span="12">
           <el-form-item prop="isQmsCheck" label="是否需要质检">
             <el-select v-model="form.isQmsCheck" style="width: 100%" placeholder="请选择">

+ 17 - 0
src/views/purchasingManage/purchaseOrder/invoice/components/inventoryTable.vue

@@ -703,6 +703,23 @@
           this.form.datasource.length,
           copyObj(obj)
         );
+        this.form.datasource.forEach((item, index) => {
+            item.receiveTotalWeight =
+              item.receiveTotalWeight ||
+              Number(item.totalCount) * Number(item.singleWeight) ||
+              0;
+            if (this.outsourceSendCode) {
+              item.increaseTotalWeight =
+                Number(item.receiveTotalWeight) - Number(item.sendTotalWeight);
+            } else {
+              item.increaseTotalWeight =
+                item.increaseTotalWeight || item.receiveTotalWeight || 0;
+            }
+            item.sendTotalWeight = item.sendTotalWeight || 0;
+            item.pricingWay=item.pricingWay||this.pricingWay
+            this.changeNum(item.totalCount, index,item);
+            
+          });
       },
       validateTotalCount(row) {
         return (rule, value, callback) => {

+ 113 - 0
src/views/purchasingManage/purchaseOrder/invoice/components/outSourceSearchTable1.vue

@@ -0,0 +1,113 @@
+<!-- 搜索表单 -->
+<template>
+  <el-form
+    label-width="100px"
+    class="ele-form-search"
+    @keyup.enter.native="search"
+    @submit.native.prevent
+  >
+    <el-row :gutter="15">
+      <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+        <el-form-item label="发货单编码:" prop="receiveNo">
+          <el-input
+            clearable
+            placeholder="请输入"
+            v-model.trim="params.receiveNo"
+          ></el-input>
+        </el-form-item>
+
+      </el-col>
+
+      <el-col v-bind="styleResponsive ? { lg:6, md: 12 } : { span:6 }">
+
+        <el-form-item label="供应商名称:" prop="supplierName">
+          <el-input
+          placeholder="请输入"
+          style="max-width:320px"
+           v-model.trim="params.supplierName" controls-position="right" >
+          </el-input>
+
+        </el-form-item>
+
+      </el-col>
+
+    </el-row>
+    <el-row :gutter="15">
+      <el-col v-bind="styleResponsive ? { lg:6, md: 12 } : { span:6 }">
+        <el-form-item label="产品名称:" prop="productName">
+          <el-input
+            clearable
+            placeholder="请输入"
+            v-model.trim="params.productName"
+          ></el-input>
+        </el-form-item>
+      </el-col>
+
+      <el-col style="display: flex;justify-content: end" v-bind="styleResponsive ? { lg:18, md: 18 } : { span:18 }">
+
+        <div class="ele-form-actions">
+          <el-button
+            type="primary"
+            icon="el-icon-search"
+            class="ele-btn-icon"
+            @click="search"
+          >
+            查询
+          </el-button>
+          <el-button @click="reset">重置</el-button>
+        </div>
+      </el-col>
+    </el-row>
+  </el-form>
+</template>
+<script>
+import {reviewStatusEnum} from '@/enum/dict';
+const repliedOptions=[
+  {value:0,label:'否'},
+  {value:1,label:'是'},
+]
+  export default {
+    data () {
+      // 默认表单数据
+      const defaultParams = {
+        contractName: '',
+        contractId:'',
+        docNo:'',
+        orderId:'',
+        replied:null,
+        reviewStatus:null
+      };
+      return {
+        reviewStatusEnum,
+        defaultParams,
+        repliedOptions,
+        // 表单数据
+        params: { ...defaultParams }
+      };
+    },
+    computed: {
+      // 是否开启响应式布局
+      styleResponsive () {
+        return this.$store.state.theme.styleResponsive;
+      }
+    },
+    methods: {
+      //选择时间
+      changeDate(e){
+       this.createTime=e
+      },
+      /* 搜索 */
+      search () {
+        this.$emit('search', {
+          ...this.params
+        });
+      },
+      /*  重置 */
+      reset () {
+        this.createTime=[]
+        this.params = Object.assign({},{ ...this.defaultParams });
+        this.search();
+      }
+    }
+  };
+</script>

+ 4 - 2
src/views/purchasingManage/purchaseOrder/invoice/components/outSourceSendDialog.vue

@@ -38,7 +38,7 @@
 </template>
 
 <script>
-import searchTable from '@/views/purchasingManage/purchaseOrder/invoice/components/outSourceSearchTable.vue';
+import searchTable from '@/views/purchasingManage/purchaseOrder/invoice/components/outSourceSearchTable1.vue';
 import {getPurchaseOutSourceSendPageAPI} from "@/api/purchasingManage/outSourceSend";
 
 export default {
@@ -126,7 +126,9 @@ export default {
   },
 
   methods: {
-    init() {},
+    init() {
+      this.reload()
+    },
     /* 表格数据源 */
     datasource({page, limit, where}) {
       return getPurchaseOutSourceSendPageAPI({

+ 2 - 3
src/views/purchasingManage/purchaseOrder/returnGoods/components/detailDialog.vue

@@ -98,9 +98,8 @@
                 disabled
                 style="width: 100%"
               >
-                <el-option :value="3" label="销售发货退货"></el-option>
-                <el-option :value="1" label="售后退货"></el-option>
-                <el-option :value="2" label="受托收货退货"></el-option>
+              <el-option :value="1" label="采购收货单退货"></el-option>
+              <el-option :value="2" label="委外发货单退货"></el-option>
               </el-select>
             </el-form-item>
             <el-form-item label="退货单编码:" prop="returnNo">

+ 1 - 1
src/views/purchasingManage/purchaseOrder/returnGoods/components/inventoryTable.vue

@@ -945,7 +945,7 @@
       },
       // 添加
       handlAdd() {
-        if (!this.receiveId) return this.$message.error('请先选择收货单');
+        // if (!this.receiveId) return this.$message.error('请先选择收货单');
         this.$refs.productListRef.open(this.form.datasource);
       },
 

+ 1 - 1
src/views/purchasingManage/purchasePlanManage/components/purchaseNeed-list.vue

@@ -40,7 +40,7 @@
 
 <script>
 import {getTableList, isHasGeneratedPlanAPI} from '@/api/purchasingManage/purchaseNeedManage';
-  import searchQuotation from './searchQuotation.vue';
+  import searchQuotation from '@/views/purchasingManage/purchaseNeedManage/components/searchQuotation.vue';
 import {isHasGeneratedContractPI, isHasGeneratedInquiryAPI} from "@/api/purchasingManage/purchasePlanManage";
   export default {
     components: {

+ 5 - 11
src/views/saleManage/quotation/components/detailDialog.vue

@@ -78,8 +78,8 @@
               <el-input v-model="form.contactAddress" disabled></el-input>
             </el-form-item>
 
-            <el-form-item label="创建人" prop="createUsername">
-              <el-input v-model="form.createUsername" disabled></el-input>
+            <el-form-item label="创建人" prop="createUserName">
+              <el-input v-model="form.createUserName" disabled></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="8">
@@ -105,14 +105,7 @@
               <el-input v-model="form.quoteAddress" disabled></el-input>
             </el-form-item>
             <el-form-item prop="askFile" label="附件">
-              <el-link
-                v-if="form.askFile && form.askFile !== ''"
-                type="primary"
-                :underline="false"
-                @click="downloadFile(form.askFile)"
-              >
-                {{ form.askFile.name }}</el-link
-              >
+              <fileMain v-model="form.askFile" type="view"></fileMain>
             </el-form-item>
 
       
@@ -180,13 +173,14 @@
   import inventoryTabledetail from '@/BIZComponents/inventoryTableDetails.vue';
   import { acceptUnpackoptions } from '@/enum/dict';
   import modalTitle from '@/BIZComponents/modalTitle.vue';
+  import fileMain from '@/components/addDoc/index.vue';
 
   export default {
     mixins: [dictMixins],
     components: {
       bpmDetail,
       inventoryTabledetail,
-      modalTitle
+      modalTitle,fileMain
     },
     data() {
       return {

+ 7 - 7
src/views/saleManage/saleOrder/invoiceConfirm/components/addInvoiceDialog.vue

@@ -773,13 +773,13 @@
             },
             align: 'center'
           },
-          {
-            width: 220,
-            prop: 'remark',
-            label: '备注',
-            slot: 'remark',
-            align: 'center'
-          }
+          // {
+          //   width: 220,
+          //   prop: 'remark',
+          //   label: '备注',
+          //   slot: 'remark',
+          //   align: 'center'
+          // }
         ];
       }
     },

+ 14 - 2
src/views/saleManage/saleOrder/returnGoods/components/addReturnGoodsDialog.vue

@@ -176,7 +176,6 @@
         v-show="!['40', '50'].includes(form.type) || form.returnSourceType != 1"
         :returnType="form.returnType"
         :returnSourceType="form.returnSourceType"
-        :pricingWay="form.pricingWay"
         :entrustedCode="form.entrustedCode"
         ref="inventoryTableref"
         :sendId="form.sendId"
@@ -487,6 +486,17 @@
             slot: 'weightUnit',
             align: 'center'
           },
+          {
+            width: 160,
+            prop: 'pricingWay',
+            label: '计价方式',
+            slot: 'pricingWay',
+            align: 'center',
+            formatter: (row, column) => {
+              return row.pricingWay == 1 ? '按数量计费' : row.pricingWay == 2 ? '按重量计费':'';
+
+            }
+          },
           {
             width: 160,
             prop: 'singlePrice',
@@ -856,15 +866,17 @@
         });
       },
       saveDate(data) {
+        console.log(this.productList,'this.productList')
         data.forEach((item) => {
           item['totalCount'] = item.measureQuantity;
           item['qmsResult'] = item.result;
           item['qmsStatus'] = item.status;
           this.productList.forEach((val) => {
+            console.log(val,'val')
             if (item.productCode == val.productCode) {
               item['singlePrice'] = val.singlePrice;
               item['clientCode'] = item.clientCode || val.customerMark;
-              item['pricingWay'] = item.pricingWay || this.form.pricingWay || 1;
+              item['pricingWay'] = item.pricingWay || val.pricingWay||this.form.pricingWay;
             }
           });
         });

+ 32 - 20
src/views/saleManage/saleOrder/returnGoods/components/inventoryTable.vue

@@ -210,20 +210,18 @@
 
       <template v-slot:totalPrice="{ row, $index }">
         <el-form-item
-          v-if="returnSourceType == 2"
-          style="margin-bottom: 20px"
+          v-if="row.pricingWay == 2"
           :prop="'datasource.' + $index + '.totalPrice'"
         >
           <el-input
             type="number"
-            clearable
             v-model="row.totalPrice"
-            @input="(val) => changeTotalPrice(val, $index)"
             placeholder="请输入"
           />
         </el-form-item>
         <span v-else>{{ row.totalPrice }}</span>
       </template>
+
       <template v-slot:headerTotalCount="{ column }">
         <span class="is-required">{{ column.label }}</span>
       </template>
@@ -449,8 +447,11 @@
             slot: 'pricingWay',
             align: 'center',
             formatter: (row, column) => {
-              return row.pricingWay == 1 ? '按数量计费' : row.pricingWay == 2 ? '按重量计费':'';
-
+              return row.pricingWay == 1
+                ? '按数量计费'
+                : row.pricingWay == 2
+                ? '按重量计费'
+                : '';
             }
           },
           {
@@ -460,10 +461,11 @@
             slot: 'singlePrice',
             align: 'center'
           },
-        
+
           {
-            width: 100,
+            width: 120,
             prop: 'totalPrice',
+            slot: 'totalPrice',
             label: '合计',
             align: 'center'
           },
@@ -530,7 +532,7 @@
             showOverflowTooltip: true,
             align: 'center'
           },
-          
+
           {
             minWidth: 200,
             prop: 'returnReason',
@@ -562,16 +564,18 @@
     computed: {
       totalAmount() {
         let num = 0;
-        this.form.datasource.forEach((item) => {
+        this.form.datasource.forEach((item, index) => {
           if (item.pricingWay == 1) {
-            item.totalPrice = item.singlePrice * item.totalCount;
+            this.$set(
+              this.form.datasource[index],
+              'totalPrice',
+              item.singlePrice * item.totalCount || 0
+            );
           }
-          if (item.pricingWay == 2) {
-            item.totalPrice =
-              item.singlePrice * item.totalCount * receiveTotalWeight;
+      
+          if (item.totalPrice) {
+            num += Number(item.totalPrice);
           }
-
-          num += item.totalPrice;
         });
         return num;
       }
@@ -584,9 +588,6 @@
         getFile({ objectName: file.storePath }, file.name);
       },
 
-
-
-
       //出库单详情
       handleOutBound(e, rows, index) {
         this.curIndex = index;
@@ -755,6 +756,16 @@
       },
       // 返回列表数据
       getTableValue() {
+        let is = false;
+        this.form.datasource.forEach((item) => {
+          if (item.pricingWay == 2 && !item.totalPrice) {
+            is = true;
+          }
+        });
+        if (is) {
+          this.$message.error('合计金额不能为空');
+          return;
+        }
         let comitDatasource = this.form.datasource;
         if (comitDatasource.length === 0) return { productList: [] };
         comitDatasource.forEach((v) => {
@@ -819,7 +830,8 @@
       },
       // 添加
       handlAdd() {
-        if (!this.sendId&&!this.entrustedCode) return this.$message.error('请先选择来源单据');
+        if (!this.sendId && !this.entrustedCode)
+          return this.$message.error('请先选择来源单据');
         this.$emit('handleSelectGoods', this.form.datasource);
         // this.$refs.productListRef.open(this.form.datasource);
       },