xiongchao пре 3 година
родитељ
комит
8846ff4f93

+ 18 - 0
src/api/sb/info.js

@@ -115,6 +115,24 @@ export function addSbInfo (parameter) {
   })
 }
 
+/**
+ * add func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function copySbInfo (parameter) {
+  return axios({
+    url: '/sb/infos/copy',
+    method: 'POST',
+    headers: {
+      'Accept': 'application/json',
+      'Content-Type': 'application/json;charset=UTF-8'
+    },
+    data: parameter
+  })
+}
+
 /**
  * update func
  * parameter: { }

+ 2 - 2
src/views/check/checkstandard/modules/DetailSbCheck.vue

@@ -50,7 +50,7 @@
     <base-form ref="baseModal" :check-type="checkType" @ok="handleOk"/>
     <base-form-insert ref="baseModalInsert" @ok="handleOk"/>
     <detail ref="detailModal"/>
-    <sb-info-select-modal :type="'radio'" ref="sbInfoSelectModal" @selected="handleSbSelectd"/>
+    <sb-info-select-modal :type="'radio'" ref="sbInfoSelectModal" @selected="handleSbSelected"/>
 
   </div>
 </template>
@@ -236,7 +236,7 @@ export default {
     handleSbSelect () {
       this.$refs.sbInfoSelectModal.base()
     },
-    handleSbSelectd (keys, rows) {
+    handleSbSelected (keys, rows) {
       const [ key ] = keys
       const [ row ] = rows
       // 日期处理

+ 4 - 0
src/views/firm/producer/FirmProducer.vue

@@ -99,6 +99,10 @@ export default {
           title: '名称',
           dataIndex: 'name'
         },
+        {
+          title: '品牌',
+          dataIndex: 'pp'
+        },
         {
           title: '等级',
           dataIndex: 'level',

+ 11 - 2
src/views/firm/producer/modules/BaseForm.vue

@@ -29,6 +29,14 @@
         <a-input
           v-decorator="['name', {rules: [{required: true, message: '名称不能为空'}]}]" />
       </a-form-item>
+      <a-form-item
+        label="品牌"
+        :labelCol="BaseTool.Constant.labelCol"
+        :wrapperCol="BaseTool.Constant.wrapperCol"
+      >
+        <a-input
+          v-decorator="['pp']" />
+      </a-form-item>
       <a-form-item
         label="等级"
         :labelCol="BaseTool.Constant.labelCol"
@@ -91,7 +99,7 @@
           :min="1"
           v-decorator="['sort']" />
       </a-form-item>
-      <a-form-item
+<!--      <a-form-item
         label="是否删除"
         :labelCol="BaseTool.Constant.labelCol"
         :wrapperCol="BaseTool.Constant.wrapperCol"
@@ -104,7 +112,7 @@
             :value="parseInt(value)">{{ label }}
           </a-select-option>
         </a-select>
-      </a-form-item>
+      </a-form-item>-->
       <a-form-item
         label="备注"
         :labelCol="BaseTool.Constant.labelCol"
@@ -159,6 +167,7 @@ export default {
           'id',
           'no',
           'name',
+          'pp',
           'level',
           'type',
           'person',

+ 2 - 0
src/views/firm/producer/modules/Detail.vue

@@ -9,6 +9,7 @@
     <detail-list title="" :col="2">
       <detail-list-item term="编码">{{ model.no }}</detail-list-item>
       <detail-list-item term="名称">{{ model.name }}</detail-list-item>
+      <detail-list-item term="名称">{{ model.pp }}</detail-list-item>
       <detail-list-item term="等级">{{ BaseTool.Object.getField(levelMap,model.level) }}</detail-list-item>
       <detail-list-item term="联系人">{{ model.person }}</detail-list-item>
       <detail-list-item term="联系电话">{{ model.mobile }}</detail-list-item>
@@ -45,6 +46,7 @@ export default {
       model: {
         'no': null,
         'name': null,
+        'pp': null,
         'level': null,
         'person': null,
         'mobile': null,

+ 7 - 2
src/views/firm/producer/modules/FirmProducerSelectModal.vue

@@ -116,16 +116,21 @@ export default {
             return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
           }
         },
-        {
+/*        {
           title: '编码',
           checked: true,
           dataIndex: 'account'
-        },
+        },*/
         {
           title: '名称',
           checked: true,
           dataIndex: 'name'
         },
+        {
+          title: '品牌',
+          checked: true,
+          dataIndex: 'pp'
+        },
         // {
         //   title: '等级',
         //   checked: true,

