Quellcode durchsuchen

【发运明细】单证状态、推送状态和操作按钮显示逻辑

liangyan0105 vor 3 Jahren
Ursprung
Commit
2a5a03ddd9

+ 3 - 3
src/components/page/GlobalFooter.vue

@@ -1,12 +1,12 @@
 <template>
   <div class="footer">
     <div class="links">
-      <a href="http://www.jeecg.com" target="_blank">JEECG 首页</a>
+      <a href="http://www.jeecg.com" target="_blank">森语 首页</a>
       <a href="https://github.com/zhangdaiscott/jeecg-boot" target="_blank">
         <a-icon type="github"/>
       </a>
-      <a href="https://ant.design/">Ant Design</a>
-      <a href="https://vuecomponent.github.io/ant-design-vue/docs/vue/introduce-cn/">Vue Antd</a>
+      <a href="https://ant.design/">上海萃颠信息科技有限公司</a>
+      <a href="https://www.yonyou.com">用友</a>
     </div>
     <div class="copyright">
       Copyright

+ 1 - 1
src/field/document/shipmentDetail.md

@@ -20,7 +20,7 @@ declarationName '报关品名',
 hsCode 'HScode',
 englishProductName '英文品名',
 state 单据状态    (0 保存,1 提交)
-pushState 推送状态    (1 要推送,2 推送失败)
+pushState 推送状态    (0 默认未推送   1 要推送,2 推送失败)
 syShippingDetailsItemList 发运明细子表集合;
  
 #### 发运明细子表字段

+ 1 - 0
src/views/book/packingListModal.vue

@@ -49,6 +49,7 @@
       <!-- table , y: 300 -->
       <div class="anotherTable">
         <a-table
+          v-if="packingListData"
           :columns="packingListColumns"
           :data-source="packingListData"
           :loading="loading"

+ 33 - 22
src/views/shipment-details/addShipDetDrawer.vue

@@ -79,18 +79,19 @@
           <a-button type="primary" @click.stop="handleAddColumn" icon="plus" style="margin-left: 20px">増行</a-button>
         </div>
 
-        <!-- 子表  :model="form"  rowKey="id" -->
+        <!-- 子表  :model="form"  rowKey="id" ,y:800 -->
         <a-spin :spinning="confirmLoading">
           <a-form-model ref="formRef">
             <a-table
+              :loading="loading"
               v-if="syShippingDetailsItemList"
               bordered
               :rowKey="record => record.id"
               :columns="columns"
               :data-source="syShippingDetailsItemList"
-              :loading="loading"
               :pagination="false"
               :scroll="{ x: 1500 }"
+              size="small"
             >
               <!-- 款号 输入框 :rules="rules.itemNumber" -->
               <template slot="itemNumber" slot-scope="text, record, index">
@@ -127,9 +128,10 @@
 
               <!-- 操作 -->
               <span slot="operationSlot" slot-scope="text, record">
-                <a-popconfirm title="确定删除吗?" ok-text="是" cancel-text="否" @confirm="handleDelete(record.id)">
+                <a-popconfirm title="确定删除吗?" ok-text="是" cancel-text="否" @confirm="handleDelete(record)">
                   <a href="javascript:void(0);" style="color:red;">删除</a>
                 </a-popconfirm>
+
                 <a-divider type="vertical" />
                 <a @click="copy(record)">复制</a>
               </span>
@@ -137,6 +139,7 @@
           </a-form-model>
         </a-spin>
       </a-card>
+      
       <!-- 页面底部保存取消 -->
       <div
         :style="{
