Browse Source

其他成果接口联调

ljb 10 months ago
parent
commit
211cee7bc2

+ 1 - 1
src/api/achievement/otherAchivement.js

@@ -2,7 +2,7 @@ import request from '@/router/axios';
 
 export const getList = (current, size, params) => {
   return request({
-    url: '/api/kd-scientific/kycg/jsbz/list',
+    url: '/api/kd-scientific/kycg/qt/list',
     method: 'get',
     params: {
       ...params,

+ 41 - 0
src/api/yfCostManage/basicDataSetting/kyDeviceList.js

@@ -0,0 +1,41 @@
+import request from '@/router/axios';
+
+export const getList = (current, size, params) => {
+  return request({
+    url: '/api/kd-scientific/zc/page',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}
+
+export const add = (row) => {
+  return request({
+    url: '/api/kd-scientific/zc/save',
+    method: 'post',
+    data: row
+  })
+}
+
+
+export const update = (row) => {
+  return request({
+    url: '/api/kd-scientific/zc/update',
+    method: 'post',
+    data: row
+  })
+}
+
+
+export const remove = (ids) => {
+  return request({
+    url: '/api/kd-scientific/zc/remove',
+    method: 'post',
+    params: {
+      ids
+    }
+  })
+}

+ 3 - 2
src/option/achievement/otherAchivement.js

@@ -7,7 +7,6 @@ export default {
   searchMenuSpan: 6,
   border: true,
   index: true,
-  viewBtn: true,
   selection: true,
   addBtn: true,
   delBtn: true,
@@ -134,6 +133,7 @@ export default {
     {
       label: "关联研发项目情况",
       prop: "canyunZhuchi",
+      align: 'center',
       children: [
         {
           label: "项目项目名称",
@@ -154,6 +154,7 @@ export default {
           label: "研发项目编号",
           prop: 'xmbh',
           width: 100,
+          align: 'center',
           search: true,
           showOverflowTooltip: true,
           display: false
@@ -163,7 +164,7 @@ export default {
     {
       label: "附件信息",
       prop: "attachment",
-      minWidth: 160,
+      minWidth: 200,
       type: "upload",
       multiple: true,
       span: 24,

+ 220 - 0
src/option/yfCostManage/basicDataSetting/kyDeviceList.js

@@ -0,0 +1,220 @@
+export default {
+  height: 'auto',
+  calcHeight: 30,
+  tip: false,
+  searchShow: true,
+  searchMenuSpan: 6,
+  border: true,
+  index: true,
+  viewBtn: true,
+  selection: true,
+  searchLabelWidth: 140,
+  labelWidth: 140,
+  menuWidth: 220,
+  dialogClickModal: false,
+  dialogWidth: 500,
+  dialogType: "drawer",
+  column: [
+    {
+      label: '资产编码',
+      prop: 'zcbm',
+      type: 'input',
+      span: 24,
+      search: true,
+      width: 100,
+      align: 'center',
+      showOverflowTooltip: true,
+      rules: [
+        {
+          required: true,
+          message: '请输入资产编码',
+          trigger: 'blur',
+        },
+      ],
+    },
+    {
+      label: '资产名称',
+      prop: 'zcmc',
+      type: 'input',
+      span: 24,
+      minWidth: 200,
+      search: true,
+      showOverflowTooltip: true,
+      rules: [
+        {
+          required: true,
+          message: '请输入资产名称',
+          trigger: 'blur',
+        },
+      ],
+    },
+    {
+      label: '资产类别',
+      prop: 'zclb',
+      type: 'select',
+      dicUrl: '/api/kd-system/dict-biz/dictionary?code=zclb',
+      props: {
+        label: 'dictValue',
+        value: 'dictKey',
+      },
+      span: 24,
+      width: 120,
+      align: 'center',
+      showOverflowTooltip: true,
+      search: true,
+      rules: [
+        {
+          required: true,
+          message: '请选择资产类别',
+          trigger: 'change',
+        },
+      ],
+    },
+    {
+      label: '功率',
+      prop: 'gl',
+      type: 'input',
+      span: 24,
+      width: 90,
+      align: 'center',
+      showOverflowTooltip: true,
+    },
+    {
+      label: '用途',
+      prop: 'yt',
+      type: 'select',
+      dicUrl: '/api/kd-system/dict-biz/dictionary?code=zcyt',
+      props: {
+        label: 'dictValue',
+        value: 'dictKey',
+      },
+      search: true,
+      span: 24,
+      width: 120,
+      align: 'center',
+      showOverflowTooltip: true,
+      rules: [
+        {
+          required: true,
+          message: '请选择用途',
+          trigger: 'blur',
+        },
+      ],
+    },
+    {
+      label: '开始时间',
+      prop: 'kssj',
+      type: 'date',
+      span: 24,
+      width: 120,
+      search: true,
+      align: 'center',
+      showOverflowTooltip: true,
+      rules: [
+        {
+          required: true,
+          message: '请选择开始时间',
+          trigger: 'blur',
+        },
+      ],
+    },
+    {
+      label: '使用寿命',
+      prop: 'sysm',
+      type: 'number',
+      span: 24,
+      width: 90,
+      search: true,
+      align: 'center',
+      showOverflowTooltip: true,
+      rules: [
+        {
+          required: true,
+          message: '请输入使用寿命',
+          trigger: 'blur',
+        },
+      ],
+    },
+    {
+      label: '已使用月数',
+      prop: 'ysysm',
+      type: 'number',
+      span: 24,
+      width: 100,
+      align: 'center',
+      display: false,
+      showOverflowTooltip: true,
+      rules: [
+        {
+          required: true,
+          message: '请输入已使用月数',
+          trigger: 'blur',
+        },
+      ],
+    },
+    {
+      label: '资产原值(元)',
+      prop: 'zcyz',
+      type: 'number',
+      span: 24,
+      width: 100,
+      align: 'center',
+      showOverflowTooltip: true,
+      rules: [
+        {
+          required: true,
+          message: '请输入资产原值',
+          trigger: 'blur',
+        },
+      ],
+    },
+    {
+      label: '净残值(%)',
+      prop: 'jcz',
+      type: 'number',
+      span: 24,
+      width: 80,
+      align: 'center',
+      showOverflowTooltip: true,
+      rules: [
+        {
+          required: true,
+          message: '请输入净残值',
+          trigger: 'change',
+        },
+      ],
+    },
+    {
+      label: '月折旧额/月摊销额(元)',
+      prop: 'yzje',
+      type: 'number',
+      span: 24,
+      width: 140,
+      align: 'center',
+      showOverflowTooltip: true,
+      rules: [
+        {
+          required: true,
+          message: '请输入月折旧额/月摊销额',
+          trigger: 'blur',
+        },
+      ],
+    },
+    {
+      label: '状态',
+      prop: 'status',
+      type: 'select',
+      dicUrl: '/api/kd-system/dict/dictionary?code=zczt',
+      props: {
+        label: 'dictValue',
+        value: 'dictKey',
+      },
+      search: true,
+      span: 24,
+      width: 90,
+      align: 'center',
+      showOverflowTooltip: true,
+      display: false,
+    }
+  ],
+};

+ 29 - 2
src/views/achievement/other-achievements.vue

@@ -44,8 +44,14 @@
         </el-button>
       </template>
 
+      <template slot="attachment" slot-scope="{ row }">
+        <div v-for="(file, index) of row.attachment" :key="index">
+          <el-link @click="handleDownFile(file)">{{ file.label }}</el-link>
+        </div>
+      </template>
+
       <template slot="xmIdForm">
-        <project-select placeholder="请选择项目名称" v-model="form.xmId"></project-select>
+        <project-select ref="proSelect" placeholder="请选择项目名称" v-model="form.xmId"></project-select>
       </template>
 
     </avue-crud>
@@ -113,6 +119,14 @@ export default window.$crudCommon({
     },
     getFormData() {
       let newFormData = { ...this.form };
+      if (!!newFormData.xmId) {
+        let projectList = this.$refs.proSelect.projectList;
+        let selPro = projectList.find(item => item.id === newFormData.xmId );
+        if (!!selPro) {
+          newFormData.xmmc = selPro.xmmc;
+          newFormData.xmbh = selPro.xmbh;
+        }
+      }
       if (!!newFormData.attachment) {
         newFormData.attachment = JSON.stringify(newFormData.attachment);
       }
@@ -142,9 +156,22 @@ export default window.$crudCommon({
         this.$refs.printWideTable.printTable(isLandscape);
       })
     },
+    handleDownFile(file) {
+      window.open(file.value, "_blank");
+    }
   },
 }, {
   // 模块路径
-  name: 'achievement/otherAchivement'
+  name: 'achievement/otherAchivement',
+  res: ({ data }) => {
+    data.records = data.records.map(item => {
+      if (!!item.attachment) {
+        item.attachment = JSON.parse(item.attachment);
+      }
+      return item;
+    })
+
+    return data;
+  }
 });
 </script>