diff --git a/src/views/AccompanyOrder/AccompanyOrder.vue b/src/views/AccompanyOrder/AccompanyOrder.vue
index 713ae61..707e6b6 100644
--- a/src/views/AccompanyOrder/AccompanyOrder.vue
+++ b/src/views/AccompanyOrder/AccompanyOrder.vue
@@ -145,7 +145,7 @@
row[fieldName] = text" />
-
+
diff --git a/src/views/AccompanyOrder/components/Assign.vue b/src/views/AccompanyOrder/components/Assign.vue
index 057b6de..11515b7 100644
--- a/src/views/AccompanyOrder/components/Assign.vue
+++ b/src/views/AccompanyOrder/components/Assign.vue
@@ -7,7 +7,7 @@
:visible.sync="visible"
append-to-body
:before-close="handleClose"
- @close="$emit('update:visible',false)"
+ @close="$emit('update:isShow', false)"
>
-
+
+
+
+
+
+
+ :filters="mobileOptions"
+ :filter-method="nameFilterMethod"
+ >
+
+
+
+
+ :filters="idcardOptions"
+ :filter-method="nameFilterMethod"
+ >
+
+
+
+
@@ -154,7 +206,7 @@
import { save } from '@/api/accompany-order/accompany-order'
export default {
props: {
- visible: {
+ isShow: {
type: Boolean,
default: false
},
@@ -165,31 +217,70 @@ export default {
},
data() {
return {
+ nameOptions: [{ data: '' }],
+ mobileOptions: [{ data: '' }],
+ idcardOptions: [{ data: '' }],
row: {},
- loading: false
+ loading: false,
+ visible: false
}
},
computed: {},
+ watch: {
+ 'row': {
+ handler: function(newVal) {
+ if (newVal.nurse_id && this.isShow) {
+ this.$nextTick((_) => {
+ this.$refs['table'].setRadioRow(
+ this.nurses.find((i) => i.id === newVal.nurse_id)
+ )
+ })
+ }
+ },
+ deep: true
+ },
+ isShow(newVal) {
+ this.visible = newVal
+ },
+ visible(newVal) {
+ this.$emit('update:isShow', newVal)
+ }
+ },
methods: {
+ changeFilterEvent(option) {
+ const $table = this.$refs.table
+ if ($table) {
+ $table.updateFilterOptionStatus(option, !!option.data)
+ }
+ },
+ nameFilterMethod({ option, cellValue }) {
+ const regex = new RegExp(option.data.split('').join('.*'), 'i')
+ return regex.test(cellValue)
+ },
handleClose(done) {
this.$confirm('确定关闭窗口?')
- .then(_ => {
+ .then((_) => {
+ this.$refs['table'].clearRadioRow()
done()
})
- .catch(_ => {})
+ .catch((_) => {})
},
submit() {
- if (this.row.id && this.$refs['table'].getRadioRecord(true)) {
- save({
- id: this.row.id,
- nurse_id: this.$refs['table'].getRadioRecord(true).id,
- status: 0
- }).then(_ => {
- this.$message.success('分配成功!')
- this.$emit('update:visible', false)
- this.$emit('refresh')
+ this.$confirm('确定分配?')
+ .then((_) => {
+ if (this.row.id && this.$refs['table'].getRadioRecord(true)) {
+ save({
+ id: this.row.id,
+ nurse_id: this.$refs['table'].getRadioRecord(true).id,
+ status: 0
+ }).then((_) => {
+ this.$message.success('分配成功!')
+ this.$emit('update:visible', false)
+ this.$emit('refresh')
+ })
+ }
})
- }
+ .catch((_) => {})
}
}
}