@@ -188,7 +191,7 @@ export default {
         {
           title: '账套',
           dataIndex: 'pkOrg',
-          width: 120,
+          width: 80,
           fixed: 'left',
           className: 'replacecolor'
         },
@@ -221,21 +224,17 @@ export default {
           dataIndex: 'orderDate',
           width: 120,
           className: 'replacecolor'
-          // sorter: true,
-          // customRender: text => {
-          //   return moment(text).format('YYYY-MM-DD')
-          // }
         },
         {
           title: '业务类型',
-          dataIndex: 'businessTypeValue',
+          dataIndex: 'businessTypeText',
           width: 120,
           className: 'replacecolor'
         },
 
         {
           title: '客户订单',
-          dataIndex: 'customerOrder',
+          dataIndex: 'customerOrderNumber',
           width: 120,
 
           className: 'replacecolor'
@@ -260,7 +259,7 @@ export default {
         },
         {
           title: '订单剩余数量',
-          dataIndex: 'orderRemaQuantity',
+          dataIndex: 'orderRemainingQuantity',
           width: 120,
           className: 'replacecolor'
         },
@@ -289,7 +288,7 @@ export default {
 
         {
           title: '销售类型',
-          dataIndex: 'salesTypeValue',
+          dataIndex: 'salesTypeText',
           width: 120,
           className: 'replacecolor'
         },
@@ -313,7 +312,7 @@ export default {
         },
         {
           title: '整单合计',
-          dataIndex: 'wholeOrderTota',
+          dataIndex: 'wholeOrderTotal',
           width: 120,
           className: 'replacecolor'
         },
@@ -407,7 +406,7 @@ export default {
           title: '操作',
           dataIndex: 'operation',
           scopedSlots: { customRender: 'operationSlot' },
-          width: 220,
+          width: 160,
           fixed: 'right',
           className: 'replacecolor'
         }
@@ -418,8 +417,8 @@ export default {
       visible: false,
       confirmLoading: false,
       dateFormat: 'YYYY-MM-DD',
-      state: '0' // 单据状态初始未【保存】
-
+      state: '0', // 单据状态初始未【保存】
+      pushState: '0' // 推送状态初始未【仅保存】
       // validatorRules: {
       //   documentNo: [{ required: true, message: '单据号不能为空', trigger: 'blur' }], 单据号
     }
@@ -447,17 +446,19 @@ export default {
     },
     // 新增 保存
     addSave() {
-      // console.log('点击了保存新增')
       var newObj = {} // 新增对象
       newObj.documentNo = this.addShipDet.documentNo // 单据号
       newObj.documentDate = this.addShipDet.documentDate.format('YYYY-MM-DD') // 单据日期
       newObj.customer = this.addShipDet.customer
       newObj.preDeliveryDate = this.addShipDet.preDeliveryDate.format('YYYY-MM-DD') // 预发货日期
-      newObj.preCompletionDate = this.addShipDet.preCompletionDate.format('YYYY-MM-DD') // 到货日期
+      newObj.preCompletionDate = this.addShipDet.preCompletionDate.format('YYYY-MM-DD') // 预完工日期
       newObj.memo = this.addShipDet.memo // U8系统适用
       newObj.syShippingDetailsItemList = this.syShippingDetailsItemList // 子表信息赋值
       // 单据状态
-      newObj.state = this.state
+      // newObj.state = this.state
+      // newObj.pushState = this.pushState
+
+      // 必须选择子表 --- 参照订单数据
       if (newObj.syShippingDetailsItemList.length == 0) {
         this.$message.error('请选择参照订单数据')
       } else {
@@ -466,6 +467,9 @@ export default {
             this.$message.success('新增成功')
             console.log('新增的对象', newObj)
             this.close()
+            //清空信息
+            newObj = {}
+            newObj.syShippingDetailsItemList = []
             this.fatherList() // 调用父组件 查询方法
             // this.msgFormSon = {}  清空子表信息
             console.log('空')
@@ -515,8 +519,9 @@ export default {
     },
     // --------------------------------------
     // 操作 删除
-    handleDelete(id) {
-      console.log('id:', id)
+    handleDelete(record) {
+      console.log('删除该项订单数据', record)
+      return this.syShippingDetailsItemList.splice(record)
     },
     // 操作 复制
     copy(record) {},
@@ -530,7 +535,8 @@ export default {
     close() {
       this.$emit('close')
       this.visible = false
-      this.$refs.form.resetFields()
+      this.addShipDet = {}
+      this.syShippingDetailsItemList = []
     },
 
     // 参照订单数据弹框 ok-------------------------------------
@@ -563,4 +569,9 @@ export default {
 /deep/ .ant-drawer-body {
   padding: 10px;
 }
+
+// 子表下拉显示
+/deep/ .ant-card-body {
+  margin-bottom: 50px;
+}
 </style>

+ 5 - 6
src/views/shipment-details/declareElementsModal.vue

@@ -1,15 +1,14 @@
 <template>
   <div id="declareElementsModal">
-    <!-- @ok="onSubmit" -->
+    <!-- @ok="onSubmit"      keyboard="{false}"
+      destroyOnClose="{true}"
+      maskClosabl="{true}" -->
     <a-modal
       title="报关要素"
       v-model="declareElementsModVis"
       :confirmLoading="confirmLoading"
       @cancel="handleCancel"
       width="60%"
-      keyboard="false"
-      destroyOnClose="true"
-      maskClosable="false"
       style="top:330px;left:100px;"
     >
       <!-- 主表信息 回显  -->
@@ -203,8 +202,8 @@ export default {
       this.$emit('close')
       this.declareElementsModVis = false
       this.declareElements = {}
-      // this.declareElementsData = []
-      console.log('清空')
+      this.declareElementsData = []
+      // console.log('清空')
     },
     handleCancel() {
       this.close()

+ 25 - 20
src/views/shipment-details/referOrderDataModal.vue

@@ -48,6 +48,7 @@
       <!-- 勾选表  :row-key="record => record.id"  -->
       <a-table
         bordered
+        size="small"
         rowKey="id"
         v-if="orderListData"
         :columns="referOerderColumns"
@@ -93,7 +94,7 @@ export default {
         {
           title: '款号',
           dataIndex: 'itemNumber',
-          width: 120,
+          width: 100,
           fixed: 'left',
           className: 'replacecolor'
         },
@@ -101,14 +102,14 @@ export default {
         {
           title: '小po',
           dataIndex: 'smallPo',
-          width: 120,
+          width: 100,
           className: 'replacecolor'
         },
         // 账套替换
         {
           title: '组织',
           dataIndex: 'pkOrg',
-          width: 120,
+          width: 80,
           className: 'replacecolor'
         },
         //         {
@@ -136,45 +137,45 @@ export default {
         {
           title: '颜色',
           dataIndex: 'colour',
-          width: 120,
+          width: 160,
           customRender: t => ellipsis(t),
           className: 'replacecolor'
         },
         {
           title: '尺码',
           dataIndex: 'size',
-          width: 120,
+          width: 100,
           className: 'replacecolor'
         },
         {
           title: '配码规格',
           dataIndex: 'codingRules',
-          width: 120,
+          width: 100,
           className: 'replacecolor'
         },
         {
           title: '数量',
           dataIndex: 'quantity',
-          width: 120,
+          width: 100,
           className: 'replacecolor'
         },
 
         {
           title: '业务类型',
           dataIndex: 'businessTypeText',
-          width: 120,
+          width: 100,
           className: 'replacecolor'
         },
         {
           title: '客户订单',
           dataIndex: 'customerOrderNumber',
-          width: 120,
+          width: 100,
           className: 'replacecolor'
         },
         {
           title: '销售类型',
           dataIndex: 'salesTypeText',
-          width: 120,
+          width: 100,
           className: 'replacecolor'
         },
 
@@ -199,13 +200,13 @@ export default {
         {
           title: '汇率',
           dataIndex: 'exchangeRate',
-          width: 120,
+          width: 100,
           className: 'replacecolor'
         },
         {
           title: '整单合计',
           dataIndex: 'wholeOrderTotal',
-          width: 120,
+          width: 100,
           className: 'replacecolor'
         },
 
@@ -224,7 +225,7 @@ export default {
         {
           title: '币种',
           dataIndex: 'currencyValue',
-          width: 120,
+          width: 100,
           className: 'replacecolor'
         },
 
@@ -243,19 +244,19 @@ export default {
         {
           title: '定金比例(%)',
           dataIndex: 'depositRatio',
-          width: 120,
+          width: 100,
           className: 'replacecolor'
         },
         {
           title: '定金',
           dataIndex: 'deposit',
-          width: 120,
+          width: 100,
           className: 'replacecolor'
         },
         {
           title: '协同路线',
           dataIndex: 'collaborativeRoute',
-          width: 120,
+          width: 100,
           className: 'replacecolor'
         },
 
@@ -290,7 +291,7 @@ export default {
         {
           title: '订单变更说明',
           dataIndex: 'orderChangeDescription',
-          width: 120,
+          width: 180,
           customRender: t => ellipsis(t),
           className: 'replacecolor'
         }
@@ -321,15 +322,15 @@ export default {
     this.getOrderList()
   },
   methods: {
-    // 查询参照订单数据
+    // 参照订单数据 查询
     getOrderList() {
       this.$nextTick(() => {
         queryOrderData(this.queryParam).then(res => {
-          console.log('参照订单数据res', res)
+          // console.log('参照订单数据res', res)
           if (res.success) {
             // 后台数据赋值给参照订单数据
             this.orderListData = res.result.records
-            console.log('参照订单数据', this.orderListData)
+            console.log('新增参照订单数据', this.orderListData)
             this.pagination = {
               total: res.result.total,
               current: res.result.current,
@@ -375,12 +376,16 @@ export default {
     close() {
       this.$emit('close')
       this.referOrderDataModVis = false
+      this.selectedRowKeys = []
+      this.orderListData = []
+      this.getOrderList()
     },
     handleCancel() {
       this.close()
     },
     handleTableChange() {
       console.log('??这是啥')
+      this.$message.error('已取消选择')
     }
   },
   computed: {

+ 36 - 114
src/views/shipment-details/shipmentList.vue

@@ -11,7 +11,8 @@
                 <a-input placeholder="请输入单据号" v-model="queryParam.documentNo"></a-input>
               </a-form-item>
             </a-col>
-            <a-col :md="6" :sm="12">
+
+            <a-col :md="6" :sm="8">
               <a-form-item label="起始时间">
                 <a-range-picker
                   style="width: 100%"
@@ -61,7 +62,7 @@
             <template v-if="toggleSearchStatus">
               <a-col :md="6" :sm="8">
                 <a-form-item label="业务员">
-                  <a-input placeholder="请输入业务员" zv-model="queryParam.salesman"></a-input>
+                  <a-input placeholder="请输入业务员" v-model="queryParam.salesman"></a-input>
                 </a-form-item>
               </a-col>
 
@@ -125,127 +126,39 @@
         <!-- 单据状态 -->
         <span slot="state" slot-scope="text, record">
           <a-tag color="orange" v-if="record.state == '0'">已保存</a-tag>
-          <a-tag color="green" v-if="record.state == '1'">提交</a-tag>
+          <a-tag color="green" v-if="record.state == '1'">提交</a-tag>
         </span>
 
-        <!-- 操作 未提交未推送-->
+        <!-- 操作 默认按钮  未提交未推送-->
         <span slot="operationSlot" slot-scope="text, record">
           <a href="javascript:void(0);" @click="declareElements(record)" style="color:green">申报要素</a>
-          <a-divider type="vertical" />
-          <a-dropdown>
-            <a class="ant-dropdown-link">更多<a-icon type="down"/></a>
-            <a-menu slot="overlay">
-              <a-menu-item>
-                <a @click="details(record)">详情</a>
-              </a-menu-item>
-
-              <a-menu-item>
-                <a-popconfirm title="确定提交吗?" ok-text="是" cancel-text="否" @confirm="submit(record)">
-                  <a href="javascript:void(0);">提交</a>
-                </a-popconfirm>
-              </a-menu-item>
-
-              <a-menu-item>
-                <a @click="edit(record)">编辑</a>
-              </a-menu-item>
-
-              <a-menu-item>
-                <a @click="push(record)">推送</a>
-              </a-menu-item>
-
-              <a-menu-item>
-                <a-popconfirm title="确定删除吗?" ok-text="是" cancel-text="否" @confirm="handleDelete(record)">
-                  <a href="javascript:void(0);" style="color:red;">删除</a>
-                </a-popconfirm>
-              </a-menu-item>
-            </a-menu>
-          </a-dropdown>
-        </span>
 
-        <!-- 单据状态是 已提交 -->
-        <span v-if="record.state == 1" slot="operationSlot" slot-scope="text, record">
-          <a href="javascript:void(0);" @click="declareElements(record)" style="color:green">申报要素</a>
           <a-divider type="vertical" />
-          <a-dropdown>
-            <a class="ant-dropdown-link">更多<a-icon type="down"/></a>
-            <a-menu slot="overlay">
-              <a-menu-item>
-                <a @click="details(record)">详情</a>
-              </a-menu-item>
-
-              <a-menu-item>
-                <a @click="edit(record)">编辑</a>
-              </a-menu-item>
-
-              <a-menu-item>
-                <a @click="push(record)">推送</a>
-              </a-menu-item>
-
-              <a-menu-item>
-                <a-popconfirm title="确定删除吗?" ok-text="是" cancel-text="否" @confirm="handleDelete(record)">
-                  <a href="javascript:void(0);" style="color:red;">删除</a>
-                </a-popconfirm>
-              </a-menu-item>
-            </a-menu>
-          </a-dropdown>
-        </span>
 
-        <!-- 推送状态是 已推送 -->
-        <span v-if="record.pushState == 1" slot="operationSlot" slot-scope="text, record">
-          <a href="javascript:void(0);" @click="declareElements(record)" style="color:green">申报要素</a>
-          <a-divider type="vertical" />
           <a-dropdown>
             <a class="ant-dropdown-link">更多<a-icon type="down"/></a>
             <a-menu slot="overlay">
               <a-menu-item>
                 <a @click="details(record)">详情</a>
               </a-menu-item>
-              <!-- <a-menu-item>
+
+              <a-menu-item v-if="record.state == '0'">
                 <a-popconfirm title="确定提交吗?" ok-text="是" cancel-text="否" @confirm="submit(record)">
                   <a href="javascript:void(0);">提交</a>
                 </a-popconfirm>
-              </a-menu-item> -->
-              <a-menu-item>
-                <a @click="edit(record)">编辑</a>
               </a-menu-item>
 
-              <!-- <a-menu-item>
-                <a @click="push(record)">推送</a>
-              </a-menu-item> -->
-
-              <a-menu-item>
-                <a-popconfirm title="确定删除吗?" ok-text="是" cancel-text="否" @confirm="handleDelete(record)">
-                  <a href="javascript:void(0);" style="color:red;">删除</a>
-                </a-popconfirm>
-              </a-menu-item>
-            </a-menu>
-          </a-dropdown>
-        </span>
-
-        <!-- 推送状态是 推送失败 -->
-        <span v-if="record.pushState === 2" slot="operationSlot" slot-scope="text, record">
-          <a href="javascript:void(0);" @click="declareElements(record)" style="color:green">申报要素</a>
-          <a-divider type="vertical" />
-          <a-dropdown>
-            <a class="ant-dropdown-link">更多<a-icon type="down"/></a>
-            <a-menu slot="overlay">
-              <a-menu-item>
-                <a @click="details(record)">详情</a>
-              </a-menu-item>
-              <!-- <a-menu-item>
-                <a-popconfirm title="确定提交吗?" ok-text="是" cancel-text="否" @confirm="submit(record)">
-                  <a href="javascript:void(0);">提交</a>
-                </a-popconfirm>
-              </a-menu-item> -->
-              <a-menu-item>
+              <a-menu-item v-if="record.state == '0'">
                 <a @click="edit(record)">编辑</a>
               </a-menu-item>
 
-              <a-menu-item>
-                <a @click="push(record)">再次推送</a>
+              <a-menu-item v-if="record.pushState == '0'">
+                <a-popconfirm title="确定推送吗?" ok-text="是" cancel-text="否" @confirm="push(record)">
+                  <a href="javascript:void(0);">推送</a>
+                </a-popconfirm>
               </a-menu-item>
 
-              <a-menu-item>
+              <a-menu-item v-if="record.state == '0'">
                 <a-popconfirm title="确定删除吗?" ok-text="是" cancel-text="否" @confirm="handleDelete(record)">
                   <a href="javascript:void(0);" style="color:red;">删除</a>
                 </a-popconfirm>
@@ -253,7 +166,6 @@
             </a-menu>
           </a-dropdown>
         </span>
-
       </a-table>
     </a-card>
 
@@ -608,28 +520,38 @@ export default {
     // 操作 提交
     submit(record) {
       console.log('点击id:', record.id)
-      // this.$nextTick(() => {
-      submitShipment({ id: record.id }).then(res => {
-        if (res.success) {
-          console.log('提交成功,推送状态要修改')
-          this.getShipmentList() // 渲染 发运明细列表
-          this.$message.success('提交成功')
-        }
+      this.$nextTick(() => {
+        submitShipment({ id: record.id }).then(res => {
+          if (res.success === true) {
+            // console.log('提交成功,推送状态要修改')
+            this.getShipmentList() // 渲染 发运明细列表
+            this.$message.success('提交成功')
+          } else {
+            this.$message.error('该订单已提交,可不删除')
+          }
+        })
       })
-      // })
     },
 
     // 操作 推送
     push(record) {},
+
     // 操作 删除
     handleDelete(record) {
       console.log('点击删除项id:', record.id)
       this.$nextTick(() => {
-        deleteShipment({ id: record.id }).then(res => {
-          console.log('res:', res)
-          this.getShipmentList() // 渲染 发运明细列表
-          this.$message.success('删除成功')
-        })
+        // 根据单据状态判断是否可删除数据(已提交不可删除)客户需要通过【删除】动作判断是否可删
+        //现在通过该状态,控制是否有【删除】按钮
+        // if (this.shipmentListData.state == 0) {
+          deleteShipment({ id: record.id }).then(res => {
+            console.log('res:', res)
+            this.getShipmentList() // 渲染 发运明细列表
+            this.$message.success('删除成功')
+          })
+        // }
+        //  else {
+        //   this.$message.error('单据已提交,不可删除') 
+        // }
       })
     },
     onDateChange(value, dateString) {