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

森语-搬运工对账单-页面调整

jbb пре 2 година
родитељ
комит
e45130cada

+ 7 - 7
src/views/oa/SyCarryList.vue

@@ -5,11 +5,11 @@
     <div class="table-page-search-wrapper">
       <a-form layout="inline" @keyup.enter.native="searchQuery">
         <a-row :gutter="24">
-          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+          <!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">
             <a-form-item label="编码">
               <a-input placeholder="请输入编码" v-model="queryParam.code"></a-input>
             </a-form-item>
-          </a-col>
+          </a-col> -->
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
             <a-form-item label="名称">
               <a-input placeholder="请输入名称" v-model="queryParam.name"></a-input>
@@ -147,11 +147,11 @@
             align:"center",
             dataIndex: 'name'
           },
-          {
-            title: '编号',
-            align:"center",
-            dataIndex: 'code'
-          },
+          // {
+          //   title: '编号',
+          //   align:"center",
+          //   dataIndex: 'code'
+          // },
           {
             title: '状态',
             align:"center",

+ 47 - 21
src/views/oa/modules/SyCarryDetailModal.vue

@@ -17,11 +17,11 @@
     <div class="table-page-search-wrapper">
       <a-form-model layout="inline" ref="form" :model="formState" :rules="validatorRules">
           <a-row :gutter="24">
-            <a-col :md="8" :sm="8">
+            <!-- <a-col :md="8" :sm="8">
               <a-form-model-item label="编号" prop="code">
                 <a-input   placeholder="请输入"  v-model="formState.code" readOnly/>
               </a-form-model-item>
-            </a-col>
+            </a-col> -->
             <a-col :md="8" :sm="8">
               <a-form-model-item label="名称"  prop="userId">
                 <a-input placeholder="请输入名称" v-model="formState.name" readOnly/>
@@ -76,7 +76,7 @@
         :columns="syCarryBTable.columns"
         :data-source="syCarryBTable.dataSource"
         :loading="syCarryBTable.loading"
-        :scroll="{x: 1800 }"
+        :scroll="{x: 1800, y:300}"
         :pagination="false"
       >
         <!-- 操作 -->
@@ -155,28 +155,43 @@
             title: '日期',
             align: "center",
             dataIndex: 'orderDate',
-            width: '9%',
+            width: '6%',
             // scopedSlots: { customRender: 'orderDate' },
+          },
+          {
+            title: '入库单号/发票号',
+            align: "center",
+            dataIndex: 'invoiceNo',
+            width: '9%',
+            scopedSlots: { customRender: 'invoiceNo' },
           },
            {
             title: '总件数',
             dataIndex: 'allNum',
-            width: '9%',
+            width: '6%',
             //  scopedSlots: { customRender: 'allNum' },
              className: 'replacecolor'
            },
+           {
+            title: '柜子数量',
+            dataIndex: 'cabinets',
+             width: '7%',
+             ellipsis: true,
+             scopedSlots: { customRender: 'cabinets' },
+             className: 'replacecolor'
+           },
            {
             title: '明细',
             dataIndex: 'detailedNum',
-           width: '9%',
+           width: '6%',
              ellipsis: true,
             //  scopedSlots: { customRender: 'detailedNum' },
              className: 'replacecolor'
            },
            {
-            title: '衣架',
+            title: '衣架/吨数',
             dataIndex: 'coatHanger',
-           width: '9%',
+           width: '7%',
              ellipsis: true,
             //  scopedSlots: { customRender: 'coatHanger' },
              className: 'replacecolor'
@@ -190,33 +205,35 @@
              className: 'replacecolor'
            },
            {
-            title: '发票号',
-            dataIndex: 'invoiceNo',
-           width: '9%',
-             ellipsis: true,
-            //  scopedSlots: { customRender: 'invoiceNo' },
-             className: 'replacecolor'
-           },
-           {
-            title: '价格',
+            title: '单价',
             dataIndex: 'price',
-           width: '9%',
+           width: '5%',
              ellipsis: true,
             //  scopedSlots: { customRender: 'price' },
              className: 'replacecolor'
+           },
+             {
+            title: '总价',
+            dataIndex: 'totalPrice',
+            width: '5%',
+             ellipsis: true,
+             scopedSlots: { customRender: 'totalPrice' },
+             className: 'replacecolor',
+            //  slots:{title:'totalPriceTitle'}
            },
            {
             title: '计划员',
             dataIndex: 'jhyNameData',
-           width: '9%',
+           width: '7%',
               ellipsis: true,
             //  scopedSlots: { customRender: 'jhyName' },
              className: 'replacecolor'
            },