+ 10 - 3
src/views/sb/info/SbInfo.vue

@@ -102,6 +102,9 @@
                          <a-popconfirm title="是否要停用该设备?" @confirm="handleStop(record)">
                           <a>停用</a>
                         </a-popconfirm>
+                      </a-menu-item>
+                      <a-menu-item key="10">
+                         <a v-if="$auth('sb-infos-edit')" @click="handleCopy(record)">复制</a>
                       </a-menu-item>
                        <a-menu-item key="4">
                          <a @click="printQcode(record)">打印</a>
@@ -200,10 +203,15 @@ export default {
           dataIndex: 'name'
         },
         {
-          title: '设备号',
+          title: '设备号',
           dataIndex: 'no',
           checked: true
         },
+        {
+          title: '设备旧号',
+          dataIndex: 'zbh',
+          checked: true
+        },
         {
           title: '设备类型',
           checked: true,
@@ -405,8 +413,7 @@ export default {
       this.visible = false
       fetchSbInfo({ id: record.id }).then(res => {
         const modal = this.$refs.baseModal
-        res.data.id = null
-        modal.base(res.data)
+        modal.base(res.data, 1)
       })
     },
     handleOk () {

+ 27 - 16
src/views/sb/info/modules/BaseForm.vue

@@ -726,6 +726,7 @@
           >
             <a-upload
               :action="uploadUrl"
+              :multiple="true"
               :file-list="this.defaultRepairFileList"
               @change="handleRepairFileChange"
               :headers="headers"
@@ -761,7 +762,7 @@
           >
             <a-upload
               :action="uploadUrl"
-              :multiple="false"
+              :multiple="true"
               :file-list="this.defaultRecheckFileList"
               @change="handleRecheckFileChange"
               :headers="headers"
@@ -798,7 +799,7 @@
 
 <script>
 import pick from 'lodash.pick'
-import { addSbInfo, updateSbInfo } from '@/api/sb/info'
+import { addSbInfo, updateSbInfo, copySbInfo } from '@/api/sb/info'
 import { fetchSbTypeTree } from '@/api/sb/type'
 import FirmProducerSelectModal from '@/views/firm/producer/modules/FirmProducerSelectModal'
 import SbGuigeSelectModal from '@/views/sb/guige/modules/SbGuigeSelectModal'
@@ -857,6 +858,7 @@ export default {
       uploadUrl: uploadUrl,
       qrcodesrc: null,
       fileList: [],
+      type: null,
       headers: {
         Authorization: 'Bearer ' + Vue.ls.get(ACCESS_TOKEN)
       }
@@ -879,7 +881,7 @@ export default {
     this.useTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_USE_TYPE)
   },
   methods: {
-    base (record) {
+    base (record, type) {
       this.setTree(record)
       // 清除文件列表
       this.visible = true
@@ -903,12 +905,13 @@ export default {
       this.defaultRecheckFileList = this.BaseTool.UPLOAD.transImg(this.recheckFileList)
       this.defaultSbFileList = this.BaseTool.UPLOAD.transImg(this.sbFileList)
 
-      // if (this.BaseTool.Object.isBlank(record.id)) {
-      // this.modalTitle = '复制'
-      // this.qrcodesrc = null
-      // record.no = null
-      // this.clearFileList()
-      // }
+      if (type === 1) {
+        this.type = type
+        this.modalTitle = '复制'
+        this.qrcodesrc = null
+        record.no = null
+        this.clearFileList()
+      }
       if (record.isChild === 1) {
         record.isChild = '1'
       }
@@ -1040,7 +1043,6 @@ export default {
           'color',
           'sbdh',
           'seatNumber',
-
           'registerNo',
           'characterType',
           'usedNo',
@@ -1092,12 +1094,21 @@ export default {
               this.confirmLoading = false
             })
         } else {
-          updateSbInfo(values)
-            .then(() => {
-              this.handleCancel(values)
-            }).catch(() => {
-              this.confirmLoading = false
-            })
+          if (this.type == null) {
+            updateSbInfo(values)
+              .then(() => {
+                this.handleCancel(values)
+              }).catch(() => {
+                this.confirmLoading = false
+              })
+          } else {
+            copySbInfo(values)
+              .then(() => {
+                this.handleCancel(values)
+              }).catch(() => {
+                this.confirmLoading = false
+              })
+          }
         }
       })
     },

+ 0 - 1
src/views/sb/info/modules/SbInfoSelectModal.vue

@@ -209,7 +209,6 @@ export default {
     this.unitMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_UNIT)
     this.sourceTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBTYPE_SOURCETYPE)
     this.useTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_UES_TYPE)
-
   },
   methods: {
     tableOption () {

+ 8 - 10
src/views/sb/modelbom/modules/BaseFormSpare.vue

@@ -30,7 +30,7 @@
               style="width: 70%"
               disabled
               v-decorator="['model', {rules: [{required: true, message: '设备不能为空'}]}]" />
-            <a-button style="width: 30%" type="primary" @click="handleSbModelSelect">选择</a-button>
+            <a-button style="width: 30%" type="primary" @click="handleSbSelect">选择</a-button>
           </a-form-item>
         </a-col>
         <a-col :lg="12" :md="24" :sm="24">
@@ -92,7 +92,7 @@
       </a-row>
     </a-form>
 
-    <sb-model-select-modal ref="sbModelSelectModal" @selected="handleSbModelSelected"/>
+    <sb-info-select-modal ref="sbInfoSelectModal" @selected="handleSbSelected"/>
     <template slot="footer">
       <a-button :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
     </template>
@@ -102,9 +102,7 @@
 <script>
 import pick from 'lodash.pick'
 import { addSbModelBom, updateSbModelBom, deleteSbModelBoms } from '@/api/sb/modelbom'
-import Vue from 'vue'
-import SbModelSelectModal from '@/views/sb/model/modules/SbModelSelectModal'
-
+import SbInfoSelectModal from '@/views/sb/info/modules/SbInfoSelectModal'
 export default {
   name: 'BaseSbModel',
   data () {
@@ -124,7 +122,7 @@ export default {
     }
   },
   components: {
-    SbModelSelectModal
+    SbInfoSelectModal
   },
   created () {
     // 下拉框map
@@ -208,17 +206,17 @@ export default {
       })
     },
 
-    handleSbModelSelect () {
-      this.$refs.sbModelSelectModal.base({}, { yt: 1 })
+    handleSbSelect () {
+      this.$refs.sbInfoSelectModal.base()
     },
-    handleSbModelSelected (keys, rows) {
+    handleSbSelected (keys, rows) {
       const [ key ] = keys
       const [ row ] = rows
       const { form: { setFieldsValue } } = this
       // 日期处理
       this.$nextTick(() => {
         setFieldsValue(Object.assign({
-          'modelId': key,
+          'sbId': key,
           'model': row.model,
           'name': row.name
         }))

+ 4 - 4
src/views/sqarepartmanage/sparepartinfo/SparePartInfo.vue

@@ -168,10 +168,10 @@ export default {
         //  title: '备件ID',
         //  dataIndex: 'id'
         // },
-        {
+ /*       {
           title: '备件编码',
           dataIndex: 'no'
-        },
+        },*/
         // {
         //  title: '备件类别',
         //  dataIndex: 'typeId',
@@ -179,10 +179,10 @@ export default {
         //    return record.typeName
         //  }
         // },
-        {
+     /*   {
           title: '原厂编号',
           dataIndex: 'initNo'
-        },
+        },*/
         {
           title: '备件名称',
           dataIndex: 'name'

+ 46 - 1
src/views/sqarepartmanage/sparepartinfo/modules/BaseForm.vue

@@ -29,6 +29,9 @@
       <a-form-item v-show="false">
         <a-input v-decorator="['producerId']" />
       </a-form-item>
+      <a-form-item v-show="false">
+        <a-input v-decorator="['supplierId']" />
+      </a-form-item>
       <title-divider title="类型设置" width="150px"></title-divider>
       <row-list :col="2">
         <row-item>
@@ -99,6 +102,19 @@
               v-decorator="['initialValue', {rules: [{required: true, message: '备件价值不能为空'}]}]" />
           </a-form-item>
         </row-item>
+        <row-item>
+          <a-form-item
+            label="采购供应商"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              style="width: 70%"
+              disabled
+              v-decorator="['supplierName']" />
+            <a-button style="width: 30%" type="primary" @click="handleSupplierSelect">选择</a-button>
+          </a-form-item>
+        </row-item>
         <row-item>
           <a-form-item
             label="备件编号"
@@ -262,6 +278,18 @@
               v-decorator="['minStock']" />
           </a-form-item>
         </row-item>
+        <row-item>
+          <a-form-item
+            label="初始库存"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input-number
+              style="width: 100%"
+              :min="1"
+              v-decorator="['initStock']" />
+          </a-form-item>
+        </row-item>
 
         <row-item>
           <a-form-item
@@ -324,6 +352,7 @@
       <a-button :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
     </template>
     <firm-producer-select-modal ref="producerSelectModal" @selected="handleProducerSelected"/>
+    <supplier-select-modal ref="supplierSelectModal" @selected="handleSupplierSelected"/>
   </a-modal>
 </template>
 
@@ -333,6 +362,7 @@ import { addSparePartInfo, querySparePartInfo, updateSparePartInfo } from '@/api
 import { querySpareType, fetchSpareTypeTree } from '@/api/sqarepartmanage/sparetype'
 import { fetchSbGuigeOptions } from '@/api/sb/guige'
 import FirmProducerSelectModal from '@/views/firm/producer/modules/FirmProducerSelectModal'
+import SupplierSelectModal from '@/views/purchase/supplier/modules/SupplierSelectModal'
 import UploadSpareFile from '@/components/Upload/UploadSpareFile'
 import Vue from 'vue'
 import { uploadUrl } from '@/api/upms/file'
@@ -342,6 +372,7 @@ export default {
   name: 'BaseSparePartInfo',
   components: {
     FirmProducerSelectModal,
+    SupplierSelectModal,
     UploadSpareFile
   },
   data () {
@@ -469,6 +500,8 @@ export default {
           'initialValue',
           'producerId',
           'producerName',
+          'supplierId',
+          'supplierName',
           'unit',
           'unitBz',
           'unitRate',
@@ -487,6 +520,7 @@ export default {
           'zbh',
           'maxStock',
           'minStock',
+          'initStock',
           'remark'
         ])))
       })
@@ -536,7 +570,18 @@ export default {
         'producerName': row.name
       })
     },
-
+    handleSupplierSelect () {
+      this.$refs.supplierSelectModal.base()
+    },
+    handleSupplierSelected (record, selectedRowKeys, selectedRow) {
+      const { form: { setFieldsValue } } = this
+      const [ key ] = selectedRowKeys
+      const [ row ] = selectedRow
+      setFieldsValue({
+        'supplierId': key,
+        'supplierName': row.name
+      })
+    },
     handleCancel (values) {
       this.visible = false
       this.confirmLoading = false

+ 6 - 1
src/views/sqarepartmanage/sparepartinfo/modules/Detail.vue

@@ -28,6 +28,7 @@
       <detail-list-item term="备件等级">{{ BaseTool.Object.getField(levelMap,model.level) }}</detail-list-item>
       <detail-list-item term="备件价值">{{ BaseTool.Amount.formatter(model.initialValue) }}</detail-list-item>
       <detail-list-item term="生产商">{{ model.producerName }}</detail-list-item>
+      <detail-list-item term="供应商">{{ model.supplierName }}</detail-list-item>
       <detail-list-item term="原厂编号">{{ model.initNo }}</detail-list-item>
       <detail-list-item term="计量单位">{{ model.unit }}</detail-list-item>
       <detail-list-item term="包装单位">{{ model.unitBz }}</detail-list-item>
@@ -37,6 +38,7 @@
       <detail-list-item term="使用周期">{{ model.usePeriod }}</detail-list-item>
       <detail-list-item term="最高库存">{{ model.maxStock }}</detail-list-item>
       <detail-list-item term="最低库存">{{ model.minStock }}</detail-list-item>
+      <detail-list-item term="初始库存">{{ model.initStock }}</detail-list-item>
       <detail-list-item term="英文名称">{{ model.englishName }}</detail-list-item>
       <detail-list-item term="助记码">{{ model.zjm }}</detail-list-item>
       <detail-list-item term="产地">{{ BaseTool.Object.getField(cdMap,model.cd) }}</detail-list-item>
@@ -82,6 +84,9 @@ export default {
         'level': null,
         'initialValue': null,
         'producerId': null,
+        'producerName': null,
+        'supplierId': null,
+        'supplierName': null,
         'unit': null,
         'unitBz': null,
         'unitRate': null,
@@ -92,13 +97,13 @@ export default {
         'qrCode': null,
         'applicationFileList': [],
         'minStock': null,
+        'initStock': null,
         'remark': null,
         'createdUserId': null,
         'updateUserId': null,
         'updateTime': null,
         'createdUserName': null,
         'updateUserName': null,
-        'producerName': null,
         'typeName': null
 
       }

+ 15 - 11
src/views/sqarepartmanage/sparepartinfo/modules/DetailBom.vue

@@ -33,7 +33,7 @@
         <a-icon type="plus"/>
         单条添加
       </a-button>
-      <a-button style="margin-left:8px;" type="primary" @click="handleSbModelSelect">
+      <a-button style="margin-left:8px;" type="primary" @click="handleSbSelect">
         <a-icon type="plus"/>
         批量添加
       </a-button>
@@ -54,15 +54,15 @@
       </span>
     </a-table>
     <base-form-spare ref="baseModal" @ok="handleOk"/>
-    <sb-model-select-modal :type="'checkbox'" ref="sbModelSelectModal" @selected="handleSbModelSelected"/>
+    <sb-info-select-modal :type="'checkbox'" ref="sbInfoSelectModal" @selected="handleSbSelected"/>
   </a-card>
 </template>
 
 <script>
 import DetailList from '@/components/tools/DetailList'
 import { addSbModelBomBatch, deleteSbModelBoms, selectSbModelListBySpareId } from '@/api/sb/modelbom'
-import SbModelSelectModal from '@/views/sb/model/modules/SbModelSelectModal'
 import BaseFormSpare from '@/views/sb/modelbom/modules/BaseFormSpare'
+import SbInfoSelectModal from '@/views/sb/info/modules/SbInfoSelectModal'
 const DetailListItem = DetailList.Item
 
 export default {
@@ -70,7 +70,7 @@ export default {
   components: {
     DetailList,
     DetailListItem,
-    SbModelSelectModal,
+    SbInfoSelectModal,
     BaseFormSpare
   },
   data () {
@@ -111,7 +111,7 @@ export default {
       // 表头
       columns: [
         {
-          title: '设备型号',
+          title: '型号',
           dataIndex: 'model'
         },
         {
@@ -119,8 +119,12 @@ export default {
           dataIndex: 'name'
         },
         {
-          title: '名称型号',
-          dataIndex: 'nameModel'
+          title: '新号',
+          dataIndex: 'no'
+        },
+        {
+          title: '旧号',
+          dataIndex: 'zbh'
         },
         {
           title: '更换周期',
@@ -188,14 +192,14 @@ export default {
         this.data = res.data
       })
     },
-    handleSbModelSelect () {
-      const modal = this.$refs.sbModelSelectModal
+    handleSbSelect () {
+      const modal = this.$refs.sbInfoSelectModal
       modal.base()
     },
-    handleSbModelSelected (keys, rows) {
+    handleSbSelected (keys, rows) {
       const addData = []
       for (let i = 0; i < rows.length; i++) {
-        addData.push({ spareId: this.model.id, modelId: rows[i].id, spareName: this.model.name, num: 1, period: 500, periodType: 6 })
+        addData.push({ spareId: this.model.id, sbId: rows[i].id, spareName: this.model.name, num: 1, period: 500, periodType: 6 })
       }
       addSbModelBomBatch(addData)
         .then((response) => {

+ 2 - 2
src/views/sqarepartmanage/sparepartinfo/modules/SparePartInfoSelectModal.vue

@@ -139,10 +139,10 @@ export default {
             return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
           }
         },
-        {
+  /*      {
           title: '编码',
           dataIndex: 'no'
-        },
+        },*/
         {
           title: '名称',
           dataIndex: 'name'

+ 1 - 0
src/views/store/sparestore/modules/Detail.vue

@@ -10,6 +10,7 @@
       <detail-list-item term="备件名称">{{ model.spareName }}</detail-list-item>
       <detail-list-item term="仓库名称">{{ model.storeName }}</detail-list-item>
       <detail-list-item term="数量">{{ model.num }}</detail-list-item>
+      <detail-list-item term="初始数量">{{ model.initNum }}</detail-list-item>
       <detail-list-item term="价格">{{ model.price }}</detail-list-item>
       <detail-list-item term="初始价">{{ model.initPrice }}</detail-list-item>
       <detail-list-item term="采购价">{{ model.initPurchasePrice }}</detail-list-item>

+ 2 - 2
src/views/upms/user/modules/BaseForm.vue

@@ -57,7 +57,7 @@
           @change="changeIdentityType"
           :show-search="true"
           :filter-option="BaseTool.ANTD.selectFilterOption"
-          v-decorator="['identityType', {rules: [{required: true, message: '身份不能为空'}]}]"
+          v-decorator="['identityType']"
           placeholder="请选择">
           <a-select-option
             v-for="(label,value) in identityTypeMap"
@@ -75,7 +75,7 @@
         <a-select
           :show-search="true"
           :filter-option="BaseTool.ANTD.selectFilterOption"
-          v-decorator="['jobType', {rules: [{required: true, message: '职务不能为空'}]}]"
+          v-decorator="['jobType']"
           placeholder="请选择">
           <a-select-option
             v-for="(label,value) in jobTypeMap"