Commit 106cfbf1 by lichengming
parents 574e367f 1e18d408
...@@ -18,6 +18,16 @@ export default { ...@@ -18,6 +18,16 @@ export default {
https https
.post('meter/v1/item/add_send_entrust', JSON.stringify(data)) .post('meter/v1/item/add_send_entrust', JSON.stringify(data))
.then(res => res), .then(res => res),
saveItems: data =>
http
.post(
'meter/v1/item/add_sample_item?sampleIds=' +
data.sampleIds +
'&itemIds=' +
data.itemIds
)
.then(res => res),
testValue: data => testValue: data =>
http http
.post( .post(
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
:tableHeight="tableHeight" :tableHeight="tableHeight"
@on-result-change="_tableResultChange" @on-result-change="_tableResultChange"
:getPage="getPage" :getPage="getPage"
:rows="100" is-task> :rows="100" is-task :isRadio="true" hide-checkbox>
<vxe-table-column <vxe-table-column
v-for="item in userColumns.length > 0 ?userColumns:pageColumns" v-for="item in userColumns.length > 0 ?userColumns:pageColumns"
:key="item.key" :key="item.key"
...@@ -100,19 +100,6 @@ export default { ...@@ -100,19 +100,6 @@ export default {
} }
}, },
methods: { methods: {
_dicSearch() {
this.$store
.dispatch('LmsBaseDict/getItem', '个人任务是否勾选')
.then(() => {
const resultData = this.$store.state.LmsBaseDict.item
if (resultData.length > 0) {
this.personal = resultData[0].name === '是' ? 1 : 0
} else {
this.personal = 1
}
this._page()
})
},
_btnClick() {}, _btnClick() {},
_selInputResult1(msg, data) { _selInputResult1(msg, data) {
switch (msg) { switch (msg) {
...@@ -122,7 +109,6 @@ export default { ...@@ -122,7 +109,6 @@ export default {
} }
}, },
_open() { _open() {
// this._dicSearch()
this._page() this._page()
}, },
_searchParams() { _searchParams() {
...@@ -135,35 +121,20 @@ export default { ...@@ -135,35 +121,20 @@ export default {
return obj return obj
}, },
_page: async function() { _page: async function() {
console.log(9522123)
// this.$refs.pageTable._page('search-form-package', 'FoodJudgeBasis/page')
// Object.assign(this.formObj, this.$refs.pageTable._searchParams())
// console.log('this.formObj', this.formObj)
const result = await meterManage.page(this.formObj) const result = await meterManage.page(this.formObj)
if (result) { if (result) {
console.log(55555)
console.log(result)
this.getPage = result this.getPage = result
console.log(123456789)
console.log(this.getPage)
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
} }
}, },
// _page() {
// // this.$refs.pageTable._page(
// // 'data-input-contract-left',
// // 'FoodContract/dataInputContractLeft',
// // this._searchParams()
// // )
// },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
switch (msg) { switch (msg) {
case 'page':
this.getPage = this.$store.state.FoodContract.page
break
case 'selectIds': case 'selectIds':
this.$emit('on-result-change', data, this.personal) this.$emit('on-result-change', data, this.personal)
break break
case 'singleSelect':
this.$emit('on-result-change', data.id, this.personal)
break
case 'changeSize': case 'changeSize':
this._page() this._page()
this._clear() this._clear()
...@@ -182,19 +153,6 @@ export default { ...@@ -182,19 +153,6 @@ export default {
this.$refs.pageTable._pageChange(1) this.$refs.pageTable._pageChange(1)
this._clear() this._clear()
} }
// 委托详情
// _detailModal(data) {
// this.$store.dispatch('FoodContract/getById', data.id).then(() => {
// if (data.type === 1) {
// this.currentComponent = 'FoodContractGovernDetail'
// } else {
// this.currentComponent = 'FoodContractCompanyDetail'
// }
// this.$nextTick(function() {
// this.$refs.refModal._open(this.$store.state.FoodContract.model)
// })
// })
// }
} }
} }
</script> </script>
...@@ -9,12 +9,17 @@ ...@@ -9,12 +9,17 @@
<ContractRightList ref="rightModal" @on-result-change="_rightResult"></ContractRightList> <ContractRightList ref="rightModal" @on-result-change="_rightResult"></ContractRightList>
</template> </template>
</TwoColumnPage> </TwoColumnPage>
<div slot="footer" class="btn-width">
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult" />
</div>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
import TwoColumnPage from '../../components/base/TwoColumnPage' import TwoColumnPage from '../../components/base/TwoColumnPage'
import { meterItem } from '../../api'
import ContractLeftList from './ContractLeftList' import ContractLeftList from './ContractLeftList'
import ContractRightList from './ContractRightList' import ContractRightList from './ContractRightList'
...@@ -26,26 +31,62 @@ export default { ...@@ -26,26 +31,62 @@ export default {
}, },
data() { data() {
return { return {
showModal: false showModal: false,
sampleIds: '',
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '添加', type: 'primary' }
],
itemIds: []
} }
}, },
methods: { methods: {
_open() { _open(sampleIds) {
// this.formObj.entrustId = id
this.showModal = true this.showModal = true
this.sampleIds = sampleIds
this.$refs.leftModal._open() this.$refs.leftModal._open()
// this._page()
}, },
_leftResult(data, personal) { _leftResult(data, personal) {
this.$refs.rightModal._open(data, personal) this.$refs.rightModal._open(data, personal)
// console.log(data, personal)
}, },
_rightResult() { _rightResult(data) {
this.$refs.leftModal._page() if (undefined !== data) {
this.itemIds = data
}
},
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '添加':
this._ok()
break
}
},
_cancel() {
this.showModal = false
},
_ok() {
if (this.itemIds.length === 0) {
this.$Message.warning('请选择要添加的检测项目!')
this.$refs.footerModal._hideLoading()
return false
}
this._saveItemForSample({
sampleIds: this.sampleIds,
itemIds: this.itemIds
})
},
_saveItemForSample: async function(data) {
const result = await meterItem.saveItems(data)
if (result) {
this.$Message.success('添加成功!')
this.$refs.footerModal._hideLoading()
this.$emit('on-result-change')
this._cancel()
}
} }
// _open() {
// this.$refs.leftModal._open()
// }
} }
} }
</script> </script>
...@@ -134,6 +134,7 @@ export default { ...@@ -134,6 +134,7 @@ export default {
{ title: '样品名称', key: 'name', width: 140 }, { title: '样品名称', key: 'name', width: 140 },
{ title: '型号规格', key: 'spec', width: 140 }, { title: '型号规格', key: 'spec', width: 140 },
{ title: '出厂编号', key: 'factoryNumber', width: 140 }, { title: '出厂编号', key: 'factoryNumber', width: 140 },
{ title: '所检项目', key: 'itemNames', width: 140 },
{ title: '是否分包', key: 'jobOut', width: 110 }, { title: '是否分包', key: 'jobOut', width: 110 },
{ title: '检测类型', key: 'type', width: 140 }, { title: '检测类型', key: 'type', width: 140 },
{ title: '数量', key: 'quantity', width: 140 } { title: '数量', key: 'quantity', width: 140 }
......
...@@ -130,6 +130,7 @@ export default { ...@@ -130,6 +130,7 @@ export default {
{ title: '样品名称', key: 'name', width: 140 }, { title: '样品名称', key: 'name', width: 140 },
{ title: '型号规格', key: 'spec', width: 140 }, { title: '型号规格', key: 'spec', width: 140 },
{ title: '出厂编号', key: 'factoryNumber', width: 140 }, { title: '出厂编号', key: 'factoryNumber', width: 140 },
{ title: '检测项目', key: 'itemNames', width: 140 },
{ title: '是否分包', key: 'jobOut', width: 110 }, { title: '是否分包', key: 'jobOut', width: 110 },
{ title: '检测类型', key: 'type', width: 140 }, { title: '检测类型', key: 'type', width: 140 },
{ title: '数量', key: 'quantity', width: 140 } { title: '数量', key: 'quantity', width: 140 }
...@@ -166,12 +167,6 @@ export default { ...@@ -166,12 +167,6 @@ export default {
case '导入检测项目': case '导入检测项目':
this._importItem() this._importItem()
break break
case '导入检测项目包':
this._importItemPackage()
break
case '复制历史样品检测项目':
this._copyHisItem()
break
case '删除': case '删除':
this._deleteSelected() this._deleteSelected()
break break
...@@ -223,7 +218,6 @@ export default { ...@@ -223,7 +218,6 @@ export default {
} }
}, },
_sampleEditModal(data) { _sampleEditModal(data) {
console.log(data)
this.$refs.sampleEditModal._open(data.id) this.$refs.sampleEditModal._open(data.id)
}, },
_tableResultChange(msg, data) { _tableResultChange(msg, data) {
...@@ -404,7 +398,7 @@ export default { ...@@ -404,7 +398,7 @@ export default {
if (this.selectIds.length === 0) { if (this.selectIds.length === 0) {
this.$Message.warning('请至少选中一条样品数据!') this.$Message.warning('请至少选中一条样品数据!')
} else { } else {
this.$refs.importModal._open(this.selectIds, this.selectData[0]) this.$refs.importModal._open(this.selectIds)
} }
}, },
_subpackageSample() { _subpackageSample() {
......
...@@ -9,12 +9,17 @@ ...@@ -9,12 +9,17 @@
<ContractRightList ref="rightModal" @on-result-change="_rightResult"></ContractRightList> <ContractRightList ref="rightModal" @on-result-change="_rightResult"></ContractRightList>
</template> </template>
</TwoColumnPage> </TwoColumnPage>
<div slot="footer" class="btn-width">
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult" />
</div>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
import TwoColumnPage from '../../../components/base/TwoColumnPage' import TwoColumnPage from '../../../components/base/TwoColumnPage'
import { meterItem } from '../../../api'
import ContractLeftList from './ContractLeftList' import ContractLeftList from './ContractLeftList'
import ContractRightList from './ContractRightList' import ContractRightList from './ContractRightList'
...@@ -26,26 +31,62 @@ export default { ...@@ -26,26 +31,62 @@ export default {
}, },
data() { data() {
return { return {
showModal: false showModal: false,
sampleIds: '',
footerList: [
{ id: '', name: '取消', type: '' },
{ id: '', name: '添加', type: 'primary' }
],
itemIds: []
} }
}, },
methods: { methods: {
_open() { _open(sampleIds) {
// this.formObj.entrustId = id
this.showModal = true this.showModal = true
this.sampleIds = sampleIds
this.$refs.leftModal._open() this.$refs.leftModal._open()
// this._page()
}, },
_leftResult(data, personal) { _leftResult(data, personal) {
this.$refs.rightModal._open(data, personal) this.$refs.rightModal._open(data, personal)
// console.log(data, personal)
}, },
_rightResult() { _rightResult(data) {
this.$refs.leftModal._page() if (undefined !== data) {
this.itemIds = data
}
},
_footerResult(name) {
switch (name) {
case '取消':
this._cancel()
break
case '添加':
this._ok()
break
}
},
_cancel() {
this.showModal = false
},
_ok() {
if (this.itemIds.length === 0) {
this.$Message.warning('请选择要添加的检测项目!')
this.$refs.footerModal._hideLoading()
return false
}
this._saveItemForSample({
sampleIds: this.sampleIds,
itemIds: this.itemIds
})
},
_saveItemForSample: async function(data) {
const result = await meterItem.saveItems(data)
if (result) {
this.$Message.success('添加成功!')
this.$refs.footerModal._hideLoading()
this.$emit('on-result-change')
this._cancel()
}
} }
// _open() {
// this.$refs.leftModal._open()
// }
} }
} }
</script> </script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment