|
@@ -1,35 +1,26 @@
|
|
|
<template>
|
|
|
<zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title + '-列表', essential: true }]">
|
|
|
<template slot-scope="{ activeKey, data }">
|
|
|
- <template-page
|
|
|
- v-if="activeKey == 'list'"
|
|
|
- ref="pageRef"
|
|
|
- :get-list="getList"
|
|
|
- :table-attributes="tableAttributes"
|
|
|
- :table-events="tableEvents"
|
|
|
- :options-evens-group="optionsEvensGroup"
|
|
|
- :moreParameters="moreParameters"
|
|
|
- :column-parsing="columnParsing"
|
|
|
- :operation="operation()"
|
|
|
- :exportList="exportList"
|
|
|
- :operationColumnWidth="80"
|
|
|
- >
|
|
|
+ <template-page v-if="activeKey == 'list'" ref="pageRef" :get-list="getList" :table-attributes="tableAttributes"
|
|
|
+ :table-events="tableEvents" :options-evens-group="optionsEvensGroup" :moreParameters="moreParameters"
|
|
|
+ :column-parsing="columnParsing" :operation="operation()" :exportList="exportList" :operationColumnWidth="80">
|
|
|
</template-page>
|
|
|
<div v-if="~['add', 'edit'].indexOf(activeKey)">
|
|
|
- <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
|
|
|
- <zj-form-module
|
|
|
- title=""
|
|
|
- label-width="180px"
|
|
|
- :showPackUp="false"
|
|
|
- :form-data="formData"
|
|
|
- :form-items="formItems"
|
|
|
- >
|
|
|
- </zj-form-module>
|
|
|
- </zj-form-container>
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
+ <div style="box-sizing: border-box;padding: 20px">
|
|
|
+ <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
|
|
|
+ <zj-form-module title="编辑" label-width="180px" :form-data="formData" :form-items="formItems">
|
|
|
+ </zj-form-module>
|
|
|
+ <zj-form-module v-if="formData.normType === 'M'" title="添加辅材" label-width="0px" :form-data="formData"
|
|
|
+ :form-items="formItems2">
|
|
|
+ </zj-form-module>
|
|
|
+ </zj-form-container>
|
|
|
+ </div>
|
|
|
+ <div slot="footer" style="box-sizing: border-box;padding-bottom: 20px; padding-right: 20px;text-align: right">
|
|
|
<el-button size="mini" @click="data.removeTab()">取 消</el-button>
|
|
|
<el-button size="mini" @click="formConfirm(data.removeTab)" type="primary">确 定</el-button>
|
|
|
</div>
|
|
|
+ <selectGoods v-if="formVisible" @close="close" @confirm="confirm"
|
|
|
+ :guolvList="(formData.items || []).map(item => item.workerGoodsId)" />
|
|
|
</div>
|
|
|
</template>
|
|
|
</zj-tab-page>
|
|
@@ -53,8 +44,9 @@ import { materialCategoryTree } from '@/api/auxiliaryMaterialClass'
|
|
|
import { getTypeList } from '@/api/auxiliaryFittings/attachmentProfile'
|
|
|
import { commonTemplateDownload } from '@/api/common.js'
|
|
|
import operation_mixin from '@/components/template/operation_mixin.js'
|
|
|
+import selectGoods from './selectGoods.vue'
|
|
|
export default {
|
|
|
- components: { TemplatePage },
|
|
|
+ components: { TemplatePage, selectGoods },
|
|
|
mixins: [import_mixin, operation_mixin],
|
|
|
data() {
|
|
|
return {
|
|
@@ -93,7 +85,8 @@ export default {
|
|
|
specification: '',
|
|
|
status: 'ON',
|
|
|
unit: '',
|
|
|
- manualAmount: 0
|
|
|
+ manualAmount: 0,
|
|
|
+ items: []
|
|
|
},
|
|
|
partsUnitList: [],
|
|
|
materialCategoryTree: [],
|
|
@@ -116,7 +109,7 @@ export default {
|
|
|
[
|
|
|
this.optionsEvensAuth(['imp', 'template'], {
|
|
|
name: '导入物料',
|
|
|
- click: () => {}
|
|
|
+ click: () => { }
|
|
|
}),
|
|
|
this.optionsEvensAuth('imp', ({ moduleName }) => {
|
|
|
return {
|
|
@@ -144,7 +137,7 @@ export default {
|
|
|
[
|
|
|
this.optionsEvensAuth(['Import', 'downloadTemplate'], {
|
|
|
name: '导入服务',
|
|
|
- click: () => {}
|
|
|
+ click: () => { }
|
|
|
}),
|
|
|
this.optionsEvensAuth('Import', ({ moduleName }) => {
|
|
|
return {
|
|
@@ -312,6 +305,11 @@ export default {
|
|
|
label: '收费类型',
|
|
|
prop: 'normType',
|
|
|
rules: [...required]
|
|
|
+ },
|
|
|
+ events: {
|
|
|
+ change: () => {
|
|
|
+ this.formData.items = []
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -457,7 +455,102 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
]
|
|
|
- }
|
|
|
+ },
|
|
|
+ formItems2() {
|
|
|
+ return [{
|
|
|
+ name: 'slot-component',
|
|
|
+ md: 24,
|
|
|
+ formItemAttributes: {
|
|
|
+ 'label-width': '0px',
|
|
|
+ label: '',
|
|
|
+ prop: 'items',
|
|
|
+ rules: [...required]
|
|
|
+ },
|
|
|
+ render: (h, { props }) => {
|
|
|
+ return (
|
|
|
+ <div>
|
|
|
+ <div>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="primary"
|
|
|
+ onClick={() => {
|
|
|
+ this.formVisible = true
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 新增
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ <zj-table columns={[{
|
|
|
+ columnAttributes: {
|
|
|
+ label: '大类名称',
|
|
|
+ prop: 'parentCategoryName',
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '小类名称',
|
|
|
+ prop: 'goodsCategoryName',
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '辅材名称',
|
|
|
+ prop: 'workerGoodsName',
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '单位',
|
|
|
+ prop: 'salesUnit',
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '商品代码',
|
|
|
+ prop: 'goodsCode',
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '数量',
|
|
|
+ prop: 'qty',
|
|
|
+ width: 150
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ return (
|
|
|
+ <div style="padding: 0 10px">
|
|
|
+ <el-input
|
|
|
+ value={row[column.columnAttributes.prop]}
|
|
|
+ onInput={val => {
|
|
|
+ row[column.columnAttributes.prop] = val
|
|
|
+ }}
|
|
|
+ placeholder="请输入内容"
|
|
|
+ ></el-input>
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ columnAttributes: {
|
|
|
+ label: '操作',
|
|
|
+ prop: '',
|
|
|
+ },
|
|
|
+ render: (h, { row, column, index }) => {
|
|
|
+ return (
|
|
|
+ <div style="padding: 0 10px">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ onClick={() => {
|
|
|
+ this.formData.items.splice(index, 1)
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 删除
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }]} table-data={this.formData.items || []} />
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }]
|
|
|
+ },
|
|
|
},
|
|
|
methods: {
|
|
|
// 列表请求函数
|
|
@@ -482,7 +575,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- openForm() {},
|
|
|
+ openForm() { },
|
|
|
openForm(type, id) {
|
|
|
this.$refs.tabPage.addTab({
|
|
|
// 对应显示的模块
|
|
@@ -496,7 +589,6 @@ export default {
|
|
|
this.formCancel()
|
|
|
this.$nextTick(() => {
|
|
|
this.formType = type
|
|
|
- this.formVisible = true
|
|
|
Promise.all([
|
|
|
getTypeList({
|
|
|
pageNum: 1,
|
|
@@ -555,7 +647,26 @@ export default {
|
|
|
},
|
|
|
setNumber(val) {
|
|
|
return Number(val.toFixed(2))
|
|
|
- }
|
|
|
+ },
|
|
|
+ close() {
|
|
|
+ this.formVisible = false
|
|
|
+ },
|
|
|
+ confirm(data) {
|
|
|
+ data.filter(val => !~this.formData.items.map(item => item.workerGoodsId).indexOf(val.goodsId)).map(item => {
|
|
|
+ this.formData.items.push({
|
|
|
+ "goodsCategoryId": item.categoryId,
|
|
|
+ "goodsCategoryName": item.categoryName,
|
|
|
+ "goodsCode": item.goodsCode,
|
|
|
+ "salesUnit": item.salesUnit,
|
|
|
+ "parentCategoryId": item.parentCategoryId,
|
|
|
+ "parentCategoryName": item.parentCategoryName,
|
|
|
+ "workerGoodsId": item.goodsId,
|
|
|
+ "workerGoodsName": item.goodsName,
|
|
|
+ "qty": ""
|
|
|
+ })
|
|
|
+ })
|
|
|
+ this.close()
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|