+           
            {
             title: '签名',
             dataIndex: 'jhyName',
-            width: '9%',
+            width: '7%',
              ellipsis: true,
              className: 'replacecolor'
            },
@@ -227,6 +244,15 @@
              ellipsis: true,
             //  scopedSlots: { customRender: 'demo' },
              className: 'replacecolor'
+           },
+           {
+            title: '原因',
+            dataIndex: 'reason',
+            width: '9%',
+             ellipsis: true,
+             scopedSlots: { customRender: 'reason' },
+             className: 'replacecolor',
+            //  slots:{title:'reasonTitle'}
            },
             {
             title: '操作',
@@ -269,7 +295,7 @@
           if(res.success){
               res.result.map(item =>{
               if(item.orderDate !==''&& item.orderDate){
-                item.orderDate = moment(item.orderDate)
+                item.orderDate = moment(item.orderDate).format('YYYY-MM-DD')
               }
             })
             this.syCarryBTable.dataSource = res.result

+ 131 - 54
src/views/oa/modules/SyCarryModal.vue

@@ -19,11 +19,11 @@
     <div class="table-page-search-wrapper">
       <a-form-model layout="inline" ref="form" :model="formState" :rules="validatorRules">
           <a-row :gutter="24">
-            <a-col :md="8" :sm="8">
+            <!-- <a-col :md="8" :sm="8">
               <a-form-model-item label="编号" prop="code">
                 <a-input   placeholder="请输入"  v-model="formState.code" />
               </a-form-model-item>
-            </a-col>
+            </a-col> -->
             <a-col :md="8" :sm="8">
               <a-form-model-item label="名称"  prop="name">
                 <a-input placeholder="请输入名称" v-model="formState.name"/>
@@ -85,25 +85,21 @@
           <span slot="orderDateTitle" class="form-table-heard">
              日期
           </span>
-          <!-- 表头--总件数 -->
-          <span slot="allNumTitle" class="form-table-heard">
-             总件数
+          <!-- 表头--明细 -->
+          <span slot="detailedNumTitle" class="form-table-heard">
+             明细
           </span>
            <!-- 表头--集装箱号 -->
           <span slot="containerNoTitle" class="form-table-heard">
              集装箱号
           </span>
-           <!-- 表头--发票号 -->
-          <span slot="invoiceNoTitle" class="form-table-heard">
-             发票号
-          </span>
-           <!-- 表头--价格 -->
-          <span slot="priceTitle" class="form-table-heard">
-             价格
+           <!-- 表头--总价 -->
+          <span slot="totalPriceTitle" class="form-table-heard">
+             总价
           </span>
-           <!-- 表头--计划员 -->
-          <span slot="jhyByDataTitle" class="form-table-heard">
-             计划员
+           <!-- 表头--原因 -->
+          <span slot="reasonTitle" class="form-table-heard">
+             原因
           </span>
         <!-- 日期 -->
          <span slot="orderDate" slot-scope="text, record,index">
@@ -116,25 +112,33 @@
           <span slot="allNum" slot-scope="text, record, index">
                   <a-input placeholder="请输入" v-model="record.allNum" />
           </span>
+          <!-- 柜子数量 -->
+          <span slot="cabinets" slot-scope="text, record, index">
+                  <a-input placeholder="请输入" v-model="record.cabinets" />
+          </span>
           <!-- 明细 -->
            <span slot="detailedNum" slot-scope="text, record, index">
-                  <a-input placeholder="请输入" v-model="record.detailedNum" />
+                  <a-input placeholder="请输入" v-model="record.detailedNum" @change="handleChangePrice(record)"/>
           </span>
-          <!-- 衣架 -->
+          <!-- 衣架/吨数 -->
           <span slot="coatHanger" slot-scope="text, record, index">
-                  <a-input placeholder="请输入" v-model="record.coatHanger" />
+                  <a-input placeholder="请输入" v-model="record.coatHanger" @change="handleChangePrice(record)"/>
           </span>
           <!-- 集装箱号 -->
            <span slot="containerNo" slot-scope="text, record, index">
                   <a-input placeholder="请输入" v-model="record.containerNo" />
           </span>
-          <!-- 发票号 -->
+          <!-- 入库单号/发票号 -->
            <span slot="invoiceNo" slot-scope="text, record, index">
                   <a-input placeholder="请输入" v-model="record.invoiceNo" />
           </span>
           <!-- 价格 -->
           <span slot="price" slot-scope="text, record, index">
-              <a-input placeholder="请输入" v-model="record.price"  @change="handleChangePrice"/>
+              <a-input placeholder="请输入" v-model="record.price"  @change="handleChangePrice(record)"/>
+          </span>
+          <!-- 总价 -->
+          <span slot="totalPrice" slot-scope="text, record, index">
+              <a-input placeholder="请输入" v-model="record.totalPrice" />
           </span>
           <!-- 计划员 -->
            <span slot="jhyByData" slot-scope="text, record, index">
@@ -149,10 +153,17 @@
                      </a-select-option>
                    </a-select>
           </span>
+          <!-- 原因 -->
+          <span slot="reason" slot-scope="text, record, index">
+                  <a-input placeholder="请输入" v-model="record.reason" />
+          </span>
           <!-- 备注 -->
           <span slot="demo" slot-scope="text, record, index">
                   <a-input placeholder="请输入" v-model="record.demo" />
           </span>
+          <span slot="option" slot-scope="text, record, index">
+                <a @click="copyRow(record)">复制</a>
+          </span>
         </a-table>
           <!-- <j-editable-table
             :ref="refKeys[0]"
@@ -227,30 +238,46 @@
             // title: '日期',
             align: "center",
             dataIndex: 'orderDate',
-            width: '9%',
+            width: '7%',
             scopedSlots: { customRender: 'orderDate' },
             slots:{title:'orderDateTitle'}
+          },
+          {
+            title: '入库单号/发票号',
+            align: "center",
+            dataIndex: 'invoiceNo',
+            width: '9%',
+            scopedSlots: { customRender: 'invoiceNo' },
           },
            {
-            // title: '总件数',
+            title: '总件数',
             dataIndex: 'allNum',
-            width: '9%',
+            width: '7%',
              scopedSlots: { customRender: 'allNum' },
              className: 'replacecolor',
-            slots:{title:'allNumTitle'}
+            // slots:{title:'allNumTitle'}
+           },
+           {
+            title: '柜子数量',
+            dataIndex: 'cabinets',
+             width: '7%',
+             ellipsis: true,
+             scopedSlots: { customRender: 'cabinets' },
+             className: 'replacecolor'
            },
            {
-            title: '明细',
+            // title: '明细',
             dataIndex: 'detailedNum',
-           width: '9%',
+             width: '7%',
              ellipsis: true,
              scopedSlots: { customRender: 'detailedNum' },
-             className: 'replacecolor'
+             className: 'replacecolor',
+             slots:{title:'detailedNumTitle'}
            },
            {
-            title: '衣架',
+            title: '衣架/吨数',
             dataIndex: 'coatHanger',
-           width: '9%',
+           width: '7%',
              ellipsis: true,
              scopedSlots: { customRender: 'coatHanger' },
              className: 'replacecolor'
@@ -258,54 +285,80 @@
            {
             // title: '集装箱号',
             dataIndex: 'containerNo',
-           width: '9%',
+           width: '7%',
              ellipsis: true,
              scopedSlots: { customRender: 'containerNo' },
              className: 'replacecolor',
             slots:{title:'containerNoTitle'}
            },
+          //  {
+          //   // title: '发票号',
+          //   dataIndex: 'invoiceNo',
+          //   width: '9%',
+          //    ellipsis: true,
+          //    scopedSlots: { customRender: 'invoiceNo' },
+          //    className: 'replacecolor',
+          //   slots:{title:'invoiceNoTitle'}
+          //  },
            {
-            // title: '发票号',
-            dataIndex: 'invoiceNo',
-            width: '9%',
+             title: '单价',
+             dataIndex: 'price',
+             width: '6%',
              ellipsis: true,
-             scopedSlots: { customRender: 'invoiceNo' },
+             scopedSlots: { customRender: 'price' },
              className: 'replacecolor',
-            slots:{title:'invoiceNoTitle'}
+            // slots:{title:'priceTitle'}
            },
-           {
-            // title: '价',
-             dataIndex: 'price',
-             width: '9%',
+             {
+            // title: '价',
+            dataIndex: 'totalPrice',
+            width: '6%',
              ellipsis: true,
-             scopedSlots: { customRender: 'price' },
+             scopedSlots: { customRender: 'totalPrice' },
              className: 'replacecolor',
-            slots:{title:'priceTitle'}
+             slots:{title:'totalPriceTitle'}
            },
            {
-            // title: '计划员',
+            title: '计划员',
             dataIndex: 'jhyByData',
-             width: '13%',
+             width: '8%',
              ellipsis: true,
              scopedSlots: { customRender: 'jhyByData' },
              className: 'replacecolor',
-            slots:{title:'jhyByDataTitle'}
+            // slots:{title:'jhyByDataTitle'}
            },
            {
             title: '签名',
             dataIndex: 'jhyName',
-            width: '11%',
+            width: '7%',
              ellipsis: true,
              className: 'replacecolor'
            },
+           {
+            // title: '原因',
+            dataIndex: 'reason',
+            width: '9%',
+             ellipsis: true,
+             scopedSlots: { customRender: 'reason' },
+             className: 'replacecolor',
+             slots:{title:'reasonTitle'}
+           },
            {
             title: '备注',
             dataIndex: 'demo',
-           width: '9%',
+             width: '9%',
              ellipsis: true,
              scopedSlots: { customRender: 'demo' },
              className: 'replacecolor'
-           }                 
+           } ,
+           {
+            title: '操作',
+            dataIndex: 'option',
+             width: '6%',
+             ellipsis: true,
+             scopedSlots: { customRender: 'option' },
+             className: 'replacecolor'
+           }                   
           ]
         },
         defultMethods:'add',
@@ -395,6 +448,13 @@
            }
          })
       },
+
+      // 复制行
+      copyRow(record){
+       this.syCarryBTable.dataSource.push(record)
+       this.formState.totalNum += Number(record.totalPrice)
+       this.$forceUpdate()
+      },
  
       /** 调用完edit()方法之后会自动调用此方法 */
       // editAfter() {
@@ -450,7 +510,7 @@
             var obj = this.formState
             this.syCarryBTable.dataSource.map(item=>{
              
-             console.log('ssssssssssss',item.jhyByData.toString());
+            //  console.log('ssssssssssss',item.jhyByData.toString());
               if(item.jhyByData!=''&&item.jhyByData){
                 
                  // item.jhyByData.forEach(t => {
@@ -500,11 +560,10 @@
              var tableRow = data[i];
              var required = [
               {key:'orderDate',value:'日期'},
-              {key:'allNum',value:'总件数'},
+              {key:'detailedNum',value:'明细'},
               {key:'containerNo',value:'集装箱号'},
-              {key:'invoiceNo',value:'发票号'},
-              {key:'price',value:'价格'},
-              {key:'jhyByData',value:'计划员'},
+              {key:'totalPrice',value:'总价'},
+              {key:'reason',value:'原因'},
               ]
              for(var j=0 ; j<required.length;j++){
                 if(tableRow[required[j].key] == null || tableRow[required[j].key] == "" || tableRow[required[j].key] == undefined){
@@ -543,10 +602,23 @@
         this.$emit('close')
       },
       // 价格改变
-      handleChangePrice(){
+      handleChangePrice(record){
+        if(record.price && record.coatHanger){
+          record.totalPrice = Number(record.coatHanger)* Number(record.price)+ Number((record.detailedNum?record.detailedNum:0))
+          this.$forceUpdate()
+        }else{
+           record.totalPrice = record.detailedNum
+        }
         var Hj = 0
        this.syCarryBTable.dataSource.map(item=>{
-         Hj+= Number(item.price)
+         if(item.price=='8'&&item.totalPrice>500){
+           item.coatHanger = ''
+           item.detailedNum = ''
+           item.price = ''
+           item.totalPrice = ''
+           this.$message.error('单价为8的行总价不能超过500,请重新输入单价,衣架/吨数,明细!!');
+         }
+         Hj+= Number(item.totalPrice)
        })
        this.formState.totalNum = Hj
        this.$forceUpdate()
@@ -606,4 +678,9 @@
       content: '*';
       color: red;
 }
+// /deep/.ant-table-fixed-header .ant-table-scroll .ant-table-header{
+
+//    width: calc(100% - 8px);//减去滚动条的宽度
+
+// }
 </style>