ソースを参照

采购入库异常-功能

jingbb 4 ヶ月 前
コミット
5c1572ca13

+ 8 - 1
src/views/inventiry/purInAbnormal/purInAbnormalForm.api.ts

@@ -10,6 +10,7 @@ enum Api {
   queryDataById = '/storeCode/storePurchaseIn/queryById',
   purInFormShipList = '/storeCode/storePurchaseIn/queryStorePurchaseInShipByMainId',
   stockInFormProductList = '/storeCode/storePurchaseIn/queryStorePurchaseInDetailsByMainId',
+  Processed='/storeCode/storePurchaseIn/hasDeal'
 }
 /**
  * 导出api
@@ -44,4 +45,10 @@ export const list = (params) =>
 * 根据id查询数据
 * @param params
 */
-export const queryDataById = (id) => defHttp.get({url: Api.queryDataById, params:{ id }});
+export const queryDataById = (id) => defHttp.get({url: Api.queryDataById, params:{ id }});
+
+export const ProcessedList = (params, handleSuccess) => {
+      return defHttp.get({url: Api.Processed, params}, {joinParamsToUrl: true}).then(() => {
+        handleSuccess();
+      });
+}

+ 22 - 21
src/views/inventiry/purInAbnormal/purInAbnormalForm.data.ts

@@ -58,9 +58,10 @@ export const columns: BasicColumn[] = [
     width:'250'
    },
    {
-    title: '提交(submit)',
+    title: '处理(deal)',
     align:"center",
-    dataIndex: 'submit_dictText',
+    dataIndex: 'hasDeal_dictText',
+    width:'250'
    },
 ];
 
@@ -76,14 +77,14 @@ export const purInAbnormalShipColumns: JVxeColumn[] = [
     {
       title: '主机号(host number)',
       key: 'hostNumber',
-      type: JVxeTypes.input,
+      type: JVxeTypes.normal,
       placeholder: '请输入${title}',
       defaultValue:'',
     },
     {
       title: '工程编号(project No)',
       key: 'projectNo',
-      type: JVxeTypes.input,
+      type: JVxeTypes.normal,
       placeholder: '请输入${title}',
       defaultValue:'',
     },
@@ -215,7 +216,7 @@ export const stockInColumns: JVxeColumn[] = [
     {
       title: '入库数量(stock in quantity)',
       key: 'stockInQuantity',
-      type: JVxeTypes.inputNumber,
+      type: JVxeTypes.normal,
       placeholder: '请输入${title}',
       defaultValue:'',  
       width:"200px",
@@ -226,14 +227,14 @@ export const stockInColumns: JVxeColumn[] = [
       width:"200px",
       placeholder: '请输入${title}',
       defaultValue:'',
-      type: JVxeTypes.select,
+      type: JVxeTypes.normal,
       options: [],
       dictCode: 'yes_or_no',
     },
     {
       title: '批号(batch code)',
       key: 'batchCode',
-      type: JVxeTypes.input,
+      type: JVxeTypes.normal,
       width:"200px",
       placeholder: '请输入${title}',
       defaultValue:'',
@@ -241,22 +242,22 @@ export const stockInColumns: JVxeColumn[] = [
     {
       title: '备注(notes)',
       key: 'notes',
-      type: JVxeTypes.input,
+      type: JVxeTypes.normal,
       width:"200px",
       placeholder: '请输入${title}',
       defaultValue:'',
     },
-    {
-      title: '操作(operation)',
-      key: 'action',
-      width:"200px",
-      // 固定在右侧
-      fixed: 'right',
-      // 对齐方式为居中
-      align: 'center',
-      // 组件类型定义为【插槽】
-      type: JVxeTypes.slot,
-      // slot 的名称,对应 v-slot 冒号后面和等号前面的内容
-      slotName: 'action',
-    },
+    // {
+    //   title: '操作(operation)',
+    //   key: 'action',
+    //   width:"200px",
+    //   // 固定在右侧
+    //   fixed: 'right',
+    //   // 对齐方式为居中
+    //   align: 'center',
+    //   // 组件类型定义为【插槽】
+    //   type: JVxeTypes.slot,
+    //   // slot 的名称,对应 v-slot 冒号后面和等号前面的内容
+    //   slotName: 'action',
+    // },
   ]

+ 33 - 13
src/views/inventiry/purInAbnormal/purInAbnormalList.vue

@@ -60,9 +60,9 @@
                 </a-form-item>
               </a-col>
               <a-col :lg="8">
-                <a-form-item name="submit">
-                  <template #label><span title="提交(submit)">提交(submit)</span></template>
-                  <JDictSelectTag v-model:value="queryParam.submit" placeholder="请选择" dictCode="yes_or_no" style="width: 100%;"/>
+                <a-form-item name="hasDeal">
+                  <template #label><span title="处理(deal)">处理(deal)</span></template>
+                  <JDictSelectTag v-model:value="queryParam.hasDeal" placeholder="请选择" dictCode="yes_or_no" style="width: 100%;"/>
                 </a-form-item>
               </a-col>
             </template>
@@ -85,7 +85,8 @@
      <BasicTable @register="registerTable" :rowSelection="rowSelection" size="small" >
        <!--插槽:table标题-->
         <template #tableTitle>
-            <a-button  type="primary" v-auth="'saleCode:sale_order:exportXls'"  preIcon="ant-design:export-outlined" @click="onExportXls"> 导出(export)</a-button>
+            <a-button  type="primary"  preIcon="ant-design:export-outlined" @click="onExportXls"> 导出(export)</a-button>
+            <a-button  type="primary"   preIcon="ant-design:export-outlined" @click="onProcessed"> 已处理(Processed)</a-button>
         </template>
          <!--操作栏-->
         <template #action="{ record }">
@@ -96,27 +97,25 @@
         </template>
       </BasicTable>
       <!-- 表单区域 -->
-      <puechaseInFormModal @register="registerModal" @success="handleSuccess"></puechaseInFormModal>
+      <purInAbnormalFormModal @register="registerModal" @success="handleSuccess"></purInAbnormalFormModal>
     </div>
   </template>
   
   <script lang="ts" name="saleCode-saleInquiryForm" setup>
-    import {ref, reactive} from 'vue';
+    import {ref, reactive,onMounted} from 'vue';
     import {BasicTable, useTable, TableAction} from '/@/components/Table';
     import { useListPage } from '/@/hooks/system/useListPage'
     import {useModal} from '/@/components/Modal';
-    import puechaseInFormModal from './components/puechaseInFormModal.vue'
+    import purInAbnormalFormModal from './components/purInAbnormalFormModal.vue'
     import {columns} from './purInAbnormalForm.data';
-    import {list, getImportUrl,getExportUrl} from './purInAbnormalForm.api';
+    import {list, getImportUrl,getExportUrl,ProcessedList} from './purInAbnormalForm.api';
     import { cloneDeep } from "lodash-es";
     import { defHttp } from '/@/utils/http/axios';
     import { JDictSelectTag} from '/@/components/Form';
     import JSelectInput from '/@/components/Form/src/jeecg/components/JSelectInput.vue';
     import { message } from 'ant-design-vue';
     const formRef = ref();
-    const queryParam = reactive<any>({
-        type:'1'
-    });
+    const queryParam = reactive<any>({});
     //注册model
     const [registerModal, {openModal}] = useModal();
     var classOption = ref([]);
@@ -189,6 +188,18 @@
          showFooter: false,
        });
      }
+
+     function handlTackle(record){
+      ProcessedList({ids: record.id},handleSuccess);
+     }
+     function onProcessed(){
+        if(selectedRowKeys.value.length==0){
+          message.warning('请选择数据')
+        }else{
+          var ids=selectedRowKeys.value.join(',')
+          ProcessedList({ids: ids},handleSuccess);
+        }
+     }
   
      /**
         * 操作栏
@@ -198,7 +209,11 @@
            {
              label: '详情(detail)',
              onClick: handleDetail.bind(null, record),
-             ifShow: record.submit=='1'
+           },
+           {
+             label: '已处理(detail)',
+             onClick: handlTackle.bind(null, record),
+             ifShow: record.hasDeal=='0'||!record.hasDeal
            },
          ]
      }
@@ -208,6 +223,12 @@
     function getDropDownAction(record){
          return [ ]
      }
+      /**
+      * 成功回调
+      */
+    function handleSuccess() {
+        (selectedRowKeys.value = []) && reload();
+     }
 
     /* ----------------------以下为原生查询需要添加的-------------------------- */
     const toggleSearchStatus = ref<boolean>(false);
@@ -233,7 +254,6 @@
     function searchReset() {
       formRef.value.resetFields();
       selectedRowKeys.value = [];
-      queryParam.type='1'
       //刷新数据
       reload();
     }