Bladeren bron

用友出库

hfxc226 2 jaren geleden
bovenliggende
commit
5a232aa5e1

+ 1 - 1
src/api/store/outstoreform.js

@@ -75,7 +75,7 @@ export function updateOutStoreForm (parameter) {
  */
 export function updateOutStoreFormYY (parameter) {
   return axios({
-    url: '/store/out-store-forms/yongyou' + parameter.id,
+    url: '/store/out-store-forms/yongyou/' + parameter.id,
     method: 'PUT',
     data: parameter
   })

+ 10 - 9
src/api/yongyou/yongyou.js

@@ -9,25 +9,26 @@ import { stringify } from 'qs'
  */
 export function getSparePageYY (parameter) {
   return axios({
-    url: '/yongyou/page?' + stringify(parameter),
+    url: '/yongyou/spare/page?' + stringify(parameter),
     method: 'get',
     headers: {
       'Content-Type': 'application/json;charset=UTF-8'
     }
   })
 }
-
 /**
- * update func
+ * page func
  * parameter: { }
  * @param parameter
  * @returns {*}
  */
-export function addSparePickFormYY (parameter) {
+export function getSpareStorePageYY (parameter) {
   return axios({
-    url: '/yongyou/spare/pick/form/' + parameter.id,
-    method: 'PUT',
-    data: parameter
+    url: '/yongyou/spareStore/page?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
   })
 }
 
@@ -37,9 +38,9 @@ export function addSparePickFormYY (parameter) {
  * @param parameter
  * @returns {*}
  */
-export function addSpareRestoreFormYY (parameter) {
+export function addOutFormYY (parameter) {
   return axios({
-    url: '/yongyou/spare/restore/form/' + parameter.id,
+    url: '/yongyou/spare/pick/form/' + parameter.id,
     method: 'PUT',
     data: parameter
   })

+ 3 - 2
src/router/generator-platform-routers.js

@@ -144,8 +144,9 @@ const constantRouterComponents = {
   // 入库登记单
   'InStoreForm': () => import('@/views/store/instoreform/InStoreForm'),
   // 出库登记单
-  'OutStoreForm': () => import('@/views/store/outstoreform/OutStoreForm'),
-  'OutStoreFormYY': () => import('@/views/store/outstoreform/OutStoreFormYY'),
+  'OutStoreForm': () => import('@/views/store/outstoreform/OutStoreForm'), // 出库
+  'OutStoreFormYY': () => import('@/views/store/outstoreform/OutStoreFormYY'), // 用友出库
+  'OutStoreFormBackYY': () => import('@/views/store/outstoreform/OutStoreFormBackYY'), // 用友退库
   // 调拨登记单
   'TransferStoreForm': () => import('@/views/store/transferstoreform/TransferStoreForm'),
 

+ 334 - 0
src/views/sqarepartmanage/sparepartinfo/modules/SparePartInfoSelectModalYY.vue

@@ -0,0 +1,334 @@
+<template>
+  <a-modal
+    :title="modalTitle"
+    :width="1200"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    class="ant-modal2"
+    @cancel="handleCancel"
+  >
+    <a-card :bordered="false">
+      <a-row :gutter="8">
+        <a-col :span="24">
+          <div class="table-page-search-wrapper">
+            <a-form layout="inline">
+              <a-row :gutter="48">
+                <a-col :md="6 || 24" :sm="24">
+                  <a-form-item label="名称/编码">
+                    <a-input v-model.trim="queryParam.keyword" placeholder="名称/编码"/>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6 || 24" :sm="24">
+                  <a-form-item label="规格型号">
+                    <a-input v-model="queryParam.ggxh" placeholder="规格型号"/>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6 || 24" :sm="24">
+                  <a-form-item label="类型">
+                    <a-tree-select
+                      style="width: 100%"
+                      :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
+                      :treeData="spareTypeTreeData"
+                      :treeNodeFilterProp="'title'"
+                      :showSearch="true"
+                      v-model="queryParam.typeId"
+                      placeholder="请选择"
+                    >
+                    </a-tree-select>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6 || 24" :sm="24">
+                  <a-form-item label="原厂编号">
+                    <a-input v-model="queryParam.initNo" placeholder="原厂编号"/>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6 || 24" :sm="24">
+                  <a-form-item label="是否专用">
+                    <a-select v-model="queryParam.isSpecial" placeholder="请选择">
+                      <a-select-option
+                        v-for="(label,value) in specialMap"
+                        :key="value"
+                        :label="label"
+                        :value="parseInt(value)">{{ label }}
+                      </a-select-option>
+                    </a-select>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="8" :sm="24">
+                  <a-form-item label="关联设备">
+                    <a-input v-model="queryParam.model" placeholder="新号/旧号/名称/规格"/>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6 || 24" :sm="24">
+                  <span class="table-page-search-submitButtons">
+                    <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
+                    <a-button style="margin-left: 8px" @click="resetSearchForm">重置</a-button>
+                  </span>
+                </a-col>
+              </a-row>
+            </a-form>
+          </div>
+
+          <div class="table-operator" style="margin-bottom: 8px;">
+          </div>
+
+          <s-table
+            ref="table"
+            size="default"
+            rowKey="id"
+            :columns="columns"
+            :data="loadData"
+            :alert="options.alert"
+            :customRow="options.customRow"
+            :rowSelection="options.rowSelection"
+            showPagination="auto"
+          >
+            <span slot="action" slot-scope="record">
+              <template>
+<!--                <a @click="handleView(record)">查看</a>-->
+              </template>
+            </span>
+          </s-table>
+        </a-col>
+      </a-row>
+      <detail ref="detailModal"/>
+    </a-card>
+    <template slot="footer">
+      <a-button :loading="confirmLoading" type="primary" @click="handleCancel()">取消</a-button>
+      <a-button :loading="confirmLoading" type="primary" @click="handleSelect()">选择</a-button>
+    </template>
+  </a-modal>
+</template>
+
+<script>
+import { STable, Ellipsis } from '@/components'
+import Detail from './Detail'
+import { getSparePageYY } from '@/api/yongyou/yongyou'
+import { fetchSpareTypeTree } from '@/api/sqarepartmanage/sparetype'
+
+export default {
+  name: 'SparePartInfoSelectModal',
+  components: {
+    STable,
+    Ellipsis,
+    Detail
+  },
+  props: {
+    type: {
+      type: String,
+      default: 'radio'
+    },
+    typeName: {
+      type: String,
+      default: ''
+    },
+    selectedRowKey: {
+      type: Array,
+      default: () => {
+        return []
+      }
+    },
+    selectedRow: {
+      type: Array,
+      default: () => {
+        return []
+      }
+    }
+  },
+  data () {
+    return {
+      confirmLoading: false,
+      mdl: {},
+      modalTitle: null,
+      specialMap: {},
+      visible: false,
+      record: null,
+      spareTypeTreeData: [],
+      expandedKeys: [],
+      selectedKeys: [],
+      // 查询参数
+      queryParam: {
+      },
+      extraQueryParam: {
+      },
+      // 表头
+
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          customRender: (text, record, index) => {
+            return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
+          }
+        },
+        {
+          title: '编号',
+          dataIndex: 'no'
+        },
+        {
+          title: '名称',
+          dataIndex: 'name'
+        },
+        {
+          title: '规格型号',
+          dataIndex: 'ggxh'
+        },
+        {
+          title: '计量单位',
+          dataIndex: 'unit'
+        },
+        {
+          title: '操作',
+          key: 'action',
+          align: 'center',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        parameter = {
+          ...parameter,
+          ...this.queryParam,
+          ...this.extraQueryParam,
+          dataScope: {
+            sortBy: 'desc',
+            sortName: 'name'
+          }
+        }
+        return getSparePageYY(Object.assign(parameter, this.queryParam))
+          .then(res => {
+            return res.data
+          })
+      },
+      selectedRowKeys: [],
+      selectedRows: [],
+
+      options: {
+        alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
+        rowSelection: {
+          selectedRowKeys: this.selectedRowKeys,
+          onChange: this.onSelectChange
+        }
+      },
+      optionAlertShow: false,
+      isCreated: false
+    }
+  },
+  created () {
+    // 下拉框map
+    this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SPARE_PART_INFO_LEVEL)
+    this.unitMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_UNIT)
+    this.specialMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
+  },
+  methods: {
+    tableOption () {
+      if (!this.optionAlertShow) {
+        this.options = {
+          alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
+          rowSelection: {
+            selectedRowKeys: this.selectedRowKeys,
+            onChange: this.onSelectChange,
+            type: this.type,
+            getCheckboxProps: record => ({
+              props: {
+                disabled: false,
+                name: record.id
+              }
+            })
+          },
+          customRow: (record) => {
+            return {
+              on: { // 事件
+                click: (event) => { // 点击行
+                  // 选择对象
+                  this.mySelect([record.id], [record])
+                },
+                dblclick: (event) => {
+                  this.mySelect([record.id], [record])
+                  this.handleSelect()
+                }
+              }
+            }
+          }
+        }
+        this.optionAlertShow = true
+      } else {
+        this.options = {
+          alert: false,
+          rowSelection: null
+        }
+        this.optionAlertShow = false
+      }
+    },
+    handleView (record) {
+      fetchSparePartInfo({ id: record.id }).then(res => {
+        const modal = this.$refs.detailModal
+        modal.base(res.data)
+      })
+    },
+    handleOk () {
+      this.$refs.table.refresh()
+    },
+    onSelectChange (selectedRowKeys, selectedRows) {
+      this.selectedRowKeys = selectedRowKeys
+      this.selectedRows = selectedRows
+    },
+    resetSearchForm () {
+      this.queryParam = {
+      }
+      this.$refs.table.refresh(true)
+    },
+    base (record, queryParam = {}) {
+      this.visible = true
+      this.modalTitle = '选择信息'
+      this.queryParam = queryParam
+      this.record = record
+      if (!this.BaseTool.Object.isBlank(queryParam.typeName)) {
+        fetchSpareTypeTree({ name: queryParam.typeName }).then(res => {
+          this.spareTypeTreeData = res.data
+        })
+      } else {
+        fetchSpareTypeTree().then(res => {
+          this.spareTypeTreeData = res.data
+        })
+      }
+      if (this.isCreated) {
+        this.$refs.table.clearSelected()
+        this.options.rowSelection.type = this.type
+        this.handleOk()
+      } else {
+        this.tableOption()
+        this.isCreated = true
+      }
+    },
+    handleCancel () {
+      this.visible = false
+      this.confirmLoading = false
+    },
+    handleSelect () {
+      if (this.selectedRowKeys.length === 0) {
+        this.$message.warn('请至少选择一项信息')
+      } else {
+        this.confirmLoading = true
+        this.$emit('selected', this.record, this.selectedRowKeys, this.selectedRows)
+        this.confirmLoading = false
+        this.visible = false
+      }
+    },
+    mySelect (selectedRowKeys, selectedRows) {
+      this.$refs.table.updateSelect(selectedRowKeys, selectedRows)
+      this.$refs.table.rowSelection.onChange(selectedRowKeys, selectedRows)
+    },
+    onSelect: function (selectedKeys, info) {
+      this.selectedKeys = selectedKeys
+      this.queryParam.typeId = selectedKeys.length > 0 ? selectedKeys[0] : ''
+      this.queryParam.typeName = ''
+      this.$refs.table.refresh(true)
+    },
+    onExpand (expandedKeys) {
+      this.expandedKeys = expandedKeys
+      this.autoExpandParent = false
+    }
+  }
+}
+</script>

+ 17 - 0
src/views/store/outstoreform/OutStoreFormBackYY.vue

@@ -0,0 +1,17 @@
+<template>
+  <OutStoreFormYY :is-out="false"/>
+</template>
+
+<script>
+import OutStoreFormYY from './OutStoreFormYY'
+export default {
+  name: 'OutStoreFormBackYY',
+  components: {
+    OutStoreFormYY
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 13 - 7
src/views/store/outstoreform/OutStoreFormYY.vue

@@ -6,10 +6,10 @@
           <a-row :gutter="48">
             <a-col :md="8" :sm="24">
               <a-form-item label="关键字">
-                <a-input v-model.trim="queryParam.keyword" placeholder="请输入出库单号"/>
+                <a-input v-model.trim="queryParam.keyword" placeholder="请输入单号"/>
               </a-form-item>
             </a-col>
-            <a-col :md="8" :sm="24">
+            <!--            <a-col :md="8" :sm="24">
               <a-form-item label="出库类型">
                 <a-select v-model="queryParam.type" placeholder="请选择">
                   <a-select-option
@@ -20,7 +20,7 @@
                   </a-select-option>
                 </a-select>
               </a-form-item>
-            </a-col>
+            </a-col>-->
             <a-col :md="8 || 24" :sm="24">
               <span class="table-page-search-submitButtons">
                 <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
@@ -93,6 +93,8 @@ import BaseForm from './modules/BaseFormYY'
 import Detail from './modules/DetailYY'
 import { updateStore, updateStoreBack, getOutStoreFormPage, deleteOutStoreForms, fetchOutStoreForm, exportOutStoreForm } from '@/api/store/outstoreform'
 
+import { addOutFormYY } from '@/api/yongyou/yongyou'
+
 export default {
   name: 'OutStoreFormList',
   components: {
@@ -105,6 +107,10 @@ export default {
     filter: {
       type: Number,
       default: -1
+    },
+    isOut: {
+      type: Boolean,
+      default: true
     }
   },
   data () {
@@ -112,8 +118,8 @@ export default {
       // 查询参数
       queryParam: {
         filter: this.filter,
+        isOut: this.isOut,
         ...this.$route.query
-
       },
       // 表头
       columns: [
@@ -245,7 +251,7 @@ export default {
     handleAdd () {
       this.visible = false
       const modal = this.$refs.baseModal
-      modal.base()
+      modal.base({ isOut: this.isOut })
     },
     handleEdit (record) {
       this.visible = false
@@ -256,8 +262,8 @@ export default {
       })
     },
     updateStore (id) {
-      updateStore({ id: id }).then(res => {
-        this.$message.info('出库成功')
+      addOutFormYY({ id: id }).then(res => {
+        this.$message.info('已提交到仓库,请联系仓库管理员审核')
         this.$refs.table.refresh()
       })
     },

+ 10 - 2
src/views/store/outstoreform/modules/BaseFormYY.vue

@@ -5,6 +5,7 @@
         <a-input v-decorator="['id']" type="hidden"/>
         <a-input v-decorator="['storeId']" type="hidden"/>
         <a-input v-decorator="['pickId']" type="hidden"/>
+        <a-input v-decorator="['isOut']" type="hidden"/>
       </a-form-item>
       <a-row :gutter="24">
         <a-col :lg="12" :md="24" :sm="24">
@@ -171,7 +172,7 @@ import { queryUsersByParentDeptNatureAll } from '@/api/upms/user'
 import { fetchStoreTree } from '@/api/store/store'
 
 export default {
-  name: 'BaseOutStoreForm',
+  name: 'BaseOutStoreFormYY',
   components: {
     DetailBaseForm,
     SparePickFormSelectModal,
@@ -274,9 +275,16 @@ export default {
         this.storeTreeDate = res.data
       })
       // 如果是空标识添加
-      if (this.BaseTool.Object.isBlank(record)) {
+      if (this.BaseTool.Object.isBlank(record.id)) {
         this.modalTitle = '添加'
         this.data = []
+        const { form: { setFieldsValue } } = this
+        // 日期处理
+        this.$nextTick(() => {
+          setFieldsValue(Object.assign(pick(record, [
+            'isOut'
+          ])))
+        })
         return
       }
       this.modalTitle = '编辑'

+ 5 - 5
src/views/store/outstoreform/modules/Detail.vue

@@ -3,8 +3,8 @@
     <a-row :gutter="48" slot="extra">
        <a-col :md="48" :sm="48">
          <span class="table-page-search-submitButtons" style="float: right">
-           <a-popconfirm v-if="model.status==1" title="是否要出库出库将更新库存?"  @confirm="updateStore()">
-            <a-button type="primary">出库</a-button>
+           <a-popconfirm v-if="model.status==1" title="是否要,将更新库存?"  @confirm="updateStore()">
+            <a-button type="primary"></a-button>
            </a-popconfirm>
            <a-button v-if="$auth('store-out-store-forms-edit')&&model.status==1" style="margin-left: 8px" type="danger" @click="handleEdit()">修改</a-button>
            <a-button style="margin-left: 8px" @click="handleCancel">返回</a-button>
@@ -12,8 +12,8 @@
        </a-col>
     </a-row>
     <detail-list title="" :col="3">
-      <detail-list-item term="出库单号">{{ model.outNo }}</detail-list-item>
-      <detail-list-item term="出库类型">{{ BaseTool.Object.getField(typeMap,model.type) }}</detail-list-item>
+      <detail-list-item term="单号">{{ model.outNo }}</detail-list-item>
+      <detail-list-item term="类型">{{ BaseTool.Object.getField(typeMap,model.type) }}</detail-list-item>
 <!--      <detail-list-item term="仓库">{{ model.storeName }}</detail-list-item>-->
       <detail-list-item term="总价">{{ model.totalPrice }}</detail-list-item>
 <!--      <detail-list-item term="领用/退货单id">{{ model.pickId }}</detail-list-item>
@@ -150,7 +150,7 @@ export default {
     },
     updateStore(){
       updateStore({id:this.model.id}).then(res => {
-        this.$message.info('出库成功')
+        this.$message.info('成功')
         this.handleOk()
       })
     }

+ 15 - 8
src/views/store/outstoreform/modules/DetailYY.vue

@@ -3,18 +3,19 @@
     <a-row :gutter="48" slot="extra">
       <a-col :md="48" :sm="48">
         <span class="table-page-search-submitButtons" style="float: right">
-          <a-popconfirm v-if="model.status==1" title="是否要出库出库将更新库存?" @confirm="updateStore()">
-            <a-button type="primary">出库</a-button>
+          <a-popconfirm v-if="model.status==1" title="是否要,将更新库存?" @confirm="updateStore()">
+            <a-button type="primary"></a-button>
           </a-popconfirm>
           <a-button style="margin-left: 8px" @click="handleCancel">返回</a-button>
         </span>
       </a-col>
     </a-row>
     <detail-list title="" :col="3">
-      <detail-list-item term="出库单号">{{ model.outNo }}</detail-list-item>
-      <detail-list-item term="出库类型">{{ BaseTool.Object.getField(typeMap,model.type) }}</detail-list-item>
+      <detail-list-item term="单号">{{ model.outNo }}</detail-list-item>
+      <detail-list-item term="类型">{{ BaseTool.Object.getField(typeMap,model.type) }}</detail-list-item>
       <detail-list-item term="仓库">{{ model.storeName }}</detail-list-item>
       <detail-list-item term="状态"><badge :text="BaseTool.Object.getField(statusMap,model.status)" :status="statusMap[model.status]"/></detail-list-item>
+      <detail-list-item term="是否出库"><badge :text="BaseTool.Object.getField(yesNoMap,model.isOut)" :status="statusMap[model.status]"/></detail-list-item>
       <detail-list-item term="创建人">{{ model.createdUserName }}</detail-list-item>
       <detail-list-item term="更新人">{{ model.updateUserName }}</detail-list-item>
       <detail-list-item term="更新日期">{{ model.updateTime }}</detail-list-item>
@@ -56,6 +57,7 @@ export default {
       // 下拉框map
       typeMap: {},
       statusMap: {},
+      yesNoMap: {},
       model: {
         'outNo': null,
         'type': null,
@@ -101,10 +103,14 @@ export default {
           dataIndex: 'cbatch'
         },
         {
-          title: '数量',
+          title: '申请数量',
           dataIndex: 'num',
-          width: 150,
-          scopedSlots: { customRender: 'num' }
+          width: 150
+        },
+        {
+          title: '实际数量',
+          dataIndex: 'realNum',
+          width: 150
         },
         {
           title: '仓库',
@@ -118,6 +124,7 @@ export default {
     // 下拉框map
     this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.OUT_STORE_FORM_TYPE)
     this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.OUT_STORE_FORM_STATUS)
+    this.yesNoMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
   },
   methods: {
     base (record) {
@@ -138,7 +145,7 @@ export default {
     },
     updateStore () {
       updateStore({ id: this.model.id }).then(res => {
-        this.$message.info('出库成功')
+        this.$message.info('成功')
         this.handleOk()
       })
     }

+ 2 - 2
src/views/store/sparestore/modules/SpareStoreSelectModalYY.vue

@@ -117,7 +117,7 @@ import Detail from './Detail'
 import { fetchSpareTypeTree } from '@/api/sqarepartmanage/sparetype'
 import { fetchStoreTree } from '@/api/store/store'
 
-import { getSparePageYY } from '@/api/yongyou/yongyou'
+import { getSpareStorePageYY } from '@/api/yongyou/yongyou'
 export default {
   name: 'SpareStoreSelectModalYY',
   components: {
@@ -208,7 +208,7 @@ export default {
             sortName: 'update_time'
           }
         }
-        return getSparePageYY(Object.assign(parameter, this.queryParam)).then(res => {
+        return getSpareStorePageYY(Object.assign(parameter, this.queryParam)).then(res => {
           if (res.data.rows === null) {
             const data = { total: 0, rows: [], pageNum: 1, pageSize: 10, pages: 1 }
             return data