This commit is contained in:
parent
6ceee45b13
commit
3a429a31da
|
@ -3,7 +3,7 @@ ALTER TABLE `vn`.`worker` DROP COLUMN `locker`;
|
|||
|
||||
|
||||
CREATE TABLE `vn`.`locker` (
|
||||
`id` int(100),
|
||||
`id` int(100) auto_increment,
|
||||
`code` varchar(10) DEFAULT NULL,
|
||||
`gender` varchar(255) DEFAULT NULL,
|
||||
`workerFk` int(10) unsigned DEFAULT NULL,
|
||||
|
@ -22,12 +22,12 @@ ON DELETE SET NULL;
|
|||
|
||||
|
||||
-- Insertar taquillas disponibles para mujeres (1A - 73A / 1B - 73B)
|
||||
INSERT INTO `vn`.`locker` (code, gender, workerFk) VALUES
|
||||
INSERT INTO `vn`.`locker` (id, code, gender, workerFk) VALUES
|
||||
('1A', 'M', NULL), ('2A', 'M', NULL), ('3A', 'M', NULL), ('4A', 'M', NULL), ('5A', 'M', NULL), ('6A', 'M', NULL), ('7A', 'M', NULL),
|
||||
('1B', 'M', NULL), ('2B', 'M', NULL), ('3B', 'M', NULL), ('4B', 'M', NULL), ('5B', 'M', NULL), ('6B', 'M', NULL), ('7B', 'M', NULL);
|
||||
|
||||
-- Insertar taquillas disponibles para mujeres (200A - 217A / 200B - 217B)
|
||||
INSERT INTO `vn`.`locker` (code, gender, workerFk) VALUES
|
||||
INSERT INTO `vn`.`locker` (id, code, gender, workerFk) VALUES
|
||||
('200A', 'F', NULL), ('201A', 'F', NULL), ('202A', 'F', NULL), ('203A', 'F', NULL), ('204A', 'F', NULL), ('205A', 'F', NULL), ('206A', 'F', NULL),
|
||||
('200B', 'F', NULL), ('201B', 'F', NULL), ('202B', 'F', NULL), ('203B', 'F', NULL), ('204B', 'F', NULL), ('205B', 'F', NULL), ('206B', 'F', NULL);
|
||||
|
||||
|
|
|
@ -45,9 +45,6 @@
|
|||
"code": {
|
||||
"type" : "string"
|
||||
},
|
||||
"locker": {
|
||||
"type" : "number"
|
||||
},
|
||||
"fi": {
|
||||
"type" : "string"
|
||||
},
|
||||
|
|
|
@ -13,16 +13,16 @@ class Controller extends Section {
|
|||
return this.$.watcher.submit()
|
||||
.then(() => this.card.reload());
|
||||
}
|
||||
async chooseLocker() {
|
||||
const locker =
|
||||
`SELECT l.code
|
||||
FROM worker w
|
||||
JOIN locker l ON w.sex = l.gender
|
||||
WHERE w.id = ? AND l.workerFk IS NULL;
|
||||
`[this.code];
|
||||
// async chooseLocker() {
|
||||
// const locker =
|
||||
// `SELECT l.code
|
||||
// FROM worker w
|
||||
// JOIN locker l ON w.sex = l.gender
|
||||
// WHERE w.id = ? AND l.workerFk IS NULL;
|
||||
// `[this.id];
|
||||
|
||||
return locker;
|
||||
}
|
||||
// return locker;
|
||||
// }
|
||||
}
|
||||
|
||||
ngModule.vnComponent('vnWorkerBasicData', {
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
></vn-link-phone>
|
||||
</vn-label-value>
|
||||
<vn-label-value label="Locker"
|
||||
value="{{worker.locker.code}}">
|
||||
>
|
||||
</vn-label-value>
|
||||
</vn-one>
|
||||
<vn-one>
|
||||
|
|
|
@ -51,10 +51,6 @@ class Controller extends Summary {
|
|||
scope: {fields: ['id', 'code', 'name']}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
relation: 'locker',
|
||||
scope: {fields: ['code']}